Fix of 1.42.0-Alpha1 won't open from self contained folder #1500

Added some missing UTF8 to wxString path explicit conversions.
This commit is contained in:
bubnikv 2019-01-03 12:32:13 +01:00
parent d426895580
commit 0d7e53badb
3 changed files with 6 additions and 6 deletions

View File

@ -36,7 +36,7 @@ bool GLTexture::load_from_file(const std::string& filename, bool generate_mipmap
// Load a PNG with an alpha channel.
wxImage image;
if (!image.LoadFile(filename, wxBITMAP_TYPE_PNG))
if (!image.LoadFile(wxString::FromUTF8(filename), wxBITMAP_TYPE_PNG))
{
reset();
return false;

View File

@ -459,7 +459,7 @@ bool GUI_App::select_language( wxArrayString & names,
{
m_wxLocale = new wxLocale;
m_wxLocale->Init(identifiers[index]);
m_wxLocale->AddCatalogLookupPathPrefix(localization_dir());
m_wxLocale->AddCatalogLookupPathPrefix(wxString::FromUTF8(localization_dir()));
m_wxLocale->AddCatalog(/*GetAppName()*/"Slic3rPE");
wxSetlocale(LC_NUMERIC, "C");
#ifdef WIN32
@ -489,7 +489,7 @@ bool GUI_App::load_language()
{
m_wxLocale = new wxLocale;
m_wxLocale->Init(identifiers[i]);
m_wxLocale->AddCatalogLookupPathPrefix(localization_dir());
m_wxLocale->AddCatalogLookupPathPrefix(wxString::FromUTF8(localization_dir()));
m_wxLocale->AddCatalog(/*GetAppName()*/"Slic3rPE");
wxSetlocale(LC_NUMERIC, "C");
#ifdef WIN32
@ -519,7 +519,7 @@ void GUI_App::get_installed_languages(wxArrayString & names, wxArrayLong & ident
names.Clear();
identifiers.Clear();
wxDir dir(localization_dir());
wxDir dir(wxString::FromUTF8(localization_dir()));
wxString filename;
const wxLanguageInfo * langinfo;
wxString name = wxLocale::GetLanguageName(wxLANGUAGE_DEFAULT);

View File

@ -37,7 +37,7 @@ wxMenuItem* append_menu_item(wxMenu* menu, int id, const wxString& string, const
wxMenuItem* append_menu_item(wxMenu* menu, int id, const wxString& string, const wxString& description,
std::function<void(wxCommandEvent& event)> cb, const std::string& icon, wxEvtHandler* event_handler)
{
const wxBitmap& bmp = !icon.empty() ? wxBitmap(Slic3r::var(icon), wxBITMAP_TYPE_PNG) : wxNullBitmap;
const wxBitmap& bmp = !icon.empty() ? wxBitmap(wxString::FromUTF8(Slic3r::var(icon)), wxBITMAP_TYPE_PNG) : wxNullBitmap;
return append_menu_item(menu, id, string, description, cb, bmp, event_handler);
}
@ -48,7 +48,7 @@ wxMenuItem* append_submenu(wxMenu* menu, wxMenu* sub_menu, int id, const wxStrin
wxMenuItem* item = new wxMenuItem(menu, id, string, description);
if (!icon.empty())
item->SetBitmap(wxBitmap(Slic3r::var(icon), wxBITMAP_TYPE_PNG));
item->SetBitmap(wxBitmap(wxString::FromUTF8(Slic3r::var(icon)), wxBITMAP_TYPE_PNG));
item->SetSubMenu(sub_menu);
menu->Append(item);