diff --git a/src/elisaapplication.h b/src/elisaapplication.h --- a/src/elisaapplication.h +++ b/src/elisaapplication.h @@ -149,6 +149,10 @@ void togglePlaylist(); + void seek(); + + void scrub(); + private: void initializeModels(); diff --git a/src/elisaapplication.cpp b/src/elisaapplication.cpp --- a/src/elisaapplication.cpp +++ b/src/elisaapplication.cpp @@ -149,6 +149,16 @@ 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::togglePlaylist() {} +void ElisaApplication::seek() {} + +void ElisaApplication::scrub() {} + ElisaUtils::EntryDataList ElisaApplication::checkFileListAndMakeAbsolute(const ElisaUtils::EntryDataList &filesList, const QString &workingDirectory) const { diff --git a/src/qml/ElisaMainWindow.qml b/src/qml/ElisaMainWindow.qml --- a/src/qml/ElisaMainWindow.qml +++ b/src/qml/ElisaMainWindow.qml @@ -41,12 +41,24 @@ 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 }