progress towards #1648

This commit is contained in:
fgerlits 2006-04-12 17:51:39 +00:00
parent 255cb4ba06
commit c4a4053d17
8 changed files with 142 additions and 25 deletions

View file

@ -125,16 +125,15 @@ ExportPlaylistWindow :: ExportPlaylistWindow (
Gtk::Label * statusBar = Gtk::manage(new Gtk::Label("")); Gtk::Label * statusBar = Gtk::manage(new Gtk::Label(""));
Gtk::Box * layout = Gtk::manage(new Gtk::VBox); Gtk::Box * layout = Gtk::manage(new Gtk::VBox);
layout->pack_start(*extraSpace, Gtk::PACK_SHRINK, 5); layout->pack_start(*extraSpace, Gtk::PACK_SHRINK, 5);
layout->pack_start(*playlistTitleBox, Gtk::PACK_SHRINK, 5); layout->pack_start(*playlistTitleBox, Gtk::PACK_SHRINK, 5);
layout->pack_start(*formatBox, Gtk::PACK_SHRINK, 5); layout->pack_start(*formatBox, Gtk::PACK_SHRINK, 0);
layout->pack_start(*buttonBox, Gtk::PACK_SHRINK, 5); layout->pack_start(*statusBar, Gtk::PACK_SHRINK, 10);
layout->pack_start(*statusBar, Gtk::PACK_SHRINK, 5); layout->pack_start(*buttonBox, Gtk::PACK_SHRINK, 0);
add(*layout); add(*layout);
set_name(windowName); set_name(windowName);
set_default_size(200, 200);
show_all(); show_all();
} }

View file

@ -40,6 +40,8 @@
#include "LiveSupport/Core/TimeConversion.h" #include "LiveSupport/Core/TimeConversion.h"
#include "LiveSupport/Widgets/WidgetFactory.h" #include "LiveSupport/Widgets/WidgetFactory.h"
#include "SchedulePlaylistWindow.h" #include "SchedulePlaylistWindow.h"
#include "ExportPlaylistWindow.h"
#include "LiveModeWindow.h" #include "LiveModeWindow.h"
@ -182,6 +184,10 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
*getResourceUstring("playMenuItem"), *getResourceUstring("playMenuItem"),
sigc::mem_fun(*this, sigc::mem_fun(*this,
&LiveModeWindow::onOutputPlay))); &LiveModeWindow::onOutputPlay)));
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
*getResourceUstring("exportPlaylistMenuItem"),
sigc::mem_fun(*this,
&LiveModeWindow::onExportPlaylist)));
} catch (std::invalid_argument &e) { } catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl; std::cerr << e.what() << std::endl;
std::exit(1); std::exit(1);
@ -368,3 +374,27 @@ LiveModeWindow :: onKeyPressed(GdkEventKey * event) throw ()
return false; return false;
} }
/*------------------------------------------------------------------------------
* Signal handler for "export playlist" in the context menu.
*----------------------------------------------------------------------------*/
void
LiveModeWindow :: onExportPlaylist(void) throw ()
{
Glib::RefPtr<Gtk::TreeView::Selection>
refSelection = treeView->get_selection();
Gtk::TreeModel::iterator iter = refSelection->get_selected();
if (iter) {
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
Ptr<Playlist>::Ref playlist = playable->getPlaylist();
if (playlist) {
Ptr<ExportPlaylistWindow>::Ref dialog(new ExportPlaylistWindow(
gLiveSupport,
gLiveSupport->getBundle("exportPlaylistWindow"),
playlist));
Gtk::Main::run(*dialog);
}
}
}

View file

