Reworked notification code in system tray.

Added a base class and a possibility for the main dialogs and the plugins (derived from MainPage) to provide a notifier.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5381 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-08-05 20:12:55 +00:00
parent 049b4bd577
commit b21e66241b
30 changed files with 1040 additions and 539 deletions

View file

@ -103,6 +103,8 @@ public:
/** get page */
static MainPage *getPage (Page page);
const QList<UserNotify*> &getUserNotifyList();
/* A Bit of a Hack... but public variables for
* the dialogs, so we can add them to the
* Notify Class...
@ -145,11 +147,6 @@ public slots:
void postModDirectories(bool update_local);
void displayDiskSpaceWarning(int loc,int size_limit_mb) ;
void checkAndSetIdle(int idleTime);
void updateMessages();
void updateForums();
void updateChannels(int type);
void updateTransfers(int count);
void privateChatChanged(int list, int type);
void linkActivated(const QUrl &url);
@ -171,13 +168,6 @@ private slots:
void toggleVisibility(QSystemTrayIcon::ActivationReason e);
void toggleVisibilitycontextmenu();
/* default parameter for connect with the actions of the combined systray icon */
void trayIconMessagesClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void trayIconForumsClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void trayIconChannelsClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void trayIconChatClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void trayIconTransfersClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
/** Toolbar fns. */
void addFriend();
void showMessengerWindow();
@ -207,12 +197,11 @@ private slots:
void doQuit();
void on_actionQuick_Start_Wizard_activated();
void updateTrayCombine();
private:
void createTrayIcon();
void createNotifyIcons();
void updateTrayCombine();
static MainWindow *_instance;
/** A BandwidthGraph object which handles monitoring RetroShare bandwidth usage */
@ -226,19 +215,10 @@ private:
QString nameAndLocation;
QSystemTrayIcon *trayIcon;
QSystemTrayIcon *trayIconMessages;
QSystemTrayIcon *trayIconForums;
QSystemTrayIcon *trayIconChannels;
QSystemTrayIcon *trayIconChat;
QSystemTrayIcon *trayIconTransfers;
QMenu *notifyMenu;
QString notifyToolTip;
QAction *trayActionMessages;
QAction *trayActionForums;
QAction *trayActionChannels;
QAction *trayActionChat;
QAction *trayActionTransfers;
QAction *toggleVisibilityAction, *toolAct;
QList<UserNotify*> userNotifyList;
PeerStatus *peerstatus;
NATStatus *natstatus;
@ -248,11 +228,6 @@ private:
HashingStatus *hashingstatus;
QComboBox *statusComboBox;
QAction *messageAction;
QAction *forumAction;
QAction *channelAction;
QAction *transferAction;
/* Status */
std::set <QObject*> m_apStatusObjects; // added objects for status
bool m_bStatusLoadDone;