Merge pull request #6793 from spycrab/qt_hotkeys

Qt: Implement missing hotkeys
This commit is contained in:
spycrab 2018-05-09 13:28:53 +02:00 committed by GitHub
commit 5cd02f0853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -138,6 +138,17 @@ void HotkeyScheduler::Run()
if (!Core::IsRunningAndStarted()) if (!Core::IsRunningAndStarted())
continue; continue;
if (IsHotkey(HK_OPEN))
emit Open();
// Disc
if (IsHotkey(HK_EJECT_DISC))
emit EjectDisc();
if (IsHotkey(HK_CHANGE_DISC))
emit ChangeDisc();
// Fullscreen // Fullscreen
if (IsHotkey(HK_FULLSCREEN)) if (IsHotkey(HK_FULLSCREEN))
emit FullScreenHotkey(); emit FullScreenHotkey();

View File

@ -20,6 +20,10 @@ public:
void Start(); void Start();
void Stop(); void Stop();
signals: signals:
void Open();
void EjectDisc();
void ChangeDisc();
void ExitHotkey(); void ExitHotkey();
void FullScreenHotkey(); void FullScreenHotkey();
void StopHotkey(); void StopHotkey();

View File

@ -334,6 +334,9 @@ void MainWindow::ConnectMenuBar()
void MainWindow::ConnectHotkeys() void MainWindow::ConnectHotkeys()
{ {
connect(m_hotkey_scheduler, &HotkeyScheduler::Open, this, &MainWindow::Open);
connect(m_hotkey_scheduler, &HotkeyScheduler::ChangeDisc, this, &MainWindow::ChangeDisc);
connect(m_hotkey_scheduler, &HotkeyScheduler::EjectDisc, this, &MainWindow::EjectDisc);
connect(m_hotkey_scheduler, &HotkeyScheduler::ExitHotkey, this, &MainWindow::close); connect(m_hotkey_scheduler, &HotkeyScheduler::ExitHotkey, this, &MainWindow::close);
connect(m_hotkey_scheduler, &HotkeyScheduler::TogglePauseHotkey, this, &MainWindow::TogglePause); connect(m_hotkey_scheduler, &HotkeyScheduler::TogglePauseHotkey, this, &MainWindow::TogglePause);
connect(m_hotkey_scheduler, &HotkeyScheduler::StopHotkey, this, &MainWindow::RequestStop); connect(m_hotkey_scheduler, &HotkeyScheduler::StopHotkey, this, &MainWindow::RequestStop);