diff --git a/livesupport/src/products/gLiveSupport/etc/Makefile.in b/livesupport/src/products/gLiveSupport/etc/Makefile.in index b2d5d0747..553b3ed56 100644 --- a/livesupport/src/products/gLiveSupport/etc/Makefile.in +++ b/livesupport/src/products/gLiveSupport/etc/Makefile.in @@ -244,6 +244,7 @@ G_LIVESUPPORT_OBJS = ${TMP_DIR}/GLiveSupport.o \ ${TMP_DIR}/MasterPanelWindow.o \ ${TMP_DIR}/NowPlaying.o \ ${TMP_DIR}/MasterPanelUserInfoWidget.o \ + ${TMP_DIR}/GuiWindow.o \ ${TMP_DIR}/LoginWindow.o \ ${TMP_DIR}/UploadFileWindow.o \ ${TMP_DIR}/ScratchpadWindow.o \ diff --git a/livesupport/src/products/gLiveSupport/src/GuiWindow.cxx b/livesupport/src/products/gLiveSupport/src/GuiWindow.cxx new file mode 100644 index 000000000..427eb8afa --- /dev/null +++ b/livesupport/src/products/gLiveSupport/src/GuiWindow.cxx @@ -0,0 +1,159 @@ +/*------------------------------------------------------------------------------ + + Copyright (c) 2004 Media Development Loan Fund + + This file is part of the LiveSupport project. + http://livesupport.campware.org/ + To report bugs, send an e-mail to bugs@campware.org + + LiveSupport 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. + + LiveSupport 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 LiveSupport; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Author : $Author: fgerlits $ + Version : $Revision$ + Location : $URL: svn+ssh://fgerlits@code.campware.org/home/svn/repo/livesupport/trunk/livesupport/src/products/gLiveSupport/src/GuiWindow.cxx $ + +------------------------------------------------------------------------------*/ + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include "LiveSupport/Widgets/Colors.h" +#include "LiveSupport/Widgets/WidgetFactory.h" + +#include "GuiWindow.h" + + +using namespace LiveSupport::Core; +using namespace LiveSupport::Widgets; +using namespace LiveSupport::GLiveSupport; + +/* =================================================== local data structures */ + + +/* ================================================ local constants & macros */ + + +/* =============================================== local function prototypes */ + + +/* ============================================================= module code */ + +/*------------------------------------------------------------------------------ + * Constructor. + *----------------------------------------------------------------------------*/ +GuiWindow :: GuiWindow (Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + WidgetConstants::ImageType titleImage, + Button * windowOpenerButton) + throw () + : WhiteWindow(titleImage, + Colors::White, + WidgetFactory::getInstance()->getWhiteWindowCorners()), + LocalizedObject(bundle), + gLiveSupport(gLiveSupport), + windowOpenerButton(windowOpenerButton) +{ +} + + +/*------------------------------------------------------------------------------ + * Constructor. + *----------------------------------------------------------------------------*/ +GuiWindow :: GuiWindow (Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + WidgetConstants::ImageType titleImage, + Button * windowOpenerButton, + int properties) + throw () + : WhiteWindow(titleImage, + Colors::White, + WidgetFactory::getInstance()->getWhiteWindowCorners(), + properties), + LocalizedObject(bundle), + gLiveSupport(gLiveSupport), + windowOpenerButton(windowOpenerButton) +{ +} + + +/*------------------------------------------------------------------------------ + * Constructor. + *----------------------------------------------------------------------------*/ +GuiWindow :: GuiWindow (Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + const Glib::ustring & titleString, + Button * windowOpenerButton) + throw () + : WhiteWindow(titleString, + Colors::White, + WidgetFactory::getInstance()->getWhiteWindowCorners()), + LocalizedObject(bundle), + gLiveSupport(gLiveSupport), + windowOpenerButton(windowOpenerButton) +{ +} + + +/*------------------------------------------------------------------------------ + * Constructor. + *----------------------------------------------------------------------------*/ +GuiWindow :: GuiWindow (Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + const Glib::ustring & titleString, + Button * windowOpenerButton, + int properties) + throw () + : WhiteWindow(titleString, + Colors::White, + WidgetFactory::getInstance()->getWhiteWindowCorners(), + properties), + LocalizedObject(bundle), + gLiveSupport(gLiveSupport), + windowOpenerButton(windowOpenerButton) +{ +} + + +/*------------------------------------------------------------------------------ + * Event handler called when the the window is shown. + *----------------------------------------------------------------------------*/ +void +GuiWindow :: on_show (void) throw () +{ + gLiveSupport->getWindowPosition(shared_from_this()); + + WhiteWindow::on_show(); +} + + +/*------------------------------------------------------------------------------ + * Event handler called when the the window gets hidden. + *----------------------------------------------------------------------------*/ +void +GuiWindow :: on_hide (void) throw () +{ + gLiveSupport->putWindowPosition(shared_from_this()); + + if (windowOpenerButton) { + windowOpenerButton->setSelected(false); + } + + WhiteWindow::on_hide(); +} + diff --git a/livesupport/src/products/gLiveSupport/src/GuiWindow.h b/livesupport/src/products/gLiveSupport/src/GuiWindow.h new file mode 100644 index 000000000..5b0d032e7 --- /dev/null +++ b/livesupport/src/products/gLiveSupport/src/GuiWindow.h @@ -0,0 +1,199 @@ +/*------------------------------------------------------------------------------ + + Copyright (c) 2004 Media Development Loan Fund + + This file is part of the LiveSupport project. + http://livesupport.campware.org/ + To report bugs, send an e-mail to bugs@campware.org + + LiveSupport 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. + + LiveSupport 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 LiveSupport; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Author : $Author: fgerlits $ + Version : $Revision$ + Location : $URL: svn+ssh://fgerlits@code.campware.org/home/svn/repo/livesupport/trunk/livesupport/src/products/gLiveSupport/src/GuiWindow.h $ + +------------------------------------------------------------------------------*/ +#ifndef GuiWindow_h +#define GuiWindow_h + +#ifndef __cplusplus +#error This is a C++ include file +#endif + + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include +#include + +#include "LiveSupport/Core/LocalizedObject.h" +#include "LiveSupport/Widgets/WhiteWindow.h" +#include "LiveSupport/Widgets/Button.h" +#include "LiveSupport/Widgets/WidgetConstants.h" +#include "GLiveSupport.h" + +namespace LiveSupport { +namespace GLiveSupport { + +using namespace LiveSupport::Core; +using namespace LiveSupport::Widgets; + +/* ================================================================ constants */ + + +/* =================================================================== macros */ + + +/* =============================================================== data types */ + +/** + * The common ancestor of all openable and closable windows in the GUI. + * + * @author $Author: fgerlits $ + * @version $Revision$ + */ +class GuiWindow : public WhiteWindow, + public LocalizedObject +{ + private: + /** + * The button which was pressed to open this window. + */ + Button * windowOpenerButton; + + protected: + /** + * The GLiveSupport object, holding the state of the application. + */ + Ptr::Ref gLiveSupport; + + /** + * Event handler called when the the window is shown. + * + * This overrides WhiteWindow::on_show(), inherited from Gtk::Widget. + * It reads and restores the saved window position, if any. + * + * @see LiveSupport::GLiveSupport::GLiveSupport::getWindowPosition() + */ + virtual void + on_show(void) throw (); + + /** + * Event handler called when the the window gets hidden. + * + * This overrides WhiteWindow::on_hide(), inherited from Gtk::Widget. + * It stores the window position, and 'pops out' the window opener + * button. + * + * @see LiveSupport::GLiveSupport::GLiveSupport::putWindowPosition() + * @see LiveSupport::Widgets::Button::setSelected() + */ + virtual void + on_hide(void) throw (); + + public: + /** + * Constructor. + * + * @param gLiveSupport the GLiveSupport application object. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param titleImage the LS logo for this window. + * @param windowOpenerButton the button which was pressed to open + * this window (optional). + */ + GuiWindow(Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + WidgetConstants::ImageType titleImage, + Button * windowOpenerButton = 0) + throw (); + + /** + * Constructor. + * + * @param gLiveSupport the GLiveSupport application object. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param titleImage the LS logo for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. + * @param properties see WhiteWindow::WindowProperties. + */ + GuiWindow(Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + WidgetConstants::ImageType titleImage, + Button * windowOpenerButton, + int properties) + throw (); + + /** + * Constructor. + * + * @param gLiveSupport the GLiveSupport, application object. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param titleString the title of this window. + * @param windowOpenerButton the button which was pressed to open + * this window (optional). + */ + GuiWindow(Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + const Glib::ustring & titleString, + Button * windowOpenerButton = 0) + throw (); + + /** + * Constructor. + * + * @param gLiveSupport the GLiveSupport, application object. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param titleString the title of this window. + * @param windowOpenerButton the button which was pressed to open + * this window. + * @param properties see WhiteWindow::WindowProperties. + */ + GuiWindow(Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + const Glib::ustring & titleString, + Button * windowOpenerButton, + int properties) + throw (); + + /** + * Virtual destructor. + */ + virtual + ~GuiWindow(void) throw () + { + } +}; + +/* ================================================= external data structures */ + + +/* ====================================================== function prototypes */ + + +} // namespace GLiveSupport +} // namespace LiveSupport + +#endif // GuiWindow_h + diff --git a/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx b/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx index 5dc2ca7f8..de6ff3d6c 100644 --- a/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx @@ -68,14 +68,14 @@ static const Glib::ustring windowName = "liveModeWindow"; /*------------------------------------------------------------------------------ * Constructor. *----------------------------------------------------------------------------*/ -LiveModeWindow :: LiveModeWindow (Ptr::Ref gLiveSupport, - Ptr::Ref bundle) +LiveModeWindow :: LiveModeWindow (Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + Button * windowOpenerButton) throw () - : WhiteWindow(WidgetConstants::liveModeWindowTitleImage, - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners()), - LocalizedObject(bundle), - gLiveSupport(gLiveSupport) + : GuiWindow(gLiveSupport, + bundle, + WidgetConstants::liveModeWindowTitleImage, + windowOpenerButton) { try { set_title(*getResourceUstring("windowTitle")); @@ -365,14 +365,3 @@ LiveModeWindow :: onKeyPressed(GdkEventKey * event) throw () return false; } - -/*------------------------------------------------------------------------------ - * Event handler for the close button getting clicked. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onCloseButtonClicked (void) throw () -{ - gLiveSupport->putWindowPosition(shared_from_this()); - hide(); -} - diff --git a/livesupport/src/products/gLiveSupport/src/LiveModeWindow.h b/livesupport/src/products/gLiveSupport/src/LiveModeWindow.h index ed71ff42e..f87fc3b6a 100644 --- a/livesupport/src/products/gLiveSupport/src/LiveModeWindow.h +++ b/livesupport/src/products/gLiveSupport/src/LiveModeWindow.h @@ -48,10 +48,10 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/WhiteWindow.h" #include "LiveSupport/Widgets/Button.h" #include "LiveSupport/Widgets/ZebraTreeView.h" #include "LiveSupport/Widgets/PlayableTreeModelColumnRecord.h" +#include "GuiWindow.h" #include "CuePlayer.h" #include "GLiveSupport.h" @@ -76,7 +76,7 @@ using namespace LiveSupport::Widgets; * @author $Author$ * @version $Revision$ */ -class LiveModeWindow : public WhiteWindow, public LocalizedObject +class LiveModeWindow : public GuiWindow { private: @@ -114,11 +114,6 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject }; - /** - * The GLiveSupport object, holding the state of the application. - */ - Ptr::Ref gLiveSupport; - /** * The column model. */ @@ -191,23 +186,22 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject bool onKeyPressed(GdkEventKey * event) throw (); - /** - * Function to catch the event of the close button being pressed. - */ - virtual void - onCloseButtonClicked(void) throw (); - public: /** * Constructor. * - * @param gLiveSupport the GLiveSupport, application object. - * @param bundle the resource bundle holding the localized - * resources for this window + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. */ LiveModeWindow(Ptr::Ref gLiveSupport, - Ptr::Ref bundle) throw (); + Ptr::Ref bundle, + Button * windowOpenerButton) + throw (); /** * Virtual destructor. diff --git a/livesupport/src/products/gLiveSupport/src/LoginWindow.cxx b/livesupport/src/products/gLiveSupport/src/LoginWindow.cxx index d28df3412..60010df7e 100644 --- a/livesupport/src/products/gLiveSupport/src/LoginWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/LoginWindow.cxx @@ -61,13 +61,14 @@ using namespace LiveSupport::GLiveSupport; * Constructor. *----------------------------------------------------------------------------*/ LoginWindow :: LoginWindow (Ptr::Ref gLiveSupport, - Ptr::Ref bundle) + Ptr::Ref bundle, + Button * windowOpenerButton) throw () - : WhiteWindow("", - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners(), - 0), - LocalizedObject(bundle) + : GuiWindow(gLiveSupport, + bundle, + "", + windowOpenerButton, + 0 /* not resizable */) { this->gLiveSupport = gLiveSupport; diff --git a/livesupport/src/products/gLiveSupport/src/LoginWindow.h b/livesupport/src/products/gLiveSupport/src/LoginWindow.h index 1f8e24c32..1e2cd4267 100644 --- a/livesupport/src/products/gLiveSupport/src/LoginWindow.h +++ b/livesupport/src/products/gLiveSupport/src/LoginWindow.h @@ -54,9 +54,9 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/WhiteWindow.h" #include "LiveSupport/Widgets/EntryBin.h" #include "LiveSupport/Widgets/ComboBoxText.h" +#include "GuiWindow.h" #include "GLiveSupport.h" namespace LiveSupport { @@ -79,15 +79,10 @@ using namespace LiveSupport::Widgets; * @author $Author$ * @version $Revision$ */ -class LoginWindow : public WhiteWindow, public LocalizedObject +class LoginWindow : public GuiWindow { protected: - /** - * The GLiveSupport object, containing all the vital info. - */ - Ptr::Ref gLiveSupport; - /** * The table, which provides the layout for the window. */ @@ -175,13 +170,17 @@ class LoginWindow : public WhiteWindow, public LocalizedObject /** * Constructor. * - * @param gLiveSupport the gLiveSupport object, containing - * all the vital info. - * @param bundle the resource bundle holding the localized - * resources for this window + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. */ LoginWindow(Ptr::Ref gLiveSupport, - Ptr::Ref bundle) throw (); + Ptr::Ref bundle, + Button * windowOpenerButton) + throw (); /** * Virtual destructor. diff --git a/livesupport/src/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx b/livesupport/src/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx index 80a42fa83..ad6380809 100644 --- a/livesupport/src/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx +++ b/livesupport/src/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx @@ -150,6 +150,7 @@ MasterPanelUserInfoWidget :: onLogoutButtonClicked (void) throw () // change the logout button to a login button logInOutButton->set_label(*loginButtonLabel); + logInOutButton->setSelected(false); logInOutSignalConnection.disconnect(); logInOutSignalConnection = logInOutButton->signal_clicked().connect(sigc::mem_fun(*this, @@ -179,7 +180,8 @@ MasterPanelUserInfoWidget :: onLoginButtonClicked (void) throw () } Ptr::Ref loginWindow(new LoginWindow(gLiveSupport, - loginBundle)); + loginBundle, + logInOutButton)); Gtk::Main::run(*loginWindow); @@ -258,6 +260,7 @@ MasterPanelUserInfoWidget :: updateStrings(void) userInfoLabel->set_label(*loggedInMsg); logInOutButton->set_label(*loginButtonLabel); + logInOutButton->setSelected(false); dialogWindow.reset(new DialogWindow(getResourceUstring("sureToExitMsg"), DialogWindow::noButton | diff --git a/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx b/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx index fd3d9be41..881121173 100644 --- a/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx @@ -388,8 +388,9 @@ MasterPanelWindow :: updateLiveModeWindow(Ptr::Ref playable) return; } - liveModeWindow.reset(new LiveModeWindow(gLiveSupport, bundle)); - gLiveSupport->getWindowPosition(liveModeWindow); + liveModeWindow.reset(new LiveModeWindow(gLiveSupport, + bundle, + liveModeButton)); } if (playable) { @@ -397,7 +398,6 @@ MasterPanelWindow :: updateLiveModeWindow(Ptr::Ref playable) } if (!liveModeWindow->is_visible()) { - gLiveSupport->getWindowPosition(liveModeWindow); liveModeWindow->show(); } } @@ -418,17 +418,16 @@ MasterPanelWindow :: onUploadFileButtonClicked(void) throw () return; } - uploadFileWindow.reset(new UploadFileWindow(gLiveSupport, bundle)); - gLiveSupport->getWindowPosition(uploadFileWindow); + uploadFileWindow.reset(new UploadFileWindow(gLiveSupport, + bundle, + uploadFileButton)); uploadFileWindow->show(); return; } if (!uploadFileWindow->is_visible()) { - gLiveSupport->getWindowPosition(uploadFileWindow); uploadFileWindow->show(); } else { - gLiveSupport->putWindowPosition(uploadFileWindow); uploadFileWindow->hide(); } } @@ -449,9 +448,10 @@ MasterPanelWindow :: updateScratchpadWindow(Ptr::Ref playable) std::cerr << e.what() << std::endl; return; } - scratchpadWindow.reset(new ScratchpadWindow(gLiveSupport, bundle)); + scratchpadWindow.reset(new ScratchpadWindow(gLiveSupport, + bundle, + scratchpadButton)); gLiveSupport->loadScratchpadContents(scratchpadWindow); - gLiveSupport->getWindowPosition(scratchpadWindow); } if (playable) { @@ -459,7 +459,6 @@ MasterPanelWindow :: updateScratchpadWindow(Ptr::Ref playable) } if (!scratchpadWindow->is_visible()) { - gLiveSupport->getWindowPosition(scratchpadWindow); scratchpadWindow->show(); } } @@ -480,15 +479,15 @@ MasterPanelWindow :: updateSimplePlaylistMgmtWindow(void) throw () return; } - simplePlaylistMgmtWindow.reset( - new SimplePlaylistManagementWindow(gLiveSupport, bundle)); - gLiveSupport->getWindowPosition(simplePlaylistMgmtWindow); + simplePlaylistMgmtWindow.reset(new SimplePlaylistManagementWindow( + gLiveSupport, + bundle, + simplePlaylistMgmtButton)); } simplePlaylistMgmtWindow->showContents(); if (!simplePlaylistMgmtWindow->is_visible()) { - gLiveSupport->getWindowPosition(simplePlaylistMgmtWindow); simplePlaylistMgmtWindow->show(); } } @@ -511,8 +510,9 @@ MasterPanelWindow :: updateSchedulerWindow( return; } - schedulerWindow.reset(new SchedulerWindow(gLiveSupport, bundle)); - gLiveSupport->getWindowPosition(schedulerWindow); + schedulerWindow.reset(new SchedulerWindow(gLiveSupport, + bundle, + schedulerButton)); } if (time.get()) { @@ -522,7 +522,6 @@ MasterPanelWindow :: updateSchedulerWindow( schedulerWindow->showContents(); if (!schedulerWindow->is_visible()) { - gLiveSupport->getWindowPosition(schedulerWindow); schedulerWindow->show(); } } @@ -543,12 +542,12 @@ MasterPanelWindow :: updateSearchWindow(void) throw () return; } - searchWindow.reset(new SearchWindow(gLiveSupport, bundle)); - gLiveSupport->getWindowPosition(searchWindow); + searchWindow.reset(new SearchWindow(gLiveSupport, + bundle, + searchButton)); } if (!searchWindow->is_visible()) { - gLiveSupport->getWindowPosition(searchWindow); searchWindow->show(); } } @@ -569,12 +568,12 @@ MasterPanelWindow :: updateOptionsWindow(void) throw () return; } - optionsWindow.reset(new OptionsWindow(gLiveSupport, bundle)); - gLiveSupport->getWindowPosition(optionsWindow); + optionsWindow.reset(new OptionsWindow(gLiveSupport, + bundle, + optionsButton)); } if (!optionsWindow->is_visible()) { - gLiveSupport->getWindowPosition(optionsWindow); optionsWindow->show(); } } @@ -597,14 +596,12 @@ MasterPanelWindow :: showAnonymousUI(void) throw () if (liveModeWindow.get()) { if (liveModeWindow->is_visible()) { - gLiveSupport->putWindowPosition(liveModeWindow); liveModeWindow->hide(); } liveModeWindow.reset(); } if (uploadFileWindow.get()) { if (uploadFileWindow->is_visible()) { - gLiveSupport->putWindowPosition(uploadFileWindow); uploadFileWindow->hide(); } uploadFileWindow.reset(); @@ -612,35 +609,30 @@ MasterPanelWindow :: showAnonymousUI(void) throw () if (scratchpadWindow.get()) { gLiveSupport->storeScratchpadContents(scratchpadWindow); if (scratchpadWindow->is_visible()) { - gLiveSupport->putWindowPosition(scratchpadWindow); scratchpadWindow->hide(); } scratchpadWindow.reset(); } if (simplePlaylistMgmtWindow.get()) { if (simplePlaylistMgmtWindow->is_visible()) { - gLiveSupport->putWindowPosition(simplePlaylistMgmtWindow); simplePlaylistMgmtWindow->hide(); } simplePlaylistMgmtWindow.reset(); } if (schedulerWindow.get()) { if (schedulerWindow->is_visible()) { - gLiveSupport->putWindowPosition(schedulerWindow); schedulerWindow->hide(); } schedulerWindow.reset(); } if (searchWindow.get()) { if (searchWindow->is_visible()) { - gLiveSupport->putWindowPosition(searchWindow); searchWindow->hide(); } searchWindow.reset(); } if (optionsWindow.get()) { if (optionsWindow->is_visible()) { - gLiveSupport->putWindowPosition(optionsWindow); optionsWindow->hide(); } optionsWindow.reset(); diff --git a/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx b/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx index da341c122..4af2c2457 100644 --- a/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx @@ -67,13 +67,13 @@ static const Glib::ustring windowName = "optionsWindow"; * Constructor. *----------------------------------------------------------------------------*/ OptionsWindow :: OptionsWindow (Ptr::Ref gLiveSupport, - Ptr::Ref bundle) + Ptr::Ref bundle, + Button * windowOpenerButton) throw () - : WhiteWindow("", - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners()), - LocalizedObject(bundle), - gLiveSupport(gLiveSupport) + : GuiWindow(gLiveSupport, + bundle, + "", + windowOpenerButton) { Ptr::Ref wf = WidgetFactory::getInstance(); @@ -316,7 +316,7 @@ OptionsWindow :: onCloseButtonClicked(bool needConfirm) throw () // TODO: add confirmation dialog // and either save changes or cancel them } - gLiveSupport->putWindowPosition(shared_from_this()); + hide(); } diff --git a/livesupport/src/products/gLiveSupport/src/OptionsWindow.h b/livesupport/src/products/gLiveSupport/src/OptionsWindow.h index 4f0a325a8..c35317cd1 100644 --- a/livesupport/src/products/gLiveSupport/src/OptionsWindow.h +++ b/livesupport/src/products/gLiveSupport/src/OptionsWindow.h @@ -54,10 +54,10 @@ #include "LiveSupport/Widgets/EntryBin.h" #include "LiveSupport/Widgets/ComboBoxText.h" #include "LiveSupport/Widgets/Notebook.h" -#include "LiveSupport/Widgets/WhiteWindow.h" #include "LiveSupport/Widgets/ScrolledWindow.h" #include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" #include "LiveSupport/Widgets/ZebraTreeView.h" +#include "GuiWindow.h" #include "GLiveSupport.h" #include "MasterPanelUserInfoWidget.h" @@ -93,7 +93,7 @@ using namespace LiveSupport::Widgets; * @author $Author$ * @version $Revision$ */ -class OptionsWindow : public WhiteWindow, public LocalizedObject +class OptionsWindow : public GuiWindow { private: /** @@ -132,11 +132,6 @@ class OptionsWindow : public WhiteWindow, public LocalizedObject */ StringEntryListType stringEntryList; - /** - * The gLiveSupport object, handling the logic of the application. - */ - Ptr::Ref gLiveSupport; - /** * Create a new user entry field item. * @@ -372,12 +367,17 @@ class OptionsWindow : public WhiteWindow, public LocalizedObject /** * Constructor. * - * @param gLiveSupport the gLiveSupport object, handling the - * logic of the application - * @param bundle the resource bundle holding localized resources + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. */ OptionsWindow(Ptr::Ref gLiveSupport, - Ptr::Ref bundle) throw (); + Ptr::Ref bundle, + Button * windowOpenerButton) + throw (); /** * Virtual destructor. diff --git a/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx b/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx index 40f94a1f2..35b154a83 100644 --- a/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx @@ -62,15 +62,15 @@ using namespace LiveSupport::GLiveSupport; * Constructor. *----------------------------------------------------------------------------*/ SchedulePlaylistWindow :: SchedulePlaylistWindow ( - Ptr::Ref gLiveSupport, - Ptr::Ref bundle, - Ptr::Ref playlist) + Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + Button * windowOpenerButton, + Ptr::Ref playlist) throw () - : WhiteWindow(WidgetConstants::schedulerWindowTitleImage, - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners()), - LocalizedObject(bundle), - gLiveSupport(gLiveSupport), + : GuiWindow(gLiveSupport, + bundle, + WidgetConstants::schedulerWindowTitleImage, + windowOpenerButton), playlist(playlist) { Ptr::Ref wf = WidgetFactory::getInstance(); @@ -172,13 +172,3 @@ SchedulePlaylistWindow :: onScheduleButtonClicked (void) throw () hide(); } -/*------------------------------------------------------------------------------ - * Event handler for the close button getting clicked. - *----------------------------------------------------------------------------*/ -void -SchedulePlaylistWindow :: onCloseButtonClicked (void) throw () -{ - hide(); -} - - diff --git a/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.h b/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.h index bfebaa462..7c731d381 100644 --- a/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.h +++ b/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.h @@ -50,9 +50,9 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/WhiteWindow.h" #include "LiveSupport/Widgets/EntryBin.h" #include "LiveSupport/Widgets/Button.h" +#include "GuiWindow.h" #include "GLiveSupport.h" namespace LiveSupport { @@ -89,17 +89,11 @@ using namespace LiveSupport::Core; * @author $Author$ * @version $Revision$ */ -class SchedulePlaylistWindow : public WhiteWindow, - public LocalizedObject +class SchedulePlaylistWindow : public GuiWindow { protected: - /** - * The GLiveSupport object, holding the state of the application. - */ - Ptr::Ref gLiveSupport; - /** * The playlist to schedule. */ @@ -156,24 +150,22 @@ class SchedulePlaylistWindow : public WhiteWindow, virtual void onScheduleButtonClicked(void) throw (); - /** - * Signal handler for the close button clicked. - */ - virtual void - onCloseButtonClicked(void) throw (); - public: /** * Constructor. * - * @param gLiveSupport the GLiveSupport, application object. - * @param bundle the resource bundle holding the localized - * resources for this window - * @param playlist the playlist to schedule. + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. + * @param playlist the playlist to schedule. */ SchedulePlaylistWindow(Ptr::Ref gLiveSupport, Ptr::Ref bundle, + Button * windowOpenerButton, Ptr::Ref playlist) throw (); diff --git a/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx b/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx index 57616d016..a629a34f6 100644 --- a/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx @@ -65,14 +65,15 @@ static const Glib::ustring windowName = "schedulerWindow"; /*------------------------------------------------------------------------------ * Constructor. *----------------------------------------------------------------------------*/ -SchedulerWindow :: SchedulerWindow (Ptr::Ref gLiveSupport, - Ptr::Ref bundle) +SchedulerWindow :: SchedulerWindow ( + Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + Button * windowOpenerButton) throw () - : WhiteWindow(WidgetConstants::schedulerWindowTitleImage, - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners()), - LocalizedObject(bundle), - gLiveSupport(gLiveSupport) + : GuiWindow(gLiveSupport, + bundle, + WidgetConstants::schedulerWindowTitleImage, + windowOpenerButton) { try { set_title(*getResourceUstring("windowTitle")); @@ -296,14 +297,3 @@ SchedulerWindow :: onDeleteItem(void) throw () } } - -/*------------------------------------------------------------------------------ - * Event handler for the close button getting clicked. - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: onCloseButtonClicked (void) throw () -{ - gLiveSupport->putWindowPosition(shared_from_this()); - hide(); -} - diff --git a/livesupport/src/products/gLiveSupport/src/SchedulerWindow.h b/livesupport/src/products/gLiveSupport/src/SchedulerWindow.h index 5a8a2fd26..4a2779ce9 100644 --- a/livesupport/src/products/gLiveSupport/src/SchedulerWindow.h +++ b/livesupport/src/products/gLiveSupport/src/SchedulerWindow.h @@ -50,7 +50,7 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/WhiteWindow.h" +#include "GuiWindow.h" #include "GLiveSupport.h" namespace LiveSupport { @@ -91,7 +91,7 @@ using namespace LiveSupport::Core; * @author $Author$ * @version $Revision$ */ -class SchedulerWindow : public WhiteWindow, public LocalizedObject +class SchedulerWindow : public GuiWindow { protected: @@ -139,11 +139,6 @@ class SchedulerWindow : public WhiteWindow, public LocalizedObject }; - /** - * The GLiveSupport object, holding the state of the application. - */ - Ptr::Ref gLiveSupport; - /** * The date selected for display. */ @@ -211,23 +206,22 @@ class SchedulerWindow : public WhiteWindow, public LocalizedObject virtual void onDeleteItem(void) throw (); - /** - * Signal handler for the close button clicked. - */ - virtual void - onCloseButtonClicked(void) throw (); - public: /** * Constructor. * - * @param gLiveSupport the GLiveSupport, application object. - * @param bundle the resource bundle holding the localized - * resources for this window + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. */ SchedulerWindow(Ptr::Ref gLiveSupport, - Ptr::Ref bundle) throw (); + Ptr::Ref bundle, + Button * windowOpenerButton) + throw (); /** * Virtual destructor. diff --git a/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx b/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx index 79d423f0c..46a1afe58 100644 --- a/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx @@ -67,14 +67,15 @@ static const Glib::ustring windowName = "scratchpadWindow"; /*------------------------------------------------------------------------------ * Constructor. *----------------------------------------------------------------------------*/ -ScratchpadWindow :: ScratchpadWindow (Ptr::Ref gLiveSupport, - Ptr::Ref bundle) +ScratchpadWindow :: ScratchpadWindow ( + Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + Button * windowOpenerButton) throw () - : WhiteWindow(WidgetConstants::scratchpadWindowTitleImage, - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners()), - LocalizedObject(bundle), - gLiveSupport(gLiveSupport) + : GuiWindow(gLiveSupport, + bundle, + WidgetConstants::scratchpadWindowTitleImage, + windowOpenerButton) { Ptr::Ref widgetFactory = WidgetFactory::getInstance(); @@ -453,6 +454,7 @@ ScratchpadWindow :: onSchedulePlaylist(void) throw () Ptr::Ref scheduleWindow; scheduleWindow.reset(new SchedulePlaylistWindow(gLiveSupport, bundle, + 0, /* no button */ playlist)); Gtk::Main::run(*scheduleWindow); @@ -546,17 +548,6 @@ ScratchpadWindow :: isSelectionSingle(void) throw () } -/*------------------------------------------------------------------------------ - * The event when the close button has been clicked. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onCloseButtonClicked(void) throw () -{ - gLiveSupport->putWindowPosition(shared_from_this()); - hide(); -} - - /*------------------------------------------------------------------------------ * Add an item to the Scratchpad. *----------------------------------------------------------------------------*/ diff --git a/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.h b/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.h index 1f2c727f5..d201d3115 100644 --- a/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.h +++ b/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.h @@ -48,9 +48,9 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/WhiteWindow.h" #include "LiveSupport/Widgets/Button.h" #include "LiveSupport/Widgets/PlayableTreeModelColumnRecord.h" +#include "GuiWindow.h" #include "CuePlayer.h" #include "GLiveSupport.h" @@ -75,8 +75,7 @@ using namespace LiveSupport::Widgets; * @author $Author$ * @version $Revision$ */ -class ScratchpadWindow : public WhiteWindow, - public LocalizedObject +class ScratchpadWindow : public GuiWindow { private: /** @@ -166,11 +165,6 @@ class ScratchpadWindow : public WhiteWindow, */ Gtk::TreeRow currentRow; - /** - * The GLiveSupport object, holding the state of the application. - */ - Ptr::Ref gLiveSupport; - /** * The main container in the window. */ @@ -307,23 +301,22 @@ class ScratchpadWindow : public WhiteWindow, virtual void onAddToLiveMode(void) throw (); - /** - * Function to catch the event of the close button being pressed. - */ - virtual void - onCloseButtonClicked(void) throw (); - public: /** * Constructor. * - * @param gLiveSupport the GLiveSupport, application object. - * @param bundle the resource bundle holding the localized - * resources for this window + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. */ - ScratchpadWindow(Ptr::Ref gLiveSupport, - Ptr::Ref bundle) throw (); + ScratchpadWindow(Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + Button * windowOpenerButton) + throw (); /** * Virtual destructor. diff --git a/livesupport/src/products/gLiveSupport/src/SearchWindow.cxx b/livesupport/src/products/gLiveSupport/src/SearchWindow.cxx index ec5b9413a..2734bd3be 100644 --- a/livesupport/src/products/gLiveSupport/src/SearchWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SearchWindow.cxx @@ -67,13 +67,13 @@ using namespace LiveSupport::GLiveSupport; * Constructor. *----------------------------------------------------------------------------*/ SearchWindow :: SearchWindow (Ptr::Ref gLiveSupport, - Ptr::Ref bundle) + Ptr::Ref bundle, + Button * windowOpenerButton) throw () - : WhiteWindow(WidgetConstants::searchWindowTitleImage, - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners()), - LocalizedObject(bundle), - gLiveSupport(gLiveSupport) + : GuiWindow(gLiveSupport, + bundle, + WidgetConstants::searchWindowTitleImage, + windowOpenerButton) { Gtk::Box * simpleSearchView = constructSimpleSearchView(); Gtk::Box * advancedSearchView = constructAdvancedSearchView(); @@ -491,14 +491,3 @@ SearchWindow :: onDoubleClick(const Gtk::TreeModel::Path & path, onAddToScratchpad(); } - -/*------------------------------------------------------------------------------ - * The event when the close button has been clicked. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onCloseButtonClicked(void) throw () -{ - gLiveSupport->putWindowPosition(shared_from_this()); - hide(); -} - diff --git a/livesupport/src/products/gLiveSupport/src/SearchWindow.h b/livesupport/src/products/gLiveSupport/src/SearchWindow.h index 71c019a96..e44263b80 100644 --- a/livesupport/src/products/gLiveSupport/src/SearchWindow.h +++ b/livesupport/src/products/gLiveSupport/src/SearchWindow.h @@ -47,9 +47,9 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/WhiteWindow.h" #include "LiveSupport/Widgets/Button.h" #include "LiveSupport/Widgets/PlayableTreeModelColumnRecord.h" +#include "GuiWindow.h" #include "AdvancedSearchEntry.h" #include "BrowseEntry.h" #include "GLiveSupport.h" @@ -75,7 +75,7 @@ using namespace LiveSupport::Widgets; * @author $Author$ * @version $Revision$ */ -class SearchWindow : public WhiteWindow, public LocalizedObject +class SearchWindow : public GuiWindow { private: @@ -250,32 +250,23 @@ class SearchWindow : public WhiteWindow, public LocalizedObject */ Gtk::Menu * contextMenu; - /** - * The GLiveSupport object, holding the state of the application. - */ - Ptr::Ref gLiveSupport; - - - protected: - - /** - * Function to catch the event of the close button being pressed. - */ - virtual void - onCloseButtonClicked(void) throw (); - public: /** * Constructor. * - * @param gLiveSupport the GLiveSupport, application object. - * @param bundle the resource bundle holding the localized - * resources for this window + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. */ SearchWindow(Ptr::Ref gLiveSupport, - Ptr::Ref bundle) throw (); + Ptr::Ref bundle, + Button * windowOpenerButton) + throw (); /** * Virtual destructor. diff --git a/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx b/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx index 26f836a5a..952e674ff 100644 --- a/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx @@ -67,15 +67,15 @@ static const Glib::ustring windowName = "simplePlaylistManagementWindow"; * Constructor. *----------------------------------------------------------------------------*/ SimplePlaylistManagementWindow :: SimplePlaylistManagementWindow ( - Ptr::Ref gLiveSupport, - Ptr::Ref bundle) + Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + Button * windowOpenerButton) throw () - : WhiteWindow(WidgetConstants::playlistsWindowTitleImage, - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners()), - LocalizedObject(bundle), - isPlaylistModified(false), - gLiveSupport(gLiveSupport) + : GuiWindow(gLiveSupport, + bundle, + WidgetConstants::playlistsWindowTitleImage, + windowOpenerButton), + isPlaylistModified(false) { Ptr::Ref wf = WidgetFactory::getInstance(); @@ -302,18 +302,6 @@ SimplePlaylistManagementWindow :: onSaveButtonClicked(void) throw () } -/*------------------------------------------------------------------------------ - * Signal handler for the close button getting clicked. - *----------------------------------------------------------------------------*/ -void -SimplePlaylistManagementWindow :: onCloseButtonClicked(void) throw () -{ - if (cancelPlaylist()) { - closeWindow(); - } -} - - /*------------------------------------------------------------------------------ * Cancel the edited playlist, after asking for confirmation. *----------------------------------------------------------------------------*/ diff --git a/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h b/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h index 9d2b05dcc..57a76e55c 100644 --- a/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h +++ b/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h @@ -48,10 +48,10 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/WhiteWindow.h" #include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" #include "LiveSupport/Widgets/ZebraTreeView.h" #include "LiveSupport/Widgets/DialogWindow.h" +#include "GuiWindow.h" #include "GLiveSupport.h" namespace LiveSupport { @@ -90,8 +90,7 @@ using namespace LiveSupport::Widgets; * @author $Author$ * @version $Revision$ */ -class SimplePlaylistManagementWindow : public WhiteWindow, - public LocalizedObject +class SimplePlaylistManagementWindow : public GuiWindow { private: @@ -189,12 +188,6 @@ class SimplePlaylistManagementWindow : public WhiteWindow, void onSaveButtonClicked(void) throw (); - /** - * Signal handler for the close button clicked. - */ - void - onCloseButtonClicked(void) throw (); - /** * Signal handler for the "lock fades" check button toggled. */ @@ -331,12 +324,6 @@ class SimplePlaylistManagementWindow : public WhiteWindow, } }; - - /** - * The GLiveSupport object, holding the state of the application. - */ - Ptr::Ref gLiveSupport; - /** * The column model. */ @@ -398,13 +385,18 @@ class SimplePlaylistManagementWindow : public WhiteWindow, /** * Constructor. * - * @param gLiveSupport the GLiveSupport, application object. - * @param bundle the resource bundle holding the localized - * resources for this window + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. */ - SimplePlaylistManagementWindow(Ptr::Ref gLiveSupport, - Ptr::Ref bundle) - throw (); + SimplePlaylistManagementWindow( + Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + Button * windowOpenerButton) + throw (); /** * Virtual destructor. diff --git a/livesupport/src/products/gLiveSupport/src/UploadFileWindow.cxx b/livesupport/src/products/gLiveSupport/src/UploadFileWindow.cxx index ed135125f..99763bb8b 100644 --- a/livesupport/src/products/gLiveSupport/src/UploadFileWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/UploadFileWindow.cxx @@ -64,14 +64,15 @@ using namespace LiveSupport::GLiveSupport; /*------------------------------------------------------------------------------ * Constructor. *----------------------------------------------------------------------------*/ -UploadFileWindow :: UploadFileWindow (Ptr::Ref gLiveSupport, - Ptr::Ref bundle) +UploadFileWindow :: UploadFileWindow ( + Ptr::Ref gLiveSupport, + Ptr::Ref bundle, + Button * windowOpenerButton) throw () - : WhiteWindow("", - Colors::White, - WidgetFactory::getInstance()->getWhiteWindowCorners()), - LocalizedObject(bundle), - gLiveSupport(gLiveSupport) + : GuiWindow(gLiveSupport, + bundle, + "", + windowOpenerButton) { isAudioClipValid = false; @@ -433,7 +434,6 @@ UploadFileWindow :: onCloseButtonClicked(void) throw () statusBar->set_text(""); isAudioClipValid = false; - gLiveSupport->putWindowPosition(shared_from_this()); hide(); } diff --git a/livesupport/src/products/gLiveSupport/src/UploadFileWindow.h b/livesupport/src/products/gLiveSupport/src/UploadFileWindow.h index 7f89a7caa..90a2f54dc 100644 --- a/livesupport/src/products/gLiveSupport/src/UploadFileWindow.h +++ b/livesupport/src/products/gLiveSupport/src/UploadFileWindow.h @@ -53,9 +53,8 @@ #include "LiveSupport/Widgets/EntryBin.h" #include "LiveSupport/Widgets/ComboBoxText.h" #include "LiveSupport/Widgets/Notebook.h" -#include "LiveSupport/Widgets/WhiteWindow.h" #include "LiveSupport/Widgets/ScrolledWindow.h" - +#include "GuiWindow.h" #include "GLiveSupport.h" #include "MasterPanelUserInfoWidget.h" @@ -90,7 +89,7 @@ using namespace LiveSupport::Widgets; * @author $Author$ * @version $Revision$ */ -class UploadFileWindow : public WhiteWindow, public LocalizedObject +class UploadFileWindow : public GuiWindow { protected: /** @@ -178,11 +177,6 @@ class UploadFileWindow : public WhiteWindow, public LocalizedObject */ Gtk::Label * statusBar; - /** - * The gLiveSupport object, handling the logic of the application. - */ - Ptr::Ref gLiveSupport; - /** * The name of the file to upload. */ @@ -248,12 +242,16 @@ class UploadFileWindow : public WhiteWindow, public LocalizedObject /** * Constructor. * - * @param gLiveSupport the gLiveSupport object, handling the - * logic of the application - * @param bundle the resource bundle holding localized resources + * @param gLiveSupport the gLiveSupport object, containing + * all the vital info. + * @param bundle the resource bundle holding the localized + * resources for this window. + * @param windowOpenerButton the button which was pressed to open + * this window. */ UploadFileWindow(Ptr::Ref gLiveSupport, - Ptr::Ref bundle) + Ptr::Ref bundle, + Button * windowOpenerButton) throw (); /**