@ -186,6 +186,13 @@ class LiveModeWindow : public GuiWindow
bool bool
onKeyPressed(GdkEventKey * event) throw (); onKeyPressed(GdkEventKey * event) throw ();
/**
* Signal handler for the "export playlist" menu item selected from
* the entry context menu.
*/
virtual void
onExportPlaylist(void) throw ();
public: public:
/** /**

View file

@ -39,6 +39,8 @@
#include "LiveSupport/Widgets/WidgetFactory.h" #include "LiveSupport/Widgets/WidgetFactory.h"
#include "LiveSupport/Widgets/ZebraTreeView.h" #include "LiveSupport/Widgets/ZebraTreeView.h"
#include "SchedulePlaylistWindow.h" #include "SchedulePlaylistWindow.h"
#include "ExportPlaylistWindow.h"
#include "ScratchpadWindow.h" #include "ScratchpadWindow.h"
@ -241,6 +243,10 @@ ScratchpadWindow :: ScratchpadWindow (
*getResourceUstring("addToLiveModeMenuItem"), *getResourceUstring("addToLiveModeMenuItem"),
sigc::mem_fun(*this, sigc::mem_fun(*this,
&ScratchpadWindow::onAddToLiveMode))); &ScratchpadWindow::onAddToLiveMode)));
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
*getResourceUstring("exportPlaylistMenuItem"),
sigc::mem_fun(*this,
&ScratchpadWindow::onExportPlaylist)));
} catch (std::invalid_argument &e) { } catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl; std::cerr << e.what() << std::endl;
std::exit(1); std::exit(1);
@ -483,6 +489,25 @@ ScratchpadWindow :: onAddToLiveMode(void) throw ()
} }
/*------------------------------------------------------------------------------
* Signal handler for "export playlist" in the context menu.
*----------------------------------------------------------------------------*/
void
ScratchpadWindow :: onExportPlaylist(void) throw ()
{
Ptr<Playable>::Ref playable = currentRow[modelColumns.playableColumn];
Ptr<Playlist>::Ref playlist = playable->getPlaylist();
if (playlist) {
Ptr<ExportPlaylistWindow>::Ref dialog(new ExportPlaylistWindow(
gLiveSupport,
gLiveSupport->getBundle("exportPlaylistWindow"),
playlist));
Gtk::Main::run(*dialog);
}
}
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Signal handler for the user double-clicking or pressing Enter. * Signal handler for the user double-clicking or pressing Enter.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/

View file

@ -307,6 +307,13 @@ class ScratchpadWindow : public GuiWindow,
virtual void virtual void
onAddToLiveMode(void) throw (); onAddToLiveMode(void) throw ();
/**
* Signal handler for the "export playlist" menu item selected from
* the entry context menu.
*/
virtual void
onExportPlaylist(void) throw ();
public: public:
/** /**

View file

@ -42,6 +42,8 @@
#include "LiveSupport/Widgets/ScrolledNotebook.h" #include "LiveSupport/Widgets/ScrolledNotebook.h"
#include "LiveSupport/Widgets/Button.h" #include "LiveSupport/Widgets/Button.h"
#include "LiveSupport/Widgets/ZebraTreeView.h" #include "LiveSupport/Widgets/ZebraTreeView.h"
#include "ExportPlaylistWindow.h"
#include "SearchWindow.h" #include "SearchWindow.h"
@ -273,6 +275,10 @@ SearchWindow :: constructSearchResultsView(void) throw ()
*getResourceUstring("addToLiveModeMenuItem"), *getResourceUstring("addToLiveModeMenuItem"),
sigc::mem_fun(*this, sigc::mem_fun(*this,
&SearchWindow::onAddToLiveMode))); &SearchWindow::onAddToLiveMode)));
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
*getResourceUstring("exportPlaylistMenuItem"),
sigc::mem_fun(*this,
&SearchWindow::onExportPlaylist)));
} catch (std::invalid_argument &e) { } catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl; std::cerr << e.what() << std::endl;
std::exit(1); std::exit(1);
@ -478,6 +484,30 @@ SearchWindow :: onAddToLiveMode(void) throw ()
} }
/*------------------------------------------------------------------------------
* Signal handler for "export playlist" in the context menu.
*----------------------------------------------------------------------------*/
void
SearchWindow :: onExportPlaylist(void) throw ()
{
Glib::RefPtr<Gtk::TreeView::Selection>
refSelection = searchResults->get_selection();
Gtk::TreeModel::iterator iter = refSelection->get_selected();
if (iter) {
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
Ptr<Playlist>::Ref playlist = playable->getPlaylist();
if (playlist) {
Ptr<ExportPlaylistWindow>::Ref dialog(new ExportPlaylistWindow(
gLiveSupport,
gLiveSupport->getBundle("exportPlaylistWindow"),
playlist));
Gtk::Main::run(*dialog);
}
}
}
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Signal handler for the user double-clicking or pressing Enter. * Signal handler for the user double-clicking or pressing Enter.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/

View file

@ -187,6 +187,13 @@ class SearchWindow : public GuiWindow
void void
onAddToLiveMode(void) throw (); onAddToLiveMode(void) throw ();
/**
* Signal handler for the "export playlist" menu item selected from
* the entry context menu.
*/
virtual void
onExportPlaylist(void) throw ();
/** /**
* The columns model needed by Gtk::TreeView. * The columns model needed by Gtk::TreeView.
* Lists one clip per row. * Lists one clip per row.

View file

@ -67,17 +67,15 @@ root:table
clearListButtonLabel:string { "Clear list" } clearListButtonLabel:string { "Clear list" }
removeButtonLabel:string { "Remove item(s)" } removeButtonLabel:string { "Remove item(s)" }
upMenuItem:string { "Move _Up" } upMenuItem:string { "Move _Up" }
downMenuItem:string { "Move D_own" } downMenuItem:string { "Move D_own" }
removeMenuItem:string { "_Remove" } removeMenuItem:string { "_Remove" }
editPlaylistMenuItem:string { "_Edit" } editPlaylistMenuItem:string { "_Edit" }
addToPlaylistMenuItem:string addToPlaylistMenuItem:string { "_Add To Playlist" }
{ "_Add To Playlist" } schedulePlaylistMenuItem:string { "_Schedule" }
schedulePlaylistMenuItem:string cueMenuItem:string { "Pre_view" }
{ "_Schedule" } addToLiveModeMenuItem:string { "Add To _Live Mode" }
cueMenuItem:string { "Pre_view" } exportPlaylistMenuItem:string { "E_xport Playlist" }
addToLiveModeMenuItem:string
{ "Add To _Live Mode" }
cannotEditPlaylistMsg:string cannotEditPlaylistMsg:string
{ "Could not open playlist for editing." } { "Could not open playlist for editing." }
@ -192,10 +190,9 @@ root:table
allStringForBrowse { "--- all ---" } allStringForBrowse { "--- all ---" }
addToScratchpadMenuItem:string addToScratchpadMenuItem:string { "_Add To Scratchpad" }
{ "_Add To Scratchpad" } addToLiveModeMenuItem:string { "Add To _Live Mode" }
addToLiveModeMenuItem:string exportPlaylistMenuItem:string { "E_xport Playlist" }
{ "Add To _Live Mode" }
} }
advancedSearchEntry:table { advancedSearchEntry:table {
@ -219,11 +216,12 @@ root:table
{ {
windowTitle:string { "Live Mode" } windowTitle:string { "Live Mode" }
cueMenuItem:string { "Pre_view" } cueMenuItem:string { "Pre_view" }
upMenuItem:string { "Move _Up" } upMenuItem:string { "Move _Up" }
downMenuItem:string { "Move D_own" } downMenuItem:string { "Move D_own" }
removeMenuItem:string { "_Remove" } removeMenuItem:string { "_Remove" }
playMenuItem:string { "_Play" } playMenuItem:string { "_Play" }
exportPlaylistMenuItem:string { "E_xport Playlist" }
cuePlayerLabel:string { "Preview" } cuePlayerLabel:string { "Preview" }
} }
@ -306,6 +304,20 @@ root:table
minuteLabel:string { "minute:" } minuteLabel:string { "minute:" }
} }
exportPlaylistWindow:table
{
windowTitle:string { "Export Playlist" }
playlistTitleLabel:string { "Title:" }
formatLabel:string { "Export as:" }
cancelButtonLabel:string { "Cancel" }
saveButtonLabel:string { "Save" }
internalFormatName:string { "LiveSupport archive" }
smilFormatName:string { "tar containing a SMIL" }
}
metadataTypes:table metadataTypes:table
{ {
title:string { "Title" } title:string { "Title" }