summaryrefslogtreecommitdiffstats
path: root/Project/main.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2019-01-22 14:52:22 -0200
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2019-01-22 14:52:22 -0200
commitd602520404c6049ccc08ad1671e9d734ccaf3b2b (patch)
tree98c822fc1951b52117e0172f0a6c99e803ec2415 /Project/main.cpp
parenta1c362b8a5e989cf9e75be14383fe8f7d3625422 (diff)
parent5a06bb4424311cbb728af35fe73d259499d7c9bf (diff)
downloadPSP.git-d602520404c6049ccc08ad1671e9d734ccaf3b2b.tar.gz
PSP.git-d602520404c6049ccc08ad1671e9d734ccaf3b2b.tar.xz
PSP.git-d602520404c6049ccc08ad1671e9d734ccaf3b2b.zip
Merge error removal (2)
Diffstat (limited to 'Project/main.cpp')
-rw-r--r--Project/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Project/main.cpp b/Project/main.cpp
index 61b7fc2..718dd06 100644
--- a/Project/main.cpp
+++ b/Project/main.cpp
@@ -17,6 +17,8 @@ class MainApp : public wxApp
virtual ~MainApp() {}
bool LoadInitFile(PropertiesData* propertiesData)
{
+ // Load configuration file, if don't exists create it.
+ // Find the executable location path.
wxFileName fn(wxStandardPaths::Get().GetExecutablePath());
wxTextFile file(fn.GetPath() + wxFileName::GetPathSeparator() + "config.ini");
auto data = propertiesData->GetGeneralPropertiesData();
@@ -77,6 +79,7 @@ class MainApp : public wxApp
void LoadCatalogs(wxLocale* locale, PropertiesData* propertiesData)
{
+ // Load language catalogs according the propertiesData attribute.
if(!locale->Init(propertiesData->GetGeneralPropertiesData().language, wxLOCALE_DONT_LOAD_DEFAULT)) {
wxMessageDialog msgDialog(NULL, _("This language is not supported by the system."), _("Error"),
wxOK | wxCENTRE | wxICON_ERROR);
@@ -109,7 +112,8 @@ class MainApp : public wxApp
LoadCatalogs(locale, propertiesData);
wxString openFilePath = "";
-
+
+ // Load command line attributes. This is used to directly open saved files (.psp).
wxCmdLineParser cmdLineParser(wxApp::argc, wxApp::argv);
cmdLineParser.AddParam("", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
if(cmdLineParser.Parse() == 0) {
@@ -120,6 +124,7 @@ class MainApp : public wxApp
}
MainFrame* mainFrame = new MainFrame(NULL, locale, propertiesData, openFilePath);
#ifdef __WXMSW__
+ //Set application icon for windows
mainFrame->SetIcon(wxICON(aaaaprogicon));
#endif
SetTopWindow(mainFrame);