Добавил сервисную страницу, небольшой рефакторинг
This commit is contained in:
@@ -20,6 +20,8 @@ ListModel {
|
||||
property alias serviceUrl: nooLiteClient.serviceUrl
|
||||
property bool isLoading: false
|
||||
|
||||
property int channelsCount: 0
|
||||
|
||||
signal error(string text)
|
||||
|
||||
onServiceUrlChanged: reload()
|
||||
@@ -30,12 +32,25 @@ ListModel {
|
||||
}
|
||||
|
||||
function populateModel(data) {
|
||||
root.clear()
|
||||
root.channelsCount = 0
|
||||
|
||||
data.groups.forEach(function (group) {
|
||||
root.append(group)
|
||||
|
||||
root.channelsCount += group.channels.length
|
||||
})
|
||||
}
|
||||
|
||||
function switchChannel(channelId) {
|
||||
root.client.switchChannel(channelId)
|
||||
root.client.sendCommand("switch", channelId)
|
||||
}
|
||||
|
||||
function bindChannel(channelId) {
|
||||
root.client.sendCommand("bind", channelId)
|
||||
}
|
||||
|
||||
function unbindChannel(channelId) {
|
||||
root.client.sendCommand("unbind", channelId)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user