diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-09-04 00:05:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-09-04 00:05:04 +0100 |
| commit | cb1dfa9ec09af2abf6d10e4bf2764476db83841b (patch) | |
| tree | 5ccd5fd123fa07702b6cf647cedb7df8e8917fa0 /src/tools | |
| parent | dc120d521c740b7f1ec356538139c5769a5f54be (diff) | |
| parent | 4092121ad052f406e8b5c5a2debbd8256321f182 (diff) | |
Merge master.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 13 | ||||
| -rw-r--r-- | src/tools/dcpomatic_batch.cc | 51 |
2 files changed, 28 insertions, 36 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 8763e35cb..3bef7bce3 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -802,12 +802,21 @@ class App : public wxApp return true; } + /* An unhandled exception has occurred inside the main event loop */ bool OnExceptionInMainLoop () { - error_dialog (0, _("An unknown exception occurred. Please report this problem to the DCP-o-matic author (carl@dcpomatic.com).")); + try { + throw; + } catch (exception& e) { + error_dialog (0, wxString::Format (_("An exception occurred (%s). Please report this problem to the DCP-o-matic author (carl@dcpomatic.com)."), e.what ())); + } catch (...) { + error_dialog (0, _("An unknown exception occurred. Please report this problem to the DCP-o-matic author (carl@dcpomatic.com).")); + } + + /* This will terminate the program */ return false; } - + void OnUnhandledException () { error_dialog (0, _("An unknown exception occurred. Please report this problem to the DCP-o-matic author (carl@dcpomatic.com).")); diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index 49b341443..de255e65e 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2014 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 @@ -28,6 +28,7 @@ #include "lib/film.h" #include "lib/job_manager.h" #include "wx/wx_util.h" +#include "wx/about_dialog.h" #include "wx/wx_ui_signaller.h" #include "wx/job_manager_view.h" @@ -61,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); @@ -75,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); + _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 ()) { @@ -135,34 +142,9 @@ private: void help_about () { - wxAboutDialogInfo info; - info.SetName (_("DCP-o-matic Batch Converter")); - if (strcmp (dcpomatic_git_commit, "release") == 0) { - info.SetVersion (std_to_wx (String::compose ("version %1", dcpomatic_version))); - } else { - info.SetVersion (std_to_wx (String::compose ("version %1 git %2", dcpomatic_version, dcpomatic_git_commit))); - } - info.SetDescription (_("Free, open-source DCP generation from almost anything.")); - info.SetCopyright (_("(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen")); - - wxArrayString authors; - authors.Add (wxT ("Carl Hetherington")); - authors.Add (wxT ("Terrence Meiczinger")); - authors.Add (wxT ("Paul Davis")); - authors.Add (wxT ("Ole Laursen")); - info.SetDevelopers (authors); - - wxArrayString translators; - translators.Add (wxT ("Olivier Perriere")); - translators.Add (wxT ("Lilian Lefranc")); - translators.Add (wxT ("Thierry Journet")); - translators.Add (wxT ("Massimiliano Broggi")); - translators.Add (wxT ("Manuel AC")); - translators.Add (wxT ("Adam Klotblixt")); - info.SetTranslators (translators); - - info.SetWebSite (wxT ("http://carlh.net/software/dcpomatic")); - wxAboutBox (info); + AboutDialog* d = new AboutDialog (this); + d->ShowModal (); + d->Destroy (); } void add_film () @@ -200,6 +182,7 @@ private: } boost::optional<boost::filesystem::path> _last_parent; + wxSizer* _sizer; }; static const wxCmdLineEntryDesc command_line_description[] = { |
