Commit b4b59198 authored by Matěj Laitl's avatar Matěj Laitl
Browse files

Add keyboard shortcut for collection search: Ctrl+F

Also change name of the "Jump to" action to "Search playlist" and
rename appropriate methods.

Both actions now ensure that relevant dock and widget gets shown upon
firing the shortcut.

Patch by Silver Juurik <silverjuurik@gmail.com>

REVIEW: 102956
FEATURE: 257381
GUI: "Jump to" keyboard shortcut renamed to "Search playlist"
FIXED-IN: 2.5
parent ac6a6214
......@@ -4,6 +4,8 @@ Amarok ChangeLog
Version 2.5.0-Beta 1
FEATURES:
* Ctrl+F now activates collection browser and focuses the seach collection
bar. (BR 257381)
* Music store based on the Amazon catalogue
* Podcast subscription synchronisation and podcast status synchronisation
with Gpodder service.
......
......@@ -585,13 +585,21 @@ MainWindow::slotAddStream() //SLOT
}
void
MainWindow::slotJumpTo() // slot
MainWindow::slotFocusPlaylistSearch()
{
DEBUG_BLOCK
showDock( AmarokDockPlaylist ); // ensure that the dock is visible if tabbed
m_playlistDock.data()->searchWidget()->focusInputLine();
}
void
MainWindow::slotFocusCollectionSearch()
{
// ensure collection browser is activated within navigation dock:
browserDock()->list()->navigate( QString("collections") );
showDock( AmarokDockNavigation ); // ensure that the dock is visible if tabbed
m_collectionBrowser->focusInputLine();
}
#ifdef DEBUG_BUILD_TYPE
void
MainWindow::showNetworkRequestViewer() //SLOT
......@@ -827,10 +835,15 @@ MainWindow::createActions()
action->setShortcut( KShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_F ) );
connect( action, SIGNAL( triggered() ), SLOT( slotFullScreen() ) );
action = new KAction( i18n( "Jump to" ), this );
ac->addAction( "jumpTo", action );
action = new KAction( i18n( "Search playlist" ), this );
ac->addAction( "searchPlaylist", action );
action->setShortcut( KShortcut( Qt::CTRL + Qt::Key_J ) );
connect( action, SIGNAL( triggered() ), SLOT( slotJumpTo() ) );
connect( action, SIGNAL( triggered() ), SLOT( slotFocusPlaylistSearch()) );
action = new KAction( i18n( "Search collection" ), this );
ac->addAction( "searchCollection", action );
action->setShortcut( KShortcut( Qt::CTRL + Qt::Key_F ) );
connect( action, SIGNAL( triggered() ), SLOT( slotFocusCollectionSearch()) );
action = new KAction( KIcon( "music-amarok" ), i18n("Show active track"), this );
ac->addAction( "show_active_track", action );
......
......@@ -143,7 +143,8 @@ class AMAROK_EXPORT MainWindow : public KMainWindow
void slotPlayMedia();
void slotAddLocation( bool directPlay = false );
void slotAddStream();
void slotJumpTo();
void slotFocusPlaylistSearch();
void slotFocusCollectionSearch();
#ifdef DEBUG_BUILD_TYPE
void showNetworkRequestViewer();
#endif // DEBUG_BUILD_TYPE
......
......@@ -304,6 +304,12 @@ CollectionWidget::~CollectionWidget()
}
void
CollectionWidget::focusInputLine()
{
return d->searchWidget->comboBox()->setFocus();
}
void
CollectionWidget::sortLevelSelected( QAction *action )
{
......
......@@ -54,6 +54,7 @@ class CollectionWidget : public BrowserCategory
/** Set the current views selected levels */
void setLevels( const QList<int> &levels );
void focusInputLine();
public slots:
void sortLevelSelected( QAction * );
void sortByArtistAlbum();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment