98772641729700876a0e51e3d001649cd1624046 from master; Windows crash fix.
[dcpomatic.git] / src / tools / dcpomatic_batch.cc
index 234bfea5cda13905048caa8d4b01dc8757689a99..da8a614142ad4ad3bd5d5ca2db7e1fba9eac7ccc 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-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
@@ -62,6 +62,7 @@ class Frame : public wxFrame
 public:
        Frame (wxString const & title)
                : wxFrame (NULL, -1, title)
+               , _sizer (new wxBoxSizer (wxVERTICAL))
        {
                wxMenuBar* bar = new wxMenuBar;
                setup_menu (bar);
@@ -76,24 +77,29 @@ public:
                s->Add (panel, 1, wxEXPAND);
                SetSizer (s);
 
-               wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
-
-               JobManagerView* job_manager_view = new JobManagerView (panel, JobManagerView::PAUSE);
-               sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6);
+               JobManagerView* job_manager_view = new JobManagerView (panel);
+               _sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6);
 
                wxSizer* buttons = new wxBoxSizer (wxHORIZONTAL);
                wxButton* add = new wxButton (panel, wxID_ANY, _("Add Film..."));
                add->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&Frame::add_film, this));
                buttons->Add (add, 1, wxALL, 6);
 
-               sizer->Add (buttons, 0, wxALL, 6);
+               _sizer->Add (buttons, 0, wxALL, 6);
 
-               panel->SetSizer (sizer);
+               panel->SetSizer (_sizer);
 
                Bind (wxEVT_CLOSE_WINDOW, boost::bind (&Frame::close, this, _1));
+               Bind (wxEVT_SIZE, boost::bind (&Frame::sized, this, _1));
        }
 
 private:
+       void sized (wxSizeEvent& ev)
+       {
+               _sizer->Layout ();
+               ev.Skip ();
+       }
+       
        bool should_close ()
        {
                if (!JobManager::instance()->work_to_do ()) {
@@ -176,6 +182,7 @@ private:
        }
 
        boost::optional<boost::filesystem::path> _last_parent;
+       wxSizer* _sizer;
 };
 
 static const wxCmdLineEntryDesc command_line_description[] = {
@@ -198,12 +205,12 @@ class App : public wxApp
                /* Enable i18n; this will create a Config object
                   to look for a force-configured language.  This Config
                   object will be wrong, however, because dcpomatic_setup
-                  hasn't yet been called and there aren't any scalers, filters etc.
+                  hasn't yet been called and there aren't any filters etc.
                   set up yet.
                */
                dcpomatic_setup_i18n ();
 
-               /* Set things up, including scalers / filters etc.
+               /* Set things up, including filters etc.
                   which will now be internationalised correctly.
                */
                dcpomatic_setup ();