Partial attempt at cleanup of naming straight vs DCI.
[dcpomatic.git] / src / tools / dvdomatic.cc
index 01f4cd59131502285e98a2670291df43d9cc6c3a..23cf216ca1d8e29de534b9e1c757008bc5ca9cc2 100644 (file)
@@ -29,6 +29,8 @@
 #include "wx/job_wrapper.h"
 //#include "gtk/dvd_title_dialog.h"
 #include "wx/wx_util.h"
+#include "wx/new_film_dialog.h"
+#include "wx/properties_dialog.h"
 #include "lib/film.h"
 #include "lib/format.h"
 #include "lib/config.h"
@@ -36,6 +38,7 @@
 #include "lib/util.h"
 #include "lib/scaler.h"
 #include "lib/exceptions.h"
+#include "lib/version.h"
 
 using namespace std;
 using namespace boost;
@@ -124,6 +127,7 @@ enum {
        ID_file_new = 1,
        ID_file_open,
        ID_file_save,
+       ID_file_properties,
        ID_file_quit,
        ID_edit_preferences,
        ID_jobs_make_dcp,
@@ -143,6 +147,8 @@ setup_menu (wxMenuBar* m)
        file->AppendSeparator ();
        add_item (file, "&Save", ID_file_save, NEEDS_FILM);
        file->AppendSeparator ();
+       add_item (file, "&Properties...", ID_file_properties, NEEDS_FILM);
+       file->AppendSeparator ();
        add_item (file, "&Quit", ID_file_quit, ALWAYS);
 
        wxMenu* edit = new wxMenu;
@@ -151,7 +157,9 @@ setup_menu (wxMenuBar* m)
        wxMenu* jobs = new wxMenu;
        add_item (jobs, "&Make DCP", ID_jobs_make_dcp, NEEDS_FILM);
        add_item (jobs, "&Send DCP to TMS", ID_jobs_send_dcp_to_tms, NEEDS_FILM);
+#ifdef DVDOMATIC_POSIX 
        add_item (jobs, "Copy from &DVD...", ID_jobs_copy_from_dvd, NEEDS_FILM);
+#endif 
        jobs->AppendSeparator ();
        add_item (jobs, "&Examine content", ID_jobs_examine_content, NEEDS_FILM);
        add_item (jobs, "Make DCP from existing &transcode", ID_jobs_make_dcp_from_existing_transcode, NEEDS_FILM);
@@ -185,6 +193,7 @@ public:
                Connect (ID_file_new, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_new));
                Connect (ID_file_open, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_open));
                Connect (ID_file_save, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_save));
+               Connect (ID_file_properties, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_properties));
                Connect (ID_file_quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_quit));
                Connect (ID_edit_preferences, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::edit_preferences));
                Connect (ID_jobs_make_dcp, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_make_dcp));
@@ -248,25 +257,26 @@ public:
        
        void file_new (wxCommandEvent &)
        {
-               wxDirDialog* c = new wxDirDialog (this, wxT ("New Film"), wxStandardPaths::Get().GetDocumentsDir());
-               int const r = c->ShowModal ();
-               c->Destroy ();
+               NewFilmDialog* d = new NewFilmDialog (this);
+               int const r = d->ShowModal ();
                
                if (r == wxID_OK) {
                        maybe_save_then_delete_film ();
-                       film = new Film (wx_to_std (c->GetPath ()));
+                       film = new Film (d->get_path (), false);
 #if BOOST_FILESYSTEM_VERSION == 3              
-                       film->set_name (filesystem::path (wx_to_std (c->GetPath())).filename().generic_string());
+                       film->set_name (filesystem::path (d->get_path()).filename().generic_string());
 #else          
-                       film->set_name (filesystem::path (wx_to_std (c->GetPath())).filename());
+                       film->set_name (filesystem::path (d->get_path()).filename());
 #endif
                        set_film ();
                }
+               
+               d->Destroy ();
        }
 
        void file_open (wxCommandEvent &)
        {
-               wxDirDialog* c = new wxDirDialog (this, wxT ("Open Film"), wxStandardPaths::Get().GetDocumentsDir(), wxDD_DIR_MUST_EXIST);
+               wxDirDialog* c = new wxDirDialog (this, wxT ("Select film to open"), wxStandardPaths::Get().GetDocumentsDir(), wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
                int const r = c->ShowModal ();
                c->Destroy ();
                
@@ -281,6 +291,13 @@ public:
        {
                film->write_metadata ();
        }
+
+       void file_properties (wxCommandEvent &)
+       {
+               PropertiesDialog* d = new PropertiesDialog (this, film);
+               d->ShowModal ();
+               d->Destroy ();
+       }
        
        void file_quit (wxCommandEvent &)
        {
@@ -308,15 +325,16 @@ public:
        
        void jobs_copy_from_dvd (wxCommandEvent &)
        {
-//     try {
+               try {
+
 //             DVDTitleDialog d;
 //             if (d.run () != Gtk::RESPONSE_OK) {
 //                     return;
 //             }
-//             film->copy_from_dvd ();
-//     } catch (DVDError& e) {
-//             error_dialog (e.what ());
-//     }
+                       film->copy_from_dvd ();
+               } catch (DVDError& e) {
+                       error_dialog (this, e.what ());
+               }
        }
        
        void jobs_send_dcp_to_tms (wxCommandEvent &)
@@ -333,13 +351,14 @@ public:
        {
                wxAboutDialogInfo info;
                info.SetName (_("DVD-o-matic"));
-               info.SetVersion (wxT (DVDOMATIC_VERSION));
+               info.SetVersion (std_to_wx (String::compose ("DVD-o-matic version %1 git %2", dvdomatic_version, dvdomatic_git_commit)));
                info.SetDescription (_("Free, open-source DCP generation from almost anything."));
-               info.SetCopyright (_("(C) Carl Hetherington, Terrence Meiczinger, Paul Davis"));
+               info.SetCopyright (_("(C) 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);
                info.SetWebSite (wxT ("http://carlh.net/software/dvdomatic"));
                wxAboutBox (info);