- 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:
thunder2 2014-07-24 20:01:12 +00:00
parent d355e8dd88
commit 6792348402
19 changed files with 79 additions and 387 deletions

View file

@ -20,7 +20,6 @@
****************************************************************/
#include "GxsChannelUserNotify.h"
#include "gui/settings/rsharesettings.h"
#include "gui/MainWindow.h"
GxsChannelUserNotify::GxsChannelUserNotify(RsGxsIfaceHelper *ifaceImpl, QObject *parent) :
@ -28,55 +27,14 @@ GxsChannelUserNotify::GxsChannelUserNotify(RsGxsIfaceHelper *ifaceImpl, QObject
{
}
bool GxsChannelUserNotify::hasSetting(QString &name)
bool GxsChannelUserNotify::hasSetting(QString *name, QString *group)
{
name = tr("Channel Post");
if (name) *name = tr("Channel Post");
if (group) *group = "Channel";
return true;
}
bool GxsChannelUserNotify::notifyEnabled()
{
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_CHANNELS);
}
bool GxsChannelUserNotify::notifyCombined()
{
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_CHANNELS_COMBINED);
}
bool GxsChannelUserNotify::notifyBlink()
{
return (Settings->getTrayNotifyBlinkFlags() & TRAYNOTIFY_BLINK_CHANNELS);
}
void GxsChannelUserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink)
{
uint notifyFlags = Settings->getTrayNotifyFlags();
uint blinkFlags = Settings->getTrayNotifyBlinkFlags();
if (enabled) {
notifyFlags |= TRAYNOTIFY_CHANNELS;
} else {
notifyFlags &= ~TRAYNOTIFY_CHANNELS;
}
if (combined) {
notifyFlags |= TRAYNOTIFY_CHANNELS_COMBINED;
} else {
notifyFlags &= ~TRAYNOTIFY_CHANNELS_COMBINED;
}
if (blink) {
blinkFlags |= TRAYNOTIFY_BLINK_CHANNELS;
} else {
blinkFlags &= ~TRAYNOTIFY_BLINK_CHANNELS;
}
Settings->setTrayNotifyFlags(notifyFlags);
Settings->setTrayNotifyBlinkFlags(blinkFlags);
}
QIcon GxsChannelUserNotify::getIcon()
{
return QIcon(":/images/channels16.png");

View file

@ -31,11 +31,7 @@ class GxsChannelUserNotify : public GxsUserNotify
public:
GxsChannelUserNotify(RsGxsIfaceHelper *ifaceImpl, QObject *parent = 0);
virtual bool hasSetting(QString &name);
virtual bool notifyEnabled();
virtual bool notifyCombined();
virtual bool notifyBlink();
virtual void setNotifyEnabled(bool enabled, bool combined, bool blink);
virtual bool hasSetting(QString *name, QString *group);
private:
virtual QIcon getIcon();