Refactor code. Add tabs for enabling using two remote controls at once.
[qzeecontrol] / qml / QZeeControl / main.qml
index f6076f6..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