fixed toggle button behavior related to selected state;

cleaned up window position storage and retrieval
This commit is contained in:
fgerlits 2006-03-15 20:13:04 +00:00
parent 82a509eed2
commit 3fa5f28259
23 changed files with 553 additions and 308 deletions

View file

@ -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 \

View file

@ -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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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();
}

View file

@ -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 <unicode/resbund.h>
#include <glibmm.h>
#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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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

View file

@ -68,14 +68,14 @@ static const Glib::ustring windowName = "liveModeWindow";
/*------------------------------------------------------------------------------
* Constructor.
*----------------------------------------------------------------------------*/
LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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();
}

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) throw ();
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ();
/**
* Virtual destructor.

View file

@ -61,13 +61,14 @@ using namespace LiveSupport::GLiveSupport;
* Constructor.
*----------------------------------------------------------------------------*/
LoginWindow :: LoginWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ()
: WhiteWindow("",
Colors::White,
WidgetFactory::getInstance()->getWhiteWindowCorners(),
0),
LocalizedObject(bundle)
: GuiWindow(gLiveSupport,
bundle,
"",
windowOpenerButton,
0 /* not resizable */)
{
this->gLiveSupport = gLiveSupport;

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) throw ();
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ();
/**
* Virtual destructor.

View file

@ -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<LoginWindow>::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 |

View file

@ -388,8 +388,9 @@ MasterPanelWindow :: updateLiveModeWindow(Ptr<Playable>::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<Playable>::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<Playable>::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<Playable>::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();

View file

@ -67,13 +67,13 @@ static const Glib::ustring windowName = "optionsWindow";
* Constructor.
*----------------------------------------------------------------------------*/
OptionsWindow :: OptionsWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ()
: WhiteWindow("",
Colors::White,
WidgetFactory::getInstance()->getWhiteWindowCorners()),
LocalizedObject(bundle),
gLiveSupport(gLiveSupport)
: GuiWindow(gLiveSupport,
bundle,
"",
windowOpenerButton)
{
Ptr<WidgetFactory>::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();
}

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) throw ();
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ();
/**
* Virtual destructor.

View file

@ -62,15 +62,15 @@ using namespace LiveSupport::GLiveSupport;
* Constructor.
*----------------------------------------------------------------------------*/
SchedulePlaylistWindow :: SchedulePlaylistWindow (
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle,
Ptr<Playlist>::Ref playlist)
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton,
Ptr<Playlist>::Ref playlist)
throw ()
: WhiteWindow(WidgetConstants::schedulerWindowTitleImage,
Colors::White,
WidgetFactory::getInstance()->getWhiteWindowCorners()),
LocalizedObject(bundle),
gLiveSupport(gLiveSupport),
: GuiWindow(gLiveSupport,
bundle,
WidgetConstants::schedulerWindowTitleImage,
windowOpenerButton),
playlist(playlist)
{
Ptr<WidgetFactory>::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();
}

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton,
Ptr<Playlist>::Ref playlist)
throw ();

View file

@ -65,14 +65,15 @@ static const Glib::ustring windowName = "schedulerWindow";
/*------------------------------------------------------------------------------
* Constructor.
*----------------------------------------------------------------------------*/
SchedulerWindow :: SchedulerWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
SchedulerWindow :: SchedulerWindow (
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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();
}

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) throw ();
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ();
/**
* Virtual destructor.

View file

@ -67,14 +67,15 @@ static const Glib::ustring windowName = "scratchpadWindow";
/*------------------------------------------------------------------------------
* Constructor.
*----------------------------------------------------------------------------*/
ScratchpadWindow :: ScratchpadWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
ScratchpadWindow :: ScratchpadWindow (
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ()
: WhiteWindow(WidgetConstants::scratchpadWindowTitleImage,
Colors::White,
WidgetFactory::getInstance()->getWhiteWindowCorners()),
LocalizedObject(bundle),
gLiveSupport(gLiveSupport)
: GuiWindow(gLiveSupport,
bundle,
WidgetConstants::scratchpadWindowTitleImage,
windowOpenerButton)
{
Ptr<WidgetFactory>::Ref widgetFactory = WidgetFactory::getInstance();
@ -453,6 +454,7 @@ ScratchpadWindow :: onSchedulePlaylist(void) throw ()
Ptr<SchedulePlaylistWindow>::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.
*----------------------------------------------------------------------------*/

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) throw ();
ScratchpadWindow(Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ();
/**
* Virtual destructor.

View file

@ -67,13 +67,13 @@ using namespace LiveSupport::GLiveSupport;
* Constructor.
*----------------------------------------------------------------------------*/
SearchWindow :: SearchWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
Ptr<ResourceBundle>::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();
}

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) throw ();
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ();
/**
* Virtual destructor.

View file

@ -67,15 +67,15 @@ static const Glib::ustring windowName = "simplePlaylistManagementWindow";
* Constructor.
*----------------------------------------------------------------------------*/
SimplePlaylistManagementWindow :: SimplePlaylistManagementWindow (
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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<WidgetFactory>::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.
*----------------------------------------------------------------------------*/

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
throw ();
SimplePlaylistManagementWindow(
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ();
/**
* Virtual destructor.

View file

@ -64,14 +64,15 @@ using namespace LiveSupport::GLiveSupport;
/*------------------------------------------------------------------------------
* Constructor.
*----------------------------------------------------------------------------*/
UploadFileWindow :: UploadFileWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
UploadFileWindow :: UploadFileWindow (
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::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();
}

View file

@ -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<GLiveSupport>::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<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle)
Ptr<ResourceBundle>::Ref bundle,
Button * windowOpenerButton)
throw ();
/**