mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-18 19:31:37 -05:00
cleaned up MainWindow
Added to pro file DEFINES += RS_RELEASE_VERSION enable it for release versions. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1151 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
255b5dca39
commit
3e2993536e
@ -62,6 +62,10 @@ win32 {
|
||||
LIBS += -lole32 -lwinmm
|
||||
|
||||
RC_FILE = gui/images/retroshare_win.rc
|
||||
|
||||
## ENABLE THIS OPTION for release Version.
|
||||
#DEFINES += RS_RELEASE_VERSION
|
||||
|
||||
}
|
||||
|
||||
##################################### MacOS ######################################
|
||||
|
@ -64,8 +64,6 @@
|
||||
#include "rsiface/rspeers.h"
|
||||
#include "rsiface/rsfiles.h"
|
||||
|
||||
//#include "gui/connect/InviteDialog.h"
|
||||
//#include "gui/connect/AddFriendDialog.h"
|
||||
#include "gui/connect/ConnectFriendWizard.h"
|
||||
|
||||
#include <sstream>
|
||||
@ -116,13 +114,6 @@
|
||||
|
||||
/* Keys for UI Preferences */
|
||||
#define UI_PREF_PROMPT_ON_QUIT "UIOptions/ConfirmOnQuit"
|
||||
/* uncomment this for release version */
|
||||
|
||||
/*****
|
||||
* #define RS_RELEASE_VERSION 1
|
||||
****/
|
||||
|
||||
//#define RS_RELEASE_VERSION 1
|
||||
|
||||
/** Constructor */
|
||||
MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
@ -134,12 +125,10 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
/* Create RshareSettings object */
|
||||
_settings = new RshareSettings();
|
||||
|
||||
setWindowTitle(tr("RetroShare %1 RetroShare a private and secure decentralised commmunication platform").arg(retroshareVersion()));
|
||||
setWindowTitle(tr("RetroShare %1 a secure decentralised commmunication platform").arg(retroshareVersion()));
|
||||
|
||||
mSMPlayer = NULL;
|
||||
|
||||
ui.toolBarservice->hide();
|
||||
|
||||
// Setting icons
|
||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
|
||||
@ -147,14 +136,11 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
_bandwidthGraph = new BandwidthGraph();
|
||||
messengerWindow = new MessengerWindow();
|
||||
_preferencesWindow = new PreferencesWindow();
|
||||
messengerWindow->hide();
|
||||
//messengerWindow->show();
|
||||
applicationWindow = new ApplicationWindow();
|
||||
applicationWindow->hide();
|
||||
|
||||
/** Left Side ToolBar**/
|
||||
connect(ui.actionAdd_Friend, SIGNAL(triggered() ), this , SLOT( addFriend() ) );
|
||||
// connect(ui.actionInvite_Friend, SIGNAL(triggered() ), this , SLOT( inviteFriend() ) );
|
||||
connect(ui.actionAdd_Share, SIGNAL(triggered() ), this , SLOT( openShareManager() ) );
|
||||
connect(ui.actionOptions, SIGNAL(triggered()), this, SLOT( showPreferencesWindow()) );
|
||||
connect(ui.actionMessenger, SIGNAL(triggered()), this, SLOT( showMessengerWindow()) );
|
||||
@ -164,7 +150,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
//connect(ui.actionSettings, SIGNAL(triggered()), this, SLOT( showSettings()) );
|
||||
|
||||
|
||||
|
||||
/** adjusted quit behaviour: trigger a warning that can be switched off in the saved
|
||||
config file RetroShare.conf */
|
||||
connect(ui.actionQuit, SIGNAL(triggered()), this, SLOT(doQuit()));
|
||||
@ -173,7 +158,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
loadStyleSheet(Rshare::stylesheet());
|
||||
|
||||
|
||||
|
||||
/* Create the Main pages and actions */
|
||||
QActionGroup *grp = new QActionGroup(this);
|
||||
|
||||
@ -239,6 +223,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
ui.stackPages->add(forumsDialog = new ForumsDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
|
||||
|
||||
addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow()));
|
||||
|
||||
#endif
|
||||
NewsFeed *newsFeed = NULL;
|
||||
ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
|
||||
@ -248,12 +234,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
|
||||
|
||||
|
||||
//ui.stackPages->add(groupsDialog = new GroupsDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(), tr("Groups"), grp));
|
||||
|
||||
//ui.stackPages->add(new StatisticDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp));
|
||||
|
||||
/* also an empty list of chat windows */
|
||||
messengerWindow->setChatDialog(peersDialog);
|
||||
|
||||
@ -269,51 +249,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
connect(sharedfilesDialog, SIGNAL(playFiles( QStringList )), this, SLOT(playFiles( QStringList )));
|
||||
connect(transfersDialog, SIGNAL(playFiles( QStringList )), this, SLOT(playFiles( QStringList )));
|
||||
|
||||
#ifdef RS_RELEASE_VERSION
|
||||
//addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow()));
|
||||
|
||||
|
||||
#else
|
||||
addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow()));
|
||||
|
||||
toolAct = ui.toolBarservice->toggleViewAction();
|
||||
toolAct->setText("Service");
|
||||
toolAct->setShortcut(tr("Ctrl+T"));
|
||||
toolAct->setIcon(QIcon(":/images/blockdevice2.png"));
|
||||
//ui.toolBar->addAction(toolAct);
|
||||
|
||||
/* Create the Service pages and actions */
|
||||
QActionGroup *servicegrp = new QActionGroup(this);
|
||||
|
||||
|
||||
#if 0
|
||||
LinksDialog *linksDialog = NULL;
|
||||
ui.stackPages->add(linksDialog = new LinksDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_LINKS), 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));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Create the toolbarservice */
|
||||
ui.toolBarservice->addActions(servicegrp->actions());
|
||||
ui.toolBarservice->addSeparator();
|
||||
connect(servicegrp, SIGNAL(triggered(QAction *)), ui.stackPages, SLOT(showPage(QAction *)));
|
||||
|
||||
ui.toolBarservice->addSeparator();
|
||||
|
||||
#endif
|
||||
/** StatusBar section **/
|
||||
peerstatus = new PeerStatus();
|
||||
statusBar()->addWidget(peerstatus);
|
||||
@ -344,8 +279,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
_hashing_info_label->hide() ;
|
||||
|
||||
statusBar()->addPermanentWidget(statusRates = new QLabel(tr("<strong>Down:</strong> 0.00 (kB/s) | <strong>Up:</strong> 0.00 (kB/s) ")));
|
||||
|
||||
//servicegrp->actions()[0]->setChecked(true);
|
||||
/******* Status Bar end ******/
|
||||
|
||||
/* Create the actions that will go in the tray menu */
|
||||
createActions();
|
||||
@ -464,29 +398,6 @@ void MainWindow::addAction(QAction *action, const char *slot)
|
||||
connect(action, SIGNAL(triggered()), this, slot);
|
||||
}
|
||||
|
||||
/** Adds the given action to the toolbar and hooks its triggered() signal to
|
||||
* the specified slot (if given). */
|
||||
void MainWindow::addActionservice(QAction *actionservice, const char *slot)
|
||||
{
|
||||
actionservice->setFont(FONT);
|
||||
ui.toolBarservice->addAction(actionservice);
|
||||
connect(actionservice, SIGNAL(triggered()), this, slot);
|
||||
}
|
||||
|
||||
/** Overloads the default show so we can load settings */
|
||||
/*void MainWindow::show()
|
||||
{
|
||||
|
||||
if (!this->isVisible()) {
|
||||
QMainWindow::show();
|
||||
} else {
|
||||
QMainWindow::activateWindow();
|
||||
setWindowState(windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
|
||||
QMainWindow::raise();
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
/** Shows the MainWindow with focus set to the given page. */
|
||||
void MainWindow::showWindow(Page page)
|
||||
{
|
||||
@ -515,36 +426,6 @@ void MainWindow::addFriend()
|
||||
connwiz->show();
|
||||
}
|
||||
|
||||
|
||||
/** Add a Friend ShortCut */
|
||||
/*void MainWindow::inviteFriend()
|
||||
{
|
||||
static InviteDialog *inviteDialog = new InviteDialog(this);
|
||||
|
||||
std::string invite = rsPeers->GetRetroshareInvite();
|
||||
inviteDialog->setInfo(invite);
|
||||
inviteDialog->show();
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
/** Add a Share */
|
||||
void MainWindow::addSharedDirectory()
|
||||
{
|
||||
/* Same Code as in Preferences Window (add Share) */
|
||||
|
||||
QString qdir = QFileDialog::getExistingDirectory(this, tr("Add Shared Directory"), "",
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
|
||||
/* add it to the server */
|
||||
std::string dir = qdir.toStdString();
|
||||
if (dir != "")
|
||||
{
|
||||
rsFiles -> addSharedDirectory(dir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Shows Share Manager */
|
||||
void MainWindow::openShareManager()
|
||||
{
|
||||
@ -716,23 +597,6 @@ void MainWindow::loadStyleSheet(const QString &sheetName)
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::startgammon()
|
||||
{
|
||||
BgWindow *bgWindow = new BgWindow(this);
|
||||
bgWindow->show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::startqcheckers()
|
||||
{
|
||||
#if 0
|
||||
myTopLevel* top = new myTopLevel();
|
||||
top->show();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/** Shows smplayer */
|
||||
void MainWindow::showsmplayer()
|
||||
{
|
||||
|
@ -108,8 +108,6 @@ public:
|
||||
MessagesDialog *messagesDialog;
|
||||
ChannelsDialog *channelsDialog;
|
||||
SharedFilesDialog *sharedfilesDialog;
|
||||
//GroupsDialog *groupsDialog;
|
||||
//StatisticDialog *statisticDialog;
|
||||
MessengerWindow *messengerWindow;
|
||||
ApplicationWindow *applicationWindow;
|
||||
PluginsPage* pluginsPage ;
|
||||
@ -122,9 +120,6 @@ public slots:
|
||||
/** Shows the config dialog with focus set to the given page. */
|
||||
void showWindow(Page page);
|
||||
|
||||
void startgammon();
|
||||
void startqcheckers();
|
||||
|
||||
void playFiles(QStringList files);
|
||||
void updateHashingInfo(const QString&) ;
|
||||
|
||||
@ -139,8 +134,6 @@ private slots:
|
||||
|
||||
/** Toolbar fns. */
|
||||
void addFriend();
|
||||
//void inviteFriend();
|
||||
void addSharedDirectory();
|
||||
void showMessengerWindow();
|
||||
void showApplWindow();
|
||||
void showsmplayer();
|
||||
|
@ -1024,26 +1024,6 @@
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBarservice" >
|
||||
<property name="windowTitle" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="allowedAreas" >
|
||||
<set>Qt::BottomToolBarArea|Qt::LeftToolBarArea|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 class="QToolBar" name="toolBar_2" >
|
||||
<property name="enabled" >
|
||||
<bool>true</bool>
|
||||
|
Loading…
Reference in New Issue
Block a user