From d2becd3338996893c01515380dcafe2088b9171e Mon Sep 17 00:00:00 2001 From: "code@koerner-de.net" Date: Thu, 13 Oct 2011 19:37:12 +0000 Subject: [PATCH] BugFix: - when loading a template, the layout function of the sizer is called, thus the new packages are also shown - Author and NoComment are also loaded from a language pack --- OTM_GUI/OTM_GUI.cpp | 5 ++++- OTM_GUI/OTM_GamePage.cpp | 3 +++ OTM_GUI/OTM_Language.cpp | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/OTM_GUI/OTM_GUI.cpp b/OTM_GUI/OTM_GUI.cpp index 553cc4c..7e7c058 100644 --- a/OTM_GUI/OTM_GUI.cpp +++ b/OTM_GUI/OTM_GUI.cpp @@ -375,7 +375,10 @@ void OTM_Frame::OnMenuOpenTemplate(wxCommandEvent& WXUNUSED(event)) //wxString file_name = wxFileSelector( Language->ChooseFile, page->GetOpenPath(), "", "*.*", "textures (*.dds)|*.dds|zip (*.zip)|*.zip|tpf (*.tpf)|*.tpf", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); - wxString file_name = wxFileSelector( Language->ChooseFile, wxGetCwd(), "", "", "", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); + + wxString dir = wxGetCwd(); + dir << "/templates"; + wxString file_name = wxFileSelector( Language->ChooseFile, dir, "", "*.txt", "text (*.txt)|*.txt", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); if ( !file_name.empty() ) { if (page->LoadTemplate( file_name)) diff --git a/OTM_GUI/OTM_GamePage.cpp b/OTM_GUI/OTM_GamePage.cpp index a7d9121..7b4ec07 100644 --- a/OTM_GUI/OTM_GamePage.cpp +++ b/OTM_GUI/OTM_GamePage.cpp @@ -393,6 +393,9 @@ int OTM_GamePage::LoadTemplate( const wxString &file_name) } delete [] checked; NumberOfEntry = new_NumberOfEntry; + + MainSizer->Layout(); + MainSizer->FitInside(this); return 0; } diff --git a/OTM_GUI/OTM_Language.cpp b/OTM_GUI/OTM_Language.cpp index 249f857..d96fd0a 100644 --- a/OTM_GUI/OTM_Language.cpp +++ b/OTM_GUI/OTM_Language.cpp @@ -246,6 +246,8 @@ int OTM_Language::LoadLanguage(const wxString &name) CheckEntry( command, msg, DeleteGame) CheckEntry( command, msg, GameAlreadyAdded) CheckEntry( command, msg, ExitGameAnyway) + CheckEntry( command, msg, NoComment) + CheckEntry( command, msg, Author) CheckEntry( command, msg, Error_FileNotSupported) CheckEntry( command, msg, Error_FktNotFound) CheckEntry( command, msg, Error_DLLNotFound)