mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-20 20:08:30 -04:00
Added UserNotify to gxs channels and forums.
Count new messages by retrieving all messages of all subscribed groups until getServiceStatistic is available. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7435 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c32ac6821a
commit
bd58cca832
13 changed files with 571 additions and 78 deletions
|
@ -21,27 +21,27 @@
|
|||
|
||||
#ifndef USERNOTIFY_H
|
||||
#define USERNOTIFY_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QListWidgetItem>
|
||||
|
||||
class QToolBar;
|
||||
class QToolButton;
|
||||
class QAction;
|
||||
//class QListWidgetItem;
|
||||
|
||||
class UserNotify : public QObject
|
||||
{
|
||||
|
||||
#include <QObject>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QListWidgetItem>
|
||||
|
||||
class QToolBar;
|
||||
class QToolButton;
|
||||
class QAction;
|
||||
|
||||
class UserNotify : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UserNotify(QObject *parent = 0);
|
||||
|
||||
void initialize(QToolBar *mainToolBar, QAction *mainAction, QListWidgetItem *listItem);
|
||||
void createIcons(QMenu *notifyMenu);
|
||||
|
||||
virtual bool hasSetting(QString &/*name*/) { return false; }
|
||||
public:
|
||||
UserNotify(QObject *parent = 0);
|
||||
virtual ~UserNotify();
|
||||
|
||||
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; }
|
||||
|
@ -57,6 +57,10 @@ private slots:
|
|||
void trayIconClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
|
||||
void blink(bool on);
|
||||
|
||||
protected:
|
||||
virtual void startUpdate();
|
||||
void update();
|
||||
|
||||
private:
|
||||
virtual QIcon getIcon() { return QIcon(); }
|
||||
virtual QIcon getMainIcon(bool /*hasNew*/) { return QIcon(); }
|
||||
|
@ -66,13 +70,14 @@ private:
|
|||
virtual QString getNotifyMessage(bool plural);
|
||||
|
||||
virtual void iconClicked() {}
|
||||
|
||||
QToolButton *mMainToolButton;
|
||||
QAction *mMainAction;
|
||||
QListWidgetItem *mListItem;
|
||||
QSystemTrayIcon *mTrayIcon;
|
||||
QAction *mNotifyIcon;
|
||||
unsigned int mNewCount;
|
||||
|
||||
private:
|
||||
QToolButton *mMainToolButton;
|
||||
QAction *mMainAction;
|
||||
QListWidgetItem *mListItem;
|
||||
QSystemTrayIcon *mTrayIcon;
|
||||
QAction *mNotifyIcon;
|
||||
unsigned int mNewCount;
|
||||
QString mButtonText;
|
||||
bool mLastBlinking;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue