Delay loading command line arguments until after Aegisub is fully initialized

This commit is contained in:
Thomas Goyne 2013-02-05 07:52:24 -08:00
parent f0054f61bc
commit 40a7a452a2
3 changed files with 12 additions and 12 deletions

View File

@ -180,8 +180,8 @@ public:
}
};
FrameMain::FrameMain (wxArrayString args)
: wxFrame(0,-1,"",wxDefaultPosition,wxSize(920,700),wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN)
FrameMain::FrameMain()
: wxFrame(nullptr, -1, "", wxDefaultPosition, wxSize(920,700), wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN)
, context(new agi::Context)
, showVideo(true)
, showAudio(true)
@ -280,9 +280,6 @@ FrameMain::FrameMain (wxArrayString args)
Show();
SetDisplayMode(1, 1);
StartupLog("Load files specified on command line");
LoadList(args);
// Version checker
StartupLog("Possibly perform automatic updates check");
if (OPT_GET("App/First Start")->GetBool()) {

View File

@ -87,7 +87,6 @@ class FrameMain: public wxFrame {
void InitContents();
void OnFilesDropped(wxThreadEvent &evt);
bool LoadList(wxArrayString list);
void UpdateTitle();
void OnKeyDown(wxKeyEvent &event);
@ -116,7 +115,7 @@ class FrameMain: public wxFrame {
wxBoxSizer *ToolsSizer; ///< Arranges audio and editing areas top to bottom
public:
FrameMain(wxArrayString args);
FrameMain();
~FrameMain();
/// Set the status bar text
@ -132,5 +131,7 @@ public:
bool IsVideoShown() const { return showVideo; }
bool IsAudioShown() const { return showAudio; }
bool LoadList(wxArrayString list);
DECLARE_EVENT_TABLE()
};

View File

@ -233,16 +233,18 @@ bool AegisubApp::OnInit() {
AssExportFilterChain::Register(new AssFixStylesFilter);
AssExportFilterChain::Register(new AssTransformFramerateFilter);
// Open main frame
StartupLog("Create main window");
frame = new FrameMain;
SetTopWindow(frame);
// Get parameter subs
StartupLog("Parse command line");
wxArrayString subs;
for (int i = 1; i < argc; ++i)
subs.push_back(argv[i]);
// Open main frame
StartupLog("Create main window");
frame = new FrameMain(subs);
SetTopWindow(frame);
if (!subs.empty())
frame->LoadList(subs);
}
catch (const char *err) {