Commit 761b1e29 authored by Ashwin  Dhakaita's avatar Ashwin Dhakaita Committed by Matthieu Gallien
Browse files

Shortcut to seek/scrub audio files

Summary:
Assigned Shift+Left/Right keys as shortcut to seek/scrub audio files (by 10 secs). Having shortcuts to seek/scrub is a good to have feature besides using the mouse.
The patch was in response to the bug 397523 which mentions to use Alt+Left/Right keys. But, as Alt+Left keys are used by ViewNavigation.qml Shift+Left/Right keys were assigned as shortcuts.
As far as fast forwarding is concerned,  Elisa doesn't support it yet. So, no shortcuts were introduced.

BUG:    397523
FIXED-IN:    elisa  0.3.80

Reviewers: #elisa, ngraham, mgallien

Reviewed By: #elisa, ngraham, mgallien

Subscribers: mgallien, ngraham

Tags: #elisa

Differential Revision: https://phabricator.kde.org/D18017
parent e973e0dc
......@@ -149,6 +149,16 @@ void ElisaApplication::setupActions(const QString &actionName)
togglePlaylistAction->setText(QStringLiteral("Toggle Playlist"));
}
if (actionName == QStringLiteral("Seek") && KAuthorized::authorizeAction(actionName)) {
auto seekAction = d->mCollection.addAction(actionName, this, &ElisaApplication::seek);
d->mCollection.setDefaultShortcut(seekAction, QKeySequence(tr("Shift+Right")));
}
if (actionName == QStringLiteral("Scrub") && KAuthorized::authorizeAction(actionName)) {
auto scrubAction = d->mCollection.addAction(actionName, this, &ElisaApplication::scrub);
d->mCollection.setDefaultShortcut(scrubAction, QKeySequence(tr("Shift+Left")));
}
if (actionName == QStringLiteral("edit_find") && KAuthorized::authorizeAction(actionName)) {
auto findAction = KStandardAction::find(this, &ElisaApplication::find, this);
d->mCollection.addAction(findAction->objectName(), findAction);
......@@ -263,6 +273,10 @@ void ElisaApplication::find() {}
void ElisaApplication::togglePlaylist() {}
void ElisaApplication::seek() {}
void ElisaApplication::scrub() {}
ElisaUtils::EntryDataList ElisaApplication::checkFileListAndMakeAbsolute(const ElisaUtils::EntryDataList &filesList,
const QString &workingDirectory) const
{
......
......@@ -149,6 +149,10 @@ private Q_SLOTS:
void togglePlaylist();
void seek();
void scrub();
private:
void initializeModels();
......
......@@ -41,12 +41,24 @@ ApplicationWindow {
title: i18n("Elisa")
property var goBackAction: elisa.action("go_back")
property var seekAction: elisa.action("Seek")
property var scrubAction: elisa.action("Scrub")
Action {
shortcut: goBackAction.shortcut
onTriggered: contentView.goBack()
}
Action {
shortcut: seekAction.shortcut
onTriggered: elisa.audioControl.seek(headerBar.playerControl.position + 10000)
}
Action {
shortcut: scrubAction.shortcut
onTriggered: elisa.audioControl.seek(headerBar.playerControl.position - 10000)
}
ApplicationMenu {
id: applicationMenu
}
......
Markdown is supported
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