mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
Hide openLocalFolderButton if no local folder is configured
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
This commit is contained in:
parent
131c1f1bac
commit
749070a29c
3 changed files with 9 additions and 0 deletions
|
@ -768,6 +768,11 @@ bool UserModel::currentUserHasActivities()
|
|||
return _users[currentUserIndex()]->hasActivities();
|
||||
}
|
||||
|
||||
bool UserModel::currentUserHasLocalFolder()
|
||||
{
|
||||
return _users[currentUserIndex()]->getFolder() != nullptr;
|
||||
}
|
||||
|
||||
void UserModel::fetchCurrentActivityModel()
|
||||
{
|
||||
_users[currentUserId()]->slotRefresh();
|
||||
|
|
|
@ -101,6 +101,7 @@ public:
|
|||
Q_INVOKABLE QString currentUserName();
|
||||
Q_INVOKABLE QString currentUserServer();
|
||||
Q_INVOKABLE bool currentUserHasActivities();
|
||||
Q_INVOKABLE bool currentUserHasLocalFolder();
|
||||
Q_INVOKABLE bool currentServerHasTalk();
|
||||
Q_INVOKABLE int currentUserId();
|
||||
Q_INVOKABLE bool isUserConnected(const int &id);
|
||||
|
|
|
@ -30,6 +30,7 @@ Window {
|
|||
currentAccountAvatar.source = "image://avatars/currentUser"
|
||||
currentAccountUser.text = userModelBackend.currentUserName();
|
||||
currentAccountServer.text = userModelBackend.currentUserServer();
|
||||
openLocalFolderButton.visible = userModelBackend.currentUserHasLocalFolder();
|
||||
trayWindowTalkButton.visible = userModelBackend.currentServerHasTalk() ? true : false;
|
||||
currentAccountStateIndicator.source = ""
|
||||
currentAccountStateIndicator.source = userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
|
||||
|
@ -52,6 +53,7 @@ Window {
|
|||
}
|
||||
onNewUserSelected: {
|
||||
accountMenu.close();
|
||||
openLocalFolderButton.visible = userModelBackend.currentUserHasLocalFolder();
|
||||
trayWindowTalkButton.visible = userModelBackend.currentServerHasTalk() ? true : false;
|
||||
}
|
||||
}
|
||||
|
@ -360,6 +362,7 @@ Window {
|
|||
Layout.preferredWidth: Style.trayWindowHeaderHeight
|
||||
Layout.preferredHeight: Style.trayWindowHeaderHeight
|
||||
flat: true
|
||||
visible: userModelBackend.currentUserHasLocalFolder()
|
||||
|
||||
icon.source: "qrc:///client/theme/white/folder.svg"
|
||||
icon.width: Style.headerButtonIconSize
|
||||
|
|
Loading…
Reference in a new issue