Commit 65c93900 authored by Donald Gagne's avatar Donald Gagne

Easter egg confirmation

parent 718feb8e
...@@ -39,6 +39,7 @@ public: ...@@ -39,6 +39,7 @@ public:
Q_PROPERTY(bool showTouchAreas READ showTouchAreas WRITE setShowTouchAreas NOTIFY showTouchAreasChanged) Q_PROPERTY(bool showTouchAreas READ showTouchAreas WRITE setShowTouchAreas NOTIFY showTouchAreasChanged)
Q_PROPERTY(bool showAdvancedUI READ showAdvancedUI WRITE setShowAdvancedUI NOTIFY showAdvancedUIChanged) Q_PROPERTY(bool showAdvancedUI READ showAdvancedUI WRITE setShowAdvancedUI NOTIFY showAdvancedUIChanged)
Q_PROPERTY(QString showAdvancedUIMessage READ showAdvancedUIMessage CONSTANT)
Q_PROPERTY(QString brandImageIndoor READ brandImageIndoor CONSTANT) Q_PROPERTY(QString brandImageIndoor READ brandImageIndoor CONSTANT)
Q_PROPERTY(QString brandImageOutdoor READ brandImageOutdoor CONSTANT) Q_PROPERTY(QString brandImageOutdoor READ brandImageOutdoor CONSTANT)
...@@ -71,6 +72,10 @@ public: ...@@ -71,6 +72,10 @@ public:
/// Return the resource file which contains the brand image for for Outdoor theme. /// Return the resource file which contains the brand image for for Outdoor theme.
virtual QString brandImageOutdoor(void) const { return QString(); } virtual QString brandImageOutdoor(void) const { return QString(); }
/// @return The message to show to the user when they a re prompted to confirm turning on advanced ui.
virtual QString showAdvancedUIMessage(void) const { return tr("WARNING: You are about to enter Advanced Mode. This may expose features which may cause your vehicle to malfunction. "
"You should do so only if instructed by customer support. Are you sure you want to enable Advanced Mode?"); }
bool showTouchAreas(void) const { return _showTouchAreas; } bool showTouchAreas(void) const { return _showTouchAreas; }
bool showAdvancedUI(void) const { return _showAdvancedUI; } bool showAdvancedUI(void) const { return _showAdvancedUI; }
void setShowTouchAreas(bool show); void setShowTouchAreas(bool show);
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
* *
****************************************************************************/ ****************************************************************************/
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import QtQuick.Dialogs 1.2
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
...@@ -19,20 +19,19 @@ import QGroundControl.ScreenTools 1.0 ...@@ -19,20 +19,19 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
Item { Item {
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _communicationLost: _activeVehicle ? _activeVehicle.connectionLost : false property bool _communicationLost: _activeVehicle ? _activeVehicle.connectionLost : false
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
// Easter egg mechanism // Easter egg mechanism
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
console.log("easter egg click", ++_clickCount) _clickCount++
eggTimer.restart() eggTimer.restart()
if (_clickCount == 5) { if (_clickCount == 5 && !QGroundControl.corePlugin.showAdvancedUI) {
QGroundControl.corePlugin.showAdvancedUI = true advancedModeConfirmation.visible = true
} else if (_clickCount == 7) { } else if (_clickCount == 7) {
QGroundControl.corePlugin.showTouchAreas = true QGroundControl.corePlugin.showTouchAreas = true
} }
...@@ -45,6 +44,18 @@ Item { ...@@ -45,6 +44,18 @@ Item {
interval: 1000 interval: 1000
onTriggered: parent._clickCount = 0 onTriggered: parent._clickCount = 0
} }
MessageDialog {
id: advancedModeConfirmation
title: qsTr("Advanced Mode")
text: QGroundControl.corePlugin.showAdvancedUIMessage
standardButtons: StandardButton.Yes | StandardButton.No
onYes: {
QGroundControl.corePlugin.showAdvancedUI = true
visible = false
}
}
} }
QGCLabel { QGCLabel {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment