Merge pull request #300 from nextcloud/upstream/pr/6351

SettingsDialogMac: Also start timer for notifications
This commit is contained in:
Roeland Jago Douma 2018-05-29 20:19:03 +02:00 коммит произвёл GitHub
Родитель 4089456bc6 13b2e51dfe
Коммит 6ebcc638e0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 20 добавлений и 0 удалений

Просмотреть файл

@ -237,6 +237,9 @@ void SettingsDialog::accountAdded(AccountState *s)
connect(s->account().data(), &Account::accountChangedAvatar, this, &SettingsDialog::slotAccountAvatarChanged); connect(s->account().data(), &Account::accountChangedAvatar, this, &SettingsDialog::slotAccountAvatarChanged);
connect(s->account().data(), &Account::accountChangedDisplayName, this, &SettingsDialog::slotAccountDisplayNameChanged); connect(s->account().data(), &Account::accountChangedDisplayName, this, &SettingsDialog::slotAccountDisplayNameChanged);
// Refresh immediatly when getting online
connect(s, &AccountState::isConnectedChanged, this, &SettingsDialog::slotRefreshActivityAccountStateSender);
slotRefreshActivity(s); slotRefreshActivity(s);
} }
@ -379,6 +382,11 @@ QAction *SettingsDialog::createColorAwareAction(const QString &iconPath, const Q
return createActionWithIcon(coloredIcon, text, iconPath); return createActionWithIcon(coloredIcon, text, iconPath);
} }
void SettingsDialog::slotRefreshActivityAccountStateSender()
{
slotRefreshActivity(qobject_cast<AccountState*>(sender()));
}
void SettingsDialog::slotRefreshActivity(AccountState *accountState) void SettingsDialog::slotRefreshActivity(AccountState *accountState)
{ {
if (accountState) { if (accountState) {

Просмотреть файл

@ -59,6 +59,7 @@ public slots:
void showIssuesList(const QString &folderAlias); void showIssuesList(const QString &folderAlias);
void slotSwitchPage(QAction *action); void slotSwitchPage(QAction *action);
void slotRefreshActivity(AccountState *accountState); void slotRefreshActivity(AccountState *accountState);
void slotRefreshActivityAccountStateSender();
void slotAccountAvatarChanged(); void slotAccountAvatarChanged();
void slotAccountDisplayNameChanged(); void slotAccountDisplayNameChanged();

Просмотреть файл

@ -21,6 +21,7 @@
#include "generalsettings.h" #include "generalsettings.h"
#include "networksettings.h" #include "networksettings.h"
#include "accountsettings.h" #include "accountsettings.h"
#include "accountstate.h"
#include "creds/abstractcredentials.h" #include "creds/abstractcredentials.h"
#include "configfile.h" #include "configfile.h"
#include "progressdispatcher.h" #include "progressdispatcher.h"
@ -121,6 +122,7 @@ SettingsDialogMac::SettingsDialogMac(ownCloudGui *gui, QWidget *parent)
ConfigFile cfg; ConfigFile cfg;
cfg.restoreGeometry(this); cfg.restoreGeometry(this);
_activitySettings->setNotificationRefreshInterval(cfg.notificationRefreshInterval());
} }
void SettingsDialogMac::closeEvent(QCloseEvent *event) void SettingsDialogMac::closeEvent(QCloseEvent *event)
@ -160,6 +162,9 @@ void SettingsDialogMac::accountAdded(AccountState *s)
connect(s->account().data(), &Account::accountChangedAvatar, this, &SettingsDialogMac::slotAccountAvatarChanged); connect(s->account().data(), &Account::accountChangedAvatar, this, &SettingsDialogMac::slotAccountAvatarChanged);
connect(s->account().data(), &Account::accountChangedDisplayName, this, &SettingsDialogMac::slotAccountDisplayNameChanged); connect(s->account().data(), &Account::accountChangedDisplayName, this, &SettingsDialogMac::slotAccountDisplayNameChanged);
// Refresh immediatly when getting online
connect(s, &AccountState::isConnectedChanged, this, &SettingsDialogMac::slotRefreshActivityAccountStateSender);
slotRefreshActivity(s); slotRefreshActivity(s);
} }
@ -175,6 +180,11 @@ void SettingsDialogMac::accountRemoved(AccountState *s)
_activitySettings->slotRemoveAccount(s); _activitySettings->slotRemoveAccount(s);
} }
void SettingsDialogMac::slotRefreshActivityAccountStateSender()
{
slotRefreshActivity(qobject_cast<AccountState*>(sender()));
}
void SettingsDialogMac::slotRefreshActivity(AccountState *accountState) void SettingsDialogMac::slotRefreshActivity(AccountState *accountState)
{ {
if (accountState) { if (accountState) {

Просмотреть файл

@ -49,6 +49,7 @@ public slots:
void showActivityPage(); void showActivityPage();
void showIssuesList(const QString &folderAlias); void showIssuesList(const QString &folderAlias);
void slotRefreshActivity(AccountState *accountState); void slotRefreshActivity(AccountState *accountState);
void slotRefreshActivityAccountStateSender();
private slots: private slots:
void accountAdded(AccountState *); void accountAdded(AccountState *);