renamed AudioClipWindow to AudioClipListWindow

setting title of all windows based on a localized resource
This commit is contained in:
maroy 2004-12-03 08:32:27 +00:00
parent 8f25fba4b3
commit b5d3b9290a
7 changed files with 47 additions and 28 deletions

View file

@ -21,7 +21,7 @@
# #
# #
# Author : $Author: maroy $ # Author : $Author: maroy $
# Version : $Revision: 1.8 $ # Version : $Revision: 1.9 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/Makefile.in,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/Makefile.in,v $
# #
# @configure_input@ # @configure_input@
@ -143,7 +143,7 @@ G_LIVESUPPORT_OBJS = ${TMP_DIR}/GLiveSupport.o \
${TMP_DIR}/UiTestMainWindow.o \ ${TMP_DIR}/UiTestMainWindow.o \
${TMP_DIR}/GtkLocalizedObject.o \ ${TMP_DIR}/GtkLocalizedObject.o \
${TMP_DIR}/LoginWindow.o \ ${TMP_DIR}/LoginWindow.o \
${TMP_DIR}/AudioClipWindow.o ${TMP_DIR}/AudioClipListWindow.o
G_LIVESUPPORT_RES = ${TMP_DIR}/${PACKAGE_NAME}_root.res \ G_LIVESUPPORT_RES = ${TMP_DIR}/${PACKAGE_NAME}_root.res \
${TMP_DIR}/${PACKAGE_NAME}_en.res \ ${TMP_DIR}/${PACKAGE_NAME}_en.res \

View file

@ -23,7 +23,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.1 $ Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/AudioClipWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/AudioClipListWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -36,7 +36,7 @@
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include "AudioClipWindow.h" #include "AudioClipListWindow.h"
using namespace Glib; using namespace Glib;
@ -58,7 +58,8 @@ using namespace LiveSupport::GLiveSupport;
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Constructor. * Constructor.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
AudioClipWindow :: AudioClipWindow (Ptr<GLiveSupport>::Ref gLiveSupport, AudioClipListWindow :: AudioClipListWindow (
Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) Ptr<ResourceBundle>::Ref bundle)
throw () throw ()
: GtkLocalizedObject(bundle) : GtkLocalizedObject(bundle)
@ -66,6 +67,7 @@ AudioClipWindow :: AudioClipWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
this->gLiveSupport = gLiveSupport; this->gLiveSupport = gLiveSupport;
try { try {
set_title(*getResourceUstring("windowTitle"));
closeButton.reset(new Gtk::Button( closeButton.reset(new Gtk::Button(
*getResourceUstring("closeButtonLabel"))); *getResourceUstring("closeButtonLabel")));
} catch (std::invalid_argument &e) { } catch (std::invalid_argument &e) {
@ -78,10 +80,9 @@ AudioClipWindow :: AudioClipWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
closeButton->set_relief(Gtk::RELIEF_NORMAL); closeButton->set_relief(Gtk::RELIEF_NORMAL);
// Register the signal handler for the button getting clicked. // Register the signal handler for the button getting clicked.
closeButton->signal_clicked().connect(sigc::mem_fun(*this, closeButton->signal_clicked().connect(sigc::mem_fun(*this,
&AudioClipWindow::onCloseButtonClicked)); &AudioClipListWindow::onCloseButtonClicked));
set_title("LiveSupport Audio Clip Window");
set_border_width(5); set_border_width(5);
set_default_size(400, 200); set_default_size(400, 200);
@ -128,7 +129,7 @@ AudioClipWindow :: AudioClipWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
* Show all audio clips * Show all audio clips
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void void
AudioClipWindow :: showAllAudioClips(void) throw () AudioClipListWindow :: showAllAudioClips(void) throw ()
{ {
// list all audio clips // list all audio clips
Ptr<SessionId>::Ref sessionId; Ptr<SessionId>::Ref sessionId;
@ -166,7 +167,7 @@ AudioClipWindow :: showAllAudioClips(void) throw ()
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Destructor. * Destructor.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
AudioClipWindow :: ~AudioClipWindow (void) throw () AudioClipListWindow :: ~AudioClipListWindow (void) throw ()
{ {
} }
@ -175,7 +176,7 @@ AudioClipWindow :: ~AudioClipWindow (void) throw ()
* Event handler for the close button getting clicked. * Event handler for the close button getting clicked.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void void
AudioClipWindow :: onCloseButtonClicked (void) throw () AudioClipListWindow :: onCloseButtonClicked (void) throw ()
{ {
hide(); hide();
} }

View file

@ -23,11 +23,11 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.1 $ Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/AudioClipWindow.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/AudioClipListWindow.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
#ifndef AudioClipWindow_h #ifndef AudioClipListWindow_h
#define AudioClipWindow_h #define AudioClipListWindow_h
#ifndef __cplusplus #ifndef __cplusplus
#error This is a C++ include file #error This is a C++ include file
@ -69,7 +69,7 @@ using namespace LiveSupport::Core;
* @author $Author: maroy $ * @author $Author: maroy $
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
class AudioClipWindow : public Gtk::Window, public GtkLocalizedObject class AudioClipListWindow : public Gtk::Window, public GtkLocalizedObject
{ {
protected: protected:
@ -178,14 +178,14 @@ class AudioClipWindow : public Gtk::Window, public GtkLocalizedObject
* @param bundle the resource bundle holding the localized * @param bundle the resource bundle holding the localized
* resources for this window * resources for this window
*/ */
AudioClipWindow(Ptr<GLiveSupport>::Ref gLiveSupport, AudioClipListWindow(Ptr<GLiveSupport>::Ref gLiveSupport,
Ptr<ResourceBundle>::Ref bundle) throw (); Ptr<ResourceBundle>::Ref bundle) throw ();
/** /**
* Virtual destructor. * Virtual destructor.
*/ */
virtual virtual
~AudioClipWindow(void) throw (); ~AudioClipListWindow(void) throw ();
}; };
/* ================================================= external data structures */ /* ================================================= external data structures */
@ -197,5 +197,5 @@ class AudioClipWindow : public Gtk::Window, public GtkLocalizedObject
} // namespace GLiveSupport } // namespace GLiveSupport
} // namespace LiveSupport } // namespace LiveSupport
#endif // AudioClipWindow_h #endif // AudioClipListWindow_h

View file

@ -22,7 +22,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.4 $ Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LoginWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LoginWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -63,7 +63,7 @@ LoginWindow :: LoginWindow (Ptr<ResourceBundle>::Ref bundle)
: GtkLocalizedObject(bundle) : GtkLocalizedObject(bundle)
{ {
try { try {
table.reset(new Gtk::Table(2, 2, false)); set_title(*getResourceUstring("windowTitle"));
loginLabel.reset(new Gtk::Label(*getResourceUstring("loginLabel"))); loginLabel.reset(new Gtk::Label(*getResourceUstring("loginLabel")));
passwordLabel.reset(new Gtk::Label( passwordLabel.reset(new Gtk::Label(
*getResourceUstring("passwordLabel"))); *getResourceUstring("passwordLabel")));
@ -122,6 +122,7 @@ LoginWindow :: LoginWindow (Ptr<ResourceBundle>::Ref bundle)
// set up the table, which provides the layout, and place the widgets // set up the table, which provides the layout, and place the widgets
// inside the table // inside the table
table.reset(new Gtk::Table(2, 2, false));
table->set_name("table"); table->set_name("table");
table->set_row_spacings(0); table->set_row_spacings(0);
table->set_col_spacings(0); table->set_col_spacings(0);
@ -143,7 +144,6 @@ LoginWindow :: LoginWindow (Ptr<ResourceBundle>::Ref bundle)
// set up the window itself // set up the window itself
set_name("loginWindow"); set_name("loginWindow");
set_title("LiveSupport login");
set_modal(true); set_modal(true);
property_window_position().set_value(Gtk::WIN_POS_NONE); property_window_position().set_value(Gtk::WIN_POS_NONE);
set_resizable(false); set_resizable(false);

View file

@ -22,7 +22,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.5 $ Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/UiTestMainWindow.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/UiTestMainWindow.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -40,7 +40,7 @@
#include "LiveSupport/Core/TimeConversion.h" #include "LiveSupport/Core/TimeConversion.h"
#include "LoginWindow.h" #include "LoginWindow.h"
#include "AudioClipWindow.h" #include "AudioClipListWindow.h"
#include "UiTestMainWindow.h" #include "UiTestMainWindow.h"
@ -67,8 +67,12 @@ UiTestMainWindow :: UiTestMainWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
{ {
this->gLiveSupport = gLiveSupport; this->gLiveSupport = gLiveSupport;
// set up the status label try {
set_title(*getResourceUstring("windowTitle"));
statusLabel.reset(new Gtk::Label(*getResourceUstring("welcomeMsg"))); statusLabel.reset(new Gtk::Label(*getResourceUstring("welcomeMsg")));
} catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl;
}
// set up the time label // set up the time label
timeLabel.reset(new Gtk::Label("")); timeLabel.reset(new Gtk::Label(""));
@ -157,7 +161,11 @@ void
UiTestMainWindow :: onLogoutButtonClicked (void) throw () UiTestMainWindow :: onLogoutButtonClicked (void) throw ()
{ {
gLiveSupport->logout(); gLiveSupport->logout();
try {
statusLabel->set_label(*getResourceUstring("welcomeMsg")); statusLabel->set_label(*getResourceUstring("welcomeMsg"));
} catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl;
}
} }
@ -241,8 +249,8 @@ UiTestMainWindow :: onAudioClipButtonClicked (void) throw ()
return; return;
} }
Ptr<AudioClipWindow>::Ref audioClipWindow( Ptr<AudioClipListWindow>::Ref audioClipWindow(
new AudioClipWindow(gLiveSupport, bundle)); new AudioClipListWindow(gLiveSupport, bundle));
Gtk::Main::run(*audioClipWindow); Gtk::Main::run(*audioClipWindow);
} }

View file

@ -1,10 +1,13 @@
hu:table hu:table
{ {
windowTitle:string { "LiveSupport Teszt Ablak" }
welcomeMsg:string { "Üdvözöljük" } welcomeMsg:string { "Üdvözöljük" }
loggedInMsg:string { "Bejelentkezve {0} felhasználóként" } loggedInMsg:string { "Bejelentkezve {0} felhasználóként" }
loginWindow:table loginWindow:table
{ {
windowTitle:string { "LiveSupport Belépés Ablak" }
loginLabel:string { "azonositó:" } loginLabel:string { "azonositó:" }
passwordLabel:string { "jelszó:" } passwordLabel:string { "jelszó:" }
okButtonLabel:string { "Belépés" } okButtonLabel:string { "Belépés" }
@ -12,6 +15,8 @@ hu:table
audioClipWindow:table audioClipWindow:table
{ {
windowTitle:string { "LiveSupport Hang Anyag Ablak" }
idColumnLabel:string { "azonositó" } idColumnLabel:string { "azonositó" }
lengthColumnLabel:string { "hossz" } lengthColumnLabel:string { "hossz" }
uriColumnLabel:string { "URI" } uriColumnLabel:string { "URI" }

View file

@ -1,10 +1,13 @@
root:table root:table
{ {
windowTitle:string { "LiveSupport Test Window" }
welcomeMsg:string { "welcome" } welcomeMsg:string { "welcome" }
loggedInMsg:string { "Logged in as {0}" } loggedInMsg:string { "Logged in as {0}" }
loginWindow:table loginWindow:table
{ {
windowTitle:string { "LiveSupport Login Window" }
loginLabel:string { "login:" } loginLabel:string { "login:" }
passwordLabel:string { "password:" } passwordLabel:string { "password:" }
okButtonLabel:string { "OK" } okButtonLabel:string { "OK" }
@ -12,6 +15,8 @@ root:table
audioClipWindow:table audioClipWindow:table
{ {
windowTitle:string { "LiveSupport Audio Clip Window" }
idColumnLabel:string { "id" } idColumnLabel:string { "id" }
lengthColumnLabel:string { "length" } lengthColumnLabel:string { "length" }
uriColumnLabel:string { "URI" } uriColumnLabel:string { "URI" }