made PlaylistListWindow nicer
This commit is contained in:
parent
3ce857b78b
commit
bae10ac014
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
* <code><pre>
|
||||
* +------ PlaylistListWindow -------------------------------------+
|
||||
* | +----- mainBox ---------------------------------------------+ |
|
||||
* | | +---- playlistBox --------------------------------------+ | |
|
||||
* | | | +--- listBox -----------+ +---- detailBox ---------+ | | |
|
||||
* | | | | listBoxLabel | | detailBoxLabel | | | |
|
||||
* | | | | listScrolledWindow | | detailScrolledWindow | | | |
|
||||
* | | | +-----------------------+ +------------------------+ | | |
|
||||
* | | +-------------------------------------------------------+ | |
|
||||
* | | +---- buttonBox ----------------------------------------+ | |
|
||||
* | | | closeButton | | |
|
||||
* | | +-------------------------------------------------------+ | |
|
||||
* | +-----------------------------------------------------------+ |
|
||||
* +---------------------------------------------------------------+
|
||||
* </pre></code>
|
||||
*
|
||||
* @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<Gtk::TreeSelection> 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.
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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" }
|
||||
|
|
Loading…
Reference in New Issue