]> git.tdb.fi Git - xinema.git/commitdiff
Move non-page qml components to a separate subdirectory
authorMikko Rasa <tdb@tdb.fi>
Sun, 18 Oct 2015 11:02:13 +0000 (14:02 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 18 Oct 2015 11:02:13 +0000 (14:02 +0300)
remote/qml/components/ChannelItem.qml [new file with mode: 0644]
remote/qml/components/ChannelSelect.qml [new file with mode: 0644]
remote/qml/components/DirectoryEntry.qml [new file with mode: 0644]
remote/qml/pages/BrowsePage.qml
remote/qml/pages/ChannelItem.qml [deleted file]
remote/qml/pages/ChannelSelect.qml [deleted file]
remote/qml/pages/DirectoryEntry.qml [deleted file]
remote/qml/pages/PlaybackPage.qml

diff --git a/remote/qml/components/ChannelItem.qml b/remote/qml/components/ChannelItem.qml
new file mode 100644 (file)
index 0000000..714e707
--- /dev/null
@@ -0,0 +1,31 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Label
+{
+       id: item
+
+       anchors
+       {
+               left: parent.left
+               right: parent.right
+               margins: Theme.paddingLarge
+       }
+
+       property int channelIndex: 0
+       property string channelName: ""
+       property bool down: false
+
+       signal clicked()
+
+       text: channelIndex+": "+channelName
+       horizontalAlignment: Text.AlignHCenter
+       color: down ? Theme.primaryColor : Theme.highlightColor
+
+       MouseArea
+       {
+               anchors.fill: parent
+
+               onClicked: item.clicked()
+       }
+}
diff --git a/remote/qml/components/ChannelSelect.qml b/remote/qml/components/ChannelSelect.qml
new file mode 100644 (file)
index 0000000..43c6cf7
--- /dev/null
@@ -0,0 +1,78 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+ValueButton
+{
+       id: channelSelect
+
+       property var channels: null
+       property int currentChannel: -1
+       property bool _channelsAvailable: channels && channels.length
+       enabled: _channelsAvailable
+
+       value: (_channelsAvailable ? currentChannel>=0 ? (currentChannel+1)+": "+channels[currentChannel] : "0: (off)" : "(not available)")
+
+       onClicked:
+       {
+               if(_channelsAvailable)
+                       pageStack.push(selectDialog);
+       }
+
+       Component
+       {
+               id: selectDialog
+
+               Page
+               {
+                       id: page
+
+                       function selectChannel(index)
+                       {
+                               channelSelect.currentChannel = index;
+                               pageStack.pop();
+                       }
+
+                       SilicaFlickable
+                       {
+                               width: parent.width
+                               contentHeight: column.height
+
+                               Column
+                               {
+                                       id: column
+                                       width: parent.width
+                                       spacing: Theme.paddingLarge
+
+                                       PageHeader
+                                       {
+                                               id: header
+                                               title: channelSelect.label
+                                       }
+
+                                       ChannelItem
+                                       {
+                                               channelIndex: 0
+                                               channelName: "(off)"
+                                               down: channelSelect.currentChannel+1==channelIndex
+
+                                               onClicked: page.selectChannel(channelIndex-1);
+                                       }
+                                       Repeater
+                                       {
+                                               id: repeater
+                                               model: channelSelect.channels
+
+                                               ChannelItem
+                                               {
+                                                       channelIndex: index+1
+                                                       channelName: modelData
+                                                       down: channelSelect.currentChannel+1==channelIndex
+
+                                                       onClicked: page.selectChannel(channelIndex-1);
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+}
diff --git a/remote/qml/components/DirectoryEntry.qml b/remote/qml/components/DirectoryEntry.qml
new file mode 100644 (file)
index 0000000..2c97456
--- /dev/null
@@ -0,0 +1,47 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Item
+{
+       id: entry
+
+       property alias icon: icon.source
+       property alias text: label.text
+       property int iconSize: Theme.iconSizeMedium
+       height: row.height
+
+       signal clicked()
+
+       Row
+       {
+               id: row
+               spacing: Theme.paddingMedium
+               anchors
+               {
+                       left: parent.left
+                       right: parent.right
+                       margins: Theme.horizontalPageMargin
+               }
+
+               Image
+               {
+                       id: icon
+                       sourceSize.width: iconSize
+                       sourceSize.height: iconSize
+                       width: iconSize
+                       height: iconSize
+               }
+               Label
+               {
+                       id: label
+                       height: icon.height
+                       verticalAlignment: Text.AlignVCenter
+               }
+       }
+
+       MouseArea
+       {
+               anchors.fill: parent
+               onClicked: entry.clicked();
+       }
+}
index 8a5d254b60edb5c8443a2895be3dea8a8ef9a4d5..2a3a123363f5c8f781bc250fcdfcddb3170110d1 100644 (file)
@@ -2,6 +2,7 @@ import QtQuick 2.0
 import Sailfish.Silica 1.0
 import org.nemomobile.configuration 1.0
 import fi.mikkosoft.xinema 0.1
+import "../components"
 
 Page
 {
diff --git a/remote/qml/pages/ChannelItem.qml b/remote/qml/pages/ChannelItem.qml
deleted file mode 100644 (file)
index 714e707..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-import QtQuick 2.0
-import Sailfish.Silica 1.0
-
-Label
-{
-       id: item
-
-       anchors
-       {
-               left: parent.left
-               right: parent.right
-               margins: Theme.paddingLarge
-       }
-
-       property int channelIndex: 0
-       property string channelName: ""
-       property bool down: false
-
-       signal clicked()
-
-       text: channelIndex+": "+channelName
-       horizontalAlignment: Text.AlignHCenter
-       color: down ? Theme.primaryColor : Theme.highlightColor
-
-       MouseArea
-       {
-               anchors.fill: parent
-
-               onClicked: item.clicked()
-       }
-}
diff --git a/remote/qml/pages/ChannelSelect.qml b/remote/qml/pages/ChannelSelect.qml
deleted file mode 100644 (file)
index 43c6cf7..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-import QtQuick 2.0
-import Sailfish.Silica 1.0
-
-ValueButton
-{
-       id: channelSelect
-
-       property var channels: null
-       property int currentChannel: -1
-       property bool _channelsAvailable: channels && channels.length
-       enabled: _channelsAvailable
-
-       value: (_channelsAvailable ? currentChannel>=0 ? (currentChannel+1)+": "+channels[currentChannel] : "0: (off)" : "(not available)")
-
-       onClicked:
-       {
-               if(_channelsAvailable)
-                       pageStack.push(selectDialog);
-       }
-
-       Component
-       {
-               id: selectDialog
-
-               Page
-               {
-                       id: page
-
-                       function selectChannel(index)
-                       {
-                               channelSelect.currentChannel = index;
-                               pageStack.pop();
-                       }
-
-                       SilicaFlickable
-                       {
-                               width: parent.width
-                               contentHeight: column.height
-
-                               Column
-                               {
-                                       id: column
-                                       width: parent.width
-                                       spacing: Theme.paddingLarge
-
-                                       PageHeader
-                                       {
-                                               id: header
-                                               title: channelSelect.label
-                                       }
-
-                                       ChannelItem
-                                       {
-                                               channelIndex: 0
-                                               channelName: "(off)"
-                                               down: channelSelect.currentChannel+1==channelIndex
-
-                                               onClicked: page.selectChannel(channelIndex-1);
-                                       }
-                                       Repeater
-                                       {
-                                               id: repeater
-                                               model: channelSelect.channels
-
-                                               ChannelItem
-                                               {
-                                                       channelIndex: index+1
-                                                       channelName: modelData
-                                                       down: channelSelect.currentChannel+1==channelIndex
-
-                                                       onClicked: page.selectChannel(channelIndex-1);
-                                               }
-                                       }
-                               }
-                       }
-               }
-       }
-}
diff --git a/remote/qml/pages/DirectoryEntry.qml b/remote/qml/pages/DirectoryEntry.qml
deleted file mode 100644 (file)
index 2c97456..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-import QtQuick 2.0
-import Sailfish.Silica 1.0
-
-Item
-{
-       id: entry
-
-       property alias icon: icon.source
-       property alias text: label.text
-       property int iconSize: Theme.iconSizeMedium
-       height: row.height
-
-       signal clicked()
-
-       Row
-       {
-               id: row
-               spacing: Theme.paddingMedium
-               anchors
-               {
-                       left: parent.left
-                       right: parent.right
-                       margins: Theme.horizontalPageMargin
-               }
-
-               Image
-               {
-                       id: icon
-                       sourceSize.width: iconSize
-                       sourceSize.height: iconSize
-                       width: iconSize
-                       height: iconSize
-               }
-               Label
-               {
-                       id: label
-                       height: icon.height
-                       verticalAlignment: Text.AlignVCenter
-               }
-       }
-
-       MouseArea
-       {
-               anchors.fill: parent
-               onClicked: entry.clicked();
-       }
-}
index 7bf7cc9069ab1f923659b6036070229a50ec83db..bf1d976c0b382eccc18a14dbc844ea9dac388633 100644 (file)
@@ -1,6 +1,7 @@
 import QtQuick 2.0
 import Sailfish.Silica 1.0
 import fi.mikkosoft.xinema 0.1
+import "../components"
 
 Page
 {