*
* For a description of the resourceBundle,
@@ -95,7 +100,7 @@ class MasterPanelWindow;
* respective documentation.
*
* @author $Author: maroy $
- * @version $Revision: 1.17 $
+ * @version $Revision: 1.18 $
* @see LocalizedObject#getBundle(const xmlpp::Element &)
* @see AuthenticationClientFactory
* @see StorageClientFactory
@@ -137,6 +142,11 @@ class GLiveSupport : public LocalizedConfigurable,
*/
Ptr::Ref storage;
+ /**
+ * The widget factory, containing our own widgets.
+ */
+ Ptr::Ref widgetFactory;
+
/**
* The scheduler client, used to access the scheduler daemon.
*/
diff --git a/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx b/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx
index 55edad3a3..2952db6f2 100644
--- a/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx
+++ b/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx
@@ -22,7 +22,7 @@
Author : $Author: maroy $
- Version : $Revision: 1.3 $
+ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx,v $
------------------------------------------------------------------------------*/
@@ -43,6 +43,7 @@
#include "MasterPanelUserInfoWidget.h"
+using namespace LiveSupport::Widgets;
using namespace LiveSupport::GLiveSupport;
/* =================================================== local data structures */
@@ -68,7 +69,7 @@ MasterPanelUserInfoWidget :: MasterPanelUserInfoWidget (
this->gLiveSupport = gLiveSupport;
loggedIn = false;
- logInOutButton.reset(new Gtk::Button());
+ logInOutButton = WidgetFactory::getInstance()->createButton("");
logInOutSignalConnection =
logInOutButton->signal_clicked().connect(sigc::mem_fun(*this,
&MasterPanelUserInfoWidget::onLoginButtonClicked));
diff --git a/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.h b/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.h
index a6f49c2a6..703d7378e 100644
--- a/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.h
+++ b/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.h
@@ -22,7 +22,7 @@
Author : $Author: maroy $
- Version : $Revision: 1.2 $
+ Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelUserInfoWidget.h,v $
------------------------------------------------------------------------------*/
@@ -51,6 +51,7 @@
namespace LiveSupport {
namespace GLiveSupport {
+using namespace LiveSupport;
using namespace LiveSupport::Core;
/* ================================================================ constants */
@@ -67,7 +68,7 @@ using namespace LiveSupport::Core;
* This widget handles login and login info display.
*
* @author $Author: maroy $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
class MasterPanelUserInfoWidget : public Gtk::Table,
public LocalizedObject
@@ -76,7 +77,7 @@ class MasterPanelUserInfoWidget : public Gtk::Table,
/**
* The login / logout button.
*/
- Ptr::Ref logInOutButton;
+ Ptr::Ref logInOutButton;
/**
* A label to display the currently logged in user.
diff --git a/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx b/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx
index 8eb821e02..84873bb10 100644
--- a/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx
+++ b/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx
@@ -22,7 +22,7 @@
Author : $Author: maroy $
- Version : $Revision: 1.9 $
+ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx,v $
------------------------------------------------------------------------------*/
@@ -44,6 +44,7 @@
#include "MasterPanelWindow.h"
+using namespace LiveSupport;
using namespace LiveSupport::GLiveSupport;
/* =================================================== local data structures */
@@ -67,37 +68,71 @@ MasterPanelWindow :: MasterPanelWindow (Ptr::Ref gLiveSupport,
{
this->gLiveSupport = gLiveSupport;
- lsLogoWidget.reset(new Gtk::Label("lsLogo"));
- nowPlayingWidget.reset(new Gtk::Label("now playing"));
- vuMeterWidget.reset(new Gtk::Label("VU meter"));
- nextPlayingWidget.reset(new Gtk::Label("next playing"));
- onAirWidget.reset(new Gtk::Label("on air"));
- radioLogoWidget.reset(new Gtk::Label("radio logo"));
- userInfoWidget.reset(new MasterPanelUserInfoWidget(gLiveSupport, bundle));
+ Ptr::Ref widgetFactory = WidgetFactory::getInstance();
+
+ // TODO: remove hard-coded station logo path reference
+ radioLogoWidget.reset(new Gtk::Image("var/stationLogo.png"));
// set up the layout, which is a button box
layout.reset(new Gtk::Table());
- // set the localized resources
- changeLanguage(bundle);
-
// set up the time label
timeWidget.reset(new Gtk::Label("time"));
+ timeBin = widgetFactory->createBlueBin();
+ timeBin->add(*timeWidget);
+
+ // set up the now playing widget
+ nowPlayingWidget.reset(new Gtk::Label("now playing"));
+ nowPlayingBin = widgetFactory->createDarkBlueBin();
+ nowPlayingBin->add(*nowPlayingWidget);
+
+ // set up the VU meter widget
+ vuMeterWidget.reset(new Gtk::Label("VU meter"));
+ vuMeterBin = widgetFactory->createBlueBin();
+ vuMeterBin->add(*vuMeterWidget);
+
+ // set up the next playing widget
+ nextPlayingWidget.reset(new Gtk::Label("next playing"));
+ nextPlayingBin = widgetFactory->createBlueBin();
+ nextPlayingBin->add(*nextPlayingWidget);
+
+ // create the bottom bar
+ bottomBar.reset(new Gtk::Table());
+ buttonBar.reset(new Gtk::Table());
+ buttonBarAlignment.reset(new Gtk::Alignment(Gtk::ALIGN_LEFT,
+ Gtk::ALIGN_CENTER,
+ 0, 0));
+ buttonBarAlignment->add(*buttonBar);
+ userInfoWidget.reset(new MasterPanelUserInfoWidget(gLiveSupport, bundle));
+ userInfoAlignment.reset(new Gtk::Alignment(Gtk::ALIGN_RIGHT,
+ Gtk::ALIGN_CENTER,
+ 0, 0));
+ userInfoAlignment->add(*userInfoWidget);
+ bottomBar->attach(*buttonBarAlignment, 0, 1, 0, 1);
+ bottomBar->attach(*userInfoAlignment, 1, 2, 0, 1);
// set up the main window, and show everything
// all the localized widgets were set up in changeLanguage()
set_border_width(10);
- layout->attach(*lsLogoWidget, 0, 1, 0, 2);
- layout->attach(*timeWidget, 1, 2, 0, 2);
- layout->attach(*nowPlayingWidget, 2, 3, 0, 2);
- layout->attach(*vuMeterWidget, 3, 4, 0, 1);
- layout->attach(*nextPlayingWidget, 3, 4, 1, 2);
- layout->attach(*onAirWidget, 4, 5, 0, 1);
- layout->attach(*radioLogoWidget, 5, 6, 0, 1);
- layout->attach(*userInfoWidget, 4, 6, 1, 2);
+ layout->attach(*timeBin, 0, 1, 0, 2);
+ layout->attach(*nowPlayingBin, 1, 2, 0, 2);
+ layout->attach(*vuMeterBin, 2, 3, 0, 1);
+ layout->attach(*nextPlayingBin, 2, 3, 1, 2);
+ layout->attach(*radioLogoWidget, 3, 4, 0, 2);
+ layout->attach(*bottomBar, 0, 4, 2, 3);
add(*layout);
+ // set the background to white
+ bgColor = Gdk::Color();
+ bgColor.set_rgb(0xffff, 0xffff, 0xffff);
+ Glib::RefPtr colormap = get_default_colormap();
+ colormap->alloc_color(bgColor);
+ modify_bg(Gtk::STATE_NORMAL, bgColor);
+
+ // set the localized resources
+ changeLanguage(bundle);
+
// show what's there to see
showAnonymousUI();
@@ -127,14 +162,16 @@ MasterPanelWindow :: changeLanguage(Ptr::Ref bundle)
try {
set_title(*getResourceUstring("windowTitle"));
- uploadFileButton.reset(new Gtk::Button(
- *getResourceUstring("uploadFileButtonLabel")));
- djBagButton.reset(new Gtk::Button(
- *getResourceUstring("djBagButtonLabel")));
- simplePlaylistMgmtButton.reset(new Gtk::Button(
- *getResourceUstring("simplePlaylistMgmtButtonLabel")));
- schedulerButton.reset(new Gtk::Button(
- *getResourceUstring("schedulerButtonLabel")));
+ Ptr::Ref wf = WidgetFactory::getInstance();
+
+ uploadFileButton = wf->createButton(
+ *getResourceUstring("uploadFileButtonLabel"));
+ djBagButton = wf->createButton(
+ *getResourceUstring("djBagButtonLabel"));
+ simplePlaylistMgmtButton = wf->createButton(
+ *getResourceUstring("simplePlaylistMgmtButtonLabel"));
+ schedulerButton = wf->createButton(
+ *getResourceUstring("schedulerButtonLabel"));
} catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl;
}
@@ -142,10 +179,10 @@ MasterPanelWindow :: changeLanguage(Ptr::Ref bundle)
userInfoWidget->changeLanguage(bundle);
// re-attach the localized widgets to the layout
- layout->attach(*uploadFileButton, 0, 1, 2, 3);
- layout->attach(*djBagButton, 1, 2, 2, 3);
- layout->attach(*simplePlaylistMgmtButton, 2, 3, 2, 3);
- layout->attach(*schedulerButton, 3, 4, 2, 3);
+ buttonBar->attach(*uploadFileButton, 0, 1, 0, 1);
+ buttonBar->attach(*djBagButton, 1, 2, 0, 1);
+ buttonBar->attach(*simplePlaylistMgmtButton, 2, 3, 0, 1);
+ buttonBar->attach(*schedulerButton, 3, 4, 0, 1);
// re-bind events to the buttons
uploadFileButton->signal_clicked().connect(sigc::mem_fun(*this,
@@ -315,6 +352,7 @@ void
MasterPanelWindow :: showAnonymousUI(void) throw ()
{
show_all();
+ buttonBar->hide();
uploadFileButton->hide();
djBagButton->hide();
simplePlaylistMgmtButton->hide();
diff --git a/livesupport/products/gLiveSupport/src/MasterPanelWindow.h b/livesupport/products/gLiveSupport/src/MasterPanelWindow.h
index 4d8d13554..cc530f4be 100644
--- a/livesupport/products/gLiveSupport/src/MasterPanelWindow.h
+++ b/livesupport/products/gLiveSupport/src/MasterPanelWindow.h
@@ -22,7 +22,7 @@
Author : $Author: maroy $
- Version : $Revision: 1.7 $
+ Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.h,v $
------------------------------------------------------------------------------*/
@@ -42,6 +42,7 @@
#include
#include
+#include
#include
#include "LiveSupport/Core/Ptr.h"
@@ -58,6 +59,7 @@ namespace LiveSupport {
namespace GLiveSupport {
using namespace LiveSupport::Core;
+using namespace LiveSupport::Widgets;
/* ================================================================ constants */
@@ -72,19 +74,21 @@ using namespace LiveSupport::Core;
*
* The layout of the window is roughly the following:
*
- * +--- master panel --------------------------------------------------------+
- * | + LS logo + + time + + now ----+ + VU meter + + on-air + + radio logo + |
- * | | | | | | playing | | | | | | | |
- * | | | | | | | +----------+ +--------+ +------------+ |
- * | | | | | | | + next ----+ + user info ------------+ |
- * | | | | | | | | playing | | | |
- * | +---------+ +------+ +---------+ +----------+ +-----------------------+ |
- * | +-- button bar -------------------------------------------------------+ |
- * +-------------------------------------------------------------------------+
+ * +--- master panel ---------------------------------+
+ * | + time + + now ----+ + VU meter + + radio logo + |
+ * | | | | playing | | | | | |
+ * | | | | | +----------+ | | |
+ * | | | | | + next ----+ | | |
+ * | | | | | | playing | | | |
+ * | +------+ +---------+ +----------+ +------------+ |
+ * | +-- bottom bar --------------------------------+ |
+ * | | +-- button bar -----------+ +-- user info -+ | |
+ * | +----------------------------------------------+ |
+ * +--------------------------------------------------+
*
*
* @author $Author: maroy $
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
class MasterPanelWindow : public Gtk::Window, public LocalizedObject
{
@@ -95,9 +99,14 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
Ptr::Ref layout;
/**
- * The LiveSupport logo
+ * The background color.
*/
- Ptr::Ref lsLogoWidget;
+ Gdk::Color bgColor;
+
+ /**
+ * The container for the time widget
+ */
+ Ptr::Ref timeBin;
/**
* The time display
@@ -110,25 +119,40 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
*/
Ptr::Ref timer;
+ /**
+ * The container for the now playing widget
+ */
+ Ptr::Ref nowPlayingBin;
+
/**
* The 'now playing' display.
*/
Ptr::Ref nowPlayingWidget;
+ /**
+ * The container for the VU meter widget
+ */
+ Ptr::Ref vuMeterBin;
+
/**
* The VU meter display.
*/
Ptr::Ref vuMeterWidget;
+ /**
+ * The container for the next playing widget.
+ */
+ Ptr::Ref nextPlayingBin;
+
/**
* The 'next playing' display.
*/
Ptr::Ref nextPlayingWidget;
/**
- * The on-air indicator.
+ * The user info alignment helper.
*/
- Ptr::Ref onAirWidget;
+ Ptr::Ref userInfoAlignment;
/**
* The user info widget.
@@ -138,27 +162,42 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
/**
* The radio logo.
*/
- Ptr::Ref radioLogoWidget;
+ Ptr::Ref radioLogoWidget;
+
+ /**
+ * The bottom bar.
+ */
+ Ptr::Ref bottomBar;
+
+ /**
+ * The button bar alignment helper
+ */
+ Ptr::Ref buttonBarAlignment;
+
+ /**
+ * The button bar.
+ */
+ Ptr::Ref buttonBar;
/**
* The button to invoke the upload file window.
*/
- Ptr::Ref uploadFileButton;
+ Ptr