]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/qt-console/tray-monitor/main.qml
authorHenrique <henrique.faria@baculasystems.com>
Sat, 16 May 2020 09:37:48 +0000 (11:37 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 29 Apr 2021 08:44:19 +0000 (10:44 +0200)
This commit is the result of the squash of the following main commits:

Author: Henrique <henrique.faria@baculasystems.com>
Date:   Thu Oct 17 17:54:43 2019 -0300

    android: changed Tutorial to only be shown when tray-monitor.conf file is empty. Also, changed android FD resource to not be deletable

Author: Henrique <henrique.faria@baculasystems.com>
Date:   Tue Oct 1 19:49:40 2019 -0300

    android: added tutorial screens

Author: Henrique <henrique.faria@baculasystems.com>
Date:   Sun Sep 1 21:28:23 2019 -0300

    android: added new start screen

Author: Henrique <henrique.faria@baculasystems.com>
Date:   Thu Aug 15 21:20:44 2019 -0300

    android: tweak comments

Author: Henrique <henrique.faria@baculasystems.com>
Date:   Wed Jun 26 12:03:27 2019 -0300

    android: added missing license and a few comments on src files. FD debug level reduced to 50

Author: Henrique Faria <henrique.faria@baculasystems.com>
Date:   Tue Dec 18 10:56:09 2018 +0100

    android: Port bacula tray-monitor for Android

bacula/src/qt-console/tray-monitor/main.qml [new file with mode: 0644]

diff --git a/bacula/src/qt-console/tray-monitor/main.qml b/bacula/src/qt-console/tray-monitor/main.qml
new file mode 100644 (file)
index 0000000..72857b5
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+   Bacula(R) - The Network Backup Solution
+
+   Copyright (C) 2000-2020 Kern Sibbald
+
+   The original author of Bacula is Kern Sibbald, with contributions
+   from many others, a complete list can be found in the file AUTHORS.
+
+   You may use this file and others of this release according to the
+   license defined in the LICENSE file, which includes the Affero General
+   Public License, v3.0 ("AGPLv3") and some additional permissions and
+   terms pursuant to its AGPLv3 Section 7.
+
+   This notice must be preserved when any source code is
+   conveyed and/or propagated.
+
+   Bacula(R) is a registered trademark of Kern Sibbald.
+*/
+
+import QtQuick 2.10
+import QtQuick.Window 2.10
+import QtQuick.Layouts 1.3
+import QtQuick.Controls 2.3
+import QtQuick.Controls.Material 2.1
+import QtQuick.Dialogs 1.2
+import io.qt.bmob.bootuicontroller 1.0
+
+ApplicationWindow {
+   visible: true
+   title: qsTr("Tray Monitor")
+
+   BootUiController {
+      id: bootUiController
+   }
+
+   StackView {
+      id: stackView
+      anchors.fill: parent
+      focus: true
+
+      // Implements back key navigation for the App toolbar button
+      Keys.onReleased: if (event.key === Qt.Key_Back && stackView.depth > 1) {
+                          if (stackView.currentItem.main === true) {
+                             Qt.quit()
+                          } else {
+                             stackView.pop();
+                          }
+                          event.accepted = true;
+                       }
+
+      initialItem: bootUiController.shouldShowTutorial() ? "TutorialPage.qml" : "MainMenuPage.qml"
+
+   }
+
+   // Implements back key navigation for global android back button
+   onClosing: {
+      if (Qt.platform.os == "android") {
+         if (stackView.depth > 1) {
+            if (stackView.currentItem.main === true) {
+               Qt.quit()
+            } else {
+               stackView.pop();
+            }
+            close.accepted = false;
+         }
+      }
+   }
+}