From 1fb11836b91977a949bef5eae807d57b13fe9bf8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 3 Oct 2016 09:14:58 +0100 Subject: [PATCH] Fix various bad automatic merges in i18n files. --- src/tools/dcpomatic_batch.cc | 2 +- src/wx/job_manager_view.cc | 21 ++++++++----- src/wx/job_manager_view.h | 4 +-- src/wx/job_view.cc | 61 +++++++++++++++++------------------- src/wx/job_view.h | 25 ++++++++++++--- src/wx/job_view_dialog.cc | 4 +-- src/wx/po/de_DE.po | 3 -- src/wx/po/es_ES.po | 3 -- src/wx/po/fr_FR.po | 3 -- src/wx/po/nl_NL.po | 3 -- src/wx/po/ru_RU.po | 3 +- src/wx/po/zh_CN.po | 3 -- src/wx/wscript | 2 ++ 13 files changed, 70 insertions(+), 67 deletions(-) diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index ca9ec3a6b..baac049c0 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -111,7 +111,7 @@ public: 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); diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc index e70622b30..6cea40c89 100644 --- a/src/wx/job_manager_view.cc +++ b/src/wx/job_manager_view.cc @@ -23,7 +23,8 @@ */ #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" @@ -41,21 +42,20 @@ using boost::shared_ptr; 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); @@ -74,7 +74,14 @@ JobManagerView::job_added (weak_ptr j) { shared_ptr job = j.lock (); if (job) { - _job_records.push_back (shared_ptr (new JobView (job, this, _panel, _table, _latest_at_top))); + shared_ptr 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(); diff --git a/src/wx/job_manager_view.h b/src/wx/job_manager_view.h index d887718d3..7784c71ee 100644 --- a/src/wx/job_manager_view.h +++ b/src/wx/job_manager_view.h @@ -35,7 +35,7 @@ class JobView; class JobManagerView : public wxScrolledWindow { public: - JobManagerView (wxWindow *, bool latest_at_top); + JobManagerView (wxWindow *, bool batch); private: void job_added (boost::weak_ptr); @@ -44,7 +44,7 @@ private: wxPanel* _panel; wxFlexGridSizer* _table; boost::shared_ptr _timer; - bool _latest_at_top; + bool _batch; std::list > _job_records; }; diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc index 83d3159b0..f9a8fb089 100644 --- a/src/wx/job_view.cc +++ b/src/wx/job_view.cc @@ -28,45 +28,53 @@ using std::string; 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, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table, bool top) +JobView::JobView (shared_ptr 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 @@ -105,7 +113,6 @@ JobView::finished () } _cancel->Enable (false); - _pause->Enable (false); if (!_job->error_details().empty ()) { _details->Enable (true); } @@ -126,15 +133,3 @@ JobView::cancel_clicked (wxCommandEvent &) _job->cancel (); } } - -void -JobView::pause_clicked (wxCommandEvent &) -{ - if (_job->paused()) { - _job->resume (); - _pause->SetLabel (_("Pause")); - } else { - _job->pause (); - _pause->SetLabel (_("Resume")); - } -} diff --git a/src/wx/job_view.h b/src/wx/job_view.h index 96233f732..8cd34fdab 100644 --- a/src/wx/job_view.h +++ b/src/wx/job_view.h @@ -18,6 +18,9 @@ */ +#ifndef DCPOMATIC_JOB_VIEW_H +#define DCPOMATIC_JOB_VIEW_H + #include #include #include @@ -31,32 +34,44 @@ class wxBoxSizer; class wxGauge; class wxStaticText; class wxButton; +class wxSizer; class JobView : public boost::noncopyable { public: - JobView (boost::shared_ptr job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table, bool top); + JobView (boost::shared_ptr job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table); + virtual ~JobView () {} + + void setup (); void maybe_pulse (); +protected: + virtual void finished (); + + boost::shared_ptr _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; 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 diff --git a/src/wx/job_view_dialog.cc b/src/wx/job_view_dialog.cc index e629cce62..c1c1c0c55 100644 --- a/src/wx/job_view_dialog.cc +++ b/src/wx/job_view_dialog.cc @@ -19,14 +19,14 @@ */ #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) : 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)); diff --git a/src/wx/po/de_DE.po b/src/wx/po/de_DE.po index 161231323..83f71dfa9 100644 --- a/src/wx/po/de_DE.po +++ b/src/wx/po/de_DE.po @@ -226,11 +226,8 @@ msgid "Appearance..." 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 "" diff --git a/src/wx/po/es_ES.po b/src/wx/po/es_ES.po index 10a4346e9..a10d96cd2 100644 --- a/src/wx/po/es_ES.po +++ b/src/wx/po/es_ES.po @@ -224,11 +224,8 @@ msgid "Appearance..." 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 "" diff --git a/src/wx/po/fr_FR.po b/src/wx/po/fr_FR.po index 81a30b919..dc3e73a16 100644 --- a/src/wx/po/fr_FR.po +++ b/src/wx/po/fr_FR.po @@ -225,11 +225,8 @@ msgid "Appearance..." 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 "" diff --git a/src/wx/po/nl_NL.po b/src/wx/po/nl_NL.po index a1320098d..c75ecac6a 100644 --- a/src/wx/po/nl_NL.po +++ b/src/wx/po/nl_NL.po @@ -225,11 +225,8 @@ msgid "Appearance..." 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 "" diff --git a/src/wx/po/ru_RU.po b/src/wx/po/ru_RU.po index e3e5e3f87..164971940 100644 --- a/src/wx/po/ru_RU.po +++ b/src/wx/po/ru_RU.po @@ -1388,9 +1388,8 @@ msgid "SMPTE" 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" diff --git a/src/wx/po/zh_CN.po b/src/wx/po/zh_CN.po index 576162efb..b6d7d4e2b 100644 --- a/src/wx/po/zh_CN.po +++ b/src/wx/po/zh_CN.po @@ -226,11 +226,8 @@ msgid "Appearance..." 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 "" diff --git a/src/wx/wscript b/src/wx/wscript index e001c51b7..fd1528b27 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -31,6 +31,7 @@ sources = """ audio_mapping_view.cc audio_panel.cc audio_plot.cc + batch_job_view.cc cinema_dialog.cc colour_conversion_editor.cc config_dialog.cc @@ -71,6 +72,7 @@ sources = """ 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 -- 2.30.2