From: Henrique Date: Tue, 24 Nov 2020 14:46:17 +0000 (+0100) Subject: BEE Backport Android part X-Git-Tag: Release-11.3.2~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e38c7096e020a5704e217be6f6c7e705c6374cbd;p=thirdparty%2Fbacula.git BEE Backport Android part --- diff --git a/bacula/src/qt-console/make-win32 b/bacula/src/qt-console/make-win32 index b9872e6c8..c3b66815e 100755 --- a/bacula/src/qt-console/make-win32 +++ b/bacula/src/qt-console/make-win32 @@ -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 index 000000000..b44db3625 --- /dev/null +++ b/bacula/src/qt-console/tray-monitor/ResourceDetailsPage.qml @@ -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/build-depkgs-android.sh b/bacula/src/qt-console/tray-monitor/android/build-depkgs-android.sh old mode 100644 new mode 100755 diff --git a/bacula/src/qt-console/tray-monitor/android/gradlew b/bacula/src/qt-console/tray-monitor/android/gradlew old mode 100644 new mode 100755 diff --git a/bacula/src/qt-console/tray-monitor/android/make_release.sh b/bacula/src/qt-console/tray-monitor/android/make_release.sh old mode 100644 new mode 100755 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 index 000000000..2af3aafe2 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 index 000000000..deec138a9 --- /dev/null +++ b/bacula/src/qt-console/tray-monitor/android/res/drawable/splash_screen.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ 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 index 000000000..6a49f36d1 --- /dev/null +++ b/bacula/src/qt-console/tray-monitor/android/res/layout/layout_barcode.xml @@ -0,0 +1,26 @@ + + + + + + + + \ 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 index 000000000..a2f590828 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 index 000000000..1b5239980 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 index 000000000..ff10afd6e 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 index 000000000..115a4c768 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 index 000000000..dcd3cd808 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 index 000000000..459ca609d 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 index 000000000..8ca12fe02 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 index 000000000..8e19b410a 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 index 000000000..b824ebdd4 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 index 000000000..4c19a13c2 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 index 000000000..5320ff618 --- /dev/null +++ b/bacula/src/qt-console/tray-monitor/android/res/values/colors.xml @@ -0,0 +1,33 @@ + + + + #d32f2f + #b71c1c + #f44336 + + #FAFAFA + #F5F5F5 + #EEEEEE + #E0E0E0 + #BDBDBD + #9E9E9E + #757575 + #616161 + #424242 + #212121 + + #de000000 + #8a000000 + #61000000 + + @color/material_grey_palette_300 + + #d32f2f + #388E3C + #e65100 + #F9A825 + + #FFFFFF + #000000 + + 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 index 000000000..4009a7785 --- /dev/null +++ b/bacula/src/qt-console/tray-monitor/android/res/values/libs.xml @@ -0,0 +1,25 @@ + + + + https://download.qt.io/ministro/android/qt5/qt-5.9 + + + + + + + + + + + + + + + + + + + + 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 index 000000000..ffcd56693 --- /dev/null +++ b/bacula/src/qt-console/tray-monitor/android/res/values/styles.xml @@ -0,0 +1,7 @@ + + + + +