Добавил BussyIndicator
This commit is contained in:
@@ -27,4 +27,9 @@ Page {
|
||||
lights: channels
|
||||
}
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
anchors.centerIn: parent
|
||||
running: lightsModel.isLoading
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ ListModel {
|
||||
id: root
|
||||
|
||||
property string serviceUrl: undefined
|
||||
property bool isLoading: false
|
||||
|
||||
signal error(string text)
|
||||
|
||||
@@ -20,14 +21,18 @@ ListModel {
|
||||
|
||||
if (request.status === 200) {
|
||||
populateModel(JSON.parse(request.responseText))
|
||||
root.isLoading = false
|
||||
return
|
||||
}
|
||||
|
||||
root.error(qsTr("[%1] Request error: %2").
|
||||
arg(request.status).
|
||||
arg(request.statusText))
|
||||
|
||||
root.isLoading = false
|
||||
}
|
||||
|
||||
root.isLoading = true
|
||||
request.send()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user