mirror of https://github.com/stella-emu/stella.git
fixed the quit bug in issue #850
This commit is contained in:
parent
10bde004ed
commit
72dd4b3ebb
|
@ -1558,6 +1558,8 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
|
|||
saveJoyMapping();
|
||||
if (myState != EventHandlerState::LAUNCHER)
|
||||
exitEmulation();
|
||||
else
|
||||
exitLauncher();
|
||||
myOSystem.quit();
|
||||
}
|
||||
return;
|
||||
|
@ -2715,6 +2717,12 @@ void EventHandler::setState(EventHandlerState state)
|
|||
myEvent.clear();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void EventHandler::exitLauncher()
|
||||
{
|
||||
myOSystem.launcher().quit();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void EventHandler::exitEmulation(bool checkLauncher)
|
||||
{
|
||||
|
|
|
@ -367,6 +367,7 @@ class EventHandler
|
|||
void saveKeyMapping();
|
||||
void saveJoyMapping();
|
||||
|
||||
void exitLauncher();
|
||||
void exitEmulation(bool checkLauncher = false);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -84,6 +84,12 @@ void Launcher::reload()
|
|||
(static_cast<LauncherDialog*>(myBaseDialog))->reload();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Launcher::quit()
|
||||
{
|
||||
(static_cast<LauncherDialog*>(myBaseDialog))->quit();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Dialog* Launcher::baseDialog()
|
||||
{
|
||||
|
|
|
@ -65,6 +65,11 @@ class Launcher : public DialogContainer
|
|||
*/
|
||||
void reload();
|
||||
|
||||
/**
|
||||
Wrapper for LauncherDialog::quit() method.
|
||||
*/
|
||||
void quit();
|
||||
|
||||
/**
|
||||
Return (and possibly create) the bottom-most dialog of this container.
|
||||
*/
|
||||
|
|
|
@ -431,6 +431,12 @@ void LauncherDialog::reload()
|
|||
myPendingReload = false;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void LauncherDialog::quit()
|
||||
{
|
||||
saveConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void LauncherDialog::tick()
|
||||
{
|
||||
|
|
|
@ -96,6 +96,12 @@ class LauncherDialog : public Dialog
|
|||
*/
|
||||
void reload();
|
||||
|
||||
/**
|
||||
Quit the dialog
|
||||
*/
|
||||
void quit();
|
||||
|
||||
|
||||
void tick() override;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue