Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
3f8dc069
Commit
3f8dc069
authored
Dec 10, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QGCViewDialog controls can now call QGCView.showDialog to stack dialogs
parent
ba088926
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
220 additions
and
219 deletions
+220
-219
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
QGCView.qml
src/QmlControls/QGCView.qml
+19
-209
QGCViewDialog.qml
src/QmlControls/QGCViewDialog.qml
+9
-10
QGCViewDialogContainer.qml
src/QmlControls/QGCViewDialogContainer.qml
+190
-0
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+1
-0
No files found.
qgroundcontrol.qrc
View file @
3f8dc069
...
@@ -97,6 +97,7 @@
...
@@ -97,6 +97,7 @@
<file alias="QGroundControl/Controls/QGCToolBarButton.qml">src/QmlControls/QGCToolBarButton.qml</file>
<file alias="QGroundControl/Controls/QGCToolBarButton.qml">src/QmlControls/QGCToolBarButton.qml</file>
<file alias="QGroundControl/Controls/QGCView.qml">src/QmlControls/QGCView.qml</file>
<file alias="QGroundControl/Controls/QGCView.qml">src/QmlControls/QGCView.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialog.qml">src/QmlControls/QGCViewDialog.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialog.qml">src/QmlControls/QGCViewDialog.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialogContainer.qml">src/QmlControls/QGCViewDialogContainer.qml</file>
<file alias="QGroundControl/Controls/QGCViewMessage.qml">src/QmlControls/QGCViewMessage.qml</file>
<file alias="QGroundControl/Controls/QGCViewMessage.qml">src/QmlControls/QGCViewMessage.qml</file>
<file alias="QGroundControl/Controls/QGCViewPanel.qml">src/QmlControls/QGCViewPanel.qml</file>
<file alias="QGroundControl/Controls/QGCViewPanel.qml">src/QmlControls/QGCViewPanel.qml</file>
<file alias="QGroundControl/Controls/qmldir">src/QmlControls/QGroundControl.Controls.qmldir</file>
<file alias="QGroundControl/Controls/qmldir">src/QmlControls/QGroundControl.Controls.qmldir</file>
...
...
src/QmlControls/QGCView.qml
View file @
3f8dc069
This diff is collapsed.
Click to expand it.
src/QmlControls/QGCViewDialog.qml
View file @
3f8dc069
...
@@ -7,22 +7,21 @@
...
@@ -7,22 +7,21 @@
*
*
****************************************************************************/
****************************************************************************/
import
QtQuick
2.3
/// @file
/// @author Don Gagne <don@thegagnes.com>
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
1.2
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
Fact
System
1.0
import
QGroundControl
.
Fact
Controls
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
ScreenTools
1.0
FactPanel
{
FactPanel
{
property
var
qgcTextFieldforwardKeysTo
:
this
///< Causes all QGCTextFields to forward keys here if they have focus
property
var
qgcTextFieldforwardKeysTo
:
this
///< Causes all QGCTextFields to forward keys here if they have focus
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixelWidth
property
real
defaultTextHeight
:
ScreenTools
.
defaultFontPixelHeight
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
signal
hideDialog
signal
hideDialog
...
...
src/QmlControls/QGCViewDialogContainer.qml
0 → 100644
View file @
3f8dc069
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
Item
{
id
:
_root
z
:
5000
property
alias
dialogWidth
:
_dialogPanel
.
width
property
alias
dialogTitle
:
titleLabel
.
text
property
alias
dialogComponent
:
_dialogComponentLoader
.
sourceComponent
property
var
viewPanel
property
real
_defaultTextHeight
:
_textMeasure
.
contentHeight
property
real
_defaultTextWidth
:
_textMeasure
.
contentWidth
function
setupDialogButtons
(
buttons
)
{
_acceptButton
.
visible
=
false
_rejectButton
.
visible
=
false
// Accept role buttons
if
(
buttons
&
StandardButton
.
Ok
)
{
_acceptButton
.
text
=
qsTr
(
"
Ok
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Open
)
{
_acceptButton
.
text
=
qsTr
(
"
Open
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Save
)
{
_acceptButton
.
text
=
qsTr
(
"
Save
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Apply
)
{
_acceptButton
.
text
=
qsTr
(
"
Apply
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Open
)
{
_acceptButton
.
text
=
qsTr
(
"
Open
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
SaveAll
)
{
_acceptButton
.
text
=
qsTr
(
"
Save All
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Yes
)
{
_acceptButton
.
text
=
qsTr
(
"
Yes
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
YesToAll
)
{
_acceptButton
.
text
=
qsTr
(
"
Yes to All
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Retry
)
{
_acceptButton
.
text
=
qsTr
(
"
Retry
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Reset
)
{
_acceptButton
.
text
=
qsTr
(
"
Reset
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
RestoreToDefaults
)
{
_acceptButton
.
text
=
qsTr
(
"
Restore to Defaults
"
)
_acceptButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Ignore
)
{
_acceptButton
.
text
=
qsTr
(
"
Ignore
"
)
_acceptButton
.
visible
=
true
}
// Reject role buttons
if
(
buttons
&
StandardButton
.
Cancel
)
{
_rejectButton
.
text
=
qsTr
(
"
Cancel
"
)
_rejectButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Close
)
{
_rejectButton
.
text
=
qsTr
(
"
Close
"
)
_rejectButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
No
)
{
_rejectButton
.
text
=
qsTr
(
"
No
"
)
_rejectButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
NoToAll
)
{
_rejectButton
.
text
=
qsTr
(
"
No to All
"
)
_rejectButton
.
visible
=
true
}
else
if
(
buttons
&
StandardButton
.
Abort
)
{
_rejectButton
.
text
=
qsTr
(
"
Abort
"
)
_rejectButton
.
visible
=
true
}
}
Connections
{
target
:
_dialogComponentLoader
.
item
onHideDialog
:
{
viewPanel
.
enabled
=
true
_root
.
destroy
()
}
}
QGCPalette
{
id
:
_qgcPal
;
colorGroupEnabled
:
true
}
QGCLabel
{
id
:
_textMeasure
;
text
:
"
X
"
;
visible
:
false
}
Rectangle
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
_dialogPanel
.
left
opacity
:
0.5
color
:
_qgcPal
.
window
z
:
5000
}
// This is the main dialog panel which is anchored to the right edge
Rectangle
{
id
:
_dialogPanel
height
:
ScreenTools
.
availableHeight
?
ScreenTools
.
availableHeight
:
parent
.
height
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
color
:
_qgcPal
.
windowShadeDark
Rectangle
{
id
:
_header
width
:
parent
.
width
height
:
_acceptButton
.
visible
?
_acceptButton
.
height
:
_rejectButton
.
height
color
:
_qgcPal
.
windowShade
function
_hidePanel
()
{
_fullPanel
.
visible
=
false
}
QGCLabel
{
id
:
titleLabel
x
:
_defaultTextWidth
height
:
parent
.
height
verticalAlignment
:
Text
.
AlignVCenter
}
QGCButton
{
id
:
_rejectButton
anchors.right
:
_acceptButton
.
visible
?
_acceptButton
.
left
:
parent
.
right
anchors.bottom
:
parent
.
bottom
onClicked
:
{
enabled
=
false
// prevent multiple clicks
_dialogComponentLoader
.
item
.
reject
()
if
(
!
viewPanel
.
enabled
)
{
// Dialog was not closed, re-enable button
enabled
=
true
}
}
}
QGCButton
{
id
:
_acceptButton
anchors.right
:
parent
.
right
primary
:
true
onClicked
:
{
enabled
=
false
// prevent multiple clicks
_dialogComponentLoader
.
item
.
accept
()
if
(
!
viewPanel
.
enabled
)
{
// Dialog was not closed, re-enable button
enabled
=
true
}
}
}
}
Item
{
id
:
_spacer
width
:
10
height
:
10
anchors.top
:
_header
.
bottom
}
Loader
{
id
:
_dialogComponentLoader
anchors.margins
:
5
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
_spacer
.
bottom
anchors.bottom
:
parent
.
bottom
sourceComponent
:
_dialogComponent
property
bool
acceptAllowed
:
_acceptButton
.
visible
property
bool
rejectAllowed
:
_rejectButton
.
visible
}
}
// Rectangle - Dialog panel
}
src/QmlControls/QGroundControl.Controls.qmldir
View file @
3f8dc069
...
@@ -57,6 +57,7 @@ QGCTextField 1.0 QGCTextField.qml
...
@@ -57,6 +57,7 @@ QGCTextField 1.0 QGCTextField.qml
QGCToolBarButton 1.0 QGCToolBarButton.qml
QGCToolBarButton 1.0 QGCToolBarButton.qml
QGCView 1.0 QGCView.qml
QGCView 1.0 QGCView.qml
QGCViewDialog 1.0 QGCViewDialog.qml
QGCViewDialog 1.0 QGCViewDialog.qml
QGCViewDialogContainer 1.0 QGCViewDialogContainer.qml
QGCViewMessage 1.0 QGCViewMessage.qml
QGCViewMessage 1.0 QGCViewMessage.qml
QGCViewPanel 1.0 QGCViewPanel.qml
QGCViewPanel 1.0 QGCViewPanel.qml
RoundButton 1.0 RoundButton.qml
RoundButton 1.0 RoundButton.qml
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment