summaryrefslogtreecommitdiff
path: root/gui/qml
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-03-17 15:14:56 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-05-04 14:58:39 +0200
commitaa7b37949ae72cc1e1c37fc1c60a3abeb48d7bf1 (patch)
tree2be52ecdd189cd9abbd109fbb98ebf0281cfa286 /gui/qml
parent74bffa3b21947600a550056d16163f5059d5fa2b (diff)
undo qualified namespace
Diffstat (limited to 'gui/qml')
-rw-r--r--gui/qml/FailDialog.qml3
-rw-r--r--gui/qml/main.qml90
2 files changed, 74 insertions, 19 deletions
diff --git a/gui/qml/FailDialog.qml b/gui/qml/FailDialog.qml
index d151feb..401fa25 100644
--- a/gui/qml/FailDialog.qml
+++ b/gui/qml/FailDialog.qml
@@ -16,7 +16,8 @@ MessageDialog {
if (ctx.loginDialog == 'true') {
login.visible = true
} else {
- // FIXME - we probably want to distinguish
+
+ // FIXME - we probably want to distinguish
// fatal from recoverable errors. For the time being
// we can avoid quitting so that people can try reconnects if it's
// a network problem, it's confusing to quit the app.
diff --git a/gui/qml/main.qml b/gui/qml/main.qml
index 502379b..fd5421a 100644
--- a/gui/qml/main.qml
+++ b/gui/qml/main.qml
@@ -1,13 +1,14 @@
import QtQuick 2.9
-import QtQuick.Controls 1.4
+import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.0
-import QtQuick.Extras 1.2
-
-import Qt.labs.platform 1.1 as LabsPlatform
+import QtQuick.Controls 1.4
-ApplicationWindow {
+//import QtQuick.Extras 1.2
+import Qt.labs.platform 1.0
+//as LabsPlatform
+Window {
id: app
visible: true
width: 300
@@ -229,7 +230,7 @@ ApplicationWindow {
id: vpn
}
- LabsPlatform.SystemTrayIcon {
+ SystemTrayIcon {
id: systray
visible: systrayVisible
@@ -239,7 +240,12 @@ ApplicationWindow {
systray.activatedSignal()
}
- menu: LabsPlatform.Menu {
+
+ /* the systray menu cannot be buried in a child qml file because
+ * otherwise the ids are not available
+ * from other components
+ */
+ menu: Menu {
id: systrayMenu
@@ -253,13 +259,61 @@ ApplicationWindow {
}
}
- LabsPlatform.MenuItem {
+ MenuItem {
id: statusItem
text: qsTr("Checking status…")
enabled: false
}
- LabsPlatform.MenuItem {
+ MenuItem {
+ id: autoSelectionItem
+ text: qsTr("automatic")
+ checkable: true
+ checked: true
+ enabled: false
+ }
+
+
+ /* a minimal segfault for submenu */
+ // Menu {}
+
+ /* this segfaults too (but it's the way to do dynamic item creation */
+
+ /*
+ Menu {
+ id: manualGatewaysSubmenu
+ title: qsTr("Manual Gateways")
+ enabled: true
+
+ Instantiator {
+ id: manualGatewayInstantiator
+ //model: settings.recentFiles
+
+ delegate: MenuItem {
+ text: "test gateway"
+ }
+
+ onObjectAdded: manualGatewaysSubmenu.insertItem(index, object)
+ onObjectRemoved: manualGatewaysSubmenu.removeItem(object)
+ }
+
+ MenuSeparator {}
+ }
+ */
+ MenuSeparator {}
+
+ MenuItem {
+ id: manualSelectionItem
+ text: qsTr("Pick gateway…")
+ checkable: true
+ checked: false
+ enabled: true
+ }
+
+ MenuSeparator {}
+
+
+ MenuItem {
text: {
if (vpn.state == "failed")
qsTr("Reconnect")
@@ -273,7 +327,7 @@ ApplicationWindow {
|| ctx.status == "failed") : false
}
- LabsPlatform.MenuItem {
+ MenuItem {
text: {
if (ctx && ctx.status == "starting")
qsTr("Cancel")
@@ -287,9 +341,9 @@ ApplicationWindow {
|| ctx.status == "failed") : false
}
- LabsPlatform.MenuSeparator {}
+ MenuSeparator {}
- LabsPlatform.MenuItem {
+ MenuItem {
text: qsTr("About…")
onTriggered: {
about.visible = true
@@ -298,7 +352,7 @@ ApplicationWindow {
}
}
- LabsPlatform.MenuItem {
+ MenuItem {
id: donateItem
text: qsTr("Donate…")
visible: ctx ? ctx.donateURL : false
@@ -307,9 +361,9 @@ ApplicationWindow {
}
}
- LabsPlatform.MenuSeparator {}
+ MenuSeparator {}
- LabsPlatform.MenuItem {
+ MenuItem {
text: qsTr("Help…")
onTriggered: {
@@ -318,7 +372,7 @@ ApplicationWindow {
}
}
- LabsPlatform.MenuItem {
+ MenuItem {
text: qsTr("Report a bug…")
onTriggered: {
@@ -328,9 +382,9 @@ ApplicationWindow {
}
}
- LabsPlatform.MenuSeparator {}
+ MenuSeparator {}
- LabsPlatform.MenuItem {
+ MenuItem {
text: qsTr("Quit")
onTriggered: backend.quit()
}