1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-31 11:35:24 +01:00

Add a "jump to the currently playing track" menu option. Fixes issue #316

This commit is contained in:
David Sansome 2010-05-16 23:55:00 +00:00
parent 84c8caea55
commit 3891bc032d
27 changed files with 148 additions and 3 deletions

View File

@ -88,5 +88,6 @@
<file>magnatune.png</file>
<file>schema-8.sql</file>
<file>schema-9.sql</file>
<file>go-jump.png</file>
</qresource>
</RCC>

BIN
data/go-jump.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

View File

@ -366,18 +366,21 @@ void PlaylistView::InhibitAutoscrollTimeout() {
}
void PlaylistView::MaybeAutoscroll() {
if (!inhibit_autoscroll_)
JumpToCurrentlyPlayingTrack();
}
void PlaylistView::JumpToCurrentlyPlayingTrack() {
Playlist* playlist = qobject_cast<Playlist*>(model());
Q_ASSERT(playlist);
if (inhibit_autoscroll_)
return;
if (playlist->current_index() == -1)
return;
QModelIndex current = playlist->index(playlist->current_index(), 0);
currently_autoscrolling_ = true;
scrollTo(current, QAbstractItemView::PositionAtCenter);
selectionModel()->setCurrentIndex(current, QItemSelectionModel::ClearAndSelect);
currently_autoscrolling_ = false;
}

View File

@ -45,6 +45,7 @@ class PlaylistView : public QTreeView {
public slots:
void StopGlowing();
void StartGlowing();
void JumpToCurrentlyPlayingTrack();
void closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditHint hint);
signals:

View File

@ -979,6 +979,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Knihovna"

View File

@ -982,6 +982,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Bibliotek"

View File

@ -978,6 +978,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Musiksammlung"

View File

@ -981,6 +981,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Βιβλιοθήκη"

View File

@ -977,6 +977,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Library"

View File

@ -984,6 +984,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Colección"

View File

@ -973,6 +973,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr ""

View File

@ -985,6 +985,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Bibliothèque"

View File

@ -975,6 +975,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr ""

View File

@ -982,6 +982,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Raccolta"

View File

@ -975,6 +975,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr ""

View File

@ -979,6 +979,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Bibliotek"

View File

@ -977,6 +977,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Biblioteka"

View File

@ -980,6 +980,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Biblioteca"

View File

@ -973,6 +973,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr ""

View File

@ -974,6 +974,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Bibliotecă"

View File

@ -977,6 +977,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Коллекция"

View File

@ -979,6 +979,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Zbierka"

View File

@ -980,6 +980,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr "Bibliotek"

View File

@ -973,6 +973,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr ""

View File

@ -964,6 +964,12 @@ msgstr ""
msgid "Configure global shortcuts..."
msgstr ""
msgid "Jump to the currently playing track"
msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "Library"
msgstr ""

View File

@ -185,6 +185,7 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
connect(ui_->action_equalizer, SIGNAL(triggered()), equalizer_.get(), SLOT(show()));
connect(ui_->action_transcode, SIGNAL(triggered()), transcode_dialog_.get(), SLOT(show()));
connect(ui_->action_configure_global_shortcuts, SIGNAL(triggered()), global_shortcuts_dialog_.get(), SLOT(show()));
connect(ui_->action_jump, SIGNAL(triggered()), ui_->playlist, SLOT(JumpToCurrentlyPlayingTrack()));
// Give actions to buttons
ui_->forward_button->setDefaultAction(ui_->action_next_track);

View File

@ -405,6 +405,7 @@
<addaction name="action_shuffle_mode"/>
<addaction name="action_repeat_mode"/>
<addaction name="separator"/>
<addaction name="action_jump"/>
<addaction name="action_clear_playlist"/>
<addaction name="action_shuffle"/>
</widget>
@ -668,6 +669,18 @@
<string>Configure global shortcuts...</string>
</property>
</action>
<action name="action_jump">
<property name="icon">
<iconset resource="../../data/data.qrc">
<normaloff>:/go-jump.png</normaloff>:/go-jump.png</iconset>
</property>
<property name="text">
<string>Jump to the currently playing track</string>
</property>
<property name="shortcut">
<string>Ctrl+J</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>