+2017-02-06 Carl Hetherington <cth@carlh.net>
+
+ * Fix display of progress meter (and crash) when sending emails
+ from the KDM creator (#1045).
+
2017-01-28 Carl Hetherington <cth@carlh.net>
* Add priority control buttons to batch converter (#961).
#include "job_view_dialog.h"
#include "normal_job_view.h"
+#include "lib/job.h"
using boost::shared_ptr;
JobViewDialog::JobViewDialog (wxWindow* parent, wxString title, shared_ptr<Job> job)
: TableDialog (parent, title, 4, 0, false)
+ , _job (job)
{
_view = new NormalJobView (job, this, this, _table);
+ _view->setup ();
layout ();
SetMinSize (wxSize (960, -1));
Bind (wxEVT_TIMER, boost::bind (&JobViewDialog::periodic, this));
_timer.reset (new wxTimer (this));
_timer->Start (1000);
+
+ /* Start off with OK disabled and it will be enabled when the job is finished */
+ wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
+ if (ok) {
+ ok->Enable (false);
+ }
}
JobViewDialog::~JobViewDialog ()
JobViewDialog::periodic ()
{
_view->maybe_pulse ();
+
+ shared_ptr<Job> job = _job.lock ();
+ wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
+ if (job && ok) {
+ ok->Enable (job->finished ());
+ }
}
#include "table_dialog.h"
#include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
class JobView;
class Job;
void periodic ();
JobView* _view;
+ boost::weak_ptr<Job> _job;
boost::shared_ptr<wxTimer> _timer;
};