s->Add (panel, 1, wxEXPAND);
SetSizer (s);
- JobManagerView* job_manager_view = new JobManagerView (panel, false);
+ JobManagerView* job_manager_view = new JobManagerView (panel, true);
_sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6);
wxSizer* buttons = new wxBoxSizer (wxHORIZONTAL);
*/
#include "job_manager_view.h"
-#include "job_view.h"
+#include "batch_job_view.h"
+#include "normal_job_view.h"
#include "wx_util.h"
#include "lib/job_manager.h"
#include "lib/job.h"
using boost::weak_ptr;
/** @param parent Parent window.
- * @param latest_at_top true to put the last-added job at the top of the view,
- * false to put it at the bottom.
+ * @param batch true to use BatchJobView, false to use NormalJobView.
*
* Must be called in the GUI thread.
*/
-JobManagerView::JobManagerView (wxWindow* parent, bool latest_at_top)
+JobManagerView::JobManagerView (wxWindow* parent, bool batch)
: wxScrolledWindow (parent)
- , _latest_at_top (latest_at_top)
+ , _batch (batch)
{
_panel = new wxPanel (this);
wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
sizer->Add (_panel, 1, wxEXPAND);
SetSizer (sizer);
- _table = new wxFlexGridSizer (4, 4, 6);
+ _table = new wxFlexGridSizer (2, 6, 6);
_table->AddGrowableCol (0, 1);
_panel->SetSizer (_table);
{
shared_ptr<Job> job = j.lock ();
if (job) {
- _job_records.push_back (shared_ptr<JobView> (new JobView (job, this, _panel, _table, _latest_at_top)));
+ shared_ptr<JobView> v;
+ if (_batch) {
+ v.reset (new BatchJobView (job, this, _panel, _table));
+ } else {
+ v.reset (new NormalJobView (job, this, _panel, _table));
+ }
+ v->setup ();
+ _job_records.push_back (v);
}
FitInside();
class JobManagerView : public wxScrolledWindow
{
public:
- JobManagerView (wxWindow *, bool latest_at_top);
+ JobManagerView (wxWindow *, bool batch);
private:
void job_added (boost::weak_ptr<Job>);
wxPanel* _panel;
wxFlexGridSizer* _table;
boost::shared_ptr<wxTimer> _timer;
- bool _latest_at_top;
+ bool _batch;
std::list<boost::shared_ptr<JobView> > _job_records;
};
using std::min;
using boost::shared_ptr;
-/** @param top Put this view at the top of table, otherwise put it at the bottom */
-JobView::JobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table, bool top)
+JobView::JobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table)
: _job (job)
+ , _table (table)
, _parent (parent)
+ , _container (container)
{
- int n = top ? 0 : (table->GetEffectiveRowsCount() * table->GetEffectiveColsCount());
+
+}
+
+void
+JobView::setup ()
+{
+ int n = insert_position ();
+
+ std::cout << "insert @ " << n << "\n";
_gauge_message = new wxBoxSizer (wxVERTICAL);
- _gauge = new wxGauge (container, wxID_ANY, 100);
+ _gauge = new wxGauge (_container, wxID_ANY, 100);
/* This seems to be required to allow the gauge to shrink under OS X */
_gauge->SetMinSize (wxSize (0, -1));
_gauge_message->Add (_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT);
- _message = new wxStaticText (container, wxID_ANY, wxT (" \n "));
+ _message = new wxStaticText (_container, wxID_ANY, wxT (" \n "));
_gauge_message->Add (_message, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
- table->Insert (n, _gauge_message, 1, wxEXPAND | wxLEFT | wxRIGHT);
+ _table->Insert (n, _gauge_message, 1, wxEXPAND | wxLEFT | wxRIGHT);
++n;
- _cancel = new wxButton (container, wxID_ANY, _("Cancel"));
- _cancel->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobView::cancel_clicked, this);
- table->Insert (n, _cancel, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3);
- ++n;
+ wxBoxSizer* buttons = new wxBoxSizer (wxHORIZONTAL);
- _pause = new wxButton (container, wxID_ANY, _("Pause"));
- _pause->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobView::pause_clicked, this);
- table->Insert (n, _pause, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3);
- ++n;
+ _cancel = new wxButton (_container, wxID_ANY, _("Cancel"));
+ _cancel->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobView::cancel_clicked, this);
+ buttons->Add (_cancel, 1, wxALIGN_CENTER_VERTICAL);
- _details = new wxButton (container, wxID_ANY, _("Details..."));
+ _details = new wxButton (_container, wxID_ANY, _("Details..."));
_details->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobView::details_clicked, this);
_details->Enable (false);
- table->Insert (n, _details, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3);
- ++n;
+ buttons->Add (_details, 1, wxALIGN_CENTER_VERTICAL);
+
+ finish_setup (_container, buttons);
- _progress_connection = job->Progress.connect (boost::bind (&JobView::progress, this));
- _finished_connection = job->Finished.connect (boost::bind (&JobView::finished, this));
+ _table->Insert (n, buttons, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3);
+
+ _progress_connection = _job->Progress.connect (boost::bind (&JobView::progress, this));
+ _finished_connection = _job->Finished.connect (boost::bind (&JobView::finished, this));
progress ();
- table->Layout ();
+ _table->Layout ();
}
void
}
_cancel->Enable (false);
- _pause->Enable (false);
if (!_job->error_details().empty ()) {
_details->Enable (true);
}
_job->cancel ();
}
}
-
-void
-JobView::pause_clicked (wxCommandEvent &)
-{
- if (_job->paused()) {
- _job->resume ();
- _pause->SetLabel (_("Pause"));
- } else {
- _job->pause ();
- _pause->SetLabel (_("Resume"));
- }
-}
*/
+#ifndef DCPOMATIC_JOB_VIEW_H
+#define DCPOMATIC_JOB_VIEW_H
+
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
class wxGauge;
class wxStaticText;
class wxButton;
+class wxSizer;
class JobView : public boost::noncopyable
{
public:
- JobView (boost::shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table, bool top);
+ JobView (boost::shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table);
+ virtual ~JobView () {}
+
+ void setup ();
void maybe_pulse ();
+protected:
+ virtual void finished ();
+
+ boost::shared_ptr<Job> _job;
+ wxFlexGridSizer* _table;
+
private:
+ virtual int insert_position () const = 0;
+ virtual void finish_setup (wxWindow *, wxSizer *) {}
+
void progress ();
- void finished ();
void details_clicked (wxCommandEvent &);
void cancel_clicked (wxCommandEvent &);
- void pause_clicked (wxCommandEvent &);
- boost::shared_ptr<Job> _job;
wxWindow* _parent;
+ wxWindow* _container;
wxBoxSizer* _gauge_message;
wxGauge* _gauge;
wxStaticText* _message;
wxButton* _cancel;
- wxButton* _pause;
wxButton* _details;
std::string _last_message;
boost::signals2::scoped_connection _progress_connection;
boost::signals2::scoped_connection _finished_connection;
};
+
+#endif
*/
#include "job_view_dialog.h"
-#include "job_view.h"
+#include "normal_job_view.h"
using boost::shared_ptr;
JobViewDialog::JobViewDialog (wxWindow* parent, wxString title, shared_ptr<Job> job)
: TableDialog (parent, title, 4, 0, false)
{
- _view = new JobView (job, this, this, _table, true);
+ _view = new NormalJobView (job, this, this, _table);
layout ();
SetMinSize (wxSize (960, -1));
msgstr "Darstellung..."
#: src/wx/job_view.cc:125
-#, fuzzy
msgid "Are you sure you want to cancel this job?"
msgstr ""
-"Bitte bestätigen Sie das Versenden von Emails an die folgenden Adressen!\n"
-"\n"
#: src/wx/confirm_kdm_email_dialog.cc:35
msgid ""
msgstr "Apariencia…"
#: src/wx/job_view.cc:125
-#, fuzzy
msgid "Are you sure you want to cancel this job?"
msgstr ""
-"¿Estás seguro de que quieres enviar correos a las direcciones siguientes?\n"
-"\n"
#: src/wx/confirm_kdm_email_dialog.cc:35
msgid ""
msgstr "Apparence..."
#: src/wx/job_view.cc:125
-#, fuzzy
msgid "Are you sure you want to cancel this job?"
msgstr ""
-"Etes-vous certain de vouloir envoyer des courriels aux adresses suivantes ?\n"
-"\n"
#: src/wx/confirm_kdm_email_dialog.cc:35
msgid ""
msgstr "Uiterlijk..."
#: src/wx/job_view.cc:125
-#, fuzzy
msgid "Are you sure you want to cancel this job?"
msgstr ""
-"Weet u zeker dat u emails naar de volgende adressen wilt verzenden?\n"
-"\n"
#: src/wx/confirm_kdm_email_dialog.cc:35
msgid ""
msgstr "SMPTE"
#: src/wx/audio_dialog.cc:320
-#, fuzzy, c-format
msgid "Sample peak is %.2fdB at %s on %s"
-msgstr "Пиковая громкость %.2fдБ на %s"
+msgstr ""
#: src/wx/save_template_dialog.cc:29
msgid "Save template"
msgstr "显示..."
#: src/wx/job_view.cc:125
-#, fuzzy
msgid "Are you sure you want to cancel this job?"
msgstr ""
-"你确定要发送邮件到以下地址?\n"
-"\n"
#: src/wx/confirm_kdm_email_dialog.cc:35
msgid ""
audio_mapping_view.cc
audio_panel.cc
audio_plot.cc
+ batch_job_view.cc
cinema_dialog.cc
colour_conversion_editor.cc
config_dialog.cc
move_to_dialog.cc
name_format_editor.cc
new_film_dialog.cc
+ normal_job_view.cc
playhead_to_timecode_dialog.cc
playhead_to_frame_dialog.cc
repeat_dialog.cc