Commit f84b44c4 authored by coppro's avatar coppro

Fixed crash with new thread-safety code (primarily on watermarks)

Actually added only showing "open recent set" if exists
Removed a call to deprecated functions.
parent 2fe2d138
...@@ -41,9 +41,9 @@ ChoiceThumbnailRequest::ChoiceThumbnailRequest(ValueViewer* cve, int id, bool fr ...@@ -41,9 +41,9 @@ ChoiceThumbnailRequest::ChoiceThumbnailRequest(ValueViewer* cve, int id, bool fr
, stylesheet(cve->viewer.stylesheet) , stylesheet(cve->viewer.stylesheet)
, id(id) , id(id)
{ {
ChoiceValueEditor& e = *(ChoiceValueEditor*)cve; ChoiceValueEditor e = *(ChoiceValueEditor*)cve;
String name = cannocial_name_form(e.field().choices->choiceName(id)); 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(); isThreadSafe = img.threadSafe();
} }
......
...@@ -39,11 +39,12 @@ WelcomeWindow::WelcomeWindow() ...@@ -39,11 +39,12 @@ WelcomeWindow::WelcomeWindow()
wxControl* open_last = nullptr; wxControl* open_last = nullptr;
if (!settings.recent_sets.empty()) { if (!settings.recent_sets.empty()) {
wxFileName n(settings.recent_sets.front()); wxFileName n(settings.recent_sets.front());
#ifdef USE_HOVERBUTTON if (n.FileExists())
open_last = new HoverButtonExt(this, ID_FILE_RECENT, load_resource_image(_("welcome_last")), _BUTTON_("last opened set"), _("Open '") + n.GetName() + _("'")); #ifdef USE_HOVERBUTTON
#else open_last = new HoverButtonExt(this, ID_FILE_RECENT, load_resource_image(_("welcome_last")), _BUTTON_("last opened set"), _("Open '") + n.GetName() + _("'"));
open_last = new wxButton(this, ID_FILE_RECENT, _BUTTON_("last opened set")); #else
#endif open_last = new wxButton(this, ID_FILE_RECENT, _BUTTON_("last opened set"));
#endif
} }
wxSizer* s1 = new wxBoxSizer(wxHORIZONTAL); wxSizer* s1 = new wxBoxSizer(wxHORIZONTAL);
...@@ -60,10 +61,9 @@ WelcomeWindow::WelcomeWindow() ...@@ -60,10 +61,9 @@ WelcomeWindow::WelcomeWindow()
void WelcomeWindow::onPaint(wxPaintEvent&) { void WelcomeWindow::onPaint(wxPaintEvent&) {
wxBufferedPaintDC dc(this); wxBufferedPaintDC dc(this);
dc.BeginDrawing();
draw(dc); draw(dc);
dc.EndDrawing();
} }
void WelcomeWindow::draw(DC& dc) { void WelcomeWindow::draw(DC& dc) {
wxSize ws = GetClientSize(); wxSize ws = GetClientSize();
// draw background // draw background
......
...@@ -47,7 +47,7 @@ class ScriptableImage { ...@@ -47,7 +47,7 @@ class ScriptableImage {
} }
/// Can this be safely generated from another thread? /// Can this be safely generated from another thread?
bool threadSafe() const {return value->threadSafe();} bool threadSafe() const {return value != nullptr ? value->threadSafe() : false; }
private: private:
OptionalScript script; ///< The script, not really optional OptionalScript script; ///< The script, not really optional
......
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