#include "wx/screens_panel.h"
#include "wx/kdm_timing_panel.h"
#include "wx/kdm_output_panel.h"
+#include "wx/job_view_dialog.h"
#include "lib/config.h"
#include "lib/util.h"
#include "lib/screen.h"
DOMFrame (wxString const & title)
: wxFrame (NULL, -1, title)
, _config_dialog (0)
+ , _job_view (0)
{
wxMenuBar* bar = new wxMenuBar;
setup_menu (bar);
wxString::Format (s, int(screen_kdms.size()), std_to_wx(_output->directory().string()).data())
);
} else {
- JobManager::instance()->add (
- shared_ptr<Job> (new SendKDMEmailJob (
- decrypted.annotation_text(),
- decrypted.content_title_text(),
- _timing->from(), _timing->until(),
- CinemaKDMs::collect (screen_kdms)
- ))
- );
+ shared_ptr<Job> job (new SendKDMEmailJob (
+ decrypted.annotation_text(),
+ decrypted.content_title_text(),
+ _timing->from(), _timing->until(),
+ CinemaKDMs::collect (screen_kdms)
+ ));
+
+ JobManager::instance()->add (job);
+ if (_job_view) {
+ _job_view->Destroy ();
+ _job_view = 0;
+ }
+ _job_view = new JobViewDialog (this, _("Send KDM emails"), job);
+ _job_view->ShowModal ();
}
} catch (dcp::NotEncryptedError& e) {
error_dialog (this, _("CPL's content is not encrypted."));
wxStaticText* _issue_date;
wxButton* _create;
KDMOutputPanel* _output;
+ JobViewDialog* _job_view;
};
/** @class App
using std::min;
using boost::shared_ptr;
-JobView::JobView (shared_ptr<Job> job, wxScrolledWindow* window, wxPanel* panel, wxFlexGridSizer* table)
+JobView::JobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table)
: _job (job)
- , _window (window)
- , _panel (panel)
+ , _parent (parent)
{
int n = 0;
_gauge_message = new wxBoxSizer (wxVERTICAL);
- _gauge = new wxGauge (panel, 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 (panel, 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);
++n;
- _cancel = new wxButton (panel, wxID_ANY, _("Cancel"));
+ _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;
- _pause = new wxButton (_panel, wxID_ANY, _("Pause"));
+ _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;
- _details = new wxButton (_panel, 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);
{
string s = _job->error_summary();
s[0] = toupper (s[0]);
- error_dialog (_window, std_to_wx (String::compose ("%1.\n\n%2", s, _job->error_details())));
+ error_dialog (_parent, std_to_wx (String::compose ("%1.\n\n%2", s, _job->error_details())));
}
void
class Job;
class wxScrolledWindow;
-class wxPanel;
+class wxWindow;
class wxFlexGridSizer;
class wxCommandEvent;
class wxBoxSizer;
class JobView : public boost::noncopyable
{
public:
- JobView (boost::shared_ptr<Job> job, wxScrolledWindow* window, wxPanel* panel, wxFlexGridSizer* table);
+ JobView (boost::shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table);
void maybe_pulse ();
void pause_clicked (wxCommandEvent &);
boost::shared_ptr<Job> _job;
- wxScrolledWindow* _window;
- wxPanel* _panel;
+ wxWindow* _parent;
wxBoxSizer* _gauge_message;
wxGauge* _gauge;
wxStaticText* _message;
--- /dev/null
+/*
+ Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "job_view_dialog.h"
+#include "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);
+ layout ();
+ SetMinSize (wxSize (960, -1));
+}
+
+JobViewDialog::~JobViewDialog ()
+{
+ delete _view;
+}
--- /dev/null
+/*
+ Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "table_dialog.h"
+#include <boost/shared_ptr.hpp>
+
+class JobView;
+class Job;
+
+class JobViewDialog : public TableDialog
+{
+public:
+ JobViewDialog (wxWindow* parent, wxString title, boost::shared_ptr<Job> job);
+ ~JobViewDialog ();
+
+private:
+ JobView* _view;
+};
#include "table_dialog.h"
#include "wx_util.h"
-TableDialog::TableDialog (wxWindow* parent, wxString title, int columns, bool cancel)
+TableDialog::TableDialog (wxWindow* parent, wxString title, int columns, int growable, bool cancel)
: wxDialog (parent, wxID_ANY, title)
{
_overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (_overall_sizer);
_table = new wxFlexGridSizer (columns, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- _table->AddGrowableCol (1, 1);
+ _table->AddGrowableCol (growable, 1);
_overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
class TableDialog : public wxDialog
{
public:
- TableDialog (wxWindow* parent, wxString title, int columns, bool cancel);
+ TableDialog (wxWindow* parent, wxString title, int columns, int growable, bool cancel);
protected:
template<class T>
void layout ();
+ wxFlexGridSizer* _table;
+
private:
wxSizer* _overall_sizer;
- wxFlexGridSizer* _table;
};
#endif
gain_calculator_dialog.cc
hints_dialog.cc
job_view.cc
+ job_view_dialog.cc
job_manager_view.cc
kdm_dialog.cc
kdm_output_panel.cc