# 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
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
--- /dev/null
+/*
+ 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
+ }
+}
--- /dev/null
+<?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>