Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a7dd3a7
Displays the actual notification subject in the system tray messages.
Feb 12, 2018
b24751b
Adds button to open notification in the browser - to update something…
Feb 14, 2018
bfc7aa1
Adds option to toggle display of Sync and Activity notifications.
Feb 14, 2018
ab7185a
Changes notification text in the checkboxes and adds tooltips with ex…
Feb 15, 2018
20cf4ed
Improves Notification Widget UI.
Feb 16, 2018
32e29fb
Doesn't open the file manager when there isn't a file associated with…
Feb 16, 2018
1a0edc1
Sync activities notifications are never shown unless there is an erro…
Feb 23, 2018
4c79059
Changes notification icon bell size.
Feb 25, 2018
e33d2bf
Removes (s) from time strings.
Feb 25, 2018
4a6a8ca
Removes _appName from Activity data.
Feb 25, 2018
71f4760
Do not display user account when there is only one user in popup mess…
Feb 25, 2018
d71438f
Adds host and scheme to activity link so it can be opened in the
Feb 25, 2018
44f299e
Removes debug messages.
Feb 25, 2018
0f9d8e1
Only uses 'More information' text in button for notification link.
Feb 25, 2018
09a92a5
Align text and changes spacing in notification widget.
Feb 25, 2018
112c5e1
Removes Server Activities option from General settings.
Feb 26, 2018
56709f3
Removes string 'Created' from notifications time.
Feb 26, 2018
6bf9f65
Only notify users of new notifications and only shows them all on sta…
Feb 27, 2018
d42401e
Changes notifications api endpoint to v2.
Mar 1, 2018
621596f
Saves notifications ETag response header to use to request only new n…
Mar 1, 2018
3c77898
Makes sure JsonApiJob::finished won't throw a JSON error when status …
Mar 3, 2018
2e4472a
Enables server notifications by default.
Mar 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adds option to toggle display of Sync and Activity notifications.
Signed-off-by: Camila San <hello@camila.codes>
  • Loading branch information
Camila San committed Feb 14, 2018
commit bfc7aa16c63c6c5fadc12e937a4a656a92fc21bb
13 changes: 10 additions & 3 deletions src/gui/activitywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "servernotificationhandler.h"
#include "theme.h"
#include "ocsjob.h"
#include "configfile.h"

#include "ui_activitywidget.h"

Expand Down Expand Up @@ -308,8 +309,11 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list)
}

// Assemble a tray notification
QString log = tr("Notification for %1.").arg(activity._accName);
emit guiLog(log, activity._subject);
ConfigFile cfg;
if(cfg.optionalDesktopNotifications()){
QString log = tr("Notification for %1.").arg(activity._accName);
emit guiLog(log, activity._subject);
}
}

// check if there are widgets that have no corresponding activity from
Expand Down Expand Up @@ -599,7 +603,10 @@ void ActivitySettings::slotCopyToClipboard()
}

QApplication::clipboard()->setText(text);
emit guiLog(tr("Copied to clipboard"), message);

ConfigFile cfg;
if(cfg.optionalActivityNotifications())
emit guiLog(tr("Copied to clipboard"), message);
}

void ActivitySettings::slotRemoveAccount(AccountState *ptr)
Expand Down
20 changes: 20 additions & 0 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ GeneralSettings::GeneralSettings(QWidget *parent)

connect(_ui->desktopNotificationsCheckBox, &QAbstractButton::toggled,
this, &GeneralSettings::slotToggleOptionalDesktopNotifications);
connect(_ui->syncNotificationsCheckBox, &QAbstractButton::toggled,
this, &GeneralSettings::slotToggleOptionalSyncNotifications);
connect(_ui->activityNotificationsCheckBox, &QAbstractButton::toggled,
this, &GeneralSettings::slotToggleOptionalActivityNotifications);
connect(_ui->showInExplorerNavigationPaneCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotShowInExplorerNavigationPane);

_ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName()));
Expand Down Expand Up @@ -115,6 +119,8 @@ void GeneralSettings::loadMiscSettings()
ConfigFile cfgFile;
_ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons());
_ui->desktopNotificationsCheckBox->setChecked(cfgFile.optionalDesktopNotifications());
_ui->syncNotificationsCheckBox->setChecked(cfgFile.optionalSyncNotifications());
_ui->activityNotificationsCheckBox->setChecked(cfgFile.optionalActivityNotifications());
_ui->showInExplorerNavigationPaneCheckBox->setChecked(cfgFile.showInExplorerNavigationPane());
_ui->crashreporterCheckBox->setChecked(cfgFile.crashReporter());
auto newFolderLimit = cfgFile.newBigFolderSizeLimit();
Expand Down Expand Up @@ -171,6 +177,20 @@ void GeneralSettings::slotToggleOptionalDesktopNotifications(bool enable)
cfgFile.setOptionalDesktopNotifications(enable);
}

void GeneralSettings::slotToggleOptionalSyncNotifications(bool enable)
{
ConfigFile cfgFile;
cfgFile.setOptionalSyncNotifications(enable);
}


void GeneralSettings::slotToggleOptionalActivityNotifications(bool enable)
{
ConfigFile cfgFile;
cfgFile.setOptionalActivityNotifications(enable);
}


void GeneralSettings::slotShowInExplorerNavigationPane(bool checked)
{
ConfigFile cfgFile;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/generalsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ private slots:
void saveMiscSettings();
void slotToggleLaunchOnStartup(bool);
void slotToggleOptionalDesktopNotifications(bool);
void slotToggleOptionalSyncNotifications(bool);
void slotToggleOptionalActivityNotifications(bool);
void slotShowInExplorerNavigationPane(bool);
void slotUpdateInfo();
void slotIgnoreFilesEditor();
Expand Down
14 changes: 14 additions & 0 deletions src/gui/generalsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
<string>General Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="1">
<widget class="QCheckBox" name="syncNotificationsCheckBox">
<property name="text">
<string>Show Sync Notifications</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="autostartCheckBox">
<property name="text">
Expand All @@ -44,6 +51,13 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="activityNotificationsCheckBox">
<property name="text">
<string>Show Activity Notifications</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
34 changes: 31 additions & 3 deletions src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ static const char notificationRefreshIntervalC[] = "notificationRefreshInterval"
static const char monoIconsC[] = "monoIcons";
static const char promptDeleteC[] = "promptDeleteAllFiles";
static const char crashReporterC[] = "crashReporter";
static const char optionalDesktopNoficationsC[] = "optionalDesktopNotifications";
static const char optionalDesktopNotificationsC[] = "optionalDesktopNotifications";
static const char optionalSyncNotificationsC[] = "optionalSyncNotifications";
static const char optionalActivityNotificationsC[] = "optionalActivityNotifications";
static const char showInExplorerNavigationPaneC[] = "showInExplorerNavigationPane";
static const char skipUpdateCheckC[] = "skipUpdateCheck";
static const char updateCheckIntervalC[] = "updateCheckInterval";
Expand Down Expand Up @@ -124,7 +126,19 @@ bool ConfigFile::setConfDir(const QString &value)
bool ConfigFile::optionalDesktopNotifications() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(optionalDesktopNoficationsC), true).toBool();
return settings.value(QLatin1String(optionalDesktopNotificationsC), true).toBool();
}

bool ConfigFile::optionalSyncNotifications() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(optionalSyncNotificationsC), false).toBool();
}

bool ConfigFile::optionalActivityNotifications() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(optionalActivityNotificationsC), false).toBool();
}

bool ConfigFile::showInExplorerNavigationPane() const
Expand Down Expand Up @@ -180,7 +194,21 @@ quint64 ConfigFile::targetChunkUploadDuration() const
void ConfigFile::setOptionalDesktopNotifications(bool show)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(optionalDesktopNoficationsC), show);
settings.setValue(QLatin1String(optionalDesktopNotificationsC), show);
settings.sync();
}

void ConfigFile::setOptionalSyncNotifications(bool show)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(optionalSyncNotificationsC), show);
settings.sync();
}

void ConfigFile::setOptionalActivityNotifications(bool show)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(optionalActivityNotificationsC), show);
settings.sync();
}

Expand Down
6 changes: 6 additions & 0 deletions src/libsync/configfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ class OWNCLOUDSYNC_EXPORT ConfigFile
bool optionalDesktopNotifications() const;
void setOptionalDesktopNotifications(bool show);

bool optionalSyncNotifications() const;
void setOptionalSyncNotifications(bool show);

bool optionalActivityNotifications() const;
void setOptionalActivityNotifications(bool show);

bool showInExplorerNavigationPane() const;
void setShowInExplorerNavigationPane(bool show);

Expand Down