mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-01 12:24:36 -04:00
- Moved settings for user notify into the base class
- Removed defines TRAYNOTIFY_... git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7470 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d355e8dd88
commit
6792348402
19 changed files with 79 additions and 387 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "UserNotify.h"
|
||||
#include "rshare.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
|
||||
UserNotify::UserNotify(QObject *parent) :
|
||||
QObject(parent)
|
||||
|
@ -44,6 +45,50 @@ UserNotify::~UserNotify()
|
|||
{
|
||||
}
|
||||
|
||||
bool UserNotify::notifyEnabled()
|
||||
{
|
||||
QString group;
|
||||
if (!hasSetting(NULL, &group) || group.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Settings->valueFromGroup(group, "TrayNotifyEnable", true).toBool();
|
||||
}
|
||||
|
||||
bool UserNotify::notifyCombined()
|
||||
{
|
||||
QString group;
|
||||
if (!hasSetting(NULL, &group) || group.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Settings->valueFromGroup(group, "TrayNotifyCombined", false).toBool();
|
||||
}
|
||||
|
||||
bool UserNotify::notifyBlink()
|
||||
{
|
||||
QString group;
|
||||
if (!hasSetting(NULL, &group) || group.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Settings->valueFromGroup(group, "TrayNotifyBlink", false).toBool();
|
||||
}
|
||||
|
||||
void UserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink)
|
||||
{
|
||||
QString group;
|
||||
if (!hasSetting(NULL, &group) || group.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Settings->beginGroup(group);
|
||||
Settings->setValue("TrayNotifyEnable", enabled);
|
||||
Settings->setValue("TrayNotifyCombined", combined);
|
||||
Settings->setValue("TrayNotifyBlink", blink);
|
||||
Settings->endGroup();
|
||||
}
|
||||
|
||||
void UserNotify::initialize(QToolBar *mainToolBar, QAction *mainAction, QListWidgetItem *listItem)
|
||||
{
|
||||
mMainAction = mainAction;
|
||||
|
|
|
@ -41,11 +41,11 @@ public:
|
|||
void initialize(QToolBar *mainToolBar, QAction *mainAction, QListWidgetItem *listItem);
|
||||
void createIcons(QMenu *notifyMenu);
|
||||
|
||||
virtual bool hasSetting(QString &/*name*/) { return false; }
|
||||
virtual bool notifyEnabled() { return false; }
|
||||
virtual bool notifyCombined() { return false; }
|
||||
virtual bool notifyBlink() { return false; }
|
||||
virtual void setNotifyEnabled(bool /*enabled*/, bool /*combined*/, bool /*blink*/) {}
|
||||
virtual bool hasSetting(QString */*name*/, QString */*group*/) { return false; }
|
||||
bool notifyEnabled();
|
||||
bool notifyCombined();
|
||||
bool notifyBlink();
|
||||
void setNotifyEnabled(bool enabled, bool combined, bool blink);
|
||||
|
||||
signals:
|
||||
void countChanged();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue