From 782617cd74411b2ff6f9744e7740e434194f540a Mon Sep 17 00:00:00 2001 From: fgerlits Date: Tue, 19 Apr 2005 08:28:38 +0000 Subject: [PATCH] added (so far, empty) Search window --- .../LiveSupport/Widgets/WidgetFactory.h | 11 +++--- .../modules/widgets/src/WhiteWindow.cxx | 5 +-- .../modules/widgets/src/WidgetFactory.cxx | 20 +++++++++-- .../products/gLiveSupport/etc/Makefile.in | 7 ++-- .../gLiveSupport/src/MasterPanelWindow.cxx | 36 +++++++++++++++++-- .../gLiveSupport/src/MasterPanelWindow.h | 31 ++++++++++++++-- livesupport/products/gLiveSupport/var/hu.txt | 6 ++++ .../products/gLiveSupport/var/root.txt | 5 +++ 8 files changed, 103 insertions(+), 18 deletions(-) diff --git a/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h b/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h index e04cc646f..95f993e86 100644 --- a/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h +++ b/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.14 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.15 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h,v $ ------------------------------------------------------------------------------*/ @@ -88,8 +88,8 @@ class WhiteWindow; * * * - * @author $Author: maroy $ - * @version $Revision: 1.14 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.15 $ */ class WidgetFactory : virtual public Configurable @@ -113,7 +113,8 @@ class WidgetFactory : * The list of available miscellaneous images. */ typedef enum { resizeImage, - scratchpadWindowTitleImage } + scratchpadWindowTitleImage, + searchWindowTitleImage } ImageType; diff --git a/livesupport/modules/widgets/src/WhiteWindow.cxx b/livesupport/modules/widgets/src/WhiteWindow.cxx index 5ee0dc93a..3f6e4c80e 100644 --- a/livesupport/modules/widgets/src/WhiteWindow.cxx +++ b/livesupport/modules/widgets/src/WhiteWindow.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.13 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.14 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WhiteWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -104,6 +104,7 @@ WhiteWindow :: constructWindow(Colors::ColorName backgroundColor, set_decorated(false); defaultWidth = -1; defaultHeight = -1; + set_resizable(resizable); Ptr::Ref wf = WidgetFactory::getInstance(); diff --git a/livesupport/modules/widgets/src/WidgetFactory.cxx b/livesupport/modules/widgets/src/WidgetFactory.cxx index f0519a3c9..b1018053f 100644 --- a/livesupport/modules/widgets/src/WidgetFactory.cxx +++ b/livesupport/modules/widgets/src/WidgetFactory.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.16 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.17 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $ ------------------------------------------------------------------------------*/ @@ -196,11 +196,17 @@ static const std::string comboBoxRightName = "combo/right.png"; static const std::string resizeImageName = "whiteWindow/resize.png"; /** - * The name of the image for the title of the login window. + * The name of the image for the title of the scratchpad window. */ static const std::string scratchpadWindowTitleImageName = "titleImages/scratchpadWindowTitle.png"; +/** + * The name of the image for the title of the search window. + */ +static const std::string searchWindowTitleImageName + = "titleImages/searchWindowTitle.png"; + /* =============================================== local function prototypes */ @@ -402,12 +408,20 @@ WidgetFactory :: createImage(ImageType imageName) throw () Glib::RefPtr rawImage; switch (imageName) { + case resizeImage: rawImage = loadImage(resizeImageName); break; + + case scratchpadWindowTitleImage: rawImage = loadImage(scratchpadWindowTitleImageName); break; + + case searchWindowTitleImage: + rawImage = loadImage(searchWindowTitleImageName); + break; + default: return 0; } diff --git a/livesupport/products/gLiveSupport/etc/Makefile.in b/livesupport/products/gLiveSupport/etc/Makefile.in index e98670582..c65b029df 100644 --- a/livesupport/products/gLiveSupport/etc/Makefile.in +++ b/livesupport/products/gLiveSupport/etc/Makefile.in @@ -20,8 +20,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # -# Author : $Author: maroy $ -# Version : $Revision: 1.28 $ +# Author : $Author: fgerlits $ +# Version : $Revision: 1.29 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/Makefile.in,v $ # # @configure_input@ @@ -189,7 +189,8 @@ G_LIVESUPPORT_OBJS = ${TMP_DIR}/GLiveSupport.o \ ${TMP_DIR}/ScratchpadWindow.o \ ${TMP_DIR}/SimplePlaylistManagementWindow.o \ ${TMP_DIR}/SchedulerWindow.o \ - ${TMP_DIR}/SchedulePlaylistWindow.o + ${TMP_DIR}/SchedulePlaylistWindow.o \ + ${TMP_DIR}/SearchWindow.o G_LIVESUPPORT_RES = ${TMP_DIR}/${PACKAGE_NAME}_root.res \ ${TMP_DIR}/${PACKAGE_NAME}_en.res \ diff --git a/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx b/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx index 24c0ec85c..d0465a54e 100644 --- a/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx +++ b/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.18 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.19 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -200,6 +200,8 @@ MasterPanelWindow :: changeLanguage(Ptr::Ref bundle) *getResourceUstring("simplePlaylistMgmtButtonLabel")); schedulerButton = wf->createButton( *getResourceUstring("schedulerButtonLabel")); + searchButton = wf->createButton( + *getResourceUstring("searchButtonLabel")); } catch (std::invalid_argument &e) { std::cerr << e.what() << std::endl; } @@ -219,6 +221,9 @@ MasterPanelWindow :: changeLanguage(Ptr::Ref bundle) buttonBar->attach(*schedulerButton, 3, 4, 0, 1, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 5, 0); + buttonBar->attach(*searchButton, 4, 5, 0, 1, + Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, + 5, 0); // re-bind events to the buttons uploadFileButton->signal_clicked().connect(sigc::mem_fun(*this, @@ -230,7 +235,8 @@ MasterPanelWindow :: changeLanguage(Ptr::Ref bundle) &MasterPanelWindow::onSimplePlaylistMgmtButtonClicked)); schedulerButton->signal_clicked().connect(sigc::mem_fun(*this, &MasterPanelWindow::onSchedulerButtonClicked)); - + searchButton->signal_clicked().connect(sigc::mem_fun(*this, + &MasterPanelWindow::onSearchButtonClicked)); } @@ -386,6 +392,30 @@ MasterPanelWindow :: onSchedulerButtonClicked(void) throw () } +/*------------------------------------------------------------------------------ + * The event when the Search button has been clicked. + *----------------------------------------------------------------------------*/ +void +MasterPanelWindow :: onSearchButtonClicked(void) throw () +{ + if (!searchWindow.get()) { + Ptr::Ref bundle; + try { + bundle = getBundle("searchWindow"); + } catch (std::invalid_argument &e) { + std::cerr << e.what() << std::endl; + return; + } + + searchWindow.reset(new SearchWindow(gLiveSupport, bundle)); + } + + if (!searchWindow->is_visible()) { + searchWindow->show(); + } +} + + /*------------------------------------------------------------------------------ * Show only the UI components that are visible when no one is logged in *----------------------------------------------------------------------------*/ diff --git a/livesupport/products/gLiveSupport/src/MasterPanelWindow.h b/livesupport/products/gLiveSupport/src/MasterPanelWindow.h index 0e1f8fe96..551ea60fc 100644 --- a/livesupport/products/gLiveSupport/src/MasterPanelWindow.h +++ b/livesupport/products/gLiveSupport/src/MasterPanelWindow.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.11 $ + Version : $Revision: 1.12 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.h,v $ ------------------------------------------------------------------------------*/ @@ -53,6 +53,7 @@ #include "ScratchpadWindow.h" #include "SimplePlaylistManagementWindow.h" #include "SchedulerWindow.h" +#include "SearchWindow.h" namespace LiveSupport { @@ -88,7 +89,7 @@ using namespace LiveSupport::Widgets; * * * @author $Author: fgerlits $ - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ */ class MasterPanelWindow : public Gtk::Window, public LocalizedObject { @@ -199,6 +200,11 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject */ Button * schedulerButton; + /** + * The button to invoke the Search Window. + */ + Button * searchButton; + /** * The gLiveSupport object, handling the logic of the application. */ @@ -219,6 +225,11 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject */ Ptr::Ref schedulerWindow; + /** + * The one and only search window. + */ + Ptr::Ref searchWindow; + /** * Function that updates timeLabel with the current time. * This is called by GTK at regular intervals. @@ -274,6 +285,13 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject virtual void onSchedulerButtonClicked(void) throw (); + /** + * Function to catch the event of the Search button + * button being pressed. + */ + virtual void + onSearchButtonClicked(void) throw (); + public: /** @@ -365,6 +383,15 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject schedulerWindow->showContents(); } + /** + * Update the Search Window + */ + void + updateSearchWindow(void) throw () + { + // this will create, open and display the window. + onSearchButtonClicked(); + } }; /* ================================================= external data structures */ diff --git a/livesupport/products/gLiveSupport/var/hu.txt b/livesupport/products/gLiveSupport/var/hu.txt index a62bb3561..b2266ba9c 100644 --- a/livesupport/products/gLiveSupport/var/hu.txt +++ b/livesupport/products/gLiveSupport/var/hu.txt @@ -9,6 +9,7 @@ hu:table scratchpadButtonLabel:string { "praktikus csupor" } simplePlaylistMgmtButtonLabel:string { "egyszerű playlist kezelés" } schedulerButtonLabel:string { "időzítő" } + searchButtonLabel:string { "keresés" } localeNotAvailableMsg:string { "A {0} nyelv nem elérhető" } schedulerNotReachableMsg:string { "Az időzitő szerver nem elérhető" } @@ -127,5 +128,10 @@ hu:table scheduleButtonLabel:string { "időzít" } closeButtonLabel:string { "bezár" } } + + searchWindow:table + { + windowTitle:string { "LiveSupport Keresés Ablak" } + } } diff --git a/livesupport/products/gLiveSupport/var/root.txt b/livesupport/products/gLiveSupport/var/root.txt index 93f13eaef..657e51773 100644 --- a/livesupport/products/gLiveSupport/var/root.txt +++ b/livesupport/products/gLiveSupport/var/root.txt @@ -9,6 +9,7 @@ root:table scratchpadButtonLabel:string { "scratchpad" } simplePlaylistMgmtButtonLabel:string { "simple playlist management" } schedulerButtonLabel:string { "scheduler" } + searchButtonLabel:string { "search" } localeNotAvailableMsg:string { "Locale {0} not available" } schedulerNotReachableMsg:string { "Scheduler server not available" } @@ -130,5 +131,9 @@ root:table closeButtonLabel:string { "close" } } + searchWindow:table + { + windowTitle:string { "LiveSupport Search/Browse Window" } + } }