mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05:00
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
This commit is contained in:
parent
c633819aab
commit
211ec7ac01
@ -27,6 +27,11 @@
|
||||
#include <QIcon>
|
||||
#include <QPixmap>
|
||||
|
||||
#include "LinksDialog.h"
|
||||
#include "GamesDialog.h"
|
||||
#include "PhotoDialog.h"
|
||||
#include "channels/channelsDialog.h"
|
||||
|
||||
#include <rshare.h>
|
||||
#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);
|
||||
}
|
||||
|
||||
|
@ -502,14 +502,26 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle" >
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget" >
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<property name="leftMargin" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="topMargin" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
@ -522,8 +534,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet" >
|
||||
<string>
|
||||
</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="currentIndex" >
|
||||
<number>0</number>
|
||||
@ -533,10 +544,19 @@
|
||||
<string>Home</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -554,18 +574,28 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QToolBox" name="toolBox" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>4</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -583,10 +613,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="font" >
|
||||
<font>
|
||||
<weight>30</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
<font/>
|
||||
</property>
|
||||
<property name="styleSheet" >
|
||||
<string>QToolBox::tab {
|
||||
@ -612,17 +639,29 @@ color: black;
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>72</width>
|
||||
<height>265</height>
|
||||
<height>269</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label" >
|
||||
<string>General</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<property name="leftMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="topMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="0" >
|
||||
@ -631,9 +670,7 @@ color: black;
|
||||
<enum>Qt::NonModal</enum>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -679,18 +716,28 @@ color: black;
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>7</number>
|
||||
</property>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QPushButton" name="invitefriendButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -724,9 +771,7 @@ color: black;
|
||||
<item row="0" column="0" >
|
||||
<widget class="QPushButton" name="addfriendButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -760,9 +805,7 @@ color: black;
|
||||
<item row="3" column="0" >
|
||||
<widget class="QPushButton" name="optionsButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -796,9 +839,7 @@ color: black;
|
||||
<item row="2" column="0" >
|
||||
<widget class="QPushButton" name="addshareButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -851,8 +892,8 @@ color: black;
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>72</width>
|
||||
<height>30</height>
|
||||
<width>98</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label" >
|
||||
@ -922,10 +963,22 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
@ -1473,9 +1526,7 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
<widget class="QFrame" name="frmConsole" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -1502,10 +1553,19 @@ p, li { white-space: pre-wrap; }
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -1530,10 +1590,22 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="2" >
|
||||
@ -1641,7 +1713,7 @@ p, li { white-space: pre-wrap; }
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allowedAreas" >
|
||||
<enum>Qt::TopToolBarArea</enum>
|
||||
<set>Qt::TopToolBarArea</set>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -1656,14 +1728,37 @@ p, li { white-space: pre-wrap; }
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea" >
|
||||
<number>4</number>
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak" >
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBarservice" >
|
||||
<property name="windowTitle" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="allowedAreas" >
|
||||
<set>Qt::BottomToolBarArea|Qt::LeftToolBarArea|Qt::NoToolBarArea|Qt::RightToolBarArea</set>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<attribute name="toolBarArea" >
|
||||
<enum>RightToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak" >
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>MainPageStack</class>
|
||||
<extends>QStackedPageWidget</extends>
|
||||
<extends>QWidget</extends>
|
||||
<header>gui/mainpagestack.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
Loading…
Reference in New Issue
Block a user