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 committed by GitHub
commit 6ebcc638e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 0 deletions

View file

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

View file

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

View file

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

View file

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