From 1a0edc1cd065a63a45a531cdf66580f3b6030a5d Mon Sep 17 00:00:00 2001 From: Camila San Date: Fri, 23 Feb 2018 12:08:37 +0100 Subject: [PATCH] Sync activities notifications are never shown unless there is an error. Server activities and notifications are off by default. Signed-off-by: Camila San --- src/gui/folder.cpp | 5 +---- src/gui/generalsettings.cpp | 13 ------------- src/gui/generalsettings.h | 1 - src/gui/generalsettings.ui | 34 +++++++++------------------------- src/libsync/configfile.cpp | 16 +--------------- src/libsync/configfile.h | 3 --- 6 files changed, 11 insertions(+), 61 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index ee4f5fd64..6d3d35a81 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -408,12 +408,9 @@ void Folder::createGuiLog(const QString &filename, LogStatus status, int count, break; } - ConfigFile cfg; if (!text.isEmpty()) { // Ignores the settings in case of an error or conflict - if(cfg.optionalClientSyncActivities() || - status == LogStatusError || - status == LogStatusConflict) + if(status == LogStatusError || status == LogStatusConflict) logger->postOptionalGuiLog(tr("Sync Activity"), text); } } diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 705e6df8c..a91da46ed 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -50,10 +50,6 @@ GeneralSettings::GeneralSettings(QWidget *parent) this, &GeneralSettings::slotToggleOptionalServerActivities); _ui->serverActivitiesCheckBox->setToolTip(tr("Activity feed from the server.")); - connect(_ui->clientSyncActivitiesCheckBox, &QAbstractButton::toggled, - this, &GeneralSettings::slotToggleOptionalClientSyncActivities); - _ui->clientSyncActivitiesCheckBox->setToolTip(tr("Client sync activity.")); - connect(_ui->showInExplorerNavigationPaneCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotShowInExplorerNavigationPane); _ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName())); @@ -126,7 +122,6 @@ void GeneralSettings::loadMiscSettings() _ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons()); _ui->serverNotificationsCheckBox->setChecked(cfgFile.optionalServerNotifications()); _ui->serverActivitiesCheckBox->setChecked(cfgFile.optionalServerActivities()); - _ui->clientSyncActivitiesCheckBox->setChecked(cfgFile.optionalClientSyncActivities()); _ui->showInExplorerNavigationPaneCheckBox->setChecked(cfgFile.showInExplorerNavigationPane()); _ui->crashreporterCheckBox->setChecked(cfgFile.crashReporter()); auto newFolderLimit = cfgFile.newBigFolderSizeLimit(); @@ -189,14 +184,6 @@ void GeneralSettings::slotToggleOptionalServerActivities(bool enable) cfgFile.setOptionalServerActivities(enable); } - -void GeneralSettings::slotToggleOptionalClientSyncActivities(bool enable) -{ - ConfigFile cfgFile; - cfgFile.setOptionalClientSyncActivities(enable); -} - - void GeneralSettings::slotShowInExplorerNavigationPane(bool checked) { ConfigFile cfgFile; diff --git a/src/gui/generalsettings.h b/src/gui/generalsettings.h index 4620171d6..aa0e16dd9 100644 --- a/src/gui/generalsettings.h +++ b/src/gui/generalsettings.h @@ -44,7 +44,6 @@ private slots: void slotToggleLaunchOnStartup(bool); void slotToggleOptionalServerNotifications(bool); void slotToggleOptionalServerActivities(bool); - void slotToggleOptionalClientSyncActivities(bool); void slotShowInExplorerNavigationPane(bool); void slotUpdateInfo(); void slotIgnoreFilesEditor(); diff --git a/src/gui/generalsettings.ui b/src/gui/generalsettings.ui index 9ef59ef4f..fefbf102d 100644 --- a/src/gui/generalsettings.ui +++ b/src/gui/generalsettings.ui @@ -20,10 +20,13 @@ General Settings - - + + + + For System Tray + - Show Server &Activities + Use &Monochrome Icons @@ -41,29 +44,10 @@ - - - - For System Tray - + + - Use &Monochrome Icons - - - - - - - - - - -1 - - - - - - Show &Client Sync Activities + Show Server &Activities diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index 9abc602b9..886ebc639 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -55,7 +55,6 @@ static const char promptDeleteC[] = "promptDeleteAllFiles"; static const char crashReporterC[] = "crashReporter"; static const char optionalServerNotificationsC[] = "optionalServerNotifications"; static const char optionalServerActivitiesC[] = "optionalServerActivities"; -static const char optionalClientSyncActivitiesC[] = "optionalClientSyncActivities"; static const char showInExplorerNavigationPaneC[] = "showInExplorerNavigationPane"; static const char skipUpdateCheckC[] = "skipUpdateCheck"; static const char updateCheckIntervalC[] = "updateCheckInterval"; @@ -126,7 +125,7 @@ bool ConfigFile::setConfDir(const QString &value) bool ConfigFile::optionalServerNotifications() const { QSettings settings(configFile(), QSettings::IniFormat); - return settings.value(QLatin1String(optionalServerNotificationsC), true).toBool(); + return settings.value(QLatin1String(optionalServerNotificationsC), false).toBool(); } bool ConfigFile::optionalServerActivities() const @@ -135,12 +134,6 @@ bool ConfigFile::optionalServerActivities() const return settings.value(QLatin1String(optionalServerActivitiesC), false).toBool(); } -bool ConfigFile::optionalClientSyncActivities() const -{ - QSettings settings(configFile(), QSettings::IniFormat); - return settings.value(QLatin1String(optionalClientSyncActivitiesC), false).toBool(); -} - bool ConfigFile::showInExplorerNavigationPane() const { const bool defaultValue = @@ -205,13 +198,6 @@ void ConfigFile::setOptionalServerActivities(bool show) settings.sync(); } -void ConfigFile::setOptionalClientSyncActivities(bool show) -{ - QSettings settings(configFile(), QSettings::IniFormat); - settings.setValue(QLatin1String(optionalClientSyncActivitiesC), show); - settings.sync(); -} - void ConfigFile::saveGeometry(QWidget *w) { #ifndef TOKEN_AUTH_ONLY diff --git a/src/libsync/configfile.h b/src/libsync/configfile.h index 60034b8ee..f1d87c002 100644 --- a/src/libsync/configfile.h +++ b/src/libsync/configfile.h @@ -126,9 +126,6 @@ public: bool optionalServerActivities() const; void setOptionalServerActivities(bool show); - bool optionalClientSyncActivities() const; - void setOptionalClientSyncActivities(bool show); - bool showInExplorerNavigationPane() const; void setShowInExplorerNavigationPane(bool show);