aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/com.luxoft.vehicle/panels/Vehicle3DControlPanel.qml1
-rw-r--r--apps/com.pelagicore.downloads/controls/DownloadsToolsColumn.qml38
-rw-r--r--apps/com.pelagicore.downloads/stores/DownloadsStates.qml6
-rw-r--r--apps/com.pelagicore.downloads/stores/DownloadsStore.qml3
-rw-r--r--apps/com.pelagicore.downloads/stores/JSONModel.qml2
-rw-r--r--apps/com.pelagicore.downloads/views/DownloadsView.qml1
6 files changed, 49 insertions, 2 deletions
diff --git a/apps/com.luxoft.vehicle/panels/Vehicle3DControlPanel.qml b/apps/com.luxoft.vehicle/panels/Vehicle3DControlPanel.qml
index c0aa54be..a8b84056 100644
--- a/apps/com.luxoft.vehicle/panels/Vehicle3DControlPanel.qml
+++ b/apps/com.luxoft.vehicle/panels/Vehicle3DControlPanel.qml
@@ -68,7 +68,6 @@ Item {
anchors.top: parent.top
anchors.left: parent.left
width: Sizes.dp(264)
- height: Sizes.dp(460)
translationContext: "VehicleToolsColumn"
}
diff --git a/apps/com.pelagicore.downloads/controls/DownloadsToolsColumn.qml b/apps/com.pelagicore.downloads/controls/DownloadsToolsColumn.qml
index 95dea832..65ab16c3 100644
--- a/apps/com.pelagicore.downloads/controls/DownloadsToolsColumn.qml
+++ b/apps/com.pelagicore.downloads/controls/DownloadsToolsColumn.qml
@@ -44,14 +44,52 @@ Item {
property string serverUrl
signal toolClicked(int index)
+ signal refresh()
+
+ BusyIndicator {
+ id: busyIndicator
+
+ running: false
+ anchors.horizontalCenter: root.horizontalCenter
+ opacity: 0.0;
+ visible: opacity > 0.0
+ width: Sizes.dp(100); height: width
+ }
ToolsColumn {
id: toolsColumn
+ property bool refreshRequired: false
+
+ interactive: true
width: Sizes.dp(264)
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: Sizes.dp(53)
onClicked: root.toolClicked(currentIndex)
+ onContentYChanged: {
+ if (atYBeginning) {
+ var d = Math.abs(contentY);
+ busyIndicator.opacity = d / busyIndicator.height;
+ if (d > busyIndicator.height) {
+ if (!busyIndicator.running) {
+ busyIndicator.running = true;
+ refreshRequired = true;
+ }
+ } else {
+ busyIndicator.running = false;
+ // if we drag back - no refresh
+ if (dragging)
+ refreshRequired = false;
+ }
+ }
+ }
+ onMovementEnded: {
+ busyIndicator.opacity = 0.0;
+ if (refreshRequired) {
+ refreshRequired = false;
+ refresh();
+ }
+ }
}
}
diff --git a/apps/com.pelagicore.downloads/stores/DownloadsStates.qml b/apps/com.pelagicore.downloads/stores/DownloadsStates.qml
index 69db4c7c..7c9d96ae 100644
--- a/apps/com.pelagicore.downloads/stores/DownloadsStates.qml
+++ b/apps/com.pelagicore.downloads/stores/DownloadsStates.qml
@@ -304,6 +304,12 @@ DSM.StateMachine {
signal: jsonAppModel.onStatusChanged
guard: jsonAppModel.status === "loading"
}
+
+ DSM.SignalTransition {
+ targetState: fetchingCategoriesState
+ signal: jsonCategoryModel.onStatusChanged
+ guard: jsonCategoryModel.status === "loading"
+ }
}
}
}
diff --git a/apps/com.pelagicore.downloads/stores/DownloadsStore.qml b/apps/com.pelagicore.downloads/stores/DownloadsStore.qml
index 98728495..ee9ab822 100644
--- a/apps/com.pelagicore.downloads/stores/DownloadsStore.qml
+++ b/apps/com.pelagicore.downloads/stores/DownloadsStore.qml
@@ -298,6 +298,9 @@ Item {
ListModel {
id: categoryListModel
+ function refresh() {
+ jsonCategoryModel.refresh();
+ }
}
JSONModel {
diff --git a/apps/com.pelagicore.downloads/stores/JSONModel.qml b/apps/com.pelagicore.downloads/stores/JSONModel.qml
index e18cf4ef..76d2beea 100644
--- a/apps/com.pelagicore.downloads/stores/JSONModel.qml
+++ b/apps/com.pelagicore.downloads/stores/JSONModel.qml
@@ -43,8 +43,8 @@ ListModel {
function refresh() {
status = "loading"
- clear();
JSONBackend.serverCall(url, data, function(data) {
+ clear();
if (data === 0) {
status = "error";
diff --git a/apps/com.pelagicore.downloads/views/DownloadsView.qml b/apps/com.pelagicore.downloads/views/DownloadsView.qml
index ca7fa916..212ecf48 100644
--- a/apps/com.pelagicore.downloads/views/DownloadsView.qml
+++ b/apps/com.pelagicore.downloads/views/DownloadsView.qml
@@ -183,6 +183,7 @@ Item {
model: root.store.categoryModel
serverUrl: root.store.appServerUrl
onToolClicked: root.store.selectCategory(index)
+ onRefresh: root.store.categoryModel.refresh()
}
DownloadAppList {