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

View file

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

View file

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