Fix conversion of _X to underlined X with GTK (via gtk_label_set_text_with_mnemonic...
[dcpomatic.git] / src / wx / job_view.cc
index fe42f4be36f6f6f911c8b01a558c2d228f111622..efe17f4deba2a01c1939f9764464c5fa8b021cba 100644 (file)
 #include "lib/job_manager.h"
 #include "lib/send_notification_email_job.h"
 #include "lib/transcode_job.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
 #include <boost/algorithm/string.hpp>
 
 
@@ -84,7 +87,7 @@ JobView::setup ()
        _controls = new wxBoxSizer (wxVERTICAL);
        _controls->Add (_buttons);
        _notify = new CheckBox (_container, _("Notify when complete"));
-       _notify->Bind (wxEVT_CHECKBOX, bind (&JobView::notify_clicked, this));
+       _notify->bind(&JobView::notify_clicked, this);
        _notify->SetValue (Config::instance()->default_notify());
        _controls->Add (_notify, 0, wxTOP, DCPOMATIC_BUTTON_STACK_GAP);
 
@@ -104,7 +107,7 @@ JobView::maybe_pulse ()
 {
        if (_gauge && _job->running()) {
                auto elapsed = _job->seconds_since_last_progress_update();
-               if (!_job->progress() || !elapsed || *elapsed > 2) {
+               if (!_job->progress() || !elapsed || *elapsed > 4) {
                        _gauge->Pulse ();
                }
        }
@@ -122,6 +125,9 @@ JobView::progress ()
        /* Watch out for < > in the error string */
        boost::algorithm::replace_all (s, "<", "&lt;");
        boost::algorithm::replace_all (s, ">", "&gt;");
+#ifdef DCPOMATIC_LINUX
+       boost::algorithm::replace_all(s, "_", "__");
+#endif
        whole += s;
        if (whole != _last_message) {
                _message->SetLabelMarkup (std_to_wx (whole));
@@ -153,9 +159,8 @@ JobView::finished ()
        }
 
        if (_job->message()) {
-               auto d = new MessageDialog (_parent, std_to_wx(_job->name()), std_to_wx(_job->message().get()));
-               d->ShowModal ();
-               d->Destroy ();
+               MessageDialog dialog(_parent, std_to_wx(_job->name()), std_to_wx(_job->message().get()));
+               dialog.ShowModal();
        }
 
        if (_job->enable_notify() && _notify->GetValue()) {