Qt/MainWindow: Maintain pointer to hotkey window

Prevents multiple hotkey windows from being opened.
This commit is contained in:
Stenzek 2018-10-14 22:15:26 +10:00
parent 211a9bf6d2
commit ea77899ddd
2 changed files with 10 additions and 6 deletions

View file

@ -937,13 +937,15 @@ void MainWindow::ShowAboutDialog()
void MainWindow::ShowHotkeyDialog()
{
auto* hotkey_window = new MappingWindow(this, MappingWindow::Type::MAPPING_HOTKEYS, 0);
if (!m_hotkey_window)
{
m_hotkey_window = new MappingWindow(this, MappingWindow::Type::MAPPING_HOTKEYS, 0);
InstallHotkeyFilter(m_hotkey_window);
}
InstallHotkeyFilter(hotkey_window);
hotkey_window->show();
hotkey_window->raise();
hotkey_window->activateWindow();
m_hotkey_window->show();
m_hotkey_window->raise();
m_hotkey_window->activateWindow();
}
void MainWindow::ShowGraphicsWindow()

View file

@ -29,6 +29,7 @@ class HotkeyScheduler;
class JITWidget;
class LogConfigWidget;
class LogWidget;
class MappingWindow;
class MemoryWidget;
class MenuBar;
class NetPlayDialog;
@ -184,6 +185,7 @@ private:
SettingsWindow* m_settings_window = nullptr;
GraphicsWindow* m_graphics_window = nullptr;
FIFOPlayerWindow* m_fifo_window = nullptr;
MappingWindow* m_hotkey_window = nullptr;
HotkeyScheduler* m_hotkey_scheduler;
NetPlayDialog* m_netplay_dialog;