|
@@ -17,11 +17,9 @@ ApplicationWindow {
|
|
|
RowLayout {
|
|
RowLayout {
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
MenuBackButton {
|
|
MenuBackButton {
|
|
|
- state: "menu"//stackView.depth > 1 ? "back" : "menu"
|
|
|
|
|
|
|
+ state: stackView.depth > 1 ? "back" : "menu"
|
|
|
onClicked: mainMenu.open()
|
|
onClicked: mainMenu.open()
|
|
|
- onBack: {
|
|
|
|
|
- state = "menu"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ onBack: stackView.pop()
|
|
|
}
|
|
}
|
|
|
ToolButton {
|
|
ToolButton {
|
|
|
text: usersModel.selectedUserName
|
|
text: usersModel.selectedUserName
|
|
@@ -55,7 +53,7 @@ ApplicationWindow {
|
|
|
id: mainMenu
|
|
id: mainMenu
|
|
|
|
|
|
|
|
readonly property var actions: {
|
|
readonly property var actions: {
|
|
|
- "settings": () => { stackView.openPage("SettingsForm.qml") },
|
|
|
|
|
|
|
+ "settings": () => { stackView.openPage("Views/SettingsView.qml") },
|
|
|
"quit": () => { Qt.quit() }
|
|
"quit": () => { Qt.quit() }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -78,4 +76,58 @@ ApplicationWindow {
|
|
|
|
|
|
|
|
onActionSelected: (action) => actions[action]()
|
|
onActionSelected: (action) => actions[action]()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ StackView {
|
|
|
|
|
+ id: stackView
|
|
|
|
|
+ initialItem: "Views/OrdersView.qml"
|
|
|
|
|
+ anchors.fill: parent
|
|
|
|
|
+
|
|
|
|
|
+ function openPage(page) {
|
|
|
|
|
+ if (depth > 1) {
|
|
|
|
|
+ pop()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ push(page)
|
|
|
|
|
+ mainMenu.close()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function showError(text) {
|
|
|
|
|
+ ToolTip.show(text, 1000)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Dialog {
|
|
|
|
|
+ id: quitDialog
|
|
|
|
|
+
|
|
|
|
|
+ property bool quitAccepted: false
|
|
|
|
|
+
|
|
|
|
|
+ anchors.centerIn: parent
|
|
|
|
|
+ parent: Overlay.overlay
|
|
|
|
|
+
|
|
|
|
|
+ modal: true
|
|
|
|
|
+ title: qsTr("Quit")
|
|
|
|
|
+ standardButtons: Dialog.Yes | Dialog.No
|
|
|
|
|
+
|
|
|
|
|
+ Label {
|
|
|
|
|
+ text: qsTr("Realy quit the application?")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ onAccepted: {
|
|
|
|
|
+ quitAccepted = true
|
|
|
|
|
+ Qt.quit()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ onClosing: (close) => {
|
|
|
|
|
+ if (stackView.depth > 1) {
|
|
|
|
|
+ close.accepted = false
|
|
|
|
|
+ stackView.pop()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!quitDialog.quitAccepted) {
|
|
|
|
|
+ close.accepted = false
|
|
|
|
|
+ quitDialog.open()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|