mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 19:58:56 +03:00
Add a 'Sync now' button to the sync status header in the tray window
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
94b45d6d68
commit
c0baf5c93c
3 changed files with 35 additions and 3 deletions
|
@ -7,7 +7,7 @@ import Style 1.0
|
||||||
import com.nextcloud.desktopclient 1.0 as NC
|
import com.nextcloud.desktopclient 1.0 as NC
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: layout
|
id: root
|
||||||
|
|
||||||
property alias model: syncStatus
|
property alias model: syncStatus
|
||||||
|
|
||||||
|
@ -98,4 +98,30 @@ RowLayout {
|
||||||
font.pixelSize: Style.subLinePixelSize
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -856,6 +856,11 @@ void User::slotSendReplyMessage(const int activityIndex, const QString &token, c
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void User::forceSyncNow() const
|
||||||
|
{
|
||||||
|
FolderMan::instance()->forceSyncForFolder(getFolder());
|
||||||
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
UserModel *UserModel::_instance = nullptr;
|
UserModel *UserModel::_instance = nullptr;
|
||||||
|
|
|
@ -108,6 +108,7 @@ public slots:
|
||||||
void setNotificationRefreshInterval(std::chrono::milliseconds interval);
|
void setNotificationRefreshInterval(std::chrono::milliseconds interval);
|
||||||
void slotRebuildNavigationAppList();
|
void slotRebuildNavigationAppList();
|
||||||
void slotSendReplyMessage(const int activityIndex, const QString &conversationToken, const QString &message, const QString &replyTo);
|
void slotSendReplyMessage(const int activityIndex, const QString &conversationToken, const QString &message, const QString &replyTo);
|
||||||
|
void forceSyncNow() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void slotPushNotificationsReady();
|
void slotPushNotificationsReady();
|
||||||
|
|
Loading…
Reference in a new issue