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 // Create actions
AddShortcut("play", tr("Play"), SIGNAL(Play())); AddShortcut("play", tr("Play"), SIGNAL(Play()));
AddShortcut("pause", tr("Pause"), SIGNAL(Pause())); AddShortcut("pause", tr("Pause"), SIGNAL(Pause()));
AddShortcut("play_pause", tr("Play/Pause"), SIGNAL(PlayPause())); //QKeySequence(Qt::Key_MediaPlay)); AddShortcut("play_pause", tr("Play/Pause"), SIGNAL(PlayPause()), QKeySequence(Qt::Key_MediaPlay));
AddShortcut("stop", tr("Stop"), SIGNAL(Stop()));// QKeySequence(Qt::Key_MediaStop)); AddShortcut("stop", tr("Stop"), SIGNAL(Stop()), QKeySequence(Qt::Key_MediaStop));
AddShortcut("stop_after", tr("Stop playing after current track"), SIGNAL(StopAfter())); AddShortcut("stop_after", tr("Stop playing after current track"), SIGNAL(StopAfter()));
AddShortcut("next_track", tr("Next track"), SIGNAL(Next()));// QKeySequence(Qt::Key_MediaNext)); 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("prev_track", tr("Previous track"), SIGNAL(Previous()), QKeySequence(Qt::Key_MediaPrevious));
AddShortcut("inc_volume", tr("Increase volume"), SIGNAL(IncVolume())); AddShortcut("inc_volume", tr("Increase volume"), SIGNAL(IncVolume()));
AddShortcut("dec_volume", tr("Decrease volume"), SIGNAL(DecVolume())); AddShortcut("dec_volume", tr("Decrease volume"), SIGNAL(DecVolume()));
AddShortcut("mute", tr("Mute"), SIGNAL(Mute())); AddShortcut("mute", tr("Mute"), SIGNAL(Mute()));

View File

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

View File

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