Add unfinished check-for-updates. Bump ffmpeg to get windows build fix.
[dcpomatic.git] / src / wx / wx_util.cc
index 20fd2df755f30240e93995ac9639386085c67d34..367d1edbbf522d12634dbc2c967bea73732f83cd 100644 (file)
@@ -105,7 +105,7 @@ confirm_dialog (wxWindow* parent, wxString m)
 string
 wx_to_std (wxString s)
 {
-       return string (s.mb_str ());
+       return string (s.ToUTF8 ());
 }
 
 /** @param s STL string.
@@ -140,17 +140,25 @@ ThreadedStaticText::~ThreadedStaticText ()
 /** Run our thread and post the result to the GUI thread via AddPendingEvent */
 void
 ThreadedStaticText::run (function<string ()> fn)
+try
 {
        wxCommandEvent ev (wxEVT_COMMAND_TEXT_UPDATED, _update_event_id);
        ev.SetString (std_to_wx (fn ()));
        GetEventHandler()->AddPendingEvent (ev);
 }
+catch (...)
+{
+       /* Ignore exceptions; marginally better than the program quitting, but
+          only marginally.
+       */
+}
 
 /** Called in the GUI thread when our worker thread has finished */
 void
 ThreadedStaticText::thread_finished (wxCommandEvent& ev)
 {
        SetLabel (ev.GetString ());
+       Finished ();
 }
 
 string
@@ -276,3 +284,15 @@ dcpomatic_setup_i18n ()
                dcpomatic_setup_gettext_i18n (wx_to_std (locale->GetCanonicalName ()));
        }
 }
+
+int
+wx_get (wxSpinCtrl* w)
+{
+       return w->GetValue ();
+}
+
+int
+wx_get (wxChoice* w)
+{
+       return w->GetSelection ();
+}