aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2021-07-01 18:05:40 +0200
committerDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2021-07-01 18:05:40 +0200
commit4945818ec1b950081926431dbda093372824b364 (patch)
treec7e48e7e5a147578072998ab9b19981fb1672434
parent2d858e000a4087de5f43352628d6bc41016fffff (diff)
downloadRWA.Support.DesktopApp-4945818ec1b950081926431dbda093372824b364.tar.gz
RWA.Support.DesktopApp-4945818ec1b950081926431dbda093372824b364.tar.bz2
RWA.Support.DesktopApp-4945818ec1b950081926431dbda093372824b364.zip
Introduce add_server_wizard placeholder scenes; Add independent functions for scene operations.
-rw-r--r--qml.qrc3
-rw-r--r--src/main.qml42
-rw-r--r--src/scenes/add_server_wizard/Scene_step_1.qml55
-rw-r--r--src/scenes/add_server_wizard/Scene_step_2.qml55
-rw-r--r--src/scenes/add_server_wizard/Scene_step_3.qml54
5 files changed, 195 insertions, 14 deletions
diff --git a/qml.qrc b/qml.qrc
index cefe120..527f4f3 100644
--- a/qml.qrc
+++ b/qml.qrc
@@ -23,5 +23,8 @@
<file>src/ToastManager.qml</file>
<file>src/Toast.qml</file>
<file>qtquickcontrols2.conf</file>
+ <file>src/scenes/add_server_wizard/Scene_step_1.qml</file>
+ <file>src/scenes/add_server_wizard/Scene_step_2.qml</file>
+ <file>src/scenes/add_server_wizard/Scene_step_3.qml</file>
</qresource>
</RCC>
diff --git a/src/main.qml b/src/main.qml
index 4a0706f..a30ed35 100644
--- a/src/main.qml
+++ b/src/main.qml
@@ -67,6 +67,27 @@ ApplicationWindow {
console.log("Opening window now...");
}
+ function main_content_pop(item, operation) {
+ if(item) {
+ if(item.search(main_content.currentItem.objectName) >= 0) return
+ }
+ return main_content.pop(item, operation)
+ }
+
+ function main_content_push(item, operation) {
+ if(item) {
+ if(item.search(main_content.currentItem.objectName) >= 0) return
+ }
+ return main_content.push(item, operation)
+ }
+
+ function main_content_replace(item, operation) {
+ if(item) {
+ if(item.search(main_content.currentItem.objectName) >= 0) return
+ }
+ return main_content.replace(item, operation)
+ }
+
MessageDialog {
id: message_dialog
objectName: "message_dialog"
@@ -89,9 +110,10 @@ ApplicationWindow {
}
}
-
StackView {
id: main_content
+ objectName: "main_content"
+
anchors.top: top_menu_bar_frame.bottom
anchors.right: parent.right
anchors.bottom: parent.bottom
@@ -191,9 +213,7 @@ ApplicationWindow {
header_text.text = qsTr("Settings")
if(inPortrait) sidebar_drawer.close()
- if(scene_url.search(main_content.currentItem.objectName) <= 0) {
- main_content.replace(scene_url)
- }
+ main_content_replace(scene_url, StackView.Transition)
}
MenuSeparator {
@@ -212,9 +232,7 @@ ApplicationWindow {
header_text.text = qsTr("Allow remote control")
if(inPortrait) sidebar_drawer.close()
- if(scene_url.search(main_content.currentItem.objectName) <= 0) {
- main_content.replace(scene_url)
- }
+ main_content_replace(scene_url, StackView.Transition)
}
}
ListItem {
@@ -224,21 +242,17 @@ ApplicationWindow {
header_text.text = qsTr("Allow remote view")
if(inPortrait) sidebar_drawer.close()
- if(scene_url.search(main_content.currentItem.objectName) <= 0) {
- main_content.replace(scene_url)
- }
+ main_content_replace(scene_url, StackView.Transition)
}
}
ListItem {
text: " " + qsTr("Add RWA-Server")
- scene_url: "scenes/Scene_placeholder.qml"
+ scene_url: "scenes/add_server_wizard/Scene_step_1.qml"
onListItemClick: {
header_text.text = qsTr("Server addition wizard")
if(inPortrait) sidebar_drawer.close()
- if(scene_url.search(main_content.currentItem.objectName) <= 0) {
- main_content.replace(scene_url)
- }
+ main_content_replace(scene_url, StackView.Transition)
}
}
}
diff --git a/src/scenes/add_server_wizard/Scene_step_1.qml b/src/scenes/add_server_wizard/Scene_step_1.qml
new file mode 100644
index 0000000..2061db1
--- /dev/null
+++ b/src/scenes/add_server_wizard/Scene_step_1.qml
@@ -0,0 +1,55 @@
+import QtQuick 2.9
+import QtQuick.Window 2.2
+import QtQuick.Extras 1.4
+import QtQuick.Controls 2.2
+import QtQuick.Dialogs 1.2
+import QtQuick.Controls.Material 2.3
+
+/*!
+ This .qml file is a Scene which can be loaded through for example a StackView (main_content in main.qml).
+ */
+
+Item {
+ id: scene_server_wizard_step_1
+ objectName: "Scene_server_wizard_step_1"
+
+ Rectangle {
+ id: rectangle
+ anchors.fill: parent
+ color: Material.background
+
+ Text {
+ color: Material.foreground
+ id: title
+
+ text: qsTr("Step 1")
+ font.pointSize: 18
+ wrapMode: Text.WordWrap
+
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 5
+ }
+
+ Button {
+ id: next_step1_button
+ text: qsTr("Next Step")
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 10
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+
+ onClicked: {
+ main_content_push("scenes/add_server_wizard/Scene_step_2.qml", StackView.Transition)
+ }
+ }
+ }
+}
+
+/*##^## Designer {
+ D{i:0;autoSize:true;height:480;width:640}
+}
+ ##^##*/
diff --git a/src/scenes/add_server_wizard/Scene_step_2.qml b/src/scenes/add_server_wizard/Scene_step_2.qml
new file mode 100644
index 0000000..acc2a20
--- /dev/null
+++ b/src/scenes/add_server_wizard/Scene_step_2.qml
@@ -0,0 +1,55 @@
+import QtQuick 2.9
+import QtQuick.Window 2.2
+import QtQuick.Extras 1.4
+import QtQuick.Controls 2.2
+import QtQuick.Dialogs 1.2
+import QtQuick.Controls.Material 2.3
+
+/*!
+ This .qml file is a Scene which can be loaded through for example a StackView (main_content in main.qml).
+ */
+
+Item {
+ id: scene_server_wizard_step_2
+ objectName: "Scene_server_wizard_step_2"
+
+ Rectangle {
+ id: rectangle
+ anchors.fill: parent
+ color: Material.background
+
+ Text {
+ color: Material.foreground
+ id: title
+
+ text: qsTr("Step 2")
+ font.pointSize: 18
+ wrapMode: Text.WordWrap
+
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 5
+ }
+
+ Button {
+ id: next_step2_button
+ text: qsTr("Next Step")
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 10
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+
+ onClicked: {
+ main_content_push("scenes/add_server_wizard/Scene_step_3.qml", StackView.Transition)
+ }
+ }
+ }
+}
+
+/*##^## Designer {
+ D{i:0;autoSize:true;height:480;width:640}
+}
+ ##^##*/
diff --git a/src/scenes/add_server_wizard/Scene_step_3.qml b/src/scenes/add_server_wizard/Scene_step_3.qml
new file mode 100644
index 0000000..337537d
--- /dev/null
+++ b/src/scenes/add_server_wizard/Scene_step_3.qml
@@ -0,0 +1,54 @@
+import QtQuick 2.9
+import QtQuick.Window 2.2
+import QtQuick.Extras 1.4
+import QtQuick.Controls 2.2
+import QtQuick.Dialogs 1.2
+import QtQuick.Controls.Material 2.3
+
+/*!
+ This .qml file is a Scene which can be loaded through for example a StackView (main_content in main.qml).
+ */
+
+Item {
+ id: scene_server_wizard_step_3
+ objectName: "Scene_server_wizard_step_3"
+
+ Rectangle {
+ id: rectangle
+ anchors.fill: parent
+ color: Material.background
+
+ Text {
+ color: Material.foreground
+ id: title
+
+ text: qsTr("Step 3")
+ font.pointSize: 18
+ wrapMode: Text.WordWrap
+
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 5
+ }
+
+ Button {
+ id: next_step3_button
+ text: qsTr("<- First step")
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.margins: 10
+
+ onClicked: {
+ main_content_pop(null, StackView.Transition)
+ }
+ }
+ }
+}
+
+/*##^## Designer {
+ D{i:0;autoSize:true;height:480;width:640}
+}
+ ##^##*/