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