fixed #1918
This commit is contained in:
parent
6456f5a162
commit
959c465bb0
4 changed files with 147 additions and 17 deletions
|
@ -39,7 +39,6 @@
|
||||||
|
|
||||||
#include "LiveSupport/Core/TimeConversion.h"
|
#include "LiveSupport/Core/TimeConversion.h"
|
||||||
#include "LiveSupport/Widgets/WidgetFactory.h"
|
#include "LiveSupport/Widgets/WidgetFactory.h"
|
||||||
#include "SchedulePlaylistWindow.h"
|
|
||||||
|
|
||||||
#include "LiveModeWindow.h"
|
#include "LiveModeWindow.h"
|
||||||
|
|
||||||
|
|
|
@ -790,9 +790,10 @@ SearchWindow :: onEntryClicked (GdkEventButton * event) throw ()
|
||||||
void
|
void
|
||||||
SearchWindow :: onAddToScratchpad(void) throw ()
|
SearchWindow :: onAddToScratchpad(void) throw ()
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Gtk::TreeView::Selection> refSelection =
|
Glib::RefPtr<Gtk::TreeView::Selection>
|
||||||
searchResultsTreeView->get_selection();
|
refSelection = searchResultsTreeView->get_selection();
|
||||||
Gtk::TreeModel::iterator iter = refSelection->get_selected();
|
Gtk::TreeModel::iterator
|
||||||
|
iter = refSelection->get_selected();
|
||||||
|
|
||||||
if (iter) {
|
if (iter) {
|
||||||
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
||||||
|
@ -810,15 +811,42 @@ SearchWindow :: onAddToScratchpad(void) throw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Signal handler for the Add To Playlist menu item selected from the
|
||||||
|
* entry conext menu
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
SearchWindow :: onAddToPlaylist(void) throw ()
|
||||||
|
{
|
||||||
|
Glib::RefPtr<Gtk::TreeView::Selection>
|
||||||
|
refSelection = searchResultsTreeView->get_selection();
|
||||||
|
Gtk::TreeModel::iterator
|
||||||
|
iter = refSelection->get_selected();
|
||||||
|
|
||||||
|
if (iter) {
|
||||||
|
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
||||||
|
try {
|
||||||
|
gLiveSupport->addToPlaylist(playable->getId());
|
||||||
|
} catch (XmlRpcException &e) {
|
||||||
|
Ptr<Glib::ustring>::Ref errorMessage(new Glib::ustring(
|
||||||
|
"error in SearchWindow::onAddToPlaylist(): "));
|
||||||
|
errorMessage->append(e.what());
|
||||||
|
gLiveSupport->displayMessageWindow(errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* Add a playable to the live mode.
|
* Add a playable to the live mode.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
SearchWindow :: onAddToLiveMode(void) throw ()
|
SearchWindow :: onAddToLiveMode(void) throw ()
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Gtk::TreeView::Selection> refSelection =
|
Glib::RefPtr<Gtk::TreeView::Selection>
|
||||||
searchResultsTreeView->get_selection();
|
refSelection = searchResultsTreeView->get_selection();
|
||||||
Gtk::TreeModel::iterator iter = refSelection->get_selected();
|
Gtk::TreeModel::iterator
|
||||||
|
iter = refSelection->get_selected();
|
||||||
|
|
||||||
if (iter) {
|
if (iter) {
|
||||||
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
||||||
|
@ -838,6 +866,60 @@ SearchWindow :: onAddToLiveMode(void) throw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Event handler for the Edit Playlist menu item selected from the
|
||||||
|
* entry conext menu.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
SearchWindow :: onEditPlaylist(void) throw ()
|
||||||
|
{
|
||||||
|
Glib::RefPtr<Gtk::TreeView::Selection>
|
||||||
|
refSelection = searchResultsTreeView->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) {
|
||||||
|
try {
|
||||||
|
gLiveSupport->openPlaylistForEditing(playlist->getId());
|
||||||
|
} catch (XmlRpcException &e) {
|
||||||
|
gLiveSupport->displayMessageWindow(getResourceUstring(
|
||||||
|
"cannotEditPlaylistMsg" ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Event handler for the Schedule Playlist menu item selected from the
|
||||||
|
* entry conext menu.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
SearchWindow :: onSchedulePlaylist(void) throw ()
|
||||||
|
{
|
||||||
|
Glib::RefPtr<Gtk::TreeView::Selection>
|
||||||
|
refSelection = searchResultsTreeView->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) {
|
||||||
|
schedulePlaylistWindow.reset(new SchedulePlaylistWindow(
|
||||||
|
gLiveSupport,
|
||||||
|
gLiveSupport->getBundle("schedulePlaylistWindow"),
|
||||||
|
playlist));
|
||||||
|
schedulePlaylistWindow->set_transient_for(*this);
|
||||||
|
Gtk::Main::run(*schedulePlaylistWindow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* Signal handler for "export playlist" in the context menu.
|
* Signal handler for "export playlist" in the context menu.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
@ -845,9 +927,9 @@ void
|
||||||
SearchWindow :: onExportPlaylist(void) throw ()
|
SearchWindow :: onExportPlaylist(void) throw ()
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Gtk::TreeView::Selection>
|
Glib::RefPtr<Gtk::TreeView::Selection>
|
||||||
refSelection = searchResultsTreeView->get_selection();
|
refSelection = searchResultsTreeView->get_selection();
|
||||||
Gtk::TreeModel::iterator
|
Gtk::TreeModel::iterator
|
||||||
iter = refSelection->get_selected();
|
iter = refSelection->get_selected();
|
||||||
|
|
||||||
if (iter) {
|
if (iter) {
|
||||||
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
||||||
|
@ -878,12 +960,12 @@ void
|
||||||
SearchWindow :: onUploadToHub(void) throw ()
|
SearchWindow :: onUploadToHub(void) throw ()
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Gtk::TreeView::Selection>
|
Glib::RefPtr<Gtk::TreeView::Selection>
|
||||||
refSelection = searchResultsTreeView->get_selection();
|
refSelection = searchResultsTreeView->get_selection();
|
||||||
Gtk::TreeModel::iterator
|
Gtk::TreeModel::iterator
|
||||||
iter = refSelection->get_selected();
|
iter = refSelection->get_selected();
|
||||||
|
|
||||||
if (iter) {
|
if (iter) {
|
||||||
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
||||||
if (playable) {
|
if (playable) {
|
||||||
uploadToHub(playable);
|
uploadToHub(playable);
|
||||||
}
|
}
|
||||||
|
@ -919,12 +1001,12 @@ void
|
||||||
SearchWindow :: onDownloadFromHub(void) throw ()
|
SearchWindow :: onDownloadFromHub(void) throw ()
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Gtk::TreeView::Selection>
|
Glib::RefPtr<Gtk::TreeView::Selection>
|
||||||
refSelection = searchResultsTreeView->get_selection();
|
refSelection = searchResultsTreeView->get_selection();
|
||||||
Gtk::TreeModel::iterator
|
Gtk::TreeModel::iterator
|
||||||
iter = refSelection->get_selected();
|
iter = refSelection->get_selected();
|
||||||
|
|
||||||
if (iter) {
|
if (iter) {
|
||||||
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
||||||
if (playable) {
|
if (playable) {
|
||||||
if (!gLiveSupport->existsPlayable(playable->getId())) {
|
if (!gLiveSupport->existsPlayable(playable->getId())) {
|
||||||
try {
|
try {
|
||||||
|
@ -969,6 +1051,9 @@ SearchWindow :: on_hide(void) throw ()
|
||||||
if (exportPlaylistWindow) {
|
if (exportPlaylistWindow) {
|
||||||
exportPlaylistWindow->hide();
|
exportPlaylistWindow->hide();
|
||||||
}
|
}
|
||||||
|
if (schedulePlaylistWindow) {
|
||||||
|
schedulePlaylistWindow->hide();
|
||||||
|
}
|
||||||
|
|
||||||
GuiWindow::on_hide();
|
GuiWindow::on_hide();
|
||||||
}
|
}
|
||||||
|
@ -1032,6 +1117,10 @@ SearchWindow :: constructAudioClipContextMenu(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("addToPlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&SearchWindow::onAddToPlaylist)));
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("addToScratchpadMenuItem"),
|
*getResourceUstring("addToScratchpadMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
|
@ -1065,11 +1154,23 @@ SearchWindow :: constructPlaylistContextMenu(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("addToPlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&SearchWindow::onAddToPlaylist)));
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("addToScratchpadMenuItem"),
|
*getResourceUstring("addToScratchpadMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
&SearchWindow::onAddToScratchpad)));
|
&SearchWindow::onAddToScratchpad)));
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("editPlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&SearchWindow::onEditPlaylist)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("schedulePlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&SearchWindow::onSchedulePlaylist)));
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("exportPlaylistMenuItem"),
|
*getResourceUstring("exportPlaylistMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
#include "AdvancedSearchEntry.h"
|
#include "AdvancedSearchEntry.h"
|
||||||
#include "BrowseEntry.h"
|
#include "BrowseEntry.h"
|
||||||
#include "GLiveSupport.h"
|
#include "GLiveSupport.h"
|
||||||
|
#include "SchedulePlaylistWindow.h"
|
||||||
#include "ExportPlaylistWindow.h"
|
#include "ExportPlaylistWindow.h"
|
||||||
#include "TransportList.h"
|
#include "TransportList.h"
|
||||||
|
|
||||||
|
@ -138,6 +139,11 @@ class SearchWindow : public GuiWindow
|
||||||
*/
|
*/
|
||||||
Button * forwardButton;
|
Button * forwardButton;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Schedule Playlist pop-up window.
|
||||||
|
*/
|
||||||
|
Ptr<SchedulePlaylistWindow>::Ref schedulePlaylistWindow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Export Playlist pop-up window.
|
* The Export Playlist pop-up window.
|
||||||
*/
|
*/
|
||||||
|
@ -383,12 +389,33 @@ class SearchWindow : public GuiWindow
|
||||||
void
|
void
|
||||||
onAddToScratchpad(void) throw ();
|
onAddToScratchpad(void) throw ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signal handler for the "add to playlist" menu item selected from
|
||||||
|
* the entry context menu.
|
||||||
|
*/
|
||||||
|
virtual void
|
||||||
|
onAddToPlaylist(void) throw ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a playable to the live mode.
|
* Add a playable to the live mode.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
onAddToLiveMode(void) throw ();
|
onAddToLiveMode(void) throw ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signal handler for the "edit playlist" menu item selected from
|
||||||
|
* the entry context menu.
|
||||||
|
*/
|
||||||
|
virtual void
|
||||||
|
onEditPlaylist(void) throw ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signal handler for the "schedule playlist" menu item selected
|
||||||
|
* from the entry context menu.
|
||||||
|
*/
|
||||||
|
virtual void
|
||||||
|
onSchedulePlaylist(void) throw ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signal handler for the "export playlist" menu item selected from
|
* Signal handler for the "export playlist" menu item selected from
|
||||||
* the entry context menu.
|
* the entry context menu.
|
||||||
|
|
|
@ -208,8 +208,11 @@ root:table
|
||||||
|
|
||||||
allStringForBrowse { "--- all ---" }
|
allStringForBrowse { "--- all ---" }
|
||||||
|
|
||||||
addToScratchpadMenuItem:string { "_Add To Scratchpad" }
|
addToScratchpadMenuItem:string { "Add To S_cratchpad" }
|
||||||
|
addToPlaylistMenuItem:string { "_Add to Playlist" }
|
||||||
addToLiveModeMenuItem:string { "Add To _Live Mode" }
|
addToLiveModeMenuItem:string { "Add To _Live Mode" }
|
||||||
|
editPlaylistMenuItem:string { "_Edit Playlist" }
|
||||||
|
schedulePlaylistMenuItem:string { "_Schedule Playlist" }
|
||||||
exportPlaylistMenuItem:string { "E_xport Playlist" }
|
exportPlaylistMenuItem:string { "E_xport Playlist" }
|
||||||
uploadToHubMenuItem:string { "Upload to the network hub" }
|
uploadToHubMenuItem:string { "Upload to the network hub" }
|
||||||
downloadFromHubMenuItem:string { "Download from the network hub" }
|
downloadFromHubMenuItem:string { "Download from the network hub" }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue