Commit a3c19a97 authored by twanvl's avatar twanvl

made welcome_window compile on windows again

parent e3bfe793
...@@ -47,12 +47,15 @@ WelcomeWindow::WelcomeWindow() ...@@ -47,12 +47,15 @@ WelcomeWindow::WelcomeWindow()
#endif #endif
wxControl* open_last = nullptr; wxControl* open_last = nullptr;
if (!settings.recent_sets.empty()) { if (!settings.recent_sets.empty()) {
if (wxFileName::FileExists(settings.recent_sets.front()) || wxFileName::DirExists(settings.recent_sets.front()+_("/"))) const String& filename = settings.recent_sets.front();
if (wxFileName::FileExists(filename) || wxFileName::DirExists(filename + _("/"))) {
#ifdef USE_HOVERBUTTON #ifdef USE_HOVERBUTTON
wxFileName n(filename);
open_last = new HoverButtonExt(this, ID_FILE_RECENT, load_resource_image(_("welcome_last")), _BUTTON_("last opened set"), _HELP_1_("last opened set", n.GetName())); open_last = new HoverButtonExt(this, ID_FILE_RECENT, load_resource_image(_("welcome_last")), _BUTTON_("last opened set"), _HELP_1_("last opened set", n.GetName()));
#else #else
open_last = new wxButton(this, ID_FILE_RECENT, _BUTTON_("last opened set")); open_last = new wxButton(this, ID_FILE_RECENT, _BUTTON_("last opened set"));
#endif #endif
}
} }
wxSizer* s1 = new wxBoxSizer(wxHORIZONTAL); wxSizer* s1 = new wxBoxSizer(wxHORIZONTAL);
...@@ -104,8 +107,9 @@ void WelcomeWindow::onOpenLast(wxCommandEvent&) { ...@@ -104,8 +107,9 @@ void WelcomeWindow::onOpenLast(wxCommandEvent&) {
try { try {
close( open_package<Set>(settings.recent_sets.front()) ); close( open_package<Set>(settings.recent_sets.front()) );
} catch (PackageNotFoundError& e) { } catch (PackageNotFoundError& e) {
handle_error(_("Cannot find package ") + e.what() + _(" to open.")); handle_error(_("Cannot find set ") + e.what() + _(" to open."));
settings.recent_sets.clear(); // remove this package from the recent sets, so we don't get this error again
settings.recent_sets.erase(settings.recent_sets.begin());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment