]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport Android part
authorHenrique <henrique.faria@baculasystems.com>
Tue, 24 Nov 2020 14:46:17 +0000 (15:46 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:27 +0000 (09:03 +0100)
21 files changed:
bacula/src/qt-console/make-win32
bacula/src/qt-console/tray-monitor/ResourceDetailsPage.qml [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/build-depkgs-android.sh [changed mode: 0644->0755]
bacula/src/qt-console/tray-monitor/android/gradlew [changed mode: 0644->0755]
bacula/src/qt-console/tray-monitor/android/make_release.sh [changed mode: 0644->0755]
bacula/src/qt-console/tray-monitor/android/res/drawable/logo.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/drawable/splash_screen.xml [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/layout/layout_barcode.xml [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-hdpi/ic_launcher.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-hdpi/ic_launcher_round.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-mdpi/ic_launcher.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-mdpi/ic_launcher_round.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-xhdpi/ic_launcher.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-xhdpi/ic_launcher_round.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-xxhdpi/ic_launcher.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-xxhdpi/ic_launcher_round.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-xxxhdpi/ic_launcher.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/mipmap-xxxhdpi/ic_launcher_round.png [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/values/colors.xml [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/values/libs.xml [new file with mode: 0644]
bacula/src/qt-console/tray-monitor/android/res/values/styles.xml [new file with mode: 0644]

index b9872e6c8cac091a5147fc6f4fb7c214ae901658..c3b66815e3c0685500b45ec6e697744bc7d40510 100755 (executable)
@@ -7,79 +7,6 @@
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 
-
-prepare_regw_build()
-{
-    local version=$1
-    local dpkgs_mingw
-    if test -d ../win32/release${version}; then
-      if [ ${version} -eq 32 ]
-      then
-        depkgs_mingw='depkgs-mingw32'
-
-      elif [ ${version} -eq 64 ]
-      then
-        depkgs_mingw='depkgs-mingw-w64'
-      else
-        echo "wrong version - '${version}'."
-        exit 1
-      fi
-
-      cd RegistrationWizard
-      qmake -spec $PWD/../win32 -unix -o Makefile.mingw${version} "CONFIG += mingw${version}" RegistrationWizard.pro
-
-      # Don't know why this libGL is added
-      sed -i s/-lGL// Makefile.mingw${version}
-      # Linux headers are also added automatically
-      perl -plne  "s:-I/usr/[^ ]+::g" Makefile.mingw${version} > 1
-      perl -plne  "s:-L/usr/[^ ]+::g" 1 > Makefile.mingw${version}
-
-      echo "Make Windows RegistrationWizard"
-      make -j3 -f Makefile.mingw${version} $2
-      if test -f RegistrationWizard.exe; then
-          cp -f RegistrationWizard.exe ../../win32/release${version}
-      fi
-      rm -f RegistrationWizard.exe
-    fi
-    cd ..
-}
-
-prepare_regw_build()
-{
-    local version=$1
-    local dpkgs_mingw
-    if test -d ../win32/release${version}; then
-      if [ ${version} -eq 32 ]
-      then
-        depkgs_mingw='depkgs-mingw32'
-
-      elif [ ${version} -eq 64 ]
-      then
-        depkgs_mingw='depkgs-mingw-w64'
-      else
-        echo "wrong version - '${version}'."
-        exit 1
-      fi
-
-      cd RegistrationWizard
-      qmake -spec $PWD/../win32 -unix -o Makefile.mingw${version} "CONFIG += mingw${version}" RegistrationWizard.pro
-
-      # Don't know why this libGL is added
-      sed -i s/-lGL// Makefile.mingw${version}
-      # Linux headers are also added automatically
-      perl -plne  "s:-I/usr/[^ ]+::g" Makefile.mingw${version} > 1
-      perl -plne  "s:-L/usr/[^ ]+::g" 1 > Makefile.mingw${version}
-
-      echo "Make Windows RegistrationWizard"
-      make -j3 -f Makefile.mingw${version} $2
-      if test -f RegistrationWizard.exe; then
-          cp -f RegistrationWizard.exe ../../win32/release${version}
-      fi
-      rm -f RegistrationWizard.exe
-    fi
-    cd ..
-}
-
 prepare_bat_build ()
 {
    local version=$1
@@ -163,8 +90,6 @@ prepare_tray_monitor_build ()
 
 readonly BUILD_ARCH="$1"
 
-prepare_regw_build ${BUILD_ARCH:-64}
-
 rm -f debug/bat.exe
 if test -f ../config.h ; then
    mv -f ../config.h ../config.h.orig
diff --git a/bacula/src/qt-console/tray-monitor/ResourceDetailsPage.qml b/bacula/src/qt-console/tray-monitor/ResourceDetailsPage.qml
new file mode 100644 (file)
index 0000000..b44db36
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+   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.resdetailscontroller 1.0
+
+Page {
+   id: resDetailsPage
+   visible: true
+   height: parent ? parent.height : 0
+   width: parent ? parent.width : 0
+
+   property var resModel;
+   property var resType;
+
+   ResDetailsUiController {
+      id: resDetailsController
+
+      onSuccessMessageChanged: {
+         titleLabel.text = resDetailsController.resourceName
+         dialog.text = resDetailsController.successMsg
+         dialog.open()
+      }
+
+      onErrorMsgChanged: {
+         dialog.text = resDetailsController.errorMsg
+         dialog.open()
+      }
+
+      Component.onCompleted: {
+         resModel = resDetailsPage.resModel
+         connectToResource();
+      }
+
+      onConnectionStarted: {
+         connStatus.text = "Connecting..."
+         connStatus.color = "#fff176"
+      }
+
+      onConnectionError: {
+         connStatus.text = connectionError
+         connStatus.color = "#ffcdd2"
+      }
+
+      onConnectionSuccess: {
+         connStatus.text = "Connected"
+         connStatus.color = "#66bb6a"
+         resStatusPage.connected = true
+         bar.visible = true
+      }
+
+      // "model" here is received as an argument
+      onRunJobModelCreated: {
+         stackView.push(
+                  Qt.resolvedUrl("RunJobPage.qml"),
+                  {"model" : model}
+                  )
+      }
+
+      onRestoreModelCreated: {
+         stackView.push(
+                  Qt.resolvedUrl("RestoreJobPage.qml"),
+                  {"model" : model}
+                  )
+      }
+   }
+
+   onVisibleChanged: {
+      if (visible) {
+         resDetailsController.connectToResource()
+      }
+   }
+
+   header: ToolBar {
+      id: toolbar
+      height: 48
+
+      background: Rectangle {
+         color: "#d32f2f"
+      }
+
+      RowLayout {
+         anchors.fill: parent
+         anchors.leftMargin: 8
+         anchors.rightMargin: 8
+
+         ToolButton {
+            id: backButton
+            onClicked: stackView.pop()
+            anchors.left: parent.left
+
+            contentItem: Text {
+               text: qsTr("<")
+               font.pixelSize: 24
+               opacity: enabled ? 1.0 : 0.3
+               color: "white"
+            }
+
+            background: Rectangle {
+               color: backButton.down ? "#b71c1c" : "#d32f2f"
+            }
+         }
+
+         Label {
+            id: titleLabel
+            text: resDetailsController.resourceName
+            color: "white"
+            font.pixelSize: 18
+            anchors.centerIn: parent
+         }
+
+      }
+   }
+
+   Rectangle {
+      id: connStatus
+      anchors.top: parent.top
+      anchors.left: parent.left
+      anchors.right: parent.right
+      height: childrenRect.height
+      color: "#ffcdd2"
+
+      property alias text: statusLabel.text
+
+      Label {
+         id: statusLabel
+         text: "Not Connected"
+         anchors.horizontalCenter: parent.horizontalCenter
+         topPadding: 4
+         bottomPadding: 4
+         color: "#000000"
+      }
+   }
+
+   Flickable {
+      id: scrollableBox
+      anchors.top: connStatus.bottom
+      anchors.bottom: parent.bottom
+      width: parent.width
+      contentWidth: parent.width
+      contentHeight: scrollContent.height
+      clip: true
+
+      Item {
+         id: scrollContent
+         width: parent.width
+         height: childrenRect.height
+
+         ResourceStatusPage {
+            id: resStatusPage
+         }
+
+         Rectangle {
+            id: divider
+            anchors.left: parent.left
+            anchors.right: parent.right
+            anchors.top: resStatusPage.bottom
+            anchors.topMargin: 16
+            height: 1
+            color: "#e0e0e0"
+         }
+
+         Text {
+            id: rjobsLabel
+            text: "Running Jobs"
+            font.pixelSize: 18
+            anchors.top: divider.bottom
+            anchors.topMargin: 24
+            anchors.horizontalCenter: parent.horizontalCenter
+         }
+
+         ListView {
+            id: runningJobsPage
+            model: resDetailsController.runningJobs
+            height: childrenRect.height
+            anchors.top: rjobsLabel.bottom
+            anchors.topMargin: 12
+            anchors.left: parent.left
+            anchors.right: parent.right
+            interactive: false
+            boundsBehavior: Flickable.StopAtBounds
+
+            delegate: JobListItem {
+               jobId: model.modelData.id
+               name: model.modelData.name
+               level: model.modelData.level
+               finfo: model.modelData.fileInfo
+               errorCount: model.modelData.errorCount
+            }
+
+            Text {
+               text: "No jobs are running"
+               anchors.left: parent.left
+               anchors.leftMargin: 24
+               anchors.top: parent.top
+               anchors.topMargin: 8
+               visible: parent.count == 0
+               font.pixelSize: 18
+               color: "#d32f2f"
+            }
+         }
+
+         Rectangle {
+            id: divider2
+            anchors.left: parent.left
+            anchors.right: parent.right
+            anchors.top: runningJobsPage.bottom
+            anchors.topMargin: 24
+            height: 1
+            color: "#e0e0e0"
+         }
+
+         Text {
+            id: tjobsLabel
+            text: "Terminated Jobs"
+            font.pixelSize: 18
+            anchors.top: divider2.bottom
+            anchors.topMargin: 24
+            anchors.horizontalCenter: parent.horizontalCenter
+         }
+
+         ListView {
+            id: terminatedJobsPage
+            model: resDetailsController.terminatedJobs
+            height: childrenRect.height
+            anchors.top: tjobsLabel.bottom
+            anchors.topMargin: 12
+            anchors.left: parent.left
+            anchors.right: parent.right
+            interactive: false
+            boundsBehavior: Flickable.StopAtBounds
+
+            delegate: JobListItem {
+               jobId: model.modelData.id
+               name: model.modelData.name
+               level: model.modelData.level
+               finfo: model.modelData.fileInfo
+               errorCount: model.modelData.errorCount
+            }
+
+            Text {
+               text: "No terminated jobs"
+               anchors.left: parent.left
+               anchors.leftMargin: 24
+               anchors.top: parent.top
+               anchors.topMargin: 8
+               visible: parent.count == 0
+               font.pixelSize: 18
+               color: "#d32f2f"
+            }
+         }
+      }
+
+   }
+
+   PulseLoader {
+      useDouble: true
+      visible: resDetailsController.isConnecting
+      radius: 28
+      color: "#d32f2f"
+      anchors.horizontalCenter: parent.horizontalCenter
+      anchors.bottom: parent.bottom
+      anchors.bottomMargin: 24
+   }
+
+   MessageDialog {
+      id: dialog
+      modality: Qt.ApplicationModal
+      standardButtons: StandardButton.Ok
+      visible: false
+   }
+}
diff --git a/bacula/src/qt-console/tray-monitor/android/res/drawable/logo.png b/bacula/src/qt-console/tray-monitor/android/res/drawable/logo.png
new file mode 100644 (file)
index 0000000..2af3aaf
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/drawable/logo.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/drawable/splash_screen.xml b/bacula/src/qt-console/tray-monitor/android/res/drawable/splash_screen.xml
new file mode 100644 (file)
index 0000000..deec138
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item
+        android:drawable="@color/colorPrimary"/>
+
+    <item>
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/logo"/>
+    </item>
+
+</layer-list>
\ No newline at end of file
diff --git a/bacula/src/qt-console/tray-monitor/android/res/layout/layout_barcode.xml b/bacula/src/qt-console/tray-monitor/android/res/layout/layout_barcode.xml
new file mode 100644 (file)
index 0000000..6a49f36
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <fragment
+        android:id="@+id/barcode_fragment"
+        android:name="info.androidhive.barcode.BarcodeReader"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        app:auto_focus="true"
+        app:use_flash="false" />
+
+    <info.androidhive.barcode.ScannerOverlay
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#44000000"
+        app:line_color="#7323DC"
+        app:line_speed="6"
+        app:line_width="4"
+        app:square_height="200"
+        app:square_width="200"/>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-hdpi/ic_launcher.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-hdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..a2f5908
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-hdpi/ic_launcher_round.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..1b52399
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-mdpi/ic_launcher.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-mdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..ff10afd
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-mdpi/ic_launcher_round.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..115a4c7
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-xhdpi/ic_launcher.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..dcd3cd8
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-xhdpi/ic_launcher_round.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..459ca60
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxhdpi/ic_launcher.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..8ca12fe
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxhdpi/ic_launcher_round.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..8e19b41
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxxhdpi/ic_launcher.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..b824ebd
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxxhdpi/ic_launcher_round.png b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..4c19a13
Binary files /dev/null and b/bacula/src/qt-console/tray-monitor/android/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/bacula/src/qt-console/tray-monitor/android/res/values/colors.xml b/bacula/src/qt-console/tray-monitor/android/res/values/colors.xml
new file mode 100644 (file)
index 0000000..5320ff6
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Material Design colors palette -->
+<resources>
+    <color name="colorPrimary">#d32f2f</color>
+    <color name="colorPrimaryDark">#b71c1c</color>
+    <color name="colorAccent">#f44336</color>
+
+    <color name="material_grey_palette_50">#FAFAFA</color>
+    <color name="material_grey_palette_100">#F5F5F5</color>
+    <color name="material_grey_palette_200">#EEEEEE</color>
+    <color name="material_grey_palette_300">#E0E0E0</color>
+    <color name="material_grey_palette_400">#BDBDBD</color>
+    <color name="material_grey_palette_500">#9E9E9E</color>
+    <color name="material_grey_palette_600">#757575</color>
+    <color name="material_grey_palette_700">#616161</color>
+    <color name="material_grey_palette_800">#424242</color>
+    <color name="material_grey_palette_900">#212121</color>
+
+    <color name="textPrimary">#de000000</color> <!-- Black 87% -->
+    <color name="textSecondary">#8a000000</color> <!-- Black 54% -->
+    <color name="textTertiary">#61000000</color> <!-- Black 38% -->
+
+    <color name="greyDivider">@color/material_grey_palette_300</color>
+
+    <color name="redError">#d32f2f</color>
+    <color name="greenDone">#388E3C</color>
+    <color name="orangeWarning">#e65100</color>
+    <color name="yellowWarning">#F9A825</color>
+
+    <color name="white">#FFFFFF</color>
+    <color name="black">#000000</color>
+
+</resources>
diff --git a/bacula/src/qt-console/tray-monitor/android/res/values/libs.xml b/bacula/src/qt-console/tray-monitor/android/res/values/libs.xml
new file mode 100644 (file)
index 0000000..4009a77
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='utf-8'?>
+<resources>
+    <array name="qt_sources">
+        <item>https://download.qt.io/ministro/android/qt5/qt-5.9</item>
+    </array>
+
+    <!-- The following is handled automatically by the deployment tool. It should
+         not be edited manually. -->
+
+    <array name="bundled_libs">
+        <!-- %%INSERT_EXTRA_LIBS%% -->
+    </array>
+
+     <array name="qt_libs">
+         <!-- %%INSERT_QT_LIBS%% -->
+     </array>
+
+    <array name="bundled_in_lib">
+        <!-- %%INSERT_BUNDLED_IN_LIB%% -->
+    </array>
+    <array name="bundled_in_assets">
+        <!-- %%INSERT_BUNDLED_IN_ASSETS%% -->
+    </array>
+
+</resources>
diff --git a/bacula/src/qt-console/tray-monitor/android/res/values/styles.xml b/bacula/src/qt-console/tray-monitor/android/res/values/styles.xml
new file mode 100644 (file)
index 0000000..ffcd566
--- /dev/null
@@ -0,0 +1,7 @@
+<resources xmlns:tools="http://schemas.android.com/tools">
+
+    <style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
+        <item name="android:windowBackground">@drawable/splash_screen</item>
+    </style>
+
+</resources>