Set up for the correct handling of UTF-8 with Windows
[dcpomatic.git] / src / tools / dcpomatic.cc
index 0a105fa6bc66a24b60b054c0682702166c73cbe8..cc85da0ef2faaa2b89aaea33c8d469198dd3dc45 100644 (file)
@@ -42,7 +42,6 @@
 #include "wx/config_dialog.h"
 #include "wx/wx_util.h"
 #include "wx/new_film_dialog.h"
-#include "wx/properties_dialog.h"
 #include "wx/wx_signal_manager.h"
 #include "wx/about_dialog.h"
 #include "wx/kdm_dialog.h"
@@ -92,9 +91,8 @@ public:
                _dialog = new wxMessageDialog (
                        0,
                        wxString::Format (_("Save changes to film \"%s\" before closing?"), std_to_wx (name).data()),
-                       /* TRANSLATORS: this is the heading for a dialog box, which tells the user that the current
-                          project (Film) has been changed since it was last saved.
-                       */
+                       /// TRANSLATORS: this is the heading for a dialog box, which tells the user that the current
+                       /// project (Film) has been changed since it was last saved.
                        _("Film changed"),
                        wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION
                        );
@@ -129,7 +127,6 @@ enum {
        ID_file_new = 1,
        ID_file_open,
        ID_file_save,
-       ID_file_properties,
        ID_file_history,
        /* Allow spare IDs after _history for the recent files list */
        ID_content_scale_to_fit_width = 100,
@@ -190,7 +187,6 @@ public:
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_new, this),                ID_file_new);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_open, this),               ID_file_open);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_save, this),               ID_file_save);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_properties, this),         ID_file_properties);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_history, this, _1),        ID_file_history, ID_file_history + HISTORY_SIZE);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_exit, this),               wxID_EXIT);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::edit_preferences, this),        wxID_PREFERENCES);
@@ -370,13 +366,6 @@ private:
                _film->write_metadata ();
        }
 
-       void file_properties ()
-       {
-               PropertiesDialog* d = new PropertiesDialog (this, _film);
-               d->ShowModal ();
-               d->Destroy ();
-       }
-
        void file_history (wxCommandEvent& event)
        {
                vector<boost::filesystem::path> history = Config::instance()->history ();
@@ -664,8 +653,6 @@ private:
                add_item (_file_menu, _("&Open...\tCtrl-O"), ID_file_open, ALWAYS);
                _file_menu->AppendSeparator ();
                add_item (_file_menu, _("&Save\tCtrl-S"), ID_file_save, NEEDS_FILM);
-               _file_menu->AppendSeparator ();
-               add_item (_file_menu, _("&Properties..."), ID_file_properties, NEEDS_FILM);
 
                _history_position = _file_menu->GetMenuItems().GetCount();
 
@@ -709,7 +696,7 @@ private:
 #else
                add_item (help, _("About"), wxID_ABOUT, ALWAYS);
 #endif
-               add_item (help, _("Report a problem..."), ID_help_report_a_problem, ALWAYS);
+               add_item (help, _("Report a problem..."), ID_help_report_a_problem, NEEDS_FILM);
 
                m->Append (_file_menu, _("&File"));
 #ifndef __WXOSX__
@@ -807,6 +794,8 @@ private:
 
                wxInitAllImageHandlers ();
 
+               dcpomatic_setup_path_encoding ();
+
                /* 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
@@ -895,7 +884,7 @@ private:
                try {
                        throw;
                } catch (FileError& e) {
-                       error_dialog (0, wxString::Format (_("An exception occurred: %s in %s.\n\n" + REPORT_PROBLEM), e.what(), e.file().string().c_str ()));
+                       error_dialog (0, wxString::Format (_("An exception occurred: %s (%s).\n\n" + REPORT_PROBLEM), e.what(), e.file().string().c_str ()));
                } catch (exception& e) {
                        error_dialog (0, wxString::Format (_("An exception occurred: %s.\n\n"), e.what ()) + "  " + REPORT_PROBLEM);
                } catch (...) {