From 98049d1507a6f2ae232782fd79f4f753ad53eead Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Tue, 6 Jul 2021 20:02:31 +0200 Subject: Fix copyright headers --- src/main.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index 1981f4f..a9bbed7 100644 --- a/src/main.qml +++ b/src/main.qml @@ -1,8 +1,8 @@ /* * This file is part of Remote Support Desktop * https://gitlab.das-netzwerkteam.de/RemoteWebApp/remote-support-desktop - * Copyright 2020-2021 Daniel Teichmann - * Copyright 2020-2021 Mike Gabriel + * Copyright 2020, 2021 Daniel Teichmann + * Copyright 2020, 2021 Mike Gabriel * SPDX-License-Identifier: GPL-2.0-or-later * * This program is free software; you can redistribute it and/or modify -- cgit v1.2.3 From 61b4ee3b8f1d4c5d85b7a561551167fa41b12400 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Tue, 6 Jul 2021 20:04:48 +0200 Subject: Tidy up some debug statements or long strings --- src/main.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index a9bbed7..3574a8c 100644 --- a/src/main.qml +++ b/src/main.qml @@ -32,7 +32,6 @@ import QtQuick.Controls.Styles 1.4 import QtQuick.Dialogs 1.2 import QtQuick.Controls.Material 2.3 import "scenes" as Scenes -//import "ListItem.qml" /*! The main.qml file contains the window, with its header, sidebar, toast and main_content. @@ -59,7 +58,7 @@ ApplicationWindow { function minimizeWindow() { showMinimized(); - console.log("Miniming window now..."); + console.log("Minimizing window now..."); } function showWindow() { @@ -225,6 +224,7 @@ ApplicationWindow { VisualItemModel { id: mainModel + ListItem { text: " " + qsTr("Remote Control") scene_url: "scenes/Scene_remote_control.qml" @@ -362,3 +362,8 @@ ApplicationWindow { } } } + +/*##^## Designer { + D{i:14;anchors_width:650} +} + ##^##*/ -- cgit v1.2.3 From 54249d9c37ce3994b03123ee6367c7f5519d3b40 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Wed, 7 Jul 2021 15:03:13 +0200 Subject: Introduce RWAHostModel. RWAHost's are now loaded on start. Scene_remote_{view, control} are no longer available if no host is selected. --- src/main.qml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index 3574a8c..8a19d54 100644 --- a/src/main.qml +++ b/src/main.qml @@ -182,8 +182,9 @@ ApplicationWindow { */ Drawer { id: sidebar_drawer - y: top_menu_bar_frame.height + objectName: "sidebar_drawer" + y: top_menu_bar_frame.height width: !inPortrait ? Math.min(300, Math.max(200, window.width * 0.333)) : (window.width * 0.5) height: window.height - top_menu_bar_frame.height @@ -194,6 +195,9 @@ ApplicationWindow { margins: -2 visible: !inPortrait + signal rwaHostSelected(string host_uuid) + property bool rwaHostIsSelected: false + ListView { id: sidebar_listview boundsBehavior: Flickable.StopAtBounds @@ -202,6 +206,21 @@ ApplicationWindow { anchors.fill: parent model: mainModel + header: ComboBox { + id: server_chooser + objectName: "server_chooser" + width: parent.width + height: 50 + model: mainqmladaptor.rwaHostModel + + textRole: "alias" + onCurrentIndexChanged: { + var rwa_host = mainqmladaptor.rwaHostModel + sidebar_drawer.rwaHostSelected(rwa_host[currentIndex].uuid) + sidebar_drawer.rwaHostIsSelected = true + } + } + footer: ItemDelegate { id: footer text: " " + qsTr("Settings") @@ -234,6 +253,9 @@ ApplicationWindow { main_content_replace(scene_url, StackView.Transition) } + + // Disabled till a RWAHost object is selected. + enabled: sidebar_drawer.rwaHostIsSelected } ListItem { text: " " + qsTr("Remote View") @@ -244,6 +266,9 @@ ApplicationWindow { main_content_replace(scene_url, StackView.Transition) } + + // Disabled till a RWAHost object is selected. + enabled: sidebar_drawer.rwaHostIsSelected } ListItem { text: " " + qsTr("Add RWA-Server") -- cgit v1.2.3 From 0ed25cd9cd46ba4c3f64eb5e8866becaa07f5344 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Wed, 7 Jul 2021 15:42:42 +0200 Subject: Various small improvements to readability --- src/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index 8a19d54..12c4668 100644 --- a/src/main.qml +++ b/src/main.qml @@ -212,8 +212,8 @@ ApplicationWindow { width: parent.width height: 50 model: mainqmladaptor.rwaHostModel - textRole: "alias" + onCurrentIndexChanged: { var rwa_host = mainqmladaptor.rwaHostModel sidebar_drawer.rwaHostSelected(rwa_host[currentIndex].uuid) -- cgit v1.2.3 From dc3b77a1e3c8b8ff9a9299fd17c13b0428f1fa14 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Thu, 8 Jul 2021 15:50:22 +0200 Subject: Add: 'Scene_no_server_available.qml' --- src/main.qml | 56 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 20 deletions(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index 12c4668..4494526 100644 --- a/src/main.qml +++ b/src/main.qml @@ -66,25 +66,25 @@ ApplicationWindow { console.log("Opening window now..."); } - function main_content_pop(item, operation) { + function main_content_pop(item) { if(item) { if(item.search(main_content.currentItem.objectName) >= 0) return } - return main_content.pop(item, operation) + return main_content.pop(item) } - function main_content_push(item, operation) { + function main_content_push(item) { if(item) { if(item.search(main_content.currentItem.objectName) >= 0) return } - return main_content.push(item, operation) + return main_content.push(item) } - function main_content_replace(item, operation) { + function main_content_replace(item) { if(item) { if(item.search(main_content.currentItem.objectName) >= 0) return } - return main_content.replace(item, operation) + return main_content.replace(item) } MessageDialog { @@ -206,18 +206,29 @@ ApplicationWindow { anchors.fill: parent model: mainModel - header: ComboBox { - id: server_chooser - objectName: "server_chooser" - width: parent.width + header: Rectangle { height: 50 - model: mainqmladaptor.rwaHostModel - textRole: "alias" + width: parent.width + color: Material.background + + ComboBox { + id: server_chooser + objectName: "server_chooser" + + padding: 0 + width: parent.width + height: 56 - y + y: -6 + clip: false + + model: mainqmladaptor.rwaHostModel + textRole: "alias" - onCurrentIndexChanged: { - var rwa_host = mainqmladaptor.rwaHostModel - sidebar_drawer.rwaHostSelected(rwa_host[currentIndex].uuid) - sidebar_drawer.rwaHostIsSelected = true + onCurrentIndexChanged: { + var rwa_host = mainqmladaptor.rwaHostModel + if (rwa_host[currentIndex] !== undefined) + sidebar_drawer.rwaHostSelected(rwa_host[currentIndex].uuid) + } } } @@ -225,13 +236,15 @@ ApplicationWindow { id: footer text: " " + qsTr("Settings") width: parent.width + enabled: false onClicked: { var scene_url = "scenes/Scene_placeholder.qml" header_text.text = qsTr("Settings") if(inPortrait) sidebar_drawer.close() - main_content_replace(scene_url, StackView.Transition) + if(scene_url.search(main_content.currentItem.objectName) >= 0) return + main_content.replace(scene_url, StackView.Transition) } MenuSeparator { @@ -251,7 +264,8 @@ ApplicationWindow { header_text.text = qsTr("Allow remote control") if(inPortrait) sidebar_drawer.close() - main_content_replace(scene_url, StackView.Transition) + if(scene_url.search(main_content.currentItem.objectName) >= 0) return + main_content.replace(scene_url, StackView.Transition) } // Disabled till a RWAHost object is selected. @@ -264,7 +278,8 @@ ApplicationWindow { header_text.text = qsTr("Allow remote view") if(inPortrait) sidebar_drawer.close() - main_content_replace(scene_url, StackView.Transition) + if(scene_url.search(main_content.currentItem.objectName) >= 0) return + main_content.replace(scene_url, StackView.Transition) } // Disabled till a RWAHost object is selected. @@ -277,7 +292,8 @@ ApplicationWindow { header_text.text = qsTr("Server addition wizard") if(inPortrait) sidebar_drawer.close() - main_content_push(scene_url, StackView.ReplaceTransition) + if(scene_url.search(main_content.currentItem.objectName) >= 0) return + main_content.push(scene_url, StackView.ReplaceTransition) } } } -- cgit v1.2.3 From 8e0e0ee3bac6ae037df12026aa1cdd396931b739 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Mon, 12 Jul 2021 12:51:56 +0200 Subject: Cosmetic code changes. --- src/main.qml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index 4494526..102df11 100644 --- a/src/main.qml +++ b/src/main.qml @@ -219,16 +219,19 @@ ApplicationWindow { width: parent.width height: 56 - y y: -6 - clip: false model: mainqmladaptor.rwaHostModel textRole: "alias" onCurrentIndexChanged: { var rwa_host = mainqmladaptor.rwaHostModel - if (rwa_host[currentIndex] !== undefined) + if (rwa_host[currentIndex] !== undefined) { sidebar_drawer.rwaHostSelected(rwa_host[currentIndex].uuid) + displayText = rwa_host[currentIndex].alias + } } + + } } @@ -241,9 +244,9 @@ ApplicationWindow { onClicked: { var scene_url = "scenes/Scene_placeholder.qml" header_text.text = qsTr("Settings") - if(inPortrait) sidebar_drawer.close() + if (inPortrait) sidebar_drawer.close() - if(scene_url.search(main_content.currentItem.objectName) >= 0) return + if (scene_url.search(main_content.currentItem.objectName) >= 0) return main_content.replace(scene_url, StackView.Transition) } @@ -262,9 +265,9 @@ ApplicationWindow { scene_url: "scenes/Scene_remote_control.qml" onListItemClick: { header_text.text = qsTr("Allow remote control") - if(inPortrait) sidebar_drawer.close() + if (inPortrait) sidebar_drawer.close() - if(scene_url.search(main_content.currentItem.objectName) >= 0) return + if (scene_url.search(main_content.currentItem.objectName) >= 0) return main_content.replace(scene_url, StackView.Transition) } @@ -276,9 +279,9 @@ ApplicationWindow { scene_url: "scenes/Scene_remote_view.qml" onListItemClick: { header_text.text = qsTr("Allow remote view") - if(inPortrait) sidebar_drawer.close() + if (inPortrait) sidebar_drawer.close() - if(scene_url.search(main_content.currentItem.objectName) >= 0) return + if (scene_url.search(main_content.currentItem.objectName) >= 0) return main_content.replace(scene_url, StackView.Transition) } @@ -290,9 +293,9 @@ ApplicationWindow { scene_url: "scenes/add_server_wizard/Scene_step_1.qml" onListItemClick: { header_text.text = qsTr("Server addition wizard") - if(inPortrait) sidebar_drawer.close() + if (inPortrait) sidebar_drawer.close() - if(scene_url.search(main_content.currentItem.objectName) >= 0) return + if (scene_url.search(main_content.currentItem.objectName) >= 0) return main_content.push(scene_url, StackView.ReplaceTransition) } } -- cgit v1.2.3 From efa44c931674e498c39fc59091cf1f8654ac97a5 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Sun, 1 Aug 2021 01:58:32 +0200 Subject: Fix typos, too long lines, various styling stuff --- src/main.qml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index 102df11..03f9c5f 100644 --- a/src/main.qml +++ b/src/main.qml @@ -114,7 +114,7 @@ ApplicationWindow { Connections { target: mainqmladaptor - onShowMessageDialogChanged: { + function onShowMessageDialogChanged(show) { message_dialog.visible = show } } @@ -153,21 +153,21 @@ ApplicationWindow { Connections { target: mainqmladaptor - onMessageDialogTextChanged: { + function onMessageDialogTextChanged(text) { message_dialog.text = text } } Connections { target: mainqmladaptor - onMessageDialogTitleChanged: { + function onMessageDialogTitleChanged(title) { message_dialog.title = title } } Connections { target: mainqmladaptor - onMessageDialogIconChanged: { + function onMessageDialogIconChanged(iconindex) { message_dialog.icon = iconindex } } @@ -185,7 +185,9 @@ ApplicationWindow { objectName: "sidebar_drawer" y: top_menu_bar_frame.height - width: !inPortrait ? Math.min(300, Math.max(200, window.width * 0.333)) : (window.width * 0.5) + width: !inPortrait ? + Math.min(300, Math.max(200, window.width * 0.333)) : + (window.width * 0.5) height: window.height - top_menu_bar_frame.height modal: inPortrait @@ -286,7 +288,10 @@ ApplicationWindow { } // Disabled till a RWAHost object is selected. - enabled: sidebar_drawer.rwaHostIsSelected + //enabled: sidebar_drawer.rwaHostIsSelected + + // But remote view is not implemented yet + enabled: false } ListItem { text: " " + qsTr("Add RWA-Server") -- cgit v1.2.3 From 766a90125df68f065495354c20412faf9e1df77a Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Sun, 1 Aug 2021 02:19:15 +0200 Subject: move scenes/Scene_remote_control.qml into scenes/remote_control/Scene_remote_control.qml --- src/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index 03f9c5f..4782f4b 100644 --- a/src/main.qml +++ b/src/main.qml @@ -264,7 +264,7 @@ ApplicationWindow { ListItem { text: " " + qsTr("Remote Control") - scene_url: "scenes/Scene_remote_control.qml" + scene_url: "scenes/remote_control/Scene_remote_control.qml" onListItemClick: { header_text.text = qsTr("Allow remote control") if (inPortrait) sidebar_drawer.close() -- cgit v1.2.3 From 35343e5158ca441f8001c0a91685f4e93b53cb03 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Sun, 1 Aug 2021 02:22:57 +0200 Subject: Toast: Add a variety of new toast colors; Session complete rewrite; A lot of bugfixing; New available toast colors/types: ToastType.Standard, ToastType.Info, ToastType.Warning ToastType.Success, ToastType.Error --- src/main.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index 4782f4b..af41dd1 100644 --- a/src/main.qml +++ b/src/main.qml @@ -107,8 +107,8 @@ ApplicationWindow { Connections { target: mainqmladaptor - onShowToastSignal: { - toast.show(text, durationMs) + function onShowToastSignal(text, durationMs, type) { + toast.show(text, durationMs, type) } } -- cgit v1.2.3 From 0e8f295868e826b89114b55a0aa360cb30d7494f Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Sun, 1 Aug 2021 02:36:42 +0200 Subject: add_server_wizard/add_server_wizard -> add_rwahost_wizard/add_rwahost_wizard --- src/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.qml') diff --git a/src/main.qml b/src/main.qml index af41dd1..a622c18 100644 --- a/src/main.qml +++ b/src/main.qml @@ -295,7 +295,7 @@ ApplicationWindow { } ListItem { text: " " + qsTr("Add RWA-Server") - scene_url: "scenes/add_server_wizard/Scene_step_1.qml" + scene_url: "scenes/add_rwahost_wizard/Scene_step_1.qml" onListItemClick: { header_text.text = qsTr("Server addition wizard") if (inPortrait) sidebar_drawer.close() -- cgit v1.2.3