mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 01:31:30 -05:00
reverted previous change on MainWindow that caused compilation issues for plugins
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7316 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c1d7f514e9
commit
6e4fa142d1
@ -72,6 +72,9 @@
|
|||||||
#include "gui/GetStartedDialog.h"
|
#include "gui/GetStartedDialog.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SUSPENDED
|
||||||
|
#include "gui/People/PeopleDialog.h"
|
||||||
|
#endif
|
||||||
#include "gui/FileTransfer/TurtleRouterDialog.h"
|
#include "gui/FileTransfer/TurtleRouterDialog.h"
|
||||||
#include "idle/idle.h"
|
#include "idle/idle.h"
|
||||||
|
|
||||||
@ -187,8 +190,10 @@
|
|||||||
MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||||
: RWindow("MainWindow", parent, flags)
|
: RWindow("MainWindow", parent, flags)
|
||||||
{
|
{
|
||||||
|
ui = new Ui::MainWindow ;
|
||||||
|
|
||||||
/* Invoke the Qt Designer generated QObject setup routine */
|
/* Invoke the Qt Designer generated QObject setup routine */
|
||||||
setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
_instance = this;
|
_instance = this;
|
||||||
|
|
||||||
@ -236,50 +241,54 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
QActionGroup *grp = new QActionGroup(this);
|
QActionGroup *grp = new QActionGroup(this);
|
||||||
QAction *action;
|
QAction *action;
|
||||||
|
|
||||||
stackPages->add(newsFeed = new NewsFeed(stackPages),
|
ui->stackPages->add(newsFeed = new NewsFeed(ui->stackPages),
|
||||||
action = createPageAction(QIcon(IMAGE_NEWSFEED), tr("News feed"), grp));
|
action = createPageAction(QIcon(IMAGE_NEWSFEED), tr("News feed"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(newsFeed, action));
|
notify.push_back(QPair<MainPage*, QAction*>(newsFeed, action));
|
||||||
|
|
||||||
|
|
||||||
stackPages->add(friendsDialog = new FriendsDialog(stackPages),
|
ui->stackPages->add(friendsDialog = new FriendsDialog(ui->stackPages),
|
||||||
action = createPageAction(QIcon(IMAGE_PEERS), tr("Network"), grp));
|
action = createPageAction(QIcon(IMAGE_PEERS), tr("Network"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(friendsDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(friendsDialog, action));
|
||||||
|
#ifdef SUSPENDED
|
||||||
|
PeopleDialog *peopleDialog = NULL;
|
||||||
|
ui->stackPages->add(peopleDialog = new PeopleDialog(ui->stackPages), action = createPageAction(QIcon(IMAGE_IDENTITY), tr("People"), grp));
|
||||||
|
notify.push_back(QPair<MainPage*, QAction*>(peopleDialog, action));
|
||||||
|
#endif
|
||||||
IdDialog *idDialog = NULL;
|
IdDialog *idDialog = NULL;
|
||||||
stackPages->add(idDialog = new IdDialog(stackPages), action = createPageAction(QIcon(IMAGE_IDENTITY), tr("People"), grp));
|
ui->stackPages->add(idDialog = new IdDialog(ui->stackPages), action = createPageAction(QIcon(IMAGE_IDENTITY), tr("Itentities"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(idDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(idDialog, action));
|
||||||
|
|
||||||
CirclesDialog *circlesDialog = NULL;
|
CirclesDialog *circlesDialog = NULL;
|
||||||
stackPages->add(circlesDialog = new CirclesDialog(stackPages), createPageAction(QIcon(IMAGE_CIRCLES ), tr("Circles"), grp));
|
ui->stackPages->add(circlesDialog = new CirclesDialog(ui->stackPages), createPageAction(QIcon(IMAGE_CIRCLES ), tr("Circles"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(circlesDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(circlesDialog, action));
|
||||||
|
|
||||||
stackPages->add(transfersDialog = new TransfersDialog(stackPages),
|
ui->stackPages->add(transfersDialog = new TransfersDialog(ui->stackPages),
|
||||||
action = createPageAction(QIcon(IMAGE_TRANSFERS), tr("File sharing"), grp));
|
action = createPageAction(QIcon(IMAGE_TRANSFERS), tr("File sharing"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(transfersDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(transfersDialog, action));
|
||||||
|
|
||||||
stackPages->add(chatLobbyDialog = new ChatLobbyWidget(stackPages),
|
ui->stackPages->add(chatLobbyDialog = new ChatLobbyWidget(ui->stackPages),
|
||||||
action = createPageAction(QIcon(IMAGE_CHATLOBBY), tr("Chat Lobbies"), grp));
|
action = createPageAction(QIcon(IMAGE_CHATLOBBY), tr("Chat Lobbies"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(chatLobbyDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(chatLobbyDialog, action));
|
||||||
|
|
||||||
stackPages->add(messagesDialog = new MessagesDialog(stackPages),
|
ui->stackPages->add(messagesDialog = new MessagesDialog(ui->stackPages),
|
||||||
action = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp));
|
action = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(messagesDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(messagesDialog, action));
|
||||||
|
|
||||||
stackPages->add(gxschannelDialog = new ChannelDialog(stackPages),
|
ui->stackPages->add(gxschannelDialog = new ChannelDialog(ui->stackPages),
|
||||||
action = createPageAction(QIcon(IMAGE_GXSCHANNELS), tr("Channels"), grp));
|
action = createPageAction(QIcon(IMAGE_GXSCHANNELS), tr("Channels"), grp));
|
||||||
gxschannelDialog->setup();
|
gxschannelDialog->setup();
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(gxschannelDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(gxschannelDialog, action));
|
||||||
|
|
||||||
stackPages->add(gxsforumDialog = new GxsForumsDialog(stackPages),
|
ui->stackPages->add(gxsforumDialog = new GxsForumsDialog(ui->stackPages),
|
||||||
action = createPageAction(QIcon(IMAGE_GXSFORUMS), tr("Forums"), grp));
|
action = createPageAction(QIcon(IMAGE_GXSFORUMS), tr("Forums"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(gxsforumDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(gxsforumDialog, action));
|
||||||
|
|
||||||
#ifdef BLOGS
|
#ifdef BLOGS
|
||||||
stackPages->add(blogsFeed = new BlogsDialog(stackPages), createPageAction(QIcon(IMAGE_BLOGS), tr("Blogs"), grp));
|
ui->stackPages->add(blogsFeed = new BlogsDialog(ui->stackPages), createPageAction(QIcon(IMAGE_BLOGS), tr("Blogs"), grp));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
stackPages->add(forumsDialog = new ForumsDialog(stackPages),
|
ui->stackPages->add(forumsDialog = new ForumsDialog(ui->stackPages),
|
||||||
action = createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
|
action = createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(forumsDialog, action));
|
notify.push_back(QPair<MainPage*, QAction*>(forumsDialog, action));
|
||||||
#endif
|
#endif
|
||||||
@ -299,7 +308,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
std::cerr << " Addign widget page for plugin " << rsPlugins->plugin(i)->getPluginName() << std::endl;
|
std::cerr << " Addign widget page for plugin " << rsPlugins->plugin(i)->getPluginName() << std::endl;
|
||||||
MainPage *pluginPage = rsPlugins->plugin(i)->qt_page();
|
MainPage *pluginPage = rsPlugins->plugin(i)->qt_page();
|
||||||
QAction *pluginAction = createPageAction(icon, QString::fromUtf8(rsPlugins->plugin(i)->getPluginName().c_str()), grp);
|
QAction *pluginAction = createPageAction(icon, QString::fromUtf8(rsPlugins->plugin(i)->getPluginName().c_str()), grp);
|
||||||
stackPages->add(pluginPage, pluginAction);
|
ui->stackPages->add(pluginPage, pluginAction);
|
||||||
notify.push_back(QPair<MainPage*, QAction*>(pluginPage, pluginAction));
|
notify.push_back(QPair<MainPage*, QAction*>(pluginPage, pluginAction));
|
||||||
}
|
}
|
||||||
else if(rsPlugins->plugin(i) == NULL)
|
else if(rsPlugins->plugin(i) == NULL)
|
||||||
@ -311,7 +320,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
|
|
||||||
#ifndef RS_RELEASE_VERSION
|
#ifndef RS_RELEASE_VERSION
|
||||||
#ifdef PLUGINMGR
|
#ifdef PLUGINMGR
|
||||||
stackPages->add(pluginsPage = new PluginsPage(stackPages),
|
ui->stackPages->add(pluginsPage = new PluginsPage(ui->stackPages),
|
||||||
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
|
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -321,27 +330,27 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
|
|
||||||
if (!advancedMode)
|
if (!advancedMode)
|
||||||
{
|
{
|
||||||
stackPages->add(getStartedPage = new GetStartedDialog(stackPages),
|
ui->stackPages->add(getStartedPage = new GetStartedDialog(ui->stackPages),
|
||||||
createPageAction(QIcon(IMG_HELP), tr("Getting Started"), grp));
|
createPageAction(QIcon(IMG_HELP), tr("Getting Started"), grp));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Create the toolbar */
|
/* Create the toolbar */
|
||||||
toolBar->addActions(grp->actions());
|
ui->toolBar->addActions(grp->actions());
|
||||||
|
|
||||||
connect(grp, SIGNAL(triggered(QAction *)), stackPages, SLOT(showPage(QAction *)));
|
connect(grp, SIGNAL(triggered(QAction *)), ui->stackPages, SLOT(showPage(QAction *)));
|
||||||
|
|
||||||
#ifdef UNFINISHED
|
#ifdef UNFINISHED
|
||||||
toolBar->addSeparator();
|
ui->toolBar->addSeparator();
|
||||||
addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), toolBar), SLOT(showApplWindow()));
|
addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), ui->toolBar), SLOT(showApplWindow()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
addAction(new QAction(QIcon(IMAGE_PREFERENCES), tr("Options"), toolBar), SLOT(showSettings()));
|
addAction(new QAction(QIcon(IMAGE_PREFERENCES), tr("Options"), ui->toolBar), SLOT(showSettings()));
|
||||||
addAction(new QAction(QIcon(IMAGE_ABOUT), tr("About"), toolBar), SLOT(showabout()));
|
addAction(new QAction(QIcon(IMAGE_ABOUT), tr("About"), ui->toolBar), SLOT(showabout()));
|
||||||
addAction(new QAction(QIcon(IMAGE_QUIT), tr("Quit"), toolBar), SLOT(doQuit()));
|
addAction(new QAction(QIcon(IMAGE_QUIT), tr("Quit"), ui->toolBar), SLOT(doQuit()));
|
||||||
|
|
||||||
|
|
||||||
stackPages->setCurrentIndex(Settings->getLastPageInMainWindow());
|
ui->stackPages->setCurrentIndex(Settings->getLastPageInMainWindow());
|
||||||
|
|
||||||
/** StatusBar section ********/
|
/** StatusBar section ********/
|
||||||
/* initialize combobox in status bar */
|
/* initialize combobox in status bar */
|
||||||
@ -387,7 +396,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) {
|
for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) {
|
||||||
UserNotify *userNotify = notifyIt->first->getUserNotify(this);
|
UserNotify *userNotify = notifyIt->first->getUserNotify(this);
|
||||||
if (userNotify) {
|
if (userNotify) {
|
||||||
userNotify->initialize(toolBar, notifyIt->second);
|
userNotify->initialize(ui->toolBar, notifyIt->second);
|
||||||
connect(userNotify, SIGNAL(countChanged()), this, SLOT(updateTrayCombine()));
|
connect(userNotify, SIGNAL(countChanged()), this, SLOT(updateTrayCombine()));
|
||||||
userNotifyList.push_back(userNotify);
|
userNotifyList.push_back(userNotify);
|
||||||
}
|
}
|
||||||
@ -403,7 +412,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
loadOwnStatus();
|
loadOwnStatus();
|
||||||
|
|
||||||
/* Set focus to the current page */
|
/* Set focus to the current page */
|
||||||
stackPages->currentWidget()->setFocus();
|
ui->stackPages->currentWidget()->setFocus();
|
||||||
|
|
||||||
idle = new Idle();
|
idle = new Idle();
|
||||||
idle->start();
|
idle->start();
|
||||||
@ -417,7 +426,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
/** Destructor. */
|
/** Destructor. */
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
Settings->setLastPageInMainWindow(stackPages->currentIndex());
|
Settings->setLastPageInMainWindow(ui->stackPages->currentIndex());
|
||||||
|
|
||||||
delete peerstatus;
|
delete peerstatus;
|
||||||
delete natstatus;
|
delete natstatus;
|
||||||
@ -698,7 +707,7 @@ void MainWindow::addAction(QAction *action, const char *slot)
|
|||||||
font = action->font();
|
font = action->font();
|
||||||
font.setPointSize(9);
|
font.setPointSize(9);
|
||||||
action->setFont(font);
|
action->setFont(font);
|
||||||
toolBar->addAction(action);
|
ui->toolBar->addAction(action);
|
||||||
connect(action, SIGNAL(triggered()), this, slot);
|
connect(action, SIGNAL(triggered()), this, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -791,7 +800,7 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||||||
/* Show the dialog. */
|
/* Show the dialog. */
|
||||||
raiseWindow();
|
raiseWindow();
|
||||||
/* Set the focus to the specified page. */
|
/* Set the focus to the specified page. */
|
||||||
_instance->stackPages->setCurrentPage(page);
|
_instance->ui->stackPages->setCurrentPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set focus to the given page. */
|
/** Set focus to the given page. */
|
||||||
@ -803,35 +812,35 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||||||
|
|
||||||
switch (page) {
|
switch (page) {
|
||||||
case Search:
|
case Search:
|
||||||
_instance->stackPages->setCurrentPage( _instance->transfersDialog );
|
_instance->ui->stackPages->setCurrentPage( _instance->transfersDialog );
|
||||||
_instance->transfersDialog->activatePage(TransfersDialog::SearchTab) ;
|
_instance->transfersDialog->activatePage(TransfersDialog::SearchTab) ;
|
||||||
break ;
|
break ;
|
||||||
case Network:
|
case Network:
|
||||||
_instance->stackPages->setCurrentPage( _instance->friendsDialog );
|
_instance->ui->stackPages->setCurrentPage( _instance->friendsDialog );
|
||||||
_instance->friendsDialog->activatePage(FriendsDialog::NetworkTab) ;
|
_instance->friendsDialog->activatePage(FriendsDialog::NetworkTab) ;
|
||||||
break;
|
break;
|
||||||
case Friends:
|
case Friends:
|
||||||
_instance->stackPages->setCurrentPage( _instance->friendsDialog );
|
_instance->ui->stackPages->setCurrentPage( _instance->friendsDialog );
|
||||||
break;
|
break;
|
||||||
case ChatLobby:
|
case ChatLobby:
|
||||||
_instance->stackPages->setCurrentPage( _instance->chatLobbyDialog );
|
_instance->ui->stackPages->setCurrentPage( _instance->chatLobbyDialog );
|
||||||
break;
|
break;
|
||||||
case Transfers:
|
case Transfers:
|
||||||
_instance->stackPages->setCurrentPage( _instance->transfersDialog );
|
_instance->ui->stackPages->setCurrentPage( _instance->transfersDialog );
|
||||||
break;
|
break;
|
||||||
case SharedDirectories:
|
case SharedDirectories:
|
||||||
_instance->stackPages->setCurrentPage( _instance->transfersDialog );
|
_instance->ui->stackPages->setCurrentPage( _instance->transfersDialog );
|
||||||
_instance->transfersDialog->activatePage(TransfersDialog::LocalSharedFilesTab) ;
|
_instance->transfersDialog->activatePage(TransfersDialog::LocalSharedFilesTab) ;
|
||||||
break;
|
break;
|
||||||
case Messages:
|
case Messages:
|
||||||
_instance->stackPages->setCurrentPage( _instance->messagesDialog );
|
_instance->ui->stackPages->setCurrentPage( _instance->messagesDialog );
|
||||||
break;
|
break;
|
||||||
#if 0
|
#if 0
|
||||||
case Channels:
|
case Channels:
|
||||||
_instance->stackPages->setCurrentPage( _instance->channelFeed );
|
_instance->ui->stackPages->setCurrentPage( _instance->channelFeed );
|
||||||
return true ;
|
return true ;
|
||||||
case Forums:
|
case Forums:
|
||||||
_instance->stackPages->setCurrentPage( _instance->forumsDialog );
|
_instance->ui->stackPages->setCurrentPage( _instance->forumsDialog );
|
||||||
return true ;
|
return true ;
|
||||||
#endif
|
#endif
|
||||||
#ifdef BLOGS
|
#ifdef BLOGS
|
||||||
@ -853,7 +862,7 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||||||
return Network;
|
return Network;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *page = _instance->stackPages->currentWidget();
|
QWidget *page = _instance->ui->stackPages->currentWidget();
|
||||||
|
|
||||||
// if (page == _instance->networkDialog) {
|
// if (page == _instance->networkDialog) {
|
||||||
// return Network;
|
// return Network;
|
||||||
@ -1109,10 +1118,10 @@ void
|
|||||||
MainWindow::retranslateUi()
|
MainWindow::retranslateUi()
|
||||||
{
|
{
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
foreach (MainPage *page, stackPages->pages()) {
|
foreach (MainPage *page, ui->stackPages->pages()) {
|
||||||
page->retranslateUi();
|
page->retranslateUi();
|
||||||
}
|
}
|
||||||
foreach (QAction *action, toolBar->actions()) {
|
foreach (QAction *action, ui->toolBar->actions()) {
|
||||||
action->setText(tr(qPrintable(action->data().toString()), "MainWindow"));
|
action->setText(tr(qPrintable(action->data().toString()), "MainWindow"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include "gui/common/rwindow.h"
|
#include "gui/common/rwindow.h"
|
||||||
#include "ui_MainWindow.h"
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
@ -73,7 +72,7 @@ class BlogsDialog;
|
|||||||
class ApplicationWindow;
|
class ApplicationWindow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class MainWindow : public RWindow, public Ui::MainWindow
|
class MainWindow : public RWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -258,6 +257,8 @@ private:
|
|||||||
// idle function
|
// idle function
|
||||||
void setIdle(bool Idle);
|
void setIdle(bool Idle);
|
||||||
bool isIdle;
|
bool isIdle;
|
||||||
|
|
||||||
|
Ui::MainWindow *ui ;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user