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

Easter egg confirmation

parent 718feb8e
......@@ -39,6 +39,7 @@ public:
Q_PROPERTY(bool showTouchAreas READ showTouchAreas WRITE setShowTouchAreas NOTIFY showTouchAreasChanged)
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 brandImageOutdoor READ brandImageOutdoor CONSTANT)
......@@ -71,6 +72,10 @@ public:
/// Return the resource file which contains the brand image for for Outdoor theme.
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 showAdvancedUI(void) const { return _showAdvancedUI; }
void setShowTouchAreas(bool show);
......
......@@ -7,10 +7,10 @@
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2
import QtQuick.Dialogs 1.2
import QGroundControl 1.0
import QGroundControl.Controls 1.0
......@@ -19,20 +19,19 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0
Item {
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _communicationLost: _activeVehicle ? _activeVehicle.connectionLost : false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _communicationLost: _activeVehicle ? _activeVehicle.connectionLost : false
QGCPalette { id: qgcPal }
// Easter egg mechanism
MouseArea {
anchors.fill: parent
onClicked: {
console.log("easter egg click", ++_clickCount)
_clickCount++
eggTimer.restart()
if (_clickCount == 5) {
QGroundControl.corePlugin.showAdvancedUI = true
if (_clickCount == 5 && !QGroundControl.corePlugin.showAdvancedUI) {
advancedModeConfirmation.visible = true
} else if (_clickCount == 7) {
QGroundControl.corePlugin.showTouchAreas = true
}
......@@ -45,6 +44,18 @@ Item {
interval: 1000
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 {
......
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