Добавил сервисную страницу, небольшой рефакторинг

This commit is contained in:
2018-08-14 20:24:20 +02:00
parent b6001e4e81
commit 76786176d2
6 changed files with 89 additions and 21 deletions

View File

@@ -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)
}
}