--- /dev/null
+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()
+ }
+}
--- /dev/null
+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);
+ }
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+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();
+ }
+}
import Sailfish.Silica 1.0
import org.nemomobile.configuration 1.0
import fi.mikkosoft.xinema 0.1
+import "../components"
Page
{
+++ /dev/null
-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()
- }
-}
+++ /dev/null
-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);
- }
- }
- }
- }
- }
- }
-}
+++ /dev/null
-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();
- }
-}
import QtQuick 2.0
import Sailfish.Silica 1.0
import fi.mikkosoft.xinema 0.1
+import "../components"
Page
{