1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 11:19:18 +01:00

Code review comments for r1198

Put back media keys for non-mac.

In this year:
The town of Riga is chartered as a city by Bishop Albert, who landed on the site of the town with 1,500 crusaders earlier that year.
This commit is contained in:
John Maguire 2010-06-17 21:54:42 +00:00
parent 27473b3f3a
commit a562190bbe
3 changed files with 10 additions and 9 deletions

View File

@ -40,11 +40,11 @@ GlobalShortcuts::GlobalShortcuts(QObject *parent)
// Create actions
AddShortcut("play", tr("Play"), SIGNAL(Play()));
AddShortcut("pause", tr("Pause"), SIGNAL(Pause()));
AddShortcut("play_pause", tr("Play/Pause"), SIGNAL(PlayPause())); //QKeySequence(Qt::Key_MediaPlay));
AddShortcut("stop", tr("Stop"), SIGNAL(Stop()));// QKeySequence(Qt::Key_MediaStop));
AddShortcut("play_pause", tr("Play/Pause"), SIGNAL(PlayPause()), QKeySequence(Qt::Key_MediaPlay));
AddShortcut("stop", tr("Stop"), SIGNAL(Stop()), QKeySequence(Qt::Key_MediaStop));
AddShortcut("stop_after", tr("Stop playing after current track"), SIGNAL(StopAfter()));
AddShortcut("next_track", tr("Next track"), SIGNAL(Next()));// QKeySequence(Qt::Key_MediaNext));
AddShortcut("prev_track", tr("Previous track"), SIGNAL(Previous()));// QKeySequence(Qt::Key_MediaPrevious));
AddShortcut("next_track", tr("Next track"), SIGNAL(Next()), QKeySequence(Qt::Key_MediaNext));
AddShortcut("prev_track", tr("Previous track"), SIGNAL(Previous()), QKeySequence(Qt::Key_MediaPrevious));
AddShortcut("inc_volume", tr("Increase volume"), SIGNAL(IncVolume()));
AddShortcut("dec_volume", tr("Decrease volume"), SIGNAL(DecVolume()));
AddShortcut("mute", tr("Mute"), SIGNAL(Mute()));

View File

@ -22,6 +22,8 @@
#include <QKeySequence>
#include <QMap>
#include <boost/scoped_ptr.hpp>
class MacGlobalShortcutBackendPrivate;
class QAction;
@ -51,7 +53,7 @@ private:
} accessibility_status_;
friend class MacGlobalShortcutBackendPrivate;
MacGlobalShortcutBackendPrivate* p_;
boost::scoped_ptr<MacGlobalShortcutBackendPrivate> p_;
};
#endif // MACGLOBALSHORTCUTBACKEND_H

View File

@ -139,7 +139,6 @@ MacGlobalShortcutBackend::MacGlobalShortcutBackend(GlobalShortcuts* parent)
}
MacGlobalShortcutBackend::~MacGlobalShortcutBackend() {
delete p_;
}
bool MacGlobalShortcutBackend::DoRegister() {
@ -170,13 +169,13 @@ void MacGlobalShortcutBackend::DoUnregister() {
void MacGlobalShortcutBackend::MacMediaKeyPressed(int key) {
switch (key) {
case NX_KEYTYPE_PLAY:
manager_->shortcuts()["play_pause"].action->trigger();
KeyPressed(Qt::Key_MediaPlay);
break;
case NX_KEYTYPE_FAST:
manager_->shortcuts()["next_track"].action->trigger();
KeyPressed(Qt::Key_MediaNext);
break;
case NX_KEYTYPE_REWIND:
manager_->shortcuts()["prev_track"].action->trigger();
KeyPressed(Qt::Key_MediaPrevious);
break;
}
}