Refactor code. Add tabs for enabling using two remote controls at once.
[qzeecontrol] / qml / QZeeControl / main.qml
index 8e72fa9..783ee85 100644 (file)
@@ -25,13 +25,51 @@ PageStackWindow {
 
     initialPage: mainPage
 
-    MainPage {
+    Page{
         id: mainPage
+
+        tools: commonTools
+        orientationLock: PageOrientation.LockPortrait
+
+        TabGroup {
+            id: tabGroup
+
+            currentTab: zeeTab1
+
+            ZeeConnectPage{
+                id: zeeTab1
+                name: "Zee_1"
+            }
+
+            ZeeConnectPage{
+                id: zeeTab2
+                name: "Zee_2"
+                usedAddresses: zeeTab1.currentAddress
+            }
+        }
     }
 
     ToolBarLayout {
         id: commonTools
         visible: true
+
+        ButtonRow{
+            id: tabButtonRow
+            style: TabButtonStyle {}
+
+            TabButton{
+                text: zeeTab1.connected ? "*Zee 1*" : "Zee 1"
+                tab: zeeTab1
+
+            }
+
+            TabButton{
+                text: zeeTab2.connected ? "*Zee 2*" : "Zee 2"
+                tab: zeeTab2
+                enabled: zeeTab1.currentAddress !== "No Zeemote found yet."
+            }
+        }
+
         ToolIcon {
             platformIconId: "toolbar-view-menu"
             anchors.right: (parent === undefined) ? undefined : parent.right
@@ -42,8 +80,14 @@ PageStackWindow {
     Menu {
         id: myMenu
         visualParent: pageStack
+
         MenuLayout {
             MenuItem {
+                text: "Edit Key Bindings"
+                onClicked: keyBindingsSettings.open()
+            }
+
+            MenuItem {
                 text: "About"
                 onClicked: aboutDialog.open()
             }
@@ -53,4 +97,9 @@ PageStackWindow {
     AboutDialog{
         id: aboutDialog
     }
+
+    KeyBindingSettings{
+        id: keyBindingsSettings
+        onAccepted: mainPage.loadKeyBindings()
+    }
 }