278e253fad54299c2f5a2b1ece9413dc6da49d4a from master; move restore-default-preferences.
[dcpomatic.git] / src / tools / dcpomatic.cc
index d0b6faecbb476b3067026104ca0be0ed260a9cdb..e0c0148b07d6179f53969b2d5ce323a1191af384 100644 (file)
@@ -137,6 +137,7 @@ enum {
        ID_tools_hints,
        ID_tools_encoding_servers,
        ID_tools_check_for_updates,
+       ID_tools_restore_default_preferences,
        ID_help_report_a_problem,
        /* IDs for shortcuts (with no associated menu item) */
        ID_add_file
@@ -198,6 +199,7 @@ public:
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::tools_hints, this),             ID_tools_hints);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::tools_encoding_servers, this),  ID_tools_encoding_servers);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::tools_check_for_updates, this), ID_tools_check_for_updates);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::tools_restore_default_preferences, this), ID_tools_restore_default_preferences);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::help_about, this),              wxID_ABOUT);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::help_report_a_problem, this),   ID_help_report_a_problem);
 
@@ -391,13 +393,25 @@ private:
                _config_dialog->Show (this);
        }
 
+       void tools_restore_default_preferences ()
+       {
+               Config::restore_defaults ();
+       }
+
        void jobs_make_dcp ()
        {
                double required;
                double available;
+               bool can_hard_link;
 
-               if (!_film->should_be_enough_disk_space (required, available)) {
-                       if (!confirm_dialog (this, wxString::Format (_("The DCP for this film will take up about %.1f Gb, and the disk that you are using only has %.1f Gb available.  Do you want to continue anyway?"), required, available))) {
+               if (!_film->should_be_enough_disk_space (required, available, can_hard_link)) {
+                       wxString message;
+                       if (can_hard_link) {
+                               message = wxString::Format (_("The DCP for this film will take up about %.1f Gb, and the disk that you are using only has %.1f Gb available.  Do you want to continue anyway?"), required, available);
+                       } else {
+                               message = wxString::Format (_("The DCP and intermediate files for this film will take up about %.1f Gb, and the disk that you are using only has %.1f Gb available.  You would need half as much space if the filesystem supported hard links, but it does not.  Do you want to continue anyway?"), required, available);
+                       }
+                       if (!confirm_dialog (this, message)) {
                                return;
                        }
                }
@@ -679,6 +693,8 @@ private:
                add_item (tools, _("Hints..."), ID_tools_hints, 0);
                add_item (tools, _("Encoding servers..."), ID_tools_encoding_servers, 0);
                add_item (tools, _("Check for updates"), ID_tools_check_for_updates, 0);
+               tools->AppendSeparator ();
+               add_item (tools, _("Restore default preferences"), ID_tools_restore_default_preferences, ALWAYS);
                
                wxMenu* help = new wxMenu;
 #ifdef __WXOSX__