@ -208,21 +208,22 @@ void GMainWindow::InitializeRecentFileMenuActions() {
}
void GMainWindow : : InitializeHotkeys ( ) {
RegisterHotkey( " Main Window " , " Load File " , QKeySequence : : Open ) ;
RegisterHotkey( " Main Window " , " Start Emulation " ) ;
RegisterHotkey( " Main Window " , " Continue/Pause " , QKeySequence ( Qt : : Key_F4 ) ) ;
RegisterHotkey( " Main Window " , " Fullscreen " , QKeySequence : : FullScreen ) ;
RegisterHotkey( " Main Window " , " Exit Fullscreen " , QKeySequence ( Qt : : Key_Escape ) ,
hotkey_registry. RegisterHotkey( " Main Window " , " Load File " , QKeySequence : : Open ) ;
hotkey_registry. RegisterHotkey( " Main Window " , " Start Emulation " ) ;
hotkey_registry. RegisterHotkey( " Main Window " , " Continue/Pause " , QKeySequence ( Qt : : Key_F4 ) ) ;
hotkey_registry. RegisterHotkey( " Main Window " , " Fullscreen " , QKeySequence : : FullScreen ) ;
hotkey_registry. RegisterHotkey( " Main Window " , " Exit Fullscreen " , QKeySequence ( Qt : : Key_Escape ) ,
Qt : : ApplicationShortcut ) ;
RegisterHotkey( " Main Window " , " Toggle Speed Limit " , QKeySequence ( " CTRL+Z " ) ,
hotkey_registry. RegisterHotkey( " Main Window " , " Toggle Speed Limit " , QKeySequence ( " CTRL+Z " ) ,
Qt : : ApplicationShortcut ) ;
LoadHotkeys( ) ;
hotkey_registry. LoadHotkeys( ) ;
connect ( GetHotkey ( " Main Window " , " Load File " , this ) , & QShortcut : : activated , this ,
& GMainWindow : : OnMenuLoadFile ) ;
connect ( GetHotkey ( " Main Window " , " Start Emulation " , this ) , & QShortcut : : activated , this ,
& GMainWindow : : OnStartGame ) ;
connect ( GetHotkey ( " Main Window " , " Continue/Pause " , this ) , & QShortcut : : activated , this , [ & ] {
connect ( hotkey_registry . GetHotkey ( " Main Window " , " Load File " , this ) , & QShortcut : : activated ,
this , & GMainWindow : : OnMenuLoadFile ) ;
connect ( hotkey_registry . GetHotkey ( " Main Window " , " Start Emulation " , this ) ,
& QShortcut : : activated , this , & GMainWindow : : OnStartGame ) ;
connect ( hotkey_registry . GetHotkey ( " Main Window " , " Continue/Pause " , this ) , & QShortcut : : activated ,
this , [ & ] {
if ( emulation_running ) {
if ( emu_thread - > IsRunning ( ) ) {
OnPauseGame ( ) ;
@ -231,17 +232,19 @@ void GMainWindow::InitializeHotkeys() {
}
}
} ) ;
connect ( GetHotkey ( " Main Window " , " Fullscreen " , render_window ) , & QShortcut : : activated ,
ui . action_Fullscreen , & QAction : : trigger ) ;
connect ( GetHotkey ( " Main Window " , " Fullscreen " , render_window ) , & QShortcut : : activatedAmbiguously ,
ui . action_Fullscreen , & QAction : : trigger ) ;
connect ( GetHotkey ( " Main Window " , " Exit Fullscreen " , this ) , & QShortcut : : activated , this , [ & ] {
connect ( hotkey_registry . GetHotkey ( " Main Window " , " Fullscreen " , render_window ) ,
& QShortcut : : activated , ui . action_Fullscreen , & QAction : : trigger ) ;
connect ( hotkey_registry . GetHotkey ( " Main Window " , " Fullscreen " , render_window ) ,
& QShortcut : : activatedAmbiguously , ui . action_Fullscreen , & QAction : : trigger ) ;
connect ( hotkey_registry . GetHotkey ( " Main Window " , " Exit Fullscreen " , this ) ,
& QShortcut : : activated , this , [ & ] {
if ( emulation_running ) {
ui . action_Fullscreen - > setChecked ( false ) ;
ToggleFullscreen ( ) ;
}
} ) ;
connect ( GetHotkey ( " Main Window " , " Toggle Speed Limit " , this ) , & QShortcut : : activated , this , [ & ] {
connect ( hotkey_registry . GetHotkey ( " Main Window " , " Toggle Speed Limit " , this ) ,
& QShortcut : : activated , this , [ & ] {
Settings : : values . toggle_framelimit = ! Settings : : values . toggle_framelimit ;
UpdateStatusBar ( ) ;
} ) ;
@ -323,7 +326,8 @@ void GMainWindow::ConnectMenuEvents() {
connect ( ui . action_Show_Status_Bar , & QAction : : triggered , statusBar ( ) , & QStatusBar : : setVisible ) ;
// Fullscreen
ui . action_Fullscreen - > setShortcut ( GetHotkey ( " Main Window " , " Fullscreen " , this ) - > key ( ) ) ;
ui . action_Fullscreen - > setShortcut (
hotkey_registry . GetHotkey ( " Main Window " , " Fullscreen " , this ) - > key ( ) ) ;
connect ( ui . action_Fullscreen , & QAction : : triggered , this , & GMainWindow : : ToggleFullscreen ) ;
// Help
@ -757,7 +761,7 @@ void GMainWindow::ToggleWindowMode() {
}
void GMainWindow : : OnConfigure ( ) {
ConfigureDialog configureDialog ( this );
ConfigureDialog configureDialog ( this , hotkey_registry );
auto old_theme = UISettings : : values . theme ;
auto result = configureDialog . exec ( ) ;
if ( result = = QDialog : : Accepted ) {
@ -896,7 +900,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) {
UISettings : : values . first_start = false ;
game_list - > SaveInterfaceLayout ( ) ;
SaveHotkeys( ) ;
hotkey_registry. SaveHotkeys( ) ;
// Shutdown session if the emu thread is active...
if ( emu_thread ! = nullptr )