From 89f25edc5dc7d43e83123969679522ea98329af5 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Tue, 22 Apr 2014 22:40:36 +0800 Subject: [PATCH] Show UI before opening any file --- ChangeLog | 1 + src/xmlcopyeditor.cpp | 18 +++++++----------- src/xmlcopyeditor.h | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33eb17c..230dedc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ + x64 installation package + Supported HTTPS on validation * Auto complete list for DTDs that are on the internet + * Show UI before opening any file * Fixed tab order * Fixed encoding problems * Fixed invisible captions in high contrast mode (Windows only, http://trac.wxwidgets.org/ticket/16186) diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index a87ee1e..f44ce6d 100644 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -387,6 +387,13 @@ bool MyApp::OnInit() singleInstanceCheck, lang ); frame->Show ( true ); + + bool rememberOpenTabs = config->Read ( _T ( "rememberOpenTabs" ), true ); + if ( rememberOpenTabs ) + frame->openRememberedTabs(); + else if ( !frame->getHandleCommandLineFlag() ) + frame->newDocument ( wxEmptyString ); + if ( frame->getHandleCommandLineFlag() ) frame->handleCommandLine(); } @@ -1033,21 +1040,10 @@ MyFrame::MyFrame ( // handle command line and, on Windows, MS Word integration handleCommandLineFlag = ( wxTheApp->argc > 1 ) ? true : false; - if ( rememberOpenTabs && !openTabsOnClose.empty() ) - openRememberedTabs(); - else - { - if ( !handleCommandLineFlag ) - newDocument ( wxEmptyString ); - } - #ifdef __WXMSW__ DragAcceptFiles ( true ); // currently Windows only #endif - XmlDoc *doc = getActiveDocument(); - insertEntityPanel->update ( doc ); // NULL is ok - manager.Update(); /* diff --git a/src/xmlcopyeditor.h b/src/xmlcopyeditor.h index 425fd26..1f929f4 100644 --- a/src/xmlcopyeditor.h +++ b/src/xmlcopyeditor.h @@ -353,6 +353,7 @@ class MyFrame : public wxFrame bool activateTab ( const wxString& fileName ); void reloadTab(); void addToFileQueue ( wxString& fileName ); + void openRememberedTabs(); private: wxAuiManager manager; wxFileConfig *config; // owned by MyApp @@ -536,7 +537,6 @@ class MyFrame : public wxFrame void showTopBars ( bool b ); void modifiedMessage(); void loadBitmaps(); - void openRememberedTabs(); void getRawText ( XmlDoc *doc, std::string& buffer ); void updateToolbar(); std::string getApproximateEncoding ( char *docBuffer, size_t docBufferLen );