From 591a141a18254f73fde002ce9e3551e62d543a86 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 23 May 2010 21:32:58 +0000 Subject: [PATCH] - removed MessagesPopupDialog - click in MessageToaster shows the MainWindow and activates the MessagesDialog git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2980 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/RetroShare.pro | 3 - retroshare-gui/src/gui/MainWindow.cpp | 9 +- retroshare-gui/src/gui/MainWindow.h | 12 ++- .../src/gui/MessagesPopupDialog.cpp | 64 -------------- retroshare-gui/src/gui/MessagesPopupDialog.h | 54 ------------ retroshare-gui/src/gui/MessagesPopupDialog.ui | 85 ------------------- retroshare-gui/src/gui/MessengerWindow.cpp | 1 - .../src/gui/toaster/MessageToaster.cpp | 7 +- 8 files changed, 12 insertions(+), 223 deletions(-) delete mode 100644 retroshare-gui/src/gui/MessagesPopupDialog.cpp delete mode 100644 retroshare-gui/src/gui/MessagesPopupDialog.h delete mode 100644 retroshare-gui/src/gui/MessagesPopupDialog.ui diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 34c2978e7..6ccaff099 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -251,7 +251,6 @@ HEADERS += rshare.h \ gui/common/rwindow.h \ gui/common/html.h \ gui/MessagesDialog.h \ - gui/MessagesPopupDialog.h \ gui/help/browser/helpbrowser.h \ gui/help/browser/helptextbrowser.h \ gui/statusbar/peerstatus.h \ @@ -307,7 +306,6 @@ FORMS += gui/StartDialog.ui \ gui/ShareManager.ui \ gui/ShareDialog.ui \ gui/MessagesDialog.ui \ - gui/MessagesPopupDialog.ui \ gui/help/browser/helpbrowser.ui \ gui/HelpDialog.ui \ gui/InfoDialog.ui \ @@ -396,7 +394,6 @@ SOURCES += main.cpp \ gui/SoundManager.cpp \ gui/MessagesDialog.cpp \ gui/FileTransferInfoWidget.cpp \ - gui/MessagesPopupDialog.cpp \ gui/im_history/IMHistoryKeeper.cpp \ gui/im_history/IMHistoryReader.cpp \ gui/im_history/IMHistoryItem.cpp \ diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 7a4df5f22..2fc676bb2 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -451,13 +451,14 @@ void MainWindow::addAction(QAction *action, const char *slot) } /** Shows the MainWindow with focus set to the given page. */ -void MainWindow::showWindow(Page page) +/*static*/ void MainWindow::showWindow(Page page) { - /* Show the dialog. */ - //show(); + if (_instance == NULL) { + return; + } /* Show the dialog. */ - RWindow::showWindow(); + _instance->show(); /* Set the focus to the specified page. */ activatePage (page); } diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index 3fbc3aa58..366a4f7a0 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -95,6 +95,11 @@ public: /** Destructor. */ ~MainWindow(); + /** Shows the MainWindow dialog with focus set to the given page. */ + static void showWindow(Page page); + /** Set focus to the given page. */ + static void activatePage (Page page); + /* A Bit of a Hack... but public variables for * the dialogs, so we can add them to the * Notify Class... @@ -128,13 +133,6 @@ public: public slots: - /** Called when this dialog is to be displayed */ - //void show(); - /** Shows the config dialog with focus set to the given page. */ - void showWindow(Page page); - /** Set focus to the given page. */ - static void activatePage (Page page); - void updateHashingInfo(const QString&) ; void displayErrorMessage(int,int,const QString&) ; void postModDirectories(bool update_local); diff --git a/retroshare-gui/src/gui/MessagesPopupDialog.cpp b/retroshare-gui/src/gui/MessagesPopupDialog.cpp deleted file mode 100644 index 50e54ebe5..000000000 --- a/retroshare-gui/src/gui/MessagesPopupDialog.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006, crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - - -#include "MessagesPopupDialog.h" -#include "MessagesDialog.h" - -#include "util/printpreview.h" - -#include "rsiface/rsiface.h" -#include "rsiface/rspeers.h" -#include "rsiface/rsmsgs.h" -#include "rsiface/rsfiles.h" -#include - - -/** Constructor */ -MessagesPopupDialog::MessagesPopupDialog(QWidget* parent, Qt::WFlags flags) -: QMainWindow(parent, flags) -{ - /* Invoke the Qt Designer generated object setup routine */ - ui.setupUi(this); - - setAttribute ( Qt::WA_DeleteOnClose, true ); - - messagesdlg = new MessagesDialog(); - messagesdlg->setAttribute ( Qt::WA_DeleteOnClose, true ); - - QVBoxLayout *layout = new QVBoxLayout(ui.centralwidget); - layout->addWidget(messagesdlg); - setLayout(layout); - layout->setSpacing( 0 ); - layout->setMargin( 0 ); - - - /* Hide platform specific features */ -#ifdef Q_WS_WIN - -#endif -} - -MessagesPopupDialog::~MessagesPopupDialog() -{ - delete messagesdlg; -} - diff --git a/retroshare-gui/src/gui/MessagesPopupDialog.h b/retroshare-gui/src/gui/MessagesPopupDialog.h deleted file mode 100644 index 3e63137b7..000000000 --- a/retroshare-gui/src/gui/MessagesPopupDialog.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2009,The RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - -#ifndef _MESSAGESPOPUPDIALOG_H -#define _MESSAGESPOPUPDIALOG_H - -#include - -#include "ui_MessagesPopupDialog.h" - -class MessagesDialog; - -class MessagesPopupDialog : public QMainWindow -{ - Q_OBJECT - -public: - /** Default Constructor */ - MessagesPopupDialog(QWidget *parent = 0, Qt::WFlags flags = 0); - /** Default Destructor */ - ~MessagesPopupDialog(); - -private slots: - - -private: - - MessagesDialog *messagesdlg; - - - /** Qt Designer generated object */ - Ui::MessagesPopupDialog ui; -}; - -#endif - diff --git a/retroshare-gui/src/gui/MessagesPopupDialog.ui b/retroshare-gui/src/gui/MessagesPopupDialog.ui deleted file mode 100644 index 0d7adfa5d..000000000 --- a/retroshare-gui/src/gui/MessagesPopupDialog.ui +++ /dev/null @@ -1,85 +0,0 @@ - - - MessagesPopupDialog - - - - 0 - 0 - 657 - 478 - - - - Messages - - - - :/images/rstray3.png:/images/rstray3.png - - - Qt::ToolButtonTextUnderIcon - - - - - - - :/images/folder-draft24.png:/images/folder-draft24.png - - - Compose - - - - - - :/images/replymail24.png:/images/replymail24.png - - - Reply - - - - - - :/images/mailforward24-hover.png:/images/mailforward24-hover.png - - - Forward - - - - - - :/images/deletemail24.png:/images/deletemail24.png - - - Remove - - - - - - :/images/print24.png:/images/print24.png - - - Print - - - - - PrintPreview - - - - - Print - - - - - - - - diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index 9727cefd6..4264b1311 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -43,7 +43,6 @@ #include "gui/connect/ConnectFriendWizard.h" -#include "MessagesPopupDialog.h" #include "ShareManager.h" #include diff --git a/retroshare-gui/src/gui/toaster/MessageToaster.cpp b/retroshare-gui/src/gui/toaster/MessageToaster.cpp index 884fd120d..f78507a2b 100644 --- a/retroshare-gui/src/gui/toaster/MessageToaster.cpp +++ b/retroshare-gui/src/gui/toaster/MessageToaster.cpp @@ -18,7 +18,7 @@ */ #include "MessageToaster.h" -#include "gui/MessagesPopupDialog.h" +#include "../MainWindow.h" MessageToaster::MessageToaster( QWidget * parent, Qt::WFlags f) : QWidget(parent, f) @@ -104,10 +104,7 @@ void MessageToaster::closeClicked() void MessageToaster::openmessageClicked() { - MessagesPopupDialog *msgdialog = new MessagesPopupDialog(); - msgdialog->show(); - - /* window will destroy itself! */ + MainWindow::showWindow (MainWindow::Messages); } void MessageToaster::setMessage(const QString & message)