Skip to content

Commit

Permalink
MythMusic: Add keybindings to jump to all the views
Browse files Browse the repository at this point in the history
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
Paul Harrison authored and stuartm committed May 18, 2012
1 parent e3699a6 commit e7e6492
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mythplugins/mythmusic/mythmusic/main.cpp
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions mythplugins/mythmusic/mythmusic/musiccommon.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit e7e6492

Please sign in to comment.