diff --git a/src/gui/value/choice.cpp b/src/gui/value/choice.cpp index 46b0aea1..0bbd47c6 100644 --- a/src/gui/value/choice.cpp +++ b/src/gui/value/choice.cpp @@ -41,9 +41,9 @@ ChoiceThumbnailRequest::ChoiceThumbnailRequest(ValueViewer* cve, int id, bool fr , stylesheet(cve->viewer.stylesheet) , id(id) { - ChoiceValueEditor& e = *(ChoiceValueEditor*)cve; + ChoiceValueEditor e = *(ChoiceValueEditor*)cve; String name = cannocial_name_form(e.field().choices->choiceName(id)); - ScriptableImage& img = e.style().choice_images[name]; + ScriptableImage img = e.style().choice_images[name]; isThreadSafe = img.threadSafe(); } diff --git a/src/gui/welcome_window.cpp b/src/gui/welcome_window.cpp index cb4fe484..f198fd49 100644 --- a/src/gui/welcome_window.cpp +++ b/src/gui/welcome_window.cpp @@ -39,11 +39,12 @@ WelcomeWindow::WelcomeWindow() wxControl* open_last = nullptr; if (!settings.recent_sets.empty()) { wxFileName n(settings.recent_sets.front()); - #ifdef USE_HOVERBUTTON - open_last = new HoverButtonExt(this, ID_FILE_RECENT, load_resource_image(_("welcome_last")), _BUTTON_("last opened set"), _("Open '") + n.GetName() + _("'")); - #else - open_last = new wxButton(this, ID_FILE_RECENT, _BUTTON_("last opened set")); - #endif + if (n.FileExists()) + #ifdef USE_HOVERBUTTON + open_last = new HoverButtonExt(this, ID_FILE_RECENT, load_resource_image(_("welcome_last")), _BUTTON_("last opened set"), _("Open '") + n.GetName() + _("'")); + #else + open_last = new wxButton(this, ID_FILE_RECENT, _BUTTON_("last opened set")); + #endif } wxSizer* s1 = new wxBoxSizer(wxHORIZONTAL); @@ -60,10 +61,9 @@ WelcomeWindow::WelcomeWindow() void WelcomeWindow::onPaint(wxPaintEvent&) { wxBufferedPaintDC dc(this); - dc.BeginDrawing(); draw(dc); - dc.EndDrawing(); } + void WelcomeWindow::draw(DC& dc) { wxSize ws = GetClientSize(); // draw background diff --git a/src/script/image.hpp b/src/script/image.hpp index 98dc1c9b..9060bf55 100644 --- a/src/script/image.hpp +++ b/src/script/image.hpp @@ -47,7 +47,7 @@ class ScriptableImage { } /// Can this be safely generated from another thread? - bool threadSafe() const {return value->threadSafe();} + bool threadSafe() const {return value != nullptr ? value->threadSafe() : false; } private: OptionalScript script; ///< The script, not really optional