From bae10ac01443f85446e2746471f96306c1fc299c Mon Sep 17 00:00:00 2001 From: maroy Date: Fri, 3 Dec 2004 11:25:01 +0000 Subject: [PATCH] made PlaylistListWindow nicer --- .../gLiveSupport/src/PlaylistListWindow.cxx | 44 +++++++++++----- .../gLiveSupport/src/PlaylistListWindow.h | 51 ++++++++++++++++--- livesupport/products/gLiveSupport/var/hu.txt | 3 ++ .../products/gLiveSupport/var/root.txt | 3 ++ 4 files changed, 81 insertions(+), 20 deletions(-) diff --git a/livesupport/products/gLiveSupport/src/PlaylistListWindow.cxx b/livesupport/products/gLiveSupport/src/PlaylistListWindow.cxx index 1c8051344..30c4f6240 100644 --- a/livesupport/products/gLiveSupport/src/PlaylistListWindow.cxx +++ b/livesupport/products/gLiveSupport/src/PlaylistListWindow.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/PlaylistListWindow.cxx,v $ ------------------------------------------------------------------------------*/ @@ -67,8 +67,11 @@ PlaylistListWindow :: PlaylistListWindow ( { this->gLiveSupport = gLiveSupport; + // get localized resources try { set_title(*getResourceUstring("windowTitle")); + listBoxLabel.set_text(*getResourceUstring("listBoxLabel")); + detailBoxLabel.set_text(*getResourceUstring("detailBoxLabel")); closeButton.reset(new Button( *getResourceUstring("closeButtonLabel"))); } catch (std::invalid_argument &e) { @@ -87,22 +90,22 @@ PlaylistListWindow :: PlaylistListWindow ( set_border_width(5); set_default_size(400, 200); - add(vBox); - vBox.pack_start(hBox); - vBox.pack_start(buttonBox, PACK_SHRINK); + // set up the main box + add(mainBox); + mainBox.pack_start(playlistBox); + mainBox.pack_start(buttonBox, PACK_SHRINK); + // set up the playlist box + playlistBox.pack_start(listBox, PACK_EXPAND_WIDGET, 5); + playlistBox.pack_start(detailBox, PACK_EXPAND_WIDGET, 5); + + // set up the listBox + listBox.pack_start(listBoxLabel, PACK_SHRINK); + listBox.pack_start(listScrolledWindow); + + // set up the listScrolledWindow listScrolledWindow.add(listTreeView); listScrolledWindow.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC); - detailScrolledWindow.add(detailTreeView); - detailScrolledWindow.set_policy(POLICY_AUTOMATIC, - POLICY_AUTOMATIC); - - hBox.pack_start(listScrolledWindow); - hBox.pack_start(detailScrolledWindow); - - buttonBox.pack_start(*closeButton, PACK_SHRINK); - buttonBox.set_border_width(5); - buttonBox.set_layout(BUTTONBOX_END); // create the list tree view, and add its columns listTreeModel = ListStore::create(modelColumns); @@ -126,6 +129,14 @@ PlaylistListWindow :: PlaylistListWindow ( listTreeSelection->signal_changed().connect( sigc::mem_fun(*this, &PlaylistListWindow::onPlaylistListSelection)); + // set up the detailBox + detailBox.pack_start(detailBoxLabel, PACK_SHRINK); + detailBox.pack_start(detailScrolledWindow); + + // set up the detailed scroll window + detailScrolledWindow.add(detailTreeView); + detailScrolledWindow.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC); + // create the detail tree view, and add its columns detailTreeModel = ListStore::create(modelColumns); detailTreeView.set_model(detailTreeModel); @@ -142,6 +153,11 @@ PlaylistListWindow :: PlaylistListWindow ( std::cerr << e.what() << std::endl; } + // set up the button box + buttonBox.pack_start(*closeButton, PACK_SHRINK); + buttonBox.set_border_width(5); + buttonBox.set_layout(BUTTONBOX_END); + showAllPlaylists(); show_all_children(); diff --git a/livesupport/products/gLiveSupport/src/PlaylistListWindow.h b/livesupport/products/gLiveSupport/src/PlaylistListWindow.h index dddaaae0b..932921656 100644 --- a/livesupport/products/gLiveSupport/src/PlaylistListWindow.h +++ b/livesupport/products/gLiveSupport/src/PlaylistListWindow.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/PlaylistListWindow.h,v $ ------------------------------------------------------------------------------*/ @@ -66,8 +66,25 @@ using namespace LiveSupport::Core; /** * A window, showing and handling playlists. * + * The layout of the window is as follows: + *
+ *  +------ PlaylistListWindow -------------------------------------+
+ *  | +----- mainBox ---------------------------------------------+ |
+ *  | | +---- playlistBox --------------------------------------+ | |
+ *  | | | +--- listBox -----------+  +---- detailBox ---------+ | | |
+ *  | | | |  listBoxLabel         |  |  detailBoxLabel        | | | |
+ *  | | | |  listScrolledWindow   |  |  detailScrolledWindow  | | | |
+ *  | | | +-----------------------+  +------------------------+ | | |
+ *  | | +-------------------------------------------------------+ | |
+ *  | | +---- buttonBox ----------------------------------------+ | |
+ *  | | |  closeButton                                          | | |
+ *  | | +-------------------------------------------------------+ | |
+ *  | +-----------------------------------------------------------+ |
+ *  +---------------------------------------------------------------+
+ *  
+ * * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ class PlaylistListWindow : public Gtk::Window, public GtkLocalizedObject { @@ -103,7 +120,7 @@ class PlaylistListWindow : public Gtk::Window, public GtkLocalizedObject * Lists one playlist per row. * * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ class ModelColumns : public Gtk::TreeModel::ColumnRecord { @@ -154,14 +171,25 @@ class PlaylistListWindow : public Gtk::Window, public GtkLocalizedObject /** * The main container in the window. */ - Gtk::VBox vBox; + Gtk::VBox mainBox; /** - * The container holding the two tables for playlist viewing: + * The container holding the two boxes for playlist viewing: * one lists the playlist, the other the details of the selected * playlist. */ - Gtk::HBox hBox; + Gtk::HBox playlistBox; + + /** + * The container holding the playlist list tree view and accompanying + * label. + */ + Gtk::VBox listBox; + + /** + * The label for listBox. + */ + Gtk::Label listBoxLabel; /** * A scrolled window holding the list of playlists @@ -186,6 +214,17 @@ class PlaylistListWindow : public Gtk::Window, public GtkLocalizedObject */ Glib::RefPtr listTreeSelection; + /** + * The container holding the playlist detail tree view and accompanying + * label. + */ + Gtk::VBox detailBox; + + /** + * The label for detailBox. + */ + Gtk::Label detailBoxLabel; + /** * A scrolled window holding the details of a playlist * so that the details can be scrolled. diff --git a/livesupport/products/gLiveSupport/var/hu.txt b/livesupport/products/gLiveSupport/var/hu.txt index 63f302c38..928898d3c 100644 --- a/livesupport/products/gLiveSupport/var/hu.txt +++ b/livesupport/products/gLiveSupport/var/hu.txt @@ -29,6 +29,9 @@ hu:table { windowTitle:string { "LiveSupport Playlist Ablak" } + listBoxLabel { "Playlistek" } + detailBoxLabel { "Playlist részletek" } + idColumnLabel:string { "azonositó" } lengthColumnLabel:string { "hossz" } uriColumnLabel:string { "URI" } diff --git a/livesupport/products/gLiveSupport/var/root.txt b/livesupport/products/gLiveSupport/var/root.txt index f7bdfd488..700cde0de 100644 --- a/livesupport/products/gLiveSupport/var/root.txt +++ b/livesupport/products/gLiveSupport/var/root.txt @@ -29,6 +29,9 @@ root:table { windowTitle:string { "LiveSupport Playlist Window" } + listBoxLabel { "Playlists" } + detailBoxLabel { "Playlist details" } + idColumnLabel:string { "id" } lengthColumnLabel:string { "length" } uriColumnLabel:string { "URI" }