Fix a segfault when the debugger is used and dolphin exits.
Put the filename back into the "Saving settings ..." notice log (soren don't remove this again.) Added a "batch" mode command line option. Now dolphin will not exit with the emulator if a file is run from the command line unless you also use the "batch" option. For example in linux "dolphin-emu -b -e filename". git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5859 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
543bb3ae4c
commit
07973f726e
|
@ -68,7 +68,7 @@ SConfig::~SConfig()
|
||||||
|
|
||||||
void SConfig::SaveSettings()
|
void SConfig::SaveSettings()
|
||||||
{
|
{
|
||||||
NOTICE_LOG(BOOT, "Saving settings");
|
NOTICE_LOG(BOOT, "Saving settings to %s", File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
|
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
|
||||||
|
|
||||||
|
|
|
@ -168,6 +168,8 @@ class CCodeWindow
|
||||||
wxMenuItem* jitpoff;
|
wxMenuItem* jitpoff;
|
||||||
wxMenuItem* jitsroff;
|
wxMenuItem* jitsroff;
|
||||||
|
|
||||||
|
std::string fontDesc;
|
||||||
|
|
||||||
CCodeView* codeview;
|
CCodeView* codeview;
|
||||||
wxListBox* callstack;
|
wxListBox* callstack;
|
||||||
wxListBox* symbols;
|
wxListBox* symbols;
|
||||||
|
|
|
@ -87,7 +87,6 @@ void CCodeWindow::Load()
|
||||||
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
|
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
|
||||||
|
|
||||||
// The font to override DebuggerFont with
|
// The font to override DebuggerFont with
|
||||||
std::string fontDesc;
|
|
||||||
ini.Get("ShowOnStart", "DebuggerFont", &fontDesc);
|
ini.Get("ShowOnStart", "DebuggerFont", &fontDesc);
|
||||||
if (!fontDesc.empty())
|
if (!fontDesc.empty())
|
||||||
DebuggerFont.SetNativeFontInfoUserDesc(wxString::FromAscii(fontDesc.c_str()));
|
DebuggerFont.SetNativeFontInfoUserDesc(wxString::FromAscii(fontDesc.c_str()));
|
||||||
|
@ -135,7 +134,7 @@ void CCodeWindow::Save()
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
|
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
|
||||||
|
|
||||||
ini.Set("ShowOnStart", "DebuggerFont", std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str()));
|
ini.Set("ShowOnStart", "DebuggerFont", fontDesc);
|
||||||
|
|
||||||
// Boot to pause or not
|
// Boot to pause or not
|
||||||
ini.Set("ShowOnStart", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
|
ini.Set("ShowOnStart", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
|
||||||
|
@ -427,7 +426,10 @@ void CCodeWindow::OnChangeFont(wxCommandEvent& event)
|
||||||
|
|
||||||
wxFontDialog dialog(this, data);
|
wxFontDialog dialog(this, data);
|
||||||
if ( dialog.ShowModal() == wxID_OK )
|
if ( dialog.ShowModal() == wxID_OK )
|
||||||
|
{
|
||||||
DebuggerFont = dialog.GetFontData().GetChosenFont();
|
DebuggerFont = dialog.GetFontData().GetChosenFont();
|
||||||
|
fontDesc = std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -342,6 +342,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
bool _UseDebugger,
|
bool _UseDebugger,
|
||||||
|
bool _BatchMode,
|
||||||
bool ShowLogWindow,
|
bool ShowLogWindow,
|
||||||
long style)
|
long style)
|
||||||
: CRenderFrame(parent, id, title, pos, size, style)
|
: CRenderFrame(parent, id, title, pos, size, style)
|
||||||
|
@ -352,8 +353,8 @@ CFrame::CFrame(wxFrame* parent,
|
||||||
, bFloatLogWindow(false), bFloatConsoleWindow(false)
|
, bFloatLogWindow(false), bFloatConsoleWindow(false)
|
||||||
, m_pStatusBar(NULL), m_GameListCtrl(NULL), m_Panel(NULL)
|
, m_pStatusBar(NULL), m_GameListCtrl(NULL), m_Panel(NULL)
|
||||||
, m_RenderFrame(NULL), m_RenderParent(NULL)
|
, m_RenderFrame(NULL), m_RenderParent(NULL)
|
||||||
, m_LogWindow(NULL)
|
, m_LogWindow(NULL), UseDebugger(_UseDebugger)
|
||||||
, UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false)
|
, m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false)
|
||||||
, m_bControlsCreated(false), m_bGameLoading(false), m_StopDlg(NULL)
|
, m_bControlsCreated(false), m_bGameLoading(false), m_StopDlg(NULL)
|
||||||
#if wxUSE_TIMER
|
#if wxUSE_TIMER
|
||||||
, m_timer(this)
|
, m_timer(this)
|
||||||
|
|
|
@ -95,6 +95,7 @@ class CFrame : public CRenderFrame
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
bool _UseDebugger = false,
|
bool _UseDebugger = false,
|
||||||
|
bool _BatchMode = false,
|
||||||
bool ShowLogWindow = false,
|
bool ShowLogWindow = false,
|
||||||
long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
|
long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
|
||||||
|
|
||||||
|
@ -233,6 +234,7 @@ class CFrame : public CRenderFrame
|
||||||
wxToolBarToolBase* m_ToolPlay;
|
wxToolBarToolBase* m_ToolPlay;
|
||||||
CLogWindow* m_LogWindow;
|
CLogWindow* m_LogWindow;
|
||||||
bool UseDebugger;
|
bool UseDebugger;
|
||||||
|
bool m_bBatchMode;
|
||||||
bool m_bEdit;
|
bool m_bEdit;
|
||||||
bool m_bTabSplit;
|
bool m_bTabSplit;
|
||||||
bool m_bNoDocking;
|
bool m_bNoDocking;
|
||||||
|
|
|
@ -904,10 +904,8 @@ void CFrame::DoStop()
|
||||||
// Clean framerate indications from the status bar.
|
// Clean framerate indications from the status bar.
|
||||||
m_pStatusBar->SetStatusText(wxT(" "), 0);
|
m_pStatusBar->SetStatusText(wxT(" "), 0);
|
||||||
|
|
||||||
extern bool LoadFile;
|
// If batch mode was specified on the command-line, exit now.
|
||||||
|
if (m_bBatchMode)
|
||||||
// If an executable was specified on the command-line, exit now.
|
|
||||||
if (LoadFile)
|
|
||||||
Close(true);
|
Close(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,6 @@ END_EVENT_TABLE()
|
||||||
bool wxMsgAlert(const char*, const char*, bool, int);
|
bool wxMsgAlert(const char*, const char*, bool, int);
|
||||||
|
|
||||||
CFrame* main_frame = NULL;
|
CFrame* main_frame = NULL;
|
||||||
bool LoadFile = false;
|
|
||||||
static wxString FileToLoad;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
//Has no error handling.
|
//Has no error handling.
|
||||||
|
@ -92,6 +90,7 @@ bool DolphinApp::OnInit()
|
||||||
{
|
{
|
||||||
// Declarations and definitions
|
// Declarations and definitions
|
||||||
bool UseDebugger = false;
|
bool UseDebugger = false;
|
||||||
|
bool BatchMode = false;
|
||||||
bool UseLogger = false;
|
bool UseLogger = false;
|
||||||
bool selectVideoPlugin = false;
|
bool selectVideoPlugin = false;
|
||||||
bool selectAudioPlugin = false;
|
bool selectAudioPlugin = false;
|
||||||
|
@ -119,6 +118,9 @@ bool DolphinApp::OnInit()
|
||||||
wxCMD_LINE_OPTION, "e", "exec", "Loads the specified file (DOL, ELF, WAD, GCM, ISO)",
|
wxCMD_LINE_OPTION, "e", "exec", "Loads the specified file (DOL, ELF, WAD, GCM, ISO)",
|
||||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
wxCMD_LINE_SWITCH, "b", "batch", "Exit Dolphin with emulator"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
wxCMD_LINE_OPTION, "V", "video_plugin","Specify a video plugin",
|
wxCMD_LINE_OPTION, "V", "video_plugin","Specify a video plugin",
|
||||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||||
|
@ -153,6 +155,9 @@ bool DolphinApp::OnInit()
|
||||||
wxCMD_LINE_OPTION, _("e"), _("exec"), wxT("Loads the specified file (DOL, ELF, WAD, GCM, ISO)"),
|
wxCMD_LINE_OPTION, _("e"), _("exec"), wxT("Loads the specified file (DOL, ELF, WAD, GCM, ISO)"),
|
||||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
wxCMD_LINE_SWITCH, _("b"), _("batch"), wxT("Exit Dolphin with emulator")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
wxCMD_LINE_OPTION, _("V"), _("video_plugin"), wxT("Specify a video plugin"),
|
wxCMD_LINE_OPTION, _("V"), _("video_plugin"), wxT("Specify a video plugin"),
|
||||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||||
|
@ -181,10 +186,12 @@ bool DolphinApp::OnInit()
|
||||||
UseDebugger = parser.Found("debugger");
|
UseDebugger = parser.Found("debugger");
|
||||||
UseLogger = parser.Found("logger");
|
UseLogger = parser.Found("logger");
|
||||||
LoadFile = parser.Found("exec", &FileToLoad);
|
LoadFile = parser.Found("exec", &FileToLoad);
|
||||||
|
BatchMode = parser.Found("batch");
|
||||||
#else
|
#else
|
||||||
UseDebugger = parser.Found(wxT("debugger"));
|
UseDebugger = parser.Found(wxT("debugger"));
|
||||||
UseLogger = parser.Found(wxT("logger"));
|
UseLogger = parser.Found(wxT("logger"));
|
||||||
LoadFile = parser.Found(wxT("exec"), &FileToLoad);
|
LoadFile = parser.Found(wxT("exec"), &FileToLoad);
|
||||||
|
BatchMode = parser.Found(wxT("batch"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxCHECK_VERSION(2, 9, 0)
|
#if wxCHECK_VERSION(2, 9, 0)
|
||||||
|
@ -368,7 +375,7 @@ bool DolphinApp::OnInit()
|
||||||
main_frame = new CFrame((wxFrame*)NULL, wxID_ANY,
|
main_frame = new CFrame((wxFrame*)NULL, wxID_ANY,
|
||||||
wxString::FromAscii(svn_rev_str),
|
wxString::FromAscii(svn_rev_str),
|
||||||
wxPoint(x, y), wxSize(w, h),
|
wxPoint(x, y), wxSize(w, h),
|
||||||
UseDebugger, UseLogger);
|
UseDebugger, BatchMode, UseLogger);
|
||||||
SetTopWindow(main_frame);
|
SetTopWindow(main_frame);
|
||||||
|
|
||||||
#if defined HAVE_X11 && HAVE_X11
|
#if defined HAVE_X11 && HAVE_X11
|
||||||
|
|
|
@ -34,6 +34,8 @@ private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
||||||
wxTimer *m_afterinit;
|
wxTimer *m_afterinit;
|
||||||
|
bool LoadFile;
|
||||||
|
wxString FileToLoad;
|
||||||
|
|
||||||
void AfterInit(wxTimerEvent& WXUNUSED(event));
|
void AfterInit(wxTimerEvent& WXUNUSED(event));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue