Add current sync status UI to file provider settings view
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Sun, 14 Jan 2024 17:38:31 +0000 (01:38 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 19 Feb 2024 14:45:21 +0000 (22:45 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/macOS/ui/FileProviderSettings.qml

index 7102324e9d263b57d15e2ea701e3d174c76f090b..9d55b0d637ad3b08f73fa1a60367d993723785a4 100644 (file)
@@ -82,6 +82,44 @@ Page {
             onClicked: root.controller.setVfsEnabledForAccount(root.accountUserIdAtHost, checked)
         }
 
+        GridLayout {
+            id: currentSyncGrid
+
+            readonly property var syncStatus: root.controller.domainSyncStatusForAccount(root.accountUserIdAtHost)
+
+            EnforcedPlainTextLabel {
+                Layout.row: 0
+                Layout.column: 1
+                Layout.columnSpan: currentSyncGrid.syncStatus.syncing ? 2 : 1
+                Layout.fillWidth: true
+                text: currentSyncGrid.syncStatus.syncing ? qsTr("Syncing") : qsTr("All synced!")
+            }
+
+            NCBusyIndicator {
+                id: syncIcon
+
+                property int size: Style.trayListItemIconSize * 0.6
+
+                Layout.row: 0
+                Layout.rowSpan: 2
+                Layout.column: 0
+                Layout.preferredWidth: size
+                Layout.preferredHeight: size
+                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+                imageSource: currentSyncGrid.syncStatus.icon
+                running: currentSyncGrid.syncStatus.syncing
+            }
+
+            ProgressBar {
+                Layout.row: 1
+                Layout.column: 1
+                Layout.fillWidth: true
+                value: currentSyncGrid.syncStatus.fractionCompleted
+                visible: currentSyncGrid.syncStatus.syncing
+            }
+        }
+
         GridLayout {
             id: generalActionsGrid