Permalink
Browse files

MythMusic: Add keybindings to jump to all the views

This adds some SWITCHTO* keybindings in the Music context that allows you to
define keys that will switch to the chosen view rather than having to use the
menu. All are unbound by default.
(cherry picked from commit 0f1c4bf)

Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information...
1 parent e3699a6 commit e7e6492d88ea5d54b8ab0967784300f1c3c4365a Paul Harrison committed with stuartm May 10, 2012
Showing with 22 additions and 0 deletions.
  1. +12 −0 mythplugins/mythmusic/mythmusic/main.cpp
  2. +10 −0 mythplugins/mythmusic/mythmusic/musiccommon.cpp
@@ -592,6 +592,18 @@ static void setupKeys(void)
REG_KEY("Music", "MARK", QT_TRANSLATE_NOOP("MythControls",
"Toggle track selection"), "T");
+ // switch to view key bindings
+ REG_KEY("Music", "SWITCHTOPLAYLIST", QT_TRANSLATE_NOOP("MythControls",
+ "Switch to the current playlist view"), "");
+ REG_KEY("Music", "SWITCHTOPLAYLISTEDITORTREE", QT_TRANSLATE_NOOP("MythControls",
+ "Switch to the playlist editor tree view"), "");
+ REG_KEY("Music", "SWITCHTOPLAYLISTEDITORGALLERY", QT_TRANSLATE_NOOP("MythControls",
+ "Switch to the playlist editor gallery view"), "");
+ REG_KEY("Music", "SWITCHTOSEARCH", QT_TRANSLATE_NOOP("MythControls",
+ "Switch to the search view"), "");
+ REG_KEY("Music", "SWITCHTOVISUALISER", QT_TRANSLATE_NOOP("MythControls",
+ "Switch to the fullscreen visualiser view"), "");
+
#ifdef FIXME
// FIXME need to find a way to stop the media monitor jumping to the main menu before
@@ -667,6 +667,16 @@ bool MusicCommon::keyPressEvent(QKeyEvent *e)
m_movingTracksState->DisplayState((m_moveTrackMode ? "on" : "off"));
}
}
+ else if (action == "SWITCHTOPLAYLIST" && m_currentView != MV_PLAYLIST)
+ switchView(MV_PLAYLIST);
+ else if (action == "SWITCHTOPLAYLISTEDITORTREE" && m_currentView != MV_PLAYLISTEDITORTREE)
+ switchView(MV_PLAYLISTEDITORTREE);
+ else if (action == "SWITCHTOPLAYLISTEDITORGALLERY" && m_currentView != MV_PLAYLISTEDITORGALLERY)
+ switchView(MV_PLAYLISTEDITORGALLERY);
+ else if (action == "SWITCHTOSEARCH" && m_currentView != MV_SEARCH)
+ switchView(MV_SEARCH);
+ else if (action == "SWITCHTOVISUALISER" && m_currentView != MV_VISUALIZER)
+ switchView(MV_VISUALIZER);
else
handled = false;
}

0 comments on commit e7e6492

Please sign in to comment.