cleaned up and rearranged the context menus (part of #1918)
This commit is contained in:
parent
a3144ce333
commit
c5b8bbb201
5 changed files with 213 additions and 146 deletions
|
@ -157,45 +157,9 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
||||||
outputPlayButton->signal_clicked().connect(sigc::mem_fun(*this,
|
outputPlayButton->signal_clicked().connect(sigc::mem_fun(*this,
|
||||||
&LiveModeWindow::onOutputPlay ));
|
&LiveModeWindow::onOutputPlay ));
|
||||||
|
|
||||||
// create the right-click entry context menu
|
// create the right-click context menus
|
||||||
contextMenu = Gtk::manage(new Gtk::Menu());
|
audioClipContextMenu = constructAudioClipContextMenu();
|
||||||
Gtk::Menu::MenuList& contextMenuList = contextMenu->items();
|
playlistContextMenu = constructPlaylistContextMenu();
|
||||||
// register the signal handlers for the popup menu
|
|
||||||
try {
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("cueMenuItem"),
|
|
||||||
sigc::mem_fun(*cueAudioButtons,
|
|
||||||
&CuePlayer::onPlayItem)));
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("upMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onUpMenuOption)));
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("downMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onDownMenuOption)));
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("removeMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onRemoveMenuOption)));
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("playMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&LiveModeWindow::onOutputPlay)));
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("exportPlaylistMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&LiveModeWindow::onExportPlaylist)));
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("uploadToHubMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&LiveModeWindow::onUploadToHub)));
|
|
||||||
} catch (std::invalid_argument &e) {
|
|
||||||
std::cerr << e.what() << std::endl;
|
|
||||||
std::exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
contextMenu->accelerate(*this);
|
|
||||||
|
|
||||||
// show
|
// show
|
||||||
set_name(windowName);
|
set_name(windowName);
|
||||||
|
@ -321,27 +285,39 @@ void
|
||||||
LiveModeWindow :: onEntryClicked(GdkEventButton * event) throw ()
|
LiveModeWindow :: onEntryClicked(GdkEventButton * event) throw ()
|
||||||
{
|
{
|
||||||
if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
|
if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
|
||||||
Glib::RefPtr<Gtk::TreeView::Selection> refSelection =
|
Gtk::TreePath currentPath;
|
||||||
treeView->get_selection();
|
Gtk::TreeViewColumn * column;
|
||||||
Gtk::TreeModel::iterator iter = refSelection->get_selected();
|
int cell_x,
|
||||||
|
cell_y;
|
||||||
|
bool foundValidRow = treeView->get_path_at_pos(
|
||||||
|
int(event->x), int(event->y),
|
||||||
|
currentPath, column,
|
||||||
|
cell_x, cell_y);
|
||||||
|
|
||||||
// if nothing is currently selected, select row at mouse pointer
|
if (foundValidRow) {
|
||||||
if (!iter) {
|
Gtk::TreeIter iter = treeModel->get_iter(currentPath);
|
||||||
Gtk::TreeModel::Path path;
|
if (iter) {
|
||||||
Gtk::TreeViewColumn * column;
|
Ptr<Playable>::Ref playable =
|
||||||
int cell_x,
|
(*iter)[modelColumns.playableColumn];
|
||||||
cell_y;
|
|
||||||
if (treeView->get_path_at_pos(int(event->x), int(event->y),
|
if (playable) {
|
||||||
path, column,
|
switch (playable->getType()) {
|
||||||
cell_x, cell_y)) {
|
case Playable::AudioClipType:
|
||||||
refSelection->select(path);
|
audioClipContextMenu->popup(event->button,
|
||||||
iter = refSelection->get_selected();
|
event->time);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Playable::PlaylistType:
|
||||||
|
playlistContextMenu->popup(event->button,
|
||||||
|
event->time);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iter) {
|
|
||||||
contextMenu->popup(event->button, event->time);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -471,3 +447,82 @@ LiveModeWindow :: refreshPlaylist(Ptr<Playlist>::Ref playlist) throw ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Construct the right-click context menu for local audio clips.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
Gtk::Menu *
|
||||||
|
LiveModeWindow :: constructAudioClipContextMenu(void) throw ()
|
||||||
|
{
|
||||||
|
Gtk::Menu * contextMenu = Gtk::manage(new Gtk::Menu());
|
||||||
|
Gtk::Menu::MenuList & contextMenuList = contextMenu->items();
|
||||||
|
|
||||||
|
try {
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("playMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&LiveModeWindow::onOutputPlay)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("cueMenuItem"),
|
||||||
|
sigc::mem_fun(*cueAudioButtons,
|
||||||
|
&CuePlayer::onPlayItem)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("removeMenuItem"),
|
||||||
|
sigc::mem_fun(*treeView,
|
||||||
|
&ZebraTreeView::onRemoveMenuOption)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("uploadToHubMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&LiveModeWindow::onUploadToHub)));
|
||||||
|
} catch (std::invalid_argument &e) {
|
||||||
|
std::cerr << e.what() << std::endl;
|
||||||
|
std::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
contextMenu->accelerate(*this);
|
||||||
|
return contextMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Construct the right-click context menu for local playlists.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
Gtk::Menu *
|
||||||
|
LiveModeWindow :: constructPlaylistContextMenu(void) throw ()
|
||||||
|
{
|
||||||
|
Gtk::Menu * contextMenu = Gtk::manage(new Gtk::Menu());
|
||||||
|
Gtk::Menu::MenuList & contextMenuList = contextMenu->items();
|
||||||
|
|
||||||
|
try {
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("playMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&LiveModeWindow::onOutputPlay)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("cueMenuItem"),
|
||||||
|
sigc::mem_fun(*cueAudioButtons,
|
||||||
|
&CuePlayer::onPlayItem)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("removeMenuItem"),
|
||||||
|
sigc::mem_fun(*treeView,
|
||||||
|
&ZebraTreeView::onRemoveMenuOption)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("exportPlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&LiveModeWindow::onExportPlaylist)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("uploadToHubMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&LiveModeWindow::onUploadToHub)));
|
||||||
|
} catch (std::invalid_argument &e) {
|
||||||
|
std::cerr << e.what() << std::endl;
|
||||||
|
std::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
contextMenu->accelerate(*this);
|
||||||
|
return contextMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,22 @@ class LiveModeWindow : public GuiWindow
|
||||||
*/
|
*/
|
||||||
CuePlayer * cueAudioButtons;
|
CuePlayer * cueAudioButtons;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct the right-click context menu for local audio clips.
|
||||||
|
*
|
||||||
|
* @return the context menu created (already Gtk::manage()'ed).
|
||||||
|
*/
|
||||||
|
Gtk::Menu *
|
||||||
|
constructAudioClipContextMenu(void) throw ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct the right-click context menu for local playlists.
|
||||||
|
*
|
||||||
|
* @return the context menu created (already Gtk::manage()'ed).
|
||||||
|
*/
|
||||||
|
Gtk::Menu *
|
||||||
|
constructPlaylistContextMenu(void) throw ();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -151,10 +167,14 @@ class LiveModeWindow : public GuiWindow
|
||||||
Glib::RefPtr<Gtk::ListStore> treeModel;
|
Glib::RefPtr<Gtk::ListStore> treeModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The right-click context menu,
|
* The right-click context menu for audio clips.
|
||||||
* that comes up when right-clicking an entry in the entry list.
|
|
||||||
*/
|
*/
|
||||||
Gtk::Menu * contextMenu;
|
Gtk::Menu * audioClipContextMenu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The right-click context menu for playlists.
|
||||||
|
*/
|
||||||
|
Gtk::Menu * playlistContextMenu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signal handler for the output play button clicked
|
* Signal handler for the output play button clicked
|
||||||
|
|
|
@ -171,22 +171,6 @@ ScratchpadWindow :: ScratchpadWindow (
|
||||||
Gtk::Menu::MenuList& audioClipMenuList = audioClipMenu->items();
|
Gtk::Menu::MenuList& audioClipMenuList = audioClipMenu->items();
|
||||||
// register the signal handlers for the popup menu
|
// register the signal handlers for the popup menu
|
||||||
try {
|
try {
|
||||||
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("addToPlaylistMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&ScratchpadWindow::onAddToPlaylist)));
|
|
||||||
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("upMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onUpMenuOption)));
|
|
||||||
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("downMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onDownMenuOption)));
|
|
||||||
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("removeMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onRemoveMenuOption)));
|
|
||||||
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("cueMenuItem"),
|
*getResourceUstring("cueMenuItem"),
|
||||||
sigc::mem_fun(*cueAudioButtons,
|
sigc::mem_fun(*cueAudioButtons,
|
||||||
|
@ -195,6 +179,15 @@ ScratchpadWindow :: ScratchpadWindow (
|
||||||
*getResourceUstring("addToLiveModeMenuItem"),
|
*getResourceUstring("addToLiveModeMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
&ScratchpadWindow::onAddToLiveMode)));
|
&ScratchpadWindow::onAddToLiveMode)));
|
||||||
|
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("addToPlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&ScratchpadWindow::onAddToPlaylist)));
|
||||||
|
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("removeMenuItem"),
|
||||||
|
sigc::mem_fun(*treeView,
|
||||||
|
&ZebraTreeView::onRemoveMenuOption)));
|
||||||
|
audioClipMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("uploadToHubMenuItem"),
|
*getResourceUstring("uploadToHubMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
|
@ -212,30 +205,6 @@ ScratchpadWindow :: ScratchpadWindow (
|
||||||
// register the signal handlers for the popup menu
|
// register the signal handlers for the popup menu
|
||||||
|
|
||||||
try{
|
try{
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("editPlaylistMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&ScratchpadWindow::onEditPlaylist)));
|
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("addToPlaylistMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&ScratchpadWindow::onAddToPlaylist)));
|
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("schedulePlaylistMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&ScratchpadWindow::onSchedulePlaylist)));
|
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("upMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onUpMenuOption)));
|
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("downMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onDownMenuOption)));
|
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("removeMenuItem"),
|
|
||||||
sigc::mem_fun(*treeView,
|
|
||||||
&ZebraTreeView::onRemoveMenuOption)));
|
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("cueMenuItem"),
|
*getResourceUstring("cueMenuItem"),
|
||||||
sigc::mem_fun(*cueAudioButtons,
|
sigc::mem_fun(*cueAudioButtons,
|
||||||
|
@ -244,10 +213,28 @@ 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("addToPlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&ScratchpadWindow::onAddToPlaylist)));
|
||||||
|
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("removeMenuItem"),
|
||||||
|
sigc::mem_fun(*treeView,
|
||||||
|
&ZebraTreeView::onRemoveMenuOption)));
|
||||||
|
playlistMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
|
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("editPlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&ScratchpadWindow::onEditPlaylist)));
|
||||||
|
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("schedulePlaylistMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&ScratchpadWindow::onSchedulePlaylist)));
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("exportPlaylistMenuItem"),
|
*getResourceUstring("exportPlaylistMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
&ScratchpadWindow::onExportPlaylist)));
|
&ScratchpadWindow::onExportPlaylist)));
|
||||||
|
playlistMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("uploadToHubMenuItem"),
|
*getResourceUstring("uploadToHubMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
|
|
|
@ -373,9 +373,10 @@ SearchWindow :: constructSearchResultsView(void) throw ()
|
||||||
searchResultsTreeView->signal_row_activated().connect(sigc::mem_fun(
|
searchResultsTreeView->signal_row_activated().connect(sigc::mem_fun(
|
||||||
*this, &SearchWindow::onDoubleClick));
|
*this, &SearchWindow::onDoubleClick));
|
||||||
|
|
||||||
constructAudioClipContextMenu();
|
// create the right-click context menus
|
||||||
constructPlaylistContextMenu();
|
audioClipContextMenu = constructAudioClipContextMenu();
|
||||||
constructRemoteContextMenu();
|
playlistContextMenu = constructPlaylistContextMenu();
|
||||||
|
remoteContextMenu = constructRemoteContextMenu();
|
||||||
|
|
||||||
// put the tree view inside a scrolled window
|
// put the tree view inside a scrolled window
|
||||||
ScrolledWindow * resultsWindow = Gtk::manage(new ScrolledWindow);
|
ScrolledWindow * resultsWindow = Gtk::manage(new ScrolledWindow);
|
||||||
|
@ -739,26 +740,18 @@ void
|
||||||
SearchWindow :: onEntryClicked (GdkEventButton * event) throw ()
|
SearchWindow :: onEntryClicked (GdkEventButton * event) throw ()
|
||||||
{
|
{
|
||||||
if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
|
if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
|
||||||
Glib::RefPtr<Gtk::TreeView::Selection> refSelection =
|
Gtk::TreePath currentPath;
|
||||||
searchResultsTreeView->get_selection();
|
Gtk::TreeViewColumn * column;
|
||||||
if (refSelection) {
|
int cell_x,
|
||||||
Gtk::TreeModel::iterator iter = refSelection->get_selected();
|
cell_y;
|
||||||
|
bool foundValidRow = searchResultsTreeView->get_path_at_pos(
|
||||||
// if nothing is currently selected, select row at mouse pointer
|
int(event->x), int(event->y),
|
||||||
if (!iter) {
|
currentPath, column,
|
||||||
Gtk::TreeModel::Path path;
|
cell_x, cell_y);
|
||||||
Gtk::TreeViewColumn * column;
|
|
||||||
int cell_x,
|
|
||||||
cell_y;
|
|
||||||
if (searchResultsTreeView->get_path_at_pos(
|
|
||||||
int(event->x), int(event->y),
|
|
||||||
path, column,
|
|
||||||
cell_x, cell_y )) {
|
|
||||||
refSelection->select(path);
|
|
||||||
iter = refSelection->get_selected();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (foundValidRow) {
|
||||||
|
Gtk::TreeIter iter = searchResultsTreeView->get_model()
|
||||||
|
->get_iter(currentPath);
|
||||||
if (iter) {
|
if (iter) {
|
||||||
Ptr<Playable>::Ref playable =
|
Ptr<Playable>::Ref playable =
|
||||||
(*iter)[modelColumns.playableColumn];
|
(*iter)[modelColumns.playableColumn];
|
||||||
|
@ -1026,21 +1019,22 @@ SearchWindow :: onTimer(void) throw ()
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* Construct the right-click context menu for local audio clips.
|
* Construct the right-click context menu for local audio clips.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
Gtk::Menu *
|
||||||
SearchWindow :: constructAudioClipContextMenu(void) throw ()
|
SearchWindow :: constructAudioClipContextMenu(void) throw ()
|
||||||
{
|
{
|
||||||
audioClipContextMenu = Gtk::manage(new Gtk::Menu());
|
Gtk::Menu * contextMenu = Gtk::manage(new Gtk::Menu());
|
||||||
Gtk::Menu::MenuList& contextMenuList = audioClipContextMenu->items();
|
Gtk::Menu::MenuList & contextMenuList = contextMenu->items();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("addToScratchpadMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&SearchWindow::onAddToScratchpad)));
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("addToLiveModeMenuItem"),
|
*getResourceUstring("addToLiveModeMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
&SearchWindow::onAddToLiveMode)));
|
&SearchWindow::onAddToLiveMode)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("addToScratchpadMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&SearchWindow::onAddToScratchpad)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("uploadToHubMenuItem"),
|
*getResourceUstring("uploadToHubMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
|
@ -1050,32 +1044,35 @@ SearchWindow :: constructAudioClipContextMenu(void) throw ()
|
||||||
std::exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
audioClipContextMenu->accelerate(*this);
|
contextMenu->accelerate(*this);
|
||||||
|
return contextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* Construct the right-click context menu for local playlists.
|
* Construct the right-click context menu for local playlists.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
Gtk::Menu *
|
||||||
SearchWindow :: constructPlaylistContextMenu(void) throw ()
|
SearchWindow :: constructPlaylistContextMenu(void) throw ()
|
||||||
{
|
{
|
||||||
playlistContextMenu = Gtk::manage(new Gtk::Menu());
|
Gtk::Menu * contextMenu = Gtk::manage(new Gtk::Menu());
|
||||||
Gtk::Menu::MenuList& contextMenuList = playlistContextMenu->items();
|
Gtk::Menu::MenuList & contextMenuList = contextMenu->items();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
|
||||||
*getResourceUstring("addToScratchpadMenuItem"),
|
|
||||||
sigc::mem_fun(*this,
|
|
||||||
&SearchWindow::onAddToScratchpad)));
|
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("addToLiveModeMenuItem"),
|
*getResourceUstring("addToLiveModeMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
&SearchWindow::onAddToLiveMode)));
|
&SearchWindow::onAddToLiveMode)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
*getResourceUstring("addToScratchpadMenuItem"),
|
||||||
|
sigc::mem_fun(*this,
|
||||||
|
&SearchWindow::onAddToScratchpad)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
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,
|
||||||
&SearchWindow::onExportPlaylist)));
|
&SearchWindow::onExportPlaylist)));
|
||||||
|
contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem());
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
*getResourceUstring("uploadToHubMenuItem"),
|
*getResourceUstring("uploadToHubMenuItem"),
|
||||||
sigc::mem_fun(*this,
|
sigc::mem_fun(*this,
|
||||||
|
@ -1085,18 +1082,19 @@ SearchWindow :: constructPlaylistContextMenu(void) throw ()
|
||||||
std::exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
playlistContextMenu->accelerate(*this);
|
contextMenu->accelerate(*this);
|
||||||
|
return contextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* Construct the right-click context menu for remote audio clips & playlists.
|
* Construct the right-click context menu for remote audio clips & playlists.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
Gtk::Menu *
|
||||||
SearchWindow :: constructRemoteContextMenu(void) throw ()
|
SearchWindow :: constructRemoteContextMenu(void) throw ()
|
||||||
{
|
{
|
||||||
remoteContextMenu = Gtk::manage(new Gtk::Menu());
|
Gtk::Menu * contextMenu = Gtk::manage(new Gtk::Menu());
|
||||||
Gtk::Menu::MenuList& contextMenuList = remoteContextMenu->items();
|
Gtk::Menu::MenuList & contextMenuList = contextMenu->items();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||||
|
@ -1108,7 +1106,8 @@ SearchWindow :: constructRemoteContextMenu(void) throw ()
|
||||||
std::exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteContextMenu->accelerate(*this);
|
contextMenu->accelerate(*this);
|
||||||
|
return contextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -201,21 +201,27 @@ class SearchWindow : public GuiWindow
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the right-click context menu for local audio clips.
|
* Construct the right-click context menu for local audio clips.
|
||||||
|
*
|
||||||
|
* @return the context menu created (already Gtk::manage()'ed).
|
||||||
*/
|
*/
|
||||||
void
|
Gtk::Menu *
|
||||||
constructAudioClipContextMenu(void) throw ();
|
constructAudioClipContextMenu(void) throw ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the right-click context menu for local playlists.
|
* Construct the right-click context menu for local playlists.
|
||||||
|
*
|
||||||
|
* @return the context menu created (already Gtk::manage()'ed).
|
||||||
*/
|
*/
|
||||||
void
|
Gtk::Menu *
|
||||||
constructPlaylistContextMenu(void) throw ();
|
constructPlaylistContextMenu(void) throw ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the right-click context menu for remote audio clips
|
* Construct the right-click context menu for remote audio clips
|
||||||
* and playlists.
|
* and playlists.
|
||||||
|
*
|
||||||
|
* @return the context menu created (already Gtk::manage()'ed).
|
||||||
*/
|
*/
|
||||||
void
|
Gtk::Menu *
|
||||||
constructRemoteContextMenu(void) throw ();
|
constructRemoteContextMenu(void) throw ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue