From 23b60d8d9a1db4f1e8ddc9b0c8984f1c4e429338 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 1 May 2014 13:08:22 +0000 Subject: [PATCH] Added possibility to use UserNotify in ApplicationWindow. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7317 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 1 + .../src/gui/unfinished/ApplicationWindow.cpp | 24 ++++++++++++------- .../src/gui/unfinished/ApplicationWindow.h | 5 ++++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 529af6795..e4b0a0438 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -343,6 +343,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) #ifdef UNFINISHED ui->toolBar->addSeparator(); addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), ui->toolBar), SLOT(showApplWindow())); + notify += applicationWindow->getNotify(); #endif addAction(new QAction(QIcon(IMAGE_PREFERENCES), tr("Options"), ui->toolBar), SLOT(showSettings())); diff --git a/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp b/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp index ef222fe62..9c5d28f73 100644 --- a/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp +++ b/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp @@ -83,6 +83,7 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WindowFlags flags) /* Create the config pages and actions */ QActionGroup *grp = new QActionGroup(this); + QAction *action; //StatisticDialog *statisticDialog = NULL; //ui.stackPages->add(statisticDialog = new StatisticDialog(ui.stackPages), @@ -98,37 +99,42 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WindowFlags flags) #if 0 IdDialog *idDialog = NULL; ui.stackPages->add(idDialog = new IdDialog(ui.stackPages), - createPageAction(QIcon(IMAGE_IDENTITY), tr("Identities"), grp)); + action = createPageAction(QIcon(IMAGE_IDENTITY), tr("Identities"), grp)); #ifdef RS_USE_CIRCLES CirclesDialog *circlesDialog = NULL; ui.stackPages->add(circlesDialog = new CirclesDialog(ui.stackPages), - createPageAction(QIcon(IMAGE_CIRCLES ), tr("Circles"), grp)); + action = createPageAction(QIcon(IMAGE_CIRCLES ), tr("Circles"), grp)); + mNotify.push_back(QPair(circlesDialog, action)); #endif #endif #ifdef RS_USE_PHOTOSHARE PhotoShare *photoShare = NULL; ui.stackPages->add(photoShare = new PhotoShare(ui.stackPages), - createPageAction(QIcon(IMAGE_PHOTO), tr("Photos"), grp)); + action = createPageAction(QIcon(IMAGE_PHOTO), tr("Photos"), grp)); + mNotify.push_back(QPair(photoShare, action)); #endif PostedDialog *postedDialog = NULL; ui.stackPages->add(postedDialog = new PostedDialog(ui.stackPages), - createPageAction(QIcon(IMAGE_POSTED), tr("Posted Links"), grp)); + action = createPageAction(QIcon(IMAGE_POSTED), tr("Posted Links"), grp)); postedDialog->setup(); + mNotify.push_back(QPair(postedDialog, action)); WikiDialog *wikiDialog = NULL; ui.stackPages->add(wikiDialog = new WikiDialog(ui.stackPages), - createPageAction(QIcon(IMAGE_WIKI), tr("Wiki Pages"), grp)); + action = createPageAction(QIcon(IMAGE_WIKI), tr("Wiki Pages"), grp)); + mNotify.push_back(QPair(wikiDialog, action)); #if 0 GxsForumsDialog *gxsforumsDialog = NULL; ui.stackPages->add(gxsforumsDialog = new GxsForumsDialog(ui.stackPages), - createPageAction(QIcon(IMAGE_GXSFORUMS), tr("GxsForums"), grp)); + action = createPageAction(QIcon(IMAGE_GXSFORUMS), tr("GxsForums"), grp)); + mNotify.push_back(QPair(gxsforumsDialog, action)); ChannelDialog *gxschannelDialog = NULL; ui.stackPages->add(gxschannelDialog = new ChannelDialog(ui.stackPages), - createPageAction(QIcon(IMAGE_GXSCHANNELS), tr("GxsChannels"), grp)); + action = createPageAction(QIcon(IMAGE_GXSCHANNELS), tr("GxsChannels"), grp)); gxschannelDialog->setup(); #endif @@ -136,8 +142,8 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WindowFlags flags) #if USE_VEG_SERVICE WireDialog *wireDialog = NULL; ui.stackPages->add(wireDialog = new WireDialog(ui.stackPages), - createPageAction(QIcon(IMAGE_BWGRAPH), tr("The Wire"), grp)); - + action = createPageAction(QIcon(IMAGE_BWGRAPH), tr("The Wire"), grp)); + mNotify.push_back(QPair(wireDialog, action)); #endif /* Create the toolbar */ diff --git a/retroshare-gui/src/gui/unfinished/ApplicationWindow.h b/retroshare-gui/src/gui/unfinished/ApplicationWindow.h index a45138eb9..1eefd9a5a 100644 --- a/retroshare-gui/src/gui/unfinished/ApplicationWindow.h +++ b/retroshare-gui/src/gui/unfinished/ApplicationWindow.h @@ -48,6 +48,8 @@ public: //GroupsDialog *groupsDialog; //StatisticDialog *statisticDialog; + QList > &getNotify() { return mNotify; } + protected: void closeEvent(QCloseEvent *); @@ -57,6 +59,9 @@ private: /** Adds a new action to the toolbar. */ void addAction(QAction *action, const char *slot = 0); +private: + QList > mNotify; + /** Qt Designer generated object */ Ui::ApplicationWindow ui; };