Commit 81742fa0 authored by Alexander Kellett's avatar Alexander Kellett

add some global key shortcuts for 'seek forward/backward'

svn path=/trunk/kdemultimedia/juk/; revision=215788
parent 92b1891e
......@@ -237,13 +237,15 @@ void JuK::setupPlayer()
void JuK::setupGlobalAccels()
{
m_accel = new KGlobalAccel(this);
KeyDialog::insert(m_accel, "PlayPause", i18n("Play/Pause"), this, SLOT(slotPlayPause()));
KeyDialog::insert(m_accel, "Stop", i18n("Stop Playing"), this, SLOT(slotStop()));
KeyDialog::insert(m_accel, "Back", i18n("Back"), this, SLOT(slotBack()));
KeyDialog::insert(m_accel, "Forward", i18n("Forward"), this, SLOT(slotForward()));
KeyDialog::insert(m_accel, "VolumeUp", i18n("Volume Up"), this, SLOT(slotVolumeUp()));
KeyDialog::insert(m_accel, "VolumeDown", i18n("Volume Down"), this, SLOT(slotVolumeDown()));
KeyDialog::insert(m_accel, "Mute", i18n("Mute"), this, SLOT(slotVolumeMute()));
KeyDialog::insert(m_accel, "PlayPause", i18n("Play/Pause"), this, SLOT(slotPlayPause()));
KeyDialog::insert(m_accel, "Stop", i18n("Stop Playing"), this, SLOT(slotStop()));
KeyDialog::insert(m_accel, "Back", i18n("Back"), this, SLOT(slotBack()));
KeyDialog::insert(m_accel, "Forward", i18n("Forward"), this, SLOT(slotForward()));
KeyDialog::insert(m_accel, "SeekBack", i18n("Seek Back"), this, SLOT(slotSeekBack()));
KeyDialog::insert(m_accel, "SeekForward",i18n("Seek Forward"), this, SLOT(slotSeekForward()));
KeyDialog::insert(m_accel, "VolumeUp", i18n("Volume Up"), this, SLOT(slotVolumeUp()));
KeyDialog::insert(m_accel, "VolumeDown", i18n("Volume Down"), this, SLOT(slotVolumeDown()));
KeyDialog::insert(m_accel, "Mute", i18n("Mute"), this, SLOT(slotVolumeMute()));
m_accel->setConfigGroup("Shortcuts");
m_accel->readSettings();
......@@ -574,6 +576,20 @@ void JuK::slotForward()
play(m_splitter->playNextFile(m_randomPlayAction->isChecked(), m_loopPlaylistAction->isChecked()));
}
void JuK::slotSeekBack()
{
int position = m_sliderAction->getTrackPositionSlider()->value();
position = QMAX(m_sliderAction->getTrackPositionSlider()->minValue(), position - 10);
emit m_sliderAction->getTrackPositionSlider()->setValue(position);
}
void JuK::slotSeekForward()
{
int position = m_sliderAction->getTrackPositionSlider()->value();
position = QMIN(m_sliderAction->getTrackPositionSlider()->maxValue(), position + 10);
emit m_sliderAction->getTrackPositionSlider()->setValue(position);
}
////////////////////////////////////////////////////////////////////////////////
// settings menu
////////////////////////////////////////////////////////////////////////////////
......
......@@ -104,6 +104,8 @@ private slots:
void slotStop();
void slotBack();
void slotForward();
void slotSeekBack();
void slotSeekForward();
// settings menu
void slotShowGenreListEditor();
......
......@@ -45,6 +45,14 @@ const KeyDialog::KeyInfo KeyDialog::keyInfo[] = {
{{KShortcut::null(), KShortcut::null()},
{Qt::CTRL+Qt::ALT+Qt::Key_Right, KKey::QtWIN+Qt::ALT+Qt::Key_Right},
{Qt::Key_MediaNext, Qt::Key_MediaNext}}},
{"SeekBack",
{{KShortcut::null(), KShortcut::null()},
{Qt::CTRL+Qt::SHIFT+Qt::ALT+Qt::Key_Left, KKey::QtWIN+Qt::SHIFT+Qt::ALT+Qt::Key_Left},
{Qt::SHIFT+Qt::Key_MediaPrev, Qt::SHIFT+Qt::Key_MediaPrev}}},
{"SeekForward",
{{KShortcut::null(), KShortcut::null()},
{Qt::CTRL+Qt::SHIFT+Qt::ALT+Qt::Key_Right,KKey::QtWIN+Qt::SHIFT+Qt::ALT+Qt::Key_Right},
{Qt::SHIFT+Qt::Key_MediaNext, Qt::SHIFT+Qt::Key_MediaNext}}},
{"VolumeUp",
{{KShortcut::null(), KShortcut::null()},
{Qt::CTRL+Qt::ALT+Qt::SHIFT+Qt::Key_Up, KKey::QtWIN+Qt::ALT+Qt::SHIFT+Qt::Key_Up},
......
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