diff --git a/campcaster/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx b/campcaster/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx index f6fcaec1e..50cea01f3 100644 --- a/campcaster/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx +++ b/campcaster/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx @@ -180,7 +180,15 @@ SimplePlaylistManagementWindow :: SimplePlaylistManagementWindow ( lockFadesCheckButton->signal_toggled().connect(sigc::mem_fun( *this, &SimplePlaylistManagementWindow::onLockFadesCheckButtonClicked )); - + + // construct the "total time" display + Gtk::Label * lengthTextLabel = Gtk::manage(new Gtk::Label( + *getResourceUstring("lengthLabel") )); + lengthValueLabel = Gtk::manage(new Gtk::Label("00:00:00")); + Gtk::HBox * lengthBox = Gtk::manage(new Gtk::HBox()); + lengthBox->pack_start(*lengthTextLabel, Gtk::PACK_SHRINK, 5); + lengthBox->pack_start(*lengthValueLabel, Gtk::PACK_SHRINK, 5); + // set up the layout Gtk::VBox * mainBox = Gtk::manage(new Gtk::VBox); @@ -191,23 +199,23 @@ SimplePlaylistManagementWindow :: SimplePlaylistManagementWindow ( 0.7)); // take up 70% of available room nameEntryAlignment->add(*nameEntry); nameBox->pack_start(*nameEntryAlignment, Gtk::PACK_EXPAND_WIDGET, 5); - mainBox->pack_start(*nameBox, Gtk::PACK_SHRINK, 5); - - mainBox->pack_start(*entriesScrolledWindow, Gtk::PACK_EXPAND_WIDGET, 5); - mainBox->pack_start(*lockFadesCheckButton, Gtk::PACK_SHRINK, 5); - Gtk::ButtonBox * buttonBox = Gtk::manage(new Gtk::HButtonBox( Gtk::BUTTONBOX_END, 5)); buttonBox->pack_start(*saveButton); buttonBox->pack_start(*closeButton); - mainBox->pack_start(*buttonBox, Gtk::PACK_SHRINK, 0); - + Gtk::Alignment * statusBarAlignment = Gtk::manage(new Gtk::Alignment( Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, 0.0)); // do not expand the label statusBarAlignment->add(*statusBar); - mainBox->pack_start(*statusBarAlignment, Gtk::PACK_SHRINK, 5); + + mainBox->pack_start(*nameBox, Gtk::PACK_SHRINK, 5); + mainBox->pack_start(*entriesScrolledWindow, Gtk::PACK_EXPAND_WIDGET, 5); + mainBox->pack_start(*lengthBox, Gtk::PACK_SHRINK, 5); + mainBox->pack_start(*lockFadesCheckButton, Gtk::PACK_SHRINK, 5); + mainBox->pack_start(*buttonBox, Gtk::PACK_SHRINK, 0); + mainBox->pack_start(*statusBarAlignment, Gtk::PACK_SHRINK, 5); add(*mainBox); @@ -399,6 +407,12 @@ SimplePlaylistManagementWindow :: showContents(void) throw () if (playlist) { nameEntry->set_text(*playlist->getTitle()); + + Ptr::Ref + lengthStr = TimeConversion::timeDurationToHhMmSsString( + playlist->getPlaylength()); + lengthValueLabel->set_text(*lengthStr); + entriesModel->clear(); for (it = playlist->begin(); it != playlist->end(); ++it) { Ptr::Ref playlistElement diff --git a/campcaster/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h b/campcaster/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h index 90cb2f412..b86900ebd 100644 --- a/campcaster/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h +++ b/campcaster/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h @@ -119,50 +119,59 @@ class SimplePlaylistManagementWindow : public GuiWindow Gtk::TreeIter currentItem; /** - * Signal handler for the title being edited. + * The label for the name entry. */ - void - onTitleEdited(void) throw(); + Gtk::Label * nameLabel; /** - * Signal handler for the fade info being edited. - * - * @path the path representing the row in the tree model - * @columnId the ID of the row which was passed to appendColumn() - * @newText the new fade value + * The test input entry for the name of the playlist. */ - void - onFadeInfoEdited(const Glib::ustring & path, - int columnId, - const Glib::ustring & newText) throw(); + EntryBin * nameEntry; /** - * Signal handler for the playlist being modified outside the window. + * A scrolled window, so that the entry list can be scrolled. */ - void - onPlaylistModified(void) throw(); + Gtk::ScrolledWindow * entriesScrolledWindow; /** - * Signal handler for the mouse clicked on one of the entries. - * This is used to pop up the right-click context menu. - * - * @param event the button event recieved + * The entry tree view, now only showing rows. */ - void - onEntryClicked(GdkEventButton * event) throw (); + ZebraTreeView * entriesView; /** - * Signal handler for a key pressed at one of the entries. - * The keys can be customized by the keyboardShortcutContainer - * element in the gLiveSupport configuration file. - * - * The actions handled are: moveItemUp, moveItemDown and removeItem. - * - * @param event the button event received - * @return true if the key press was fully handled, false if not + * The entry tree model, as a GTK reference. */ - bool - onKeyPressed(GdkEventKey * event) throw (); + Glib::RefPtr entriesModel; + + /** + * The label containing the length of the playlist. + */ + Gtk::Label * lengthValueLabel; + /** + * The save button. + */ + Button * saveButton; + + /** + * The close button. + */ + Button * closeButton; + + /** + * The status bar. + */ + Gtk::Label * statusBar; + + /** + * The "are you sure you want to exit?" dialog window. + */ + Ptr::Ref dialogWindow; + + /** + * The right-click context menu that comes up when right-clicking + * a playlist element. + */ + Gtk::Menu * rightClickMenu; /** * Find (an iterator pointing to) the currently selected row. @@ -182,43 +191,6 @@ class SimplePlaylistManagementWindow : public GuiWindow void selectRow(int rowNumber) throw (); - /** - * Signal handler for a click on the save button. - */ - void - onSaveButtonClicked(void) throw (); - - /** - * Signal handler for a click on the close button at the bottom - * right corner. - * This cancels the edited playlist; the normal close button (X) - * at the upper right corner hides the window only. - * If the playlist has been modified, a confirmation message will - * be displayed. - */ - void - onBottomCloseButtonClicked(void) throw (); - - /** - * Signal handler for the "lock fades" check button toggled. - */ - void - onLockFadesCheckButtonClicked(void) throw (); - - /** - * Signal handler for the "up" menu item selected from - * the right-click context menu. - */ - void - onUpItem(void) throw (); - - /** - * Signal handler for the "down" menu item selected from - * the right-click context menu. - */ - void - onDownItem(void) throw (); - /** * Swap two playlist elements in the edited playlist. * This is used by onUpItem() and onDownItem(). @@ -347,55 +319,87 @@ class SimplePlaylistManagementWindow : public GuiWindow ModelColumns modelColumns; /** - * The label for the name entry. + * Signal handler for the title being edited. */ - Gtk::Label * nameLabel; + void + onTitleEdited(void) throw(); /** - * The test input entry for the name of the playlist. + * Signal handler for the fade info being edited. + * + * @path the path representing the row in the tree model + * @columnId the ID of the row which was passed to appendColumn() + * @newText the new fade value */ - EntryBin * nameEntry; + void + onFadeInfoEdited(const Glib::ustring & path, + int columnId, + const Glib::ustring & newText) throw(); /** - * A scrolled window, so that the entry list can be scrolled. + * Signal handler for the playlist being modified outside the window. */ - Gtk::ScrolledWindow * entriesScrolledWindow; + void + onPlaylistModified(void) throw(); /** - * The entry tree view, now only showing rows. + * Signal handler for the mouse clicked on one of the entries. + * This is used to pop up the right-click context menu. + * + * @param event the button event recieved */ - ZebraTreeView * entriesView; + void + onEntryClicked(GdkEventButton * event) throw (); /** - * The entry tree model, as a GTK reference. + * Signal handler for a key pressed at one of the entries. + * The keys can be customized by the keyboardShortcutContainer + * element in the gLiveSupport configuration file. + * + * The actions handled are: moveItemUp, moveItemDown and removeItem. + * + * @param event the button event received + * @return true if the key press was fully handled, false if not */ - Glib::RefPtr entriesModel; + bool + onKeyPressed(GdkEventKey * event) throw (); /** - * The save button. + * Signal handler for a click on the save button. */ - Button * saveButton; + void + onSaveButtonClicked(void) throw (); /** - * The close button. + * Signal handler for a click on the close button at the bottom + * right corner. + * This cancels the edited playlist; the normal close button (X) + * at the upper right corner hides the window only. + * If the playlist has been modified, a confirmation message will + * be displayed. */ - Button * closeButton; + void + onBottomCloseButtonClicked(void) throw (); /** - * The status bar. + * Signal handler for the "lock fades" check button toggled. */ - Gtk::Label * statusBar; + void + onLockFadesCheckButtonClicked(void) throw (); /** - * The "are you sure you want to exit?" dialog window. + * Signal handler for the "up" menu item selected from + * the right-click context menu. */ - Ptr::Ref dialogWindow; + void + onUpItem(void) throw (); /** - * The right-click context menu that comes up when right-clicking - * a playlist element. + * Signal handler for the "down" menu item selected from + * the right-click context menu. */ - Gtk::Menu * rightClickMenu; + void + onDownItem(void) throw (); public: diff --git a/campcaster/src/products/gLiveSupport/var/root.txt b/campcaster/src/products/gLiveSupport/var/root.txt index 7c7b02e05..7f1ad7b14 100644 --- a/campcaster/src/products/gLiveSupport/var/root.txt +++ b/campcaster/src/products/gLiveSupport/var/root.txt @@ -139,6 +139,7 @@ root:table fadeInColumnLabel:string { "Fade in" } fadeOutColumnLabel:string { "Fade out" } nameLabel:string { "Name" } + lengthLabel:string { "Duration:" } saveButtonLabel:string { "Save" } closeButtonLabel:string { "Close" } lockFadesCheckButtonLabel:string