mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 01:25:17 -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
|
@ -20,7 +20,6 @@
|
|||
****************************************************************/
|
||||
|
||||
#include "TransferUserNotify.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/notifyqt.h"
|
||||
#include "gui/MainWindow.h"
|
||||
|
||||
|
@ -32,55 +31,14 @@ TransferUserNotify::TransferUserNotify(QObject *parent) :
|
|||
connect(NotifyQt::getInstance(), SIGNAL(downloadCompleteCountChanged(int)), this, SLOT(downloadCountChanged(int)));
|
||||
}
|
||||
|
||||
bool TransferUserNotify::hasSetting(QString &name)
|
||||
bool TransferUserNotify::hasSetting(QString *name, QString *group)
|
||||
{
|
||||
name = tr("Download completed");
|
||||
if (name) *name = tr("Download completed");
|
||||
if (group) *group = "Transfer";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TransferUserNotify::notifyEnabled()
|
||||
{
|
||||
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_TRANSFERS);
|
||||
}
|
||||
|
||||
bool TransferUserNotify::notifyCombined()
|
||||
{
|
||||
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_TRANSFERS_COMBINED);
|
||||
}
|
||||
|
||||
bool TransferUserNotify::notifyBlink()
|
||||
{
|
||||
return (Settings->getTrayNotifyBlinkFlags() & TRAYNOTIFY_BLINK_TRANSFERS);
|
||||
}
|
||||
|
||||
void TransferUserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink)
|
||||
{
|
||||
uint notifyFlags = Settings->getTrayNotifyFlags();
|
||||
uint blinkFlags = Settings->getTrayNotifyBlinkFlags();
|
||||
|
||||
if (enabled) {
|
||||
notifyFlags |= TRAYNOTIFY_TRANSFERS;
|
||||
} else {
|
||||
notifyFlags &= ~TRAYNOTIFY_TRANSFERS;
|
||||
}
|
||||
|
||||
if (combined) {
|
||||
notifyFlags |= TRAYNOTIFY_TRANSFERS_COMBINED;
|
||||
} else {
|
||||
notifyFlags &= ~TRAYNOTIFY_TRANSFERS_COMBINED;
|
||||
}
|
||||
|
||||
if (blink) {
|
||||
blinkFlags |= TRAYNOTIFY_BLINK_TRANSFERS;
|
||||
} else {
|
||||
blinkFlags &= ~TRAYNOTIFY_BLINK_TRANSFERS;
|
||||
}
|
||||
|
||||
Settings->setTrayNotifyFlags(notifyFlags);
|
||||
Settings->setTrayNotifyBlinkFlags(blinkFlags);
|
||||
}
|
||||
|
||||
QIcon TransferUserNotify::getIcon()
|
||||
{
|
||||
return QIcon(":/images/ktorrent32.png");
|
||||
|
|
|
@ -31,11 +31,7 @@ class TransferUserNotify : public UserNotify
|
|||
public:
|
||||
TransferUserNotify(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 slots:
|
||||
void downloadCountChanged(int count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue