mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 04:55:48 +03:00
SettingsDialogMac: Fix account display name #6078
This commit is contained in:
parent
a3c1052cae
commit
9866010b4c
2 changed files with 22 additions and 1 deletions
|
@ -157,7 +157,8 @@ void SettingsDialogMac::accountAdded(AccountState *s)
|
|||
connect(accountSettings, &AccountSettings::openFolderAlias, _gui, &ownCloudGui::slotFolderOpenAction);
|
||||
connect(accountSettings, &AccountSettings::showIssuesList, this, &SettingsDialogMac::showIssuesList);
|
||||
|
||||
connect(s->account().data(), SIGNAL(accountChangedAvatar()), this, SLOT(slotAccountAvatarChanged()));
|
||||
connect(s->account().data(), &Account::accountChangedAvatar, this, &SettingsDialogMac::slotAccountAvatarChanged);
|
||||
connect(s->account().data(), &Account::accountChangedDisplayName, this, &SettingsDialogMac::slotAccountDisplayNameChanged);
|
||||
|
||||
slotRefreshActivity(s);
|
||||
}
|
||||
|
@ -195,4 +196,23 @@ void SettingsDialogMac::slotAccountAvatarChanged()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialogMac::slotAccountDisplayNameChanged()
|
||||
{
|
||||
Account *account = static_cast<Account *>(sender());
|
||||
auto list = findChildren<AccountSettings *>(QString());
|
||||
foreach (auto p, list) {
|
||||
if (p->accountsState()->account() == account) {
|
||||
int idx = indexForPanel(p);
|
||||
QString displayName = account->displayName();
|
||||
if (!displayName.isNull()) {
|
||||
displayName = Theme::instance()->multiAccount()
|
||||
? SettingsDialogCommon::shortDisplayNameForSettings(account, 0)
|
||||
: tr("Account");
|
||||
setPreferencesPanelTitle(idx, displayName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ private slots:
|
|||
void accountAdded(AccountState *);
|
||||
void accountRemoved(AccountState *);
|
||||
void slotAccountAvatarChanged();
|
||||
void slotAccountDisplayNameChanged();
|
||||
|
||||
private:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
|
Loading…
Reference in a new issue