Skip to content

Commit

Permalink
Merge pull request #2994 from aserna3/master
Browse files Browse the repository at this point in the history
Properly implemented confirm on stop CLI switch
  • Loading branch information
degasus committed Sep 7, 2015
2 parents a9a339a + a5d6072 commit 5585c5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
17 changes: 11 additions & 6 deletions Source/Core/DolphinWX/Main.cpp
Expand Up @@ -189,9 +189,9 @@ void DolphinApp::OnInitCmdLine(wxCmdLineParser& parser)
wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_SWITCH, "n", "noconfirm",
"Disable Confirm on Stop",
wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL
wxCMD_LINE_OPTION, "c", "confirm",
"Set Confirm on Stop",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_OPTION, "v", "video_backend",
Expand Down Expand Up @@ -239,7 +239,7 @@ bool DolphinApp::OnCmdLineParsed(wxCmdLineParser& parser)
m_use_debugger = parser.Found("debugger");
m_use_logger = parser.Found("logger");
m_batch_mode = parser.Found("batch");
m_no_confirm_stop = parser.Found("noconfirm");
m_confirm_stop = parser.Found("confirm", &m_confirm_setting);
m_select_video_backend = parser.Found("video_backend", &m_video_backend_name);
m_select_audio_emulation = parser.Found("audio_emulation", &m_audio_emulation_name);
m_play_movie = parser.Found("movie", &m_movie_file);
Expand Down Expand Up @@ -279,8 +279,13 @@ void DolphinApp::AfterInit()
if (!m_batch_mode)
main_frame->UpdateGameList();

if (m_no_confirm_stop)
SConfig::GetInstance().bConfirmStop = false;
if (m_confirm_stop)
{
if (m_confirm_setting.Upper() == "TRUE")
SConfig::GetInstance().bConfirmStop = true;
else if (m_confirm_setting.Upper() == "FALSE")
SConfig::GetInstance().bConfirmStop = false;
}

if (m_play_movie && !m_movie_file.empty())
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/DolphinWX/Main.h
Expand Up @@ -36,13 +36,14 @@ class DolphinApp : public wxApp
static bool DolphinEmulatorDotComTextFileExists();

bool m_batch_mode = false;
bool m_no_confirm_stop = false;
bool m_confirm_stop = false;
bool m_load_file = false;
bool m_play_movie = false;
bool m_use_debugger = false;
bool m_use_logger = false;
bool m_select_video_backend = false;
bool m_select_audio_emulation = false;
wxString m_confirm_setting;
wxString m_video_backend_name;
wxString m_audio_emulation_name;
wxString m_user_path;
Expand Down

0 comments on commit 5585c5a

Please sign in to comment.