import com.nextcloud.desktopclient 1.0 as NC
RowLayout {
- id: layout
+ id: root
property alias model: syncStatus
Text {
id: syncProgressText
-
+
Layout.fillWidth: true
text: syncStatus.syncStatusString
active: syncStatus.syncing
visible: syncStatus.syncing
-
+
sourceComponent: ProgressBar {
id: syncProgressBar
font.pixelSize: Style.subLinePixelSize
}
}
+
+ CustomButton {
+ FontMetrics {
+ id: syncNowFm
+ font.bold: true
+ }
+
+ Layout.preferredWidth: syncNowFm.boundingRect(text).width + leftPadding + rightPadding
+ Layout.rightMargin: Style.trayHorizontalMargin
+
+ FontMetrics { font.bold: true }
+
+ text: qsTr("Sync now")
+ textColor: Style.adjustedCurrentUserHeaderColor
+ textColorHovered: Style.currentUserHeaderTextColor
+ bold: true
+ bgColor: Style.currentUserHeaderColor
+
+ visible: !syncStatus.syncing && NC.UserModel.currentUser.hasLocalFolder
+ enabled: visible
+ onClicked: {
+ if(!syncStatus.syncing) {
+ NC.UserModel.currentUser.forceSyncNow();
+ }
+ }
+ }
}
});
}
+void User::forceSyncNow() const
+{
+ FolderMan::instance()->forceSyncForFolder(getFolder());
+}
+
/*-------------------------------------------------------------------------------------*/
UserModel *UserModel::_instance = nullptr;
void setNotificationRefreshInterval(std::chrono::milliseconds interval);
void slotRebuildNavigationAppList();
void slotSendReplyMessage(const int activityIndex, const QString &conversationToken, const QString &message, const QString &replyTo);
+ void forceSyncNow() const;
private:
void slotPushNotificationsReady();