From 211ec7ac014c313dacd950cd6892204fe8e359fb Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 30 Mar 2008 21:05:14 +0000 Subject: [PATCH] added a feature to can use other Service Dialogs in MainWindow added a scond toolbar for these actions git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@439 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 51 +++++-- retroshare-gui/src/gui/MainWindow.ui | 195 +++++++++++++++++++------- 2 files changed, 182 insertions(+), 64 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index fe58c23f3..c0f558b59 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -27,6 +27,11 @@ #include #include +#include "LinksDialog.h" +#include "GamesDialog.h" +#include "PhotoDialog.h" +#include "channels/channelsDialog.h" + #include #include "MainWindow.h" #include "MessengerWindow.h" @@ -68,6 +73,9 @@ #define IMAGE_SMPLAYER ":/images/smplayer_icon32.png" #define IMAGE_BLOCK ":/images/blockdevice.png" #define IMAGE_COLOR ":/images/highlight.png" +#define IMAGE_GAMES ":/images/kgames.png" +#define IMAGE_PHOTO ":/images/lphoto.png" +#define IMAGE_SMPLAYER ":/images/smplayer_icon32.png" /* Keys for UI Preferences */ @@ -133,8 +141,10 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) - /* Create the config pages and actions */ + /* Create the Main pages and actions */ QActionGroup *grp = new QActionGroup(this); + /* Create the Service pages and actions */ + QActionGroup *servicegrp = new QActionGroup(this); ui.stackPages->add(networkDialog = new NetworkDialog(ui.stackPages), createPageAction(QIcon(IMAGE_NETWORK), tr("Network"), grp)); @@ -156,6 +166,22 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) ui.stackPages->add(messagesDialog = new MessagesDialog(ui.stackPages), createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp)); + + LinksDialog *linksDialog = NULL; + ui.stackPages->add(linksDialog = new LinksDialog(ui.stackPages), + createPageAction(QIcon(IMAGE_TRANSFERS), tr("Links Cloud"), servicegrp)); + + ChannelsDialog *channelsDialog = NULL; + ui.stackPages->add(channelsDialog = new ChannelsDialog(ui.stackPages), + createPageAction(QIcon(IMAGE_CHANNELS), tr("Channels"), servicegrp)); + + GamesDialog *gamesDialog = NULL; + ui.stackPages->add(gamesDialog = new GamesDialog(ui.stackPages), + createPageAction(QIcon(IMAGE_GAMES), tr("Games"), servicegrp)); + + PhotoDialog *photoDialog = NULL; + ui.stackPages->add(photoDialog = new PhotoDialog(ui.stackPages), + createPageAction(QIcon(IMAGE_PHOTO), tr("Photo View"), servicegrp)); #ifdef RS_RELEASE_VERSION channelsDialog = NULL; @@ -182,6 +208,10 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) ui.toolBar->addActions(grp->actions()); ui.toolBar->addSeparator(); connect(grp, SIGNAL(triggered(QAction *)), ui.stackPages, SLOT(showPage(QAction *))); + /* Create the toolbarservice */ + ui.toolBarservice->addActions(servicegrp->actions()); + ui.toolBarservice->addSeparator(); + connect(servicegrp, SIGNAL(triggered(QAction *)), ui.stackPages, SLOT(showPage(QAction *))); /* Create and bind the messenger button */ addAction(new QAction(QIcon(IMAGE_RSM32), tr("Messenger"), ui.toolBar), SLOT(showMessengerWindow())); @@ -198,27 +228,19 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) addAction(new QAction(QIcon(IMAGE_BLOCK), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow())); #endif - addAction(new QAction(QIcon(IMAGE_COLOR), tr("Color"), ui.toolBar), SLOT(setStyle())); - - -#ifdef NO_MORE_OPTIONS_OR_SS - - /* Create and bind the Preferences button */ - addAction(new QAction(QIcon(IMAGE_PREFERENCES), tr("Options"), ui.toolBar), - SLOT(showSettings())); - - - - -#endif + //addAction(new QAction(QIcon(IMAGE_COLOR), tr("Color"), ui.toolBar), SLOT(setStyle())); /* Select the first action */ grp->actions()[0]->setChecked(true); + /* Select the first action */ + servicegrp->actions()[0]->setChecked(true); /* Create the actions that will go in the tray menu */ createActions(); + + statusBar()->addWidget(new QLabel(tr("Users: 0 Files: 0 "))); statusBar()->addPermanentWidget(new QLabel(tr("Down: 0.0 Up: 0.0 "))); @@ -284,6 +306,7 @@ void MainWindow::addAction(QAction *action, const char *slot) { action->setFont(FONT); ui.toolBar->addAction(action); + ui.toolBarservice->addAction(action); connect(action, SIGNAL(triggered()), this, slot); } diff --git a/retroshare-gui/src/gui/MainWindow.ui b/retroshare-gui/src/gui/MainWindow.ui index 487c8b37f..c96e13d79 100644 --- a/retroshare-gui/src/gui/MainWindow.ui +++ b/retroshare-gui/src/gui/MainWindow.ui @@ -502,14 +502,26 @@ - Qt::ToolButtonTextUnderIcon + Qt::ToolButtonIconOnly - + 1 - + + 1 + + + 1 + + + 1 + + + 1 + + 1 @@ -522,8 +534,7 @@ true - - + 0 @@ -533,10 +544,19 @@ Home - + 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -554,18 +574,28 @@ QFrame::Raised - + 0 - + + 0 + + + 0 + + + 0 + + + 0 + + 0 - - 4 - 5 + 0 0 @@ -583,10 +613,7 @@ - - 30 - true - + QToolBox::tab { @@ -612,17 +639,29 @@ color: black; 0 0 72 - 265 + 269 General - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 @@ -631,9 +670,7 @@ color: black; Qt::NonModal - - 0 - 0 + 0 0 @@ -679,18 +716,28 @@ color: black; - + 0 - + + 0 + + + 0 + + + 0 + + + 7 + + 7 - - 0 - 0 + 0 0 @@ -724,9 +771,7 @@ color: black; - - 0 - 0 + 0 0 @@ -760,9 +805,7 @@ color: black; - - 0 - 0 + 0 0 @@ -796,9 +839,7 @@ color: black; - - 0 - 0 + 0 0 @@ -851,8 +892,8 @@ color: black; 0 0 - 72 - 30 + 98 + 28 @@ -922,10 +963,22 @@ p, li { white-space: pre-wrap; } - + 0 - + + 0 + + + 0 + + + 0 + + + 0 + + 0 @@ -1473,9 +1526,7 @@ p, li { white-space: pre-wrap; } - - 7 - 7 + 0 0 @@ -1502,10 +1553,19 @@ p, li { white-space: pre-wrap; } QFrame::Raised - + 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -1530,10 +1590,22 @@ p, li { white-space: pre-wrap; } - + 0 - + + 0 + + + 0 + + + 0 + + + 6 + + 6 @@ -1641,7 +1713,7 @@ p, li { white-space: pre-wrap; } true - Qt::TopToolBarArea + Qt::TopToolBarArea Qt::Horizontal @@ -1656,14 +1728,37 @@ p, li { white-space: pre-wrap; } Qt::ToolButtonTextUnderIcon - 4 + TopToolBarArea + + + false + + + + + + + + Qt::BottomToolBarArea|Qt::LeftToolBarArea|Qt::NoToolBarArea|Qt::RightToolBarArea + + + + 32 + 32 + + + + RightToolBarArea + + + false MainPageStack - QStackedPageWidget + QWidget
gui/mainpagestack.h