pot/merge.
[dcpomatic.git] / src / wx / job_manager_view.cc
index b32c695a907fa7e9b77c5bb0c4a0607a90a1bd70..e70622b30e8b0cb6c0e66b85f45e4265949ee437 100644 (file)
@@ -1,19 +1,20 @@
 /*
     Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
-    This program is free software; you can redistribute it and/or modify
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic 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,
+    DCP-o-matic 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.
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
@@ -39,9 +40,15 @@ using std::cout;
 using boost::shared_ptr;
 using boost::weak_ptr;
 
-/** Must be called in the GUI thread */
-JobManagerView::JobManagerView (wxWindow* parent)
+/** @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.
+ *
+ *  Must be called in the GUI thread.
+ */
+JobManagerView::JobManagerView (wxWindow* parent, bool latest_at_top)
        : wxScrolledWindow (parent)
+       , _latest_at_top (latest_at_top)
 {
        _panel = new wxPanel (this);
        wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
@@ -67,8 +74,10 @@ JobManagerView::job_added (weak_ptr<Job> j)
 {
        shared_ptr<Job> job = j.lock ();
        if (job) {
-               _job_records.push_back (shared_ptr<JobView> (new JobView (job, this, _panel, _table)));
+               _job_records.push_back (shared_ptr<JobView> (new JobView (job, this, _panel, _table, _latest_at_top)));
        }
+
+       FitInside();
 }
 
 void