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
5ad2b7f8
Commit
5ad2b7f8
authored
Apr 11, 2020
by
DoinLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
fb5fc249
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
229 additions
and
0 deletions
+229
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-0
QGCPopupDialog.qml
src/QmlControls/QGCPopupDialog.qml
+41
-0
QGCPopupDialogContainer.qml
src/QmlControls/QGCPopupDialogContainer.qml
+174
-0
qmldir
src/QmlControls/QGroundControl/Controls/qmldir
+2
-0
MainRootWindow.qml
src/ui/MainRootWindow.qml
+10
-0
No files found.
qgroundcontrol.qrc
View file @
5ad2b7f8
...
@@ -142,6 +142,8 @@
...
@@ -142,6 +142,8 @@
<file alias="QGroundControl/Controls/QGCMenuSeparator.qml">src/QmlControls/QGCMenuSeparator.qml</file>
<file alias="QGroundControl/Controls/QGCMenuSeparator.qml">src/QmlControls/QGCMenuSeparator.qml</file>
<file alias="QGroundControl/Controls/QGCMouseArea.qml">src/QmlControls/QGCMouseArea.qml</file>
<file alias="QGroundControl/Controls/QGCMouseArea.qml">src/QmlControls/QGCMouseArea.qml</file>
<file alias="QGroundControl/Controls/QGCMovableItem.qml">src/QmlControls/QGCMovableItem.qml</file>
<file alias="QGroundControl/Controls/QGCMovableItem.qml">src/QmlControls/QGCMovableItem.qml</file>
<file alias="QGroundControl/Controls/QGCPopupDialog.qml">src/QmlControls/QGCPopupDialog.qml</file>
<file alias="QGroundControl/Controls/QGCPopupDialogContainer.qml">src/QmlControls/QGCPopupDialogContainer.qml</file>
<file alias="QGroundControl/Controls/QGCPipable.qml">src/QmlControls/QGCPipable.qml</file>
<file alias="QGroundControl/Controls/QGCPipable.qml">src/QmlControls/QGCPipable.qml</file>
<file alias="QGroundControl/Controls/QGCRadioButton.qml">src/QmlControls/QGCRadioButton.qml</file>
<file alias="QGroundControl/Controls/QGCRadioButton.qml">src/QmlControls/QGCRadioButton.qml</file>
<file alias="QGroundControl/Controls/QGCSlider.qml">src/QmlControls/QGCSlider.qml</file>
<file alias="QGroundControl/Controls/QGCSlider.qml">src/QmlControls/QGCSlider.qml</file>
...
...
src/QmlControls/QGCPopupDialog.qml
0 → 100644
View file @
5ad2b7f8
/****************************************************************************
*
* (c) 2009-2020 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.12
Item
{
width
:
childrenRect
.
width
height
:
childrenRect
.
height
signal
hideDialog
Keys.onReleased
:
{
if
(
event
.
key
===
Qt
.
Key_Escape
)
{
reject
()
event
.
accepted
=
true
}
else
if
(
event
.
key
===
Qt
.
Key_Return
||
event
.
key
===
Qt
.
Key_Enter
)
{
accept
()
event
.
accepted
=
true
}
}
function
accept
()
{
if
(
acceptAllowed
)
{
Qt
.
inputMethod
.
hide
()
hideDialog
()
}
}
function
reject
()
{
if
(
rejectAllowed
)
{
Qt
.
inputMethod
.
hide
()
hideDialog
()
}
}
}
src/QmlControls/QGCPopupDialogContainer.qml
0 → 100644
View file @
5ad2b7f8
/****************************************************************************
*
* (c) 2009-2020 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.12
import
QtQuick
.
Controls
2.4
import
QtQuick
.
Layouts
1.12
import
QtQuick
.
Dialogs
1.3
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
Popup
{
anchors.centerIn
:
parent
width
:
mainFlickable
.
width
height
:
mainFlickable
.
height
padding
:
0
modal
:
true
focus
:
true
background
:
Rectangle
{
color
:
QGroundControl
.
globalPalette
.
window
}
property
string
title
property
var
buttons
property
var
dialogComponent
property
real
_contentMargin
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
real
_popupDoubleInset
:
ScreenTools
.
defaultFontPixelHeight
*
2
property
real
_maxAvailableWidth
:
parent
.
width
-
_popupDoubleInset
property
real
_maxAvailableHeight
:
parent
.
height
-
_popupDoubleInset
Component.onCompleted
:
setupDialogButtons
()
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
parent
.
enabled
}
function
setupDialogButtons
()
{
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
}
if
(
rejectButton
.
visible
)
{
closePolicy
=
Popup
.
NoAutoClose
|
Popup
.
CloseOnEscape
}
else
{
closePolicy
=
Popup
.
NoAutoClose
}
}
Connections
{
target
:
dialogComponentLoader
.
item
onHideDialog
:
close
()
}
QGCFlickable
{
id
:
mainFlickable
width
:
Math
.
min
(
mainColumnLayout
.
width
,
_maxAvailableWidth
)
height
:
Math
.
min
(
mainColumnLayout
.
height
,
_maxAvailableHeight
)
contentWidth
:
mainColumnLayout
.
width
contentHeight
:
mainColumnLayout
.
height
Rectangle
{
width
:
titleRowLayout
.
width
height
:
titleRowLayout
.
height
color
:
qgcPal
.
windowShade
}
ColumnLayout
{
id
:
mainColumnLayout
spacing
:
_contentMargin
RowLayout
{
id
:
titleRowLayout
Layout.fillWidth
:
true
QGCLabel
{
Layout.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
Layout.fillWidth
:
true
text
:
title
height
:
parent
.
height
verticalAlignment
:
Text
.
AlignVCenter
}
QGCButton
{
id
:
rejectButton
onClicked
:
dialogComponentLoader
.
item
.
reject
()
}
QGCButton
{
id
:
acceptButton
primary
:
true
onClicked
:
dialogComponentLoader
.
item
.
accept
()
}
}
Item
{
id
:
item
width
:
dialogComponentLoader
.
width
+
(
_contentMargin
*
2
)
height
:
dialogComponentLoader
.
height
+
_contentMargin
Loader
{
id
:
dialogComponentLoader
x
:
_contentMargin
sourceComponent
:
dialogComponent
focus
:
true
property
bool
acceptAllowed
:
acceptButton
.
visible
property
bool
rejectAllowed
:
rejectButton
.
visible
}
}
}
}
}
src/QmlControls/QGroundControl/Controls/qmldir
View file @
5ad2b7f8
...
@@ -64,6 +64,8 @@ QGCMouseArea 1.0 QGCMouseArea.qml
...
@@ -64,6 +64,8 @@ QGCMouseArea 1.0 QGCMouseArea.qml
QGCMovableItem 1.0 QGCMovableItem.qml
QGCMovableItem 1.0 QGCMovableItem.qml
QGCOptionsComboBox 1.0 QGCOptionsComboBox.qml
QGCOptionsComboBox 1.0 QGCOptionsComboBox.qml
QGCPipable 1.0 QGCPipable.qml
QGCPipable 1.0 QGCPipable.qml
QGCPopupDialog 1.0 QGCPopupDialog.qml
QGCPopupDialogContainer 1.0 QGCPopupDialogContainer.qml
QGCRadioButton 1.0 QGCRadioButton.qml
QGCRadioButton 1.0 QGCRadioButton.qml
QGCSlider 1.0 QGCSlider.qml
QGCSlider 1.0 QGCSlider.qml
QGCSwitch 1.0 QGCSwitch.qml
QGCSwitch 1.0 QGCSwitch.qml
...
...
src/ui/MainRootWindow.qml
View file @
5ad2b7f8
...
@@ -223,6 +223,16 @@ ApplicationWindow {
...
@@ -223,6 +223,16 @@ ApplicationWindow {
}
}
}
}
function
showPopupDialog
(
component
,
title
,
buttons
)
{
var
popup
=
popupDialogContainterComponent
.
createObject
(
mainWindow
,
{
"
title
"
:
title
,
"
buttons
"
:
buttons
,
"
dialogComponent
"
:
component
})
popup
.
open
()
}
Component
{
id
:
popupDialogContainterComponent
QGCPopupDialogContainer
{
}
}
property
bool
_forceClose
:
false
property
bool
_forceClose
:
false
function
finishCloseProcess
()
{
function
finishCloseProcess
()
{
...
...
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