Don't allow the user to set the 'ID' of exported canvases to be empty.
[synfig.git] / synfig-studio / trunk / src / gtkmm / dialog_setup.cpp
index fecf24d..17c0ea4 100644 (file)
 #include <gtkmm/notebook.h>
 #include <gtkmm/spinbutton.h>
 #include "widget_enum.h"
+#include "autorecover.h"
 
 #include <ETL/stringf>
 #include <ETL/misc>
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -65,7 +68,8 @@ Dialog_Setup::Dialog_Setup():
        adj_gamma_b(2.2,0.1,3.0,0.025,0.025,0.025),
        adj_recent_files(15,1,50,1,1,1),
        adj_undo_depth(100,10,5000,1,1,1),
-       toggle_use_colorspace_gamma(_("Visually Linear Color Selection"))
+       toggle_use_colorspace_gamma(_("Visually Linear Color Selection")),
+       toggle_single_threaded(_("Use Only a Single Thread"))
 {
        // Setup the buttons
 
@@ -180,6 +184,13 @@ Dialog_Setup::Dialog_Setup():
        // Misc - use_colorspace_gamma
        misc_table->attach(toggle_use_colorspace_gamma, 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
 
+       // Misc - single_threaded
+       misc_table->attach(toggle_single_threaded, 0, 2, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+
+       // Misc - auto backup interval
+       misc_table->attach(*manage(new Gtk::Label(_("Auto Backup Interval (0 to disable)"))), 0, 1, 5, 6, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+       misc_table->attach(auto_backup_interval, 1, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+
        show_all_children();
 }
 
@@ -207,6 +218,12 @@ Dialog_Setup::on_apply_pressed()
        // Set the use_colorspace_gamma flag
        App::use_colorspace_gamma=toggle_use_colorspace_gamma.get_active();
 
+       // Set the single_threaded flag
+       App::single_threaded=toggle_single_threaded.get_active();
+
+       // Set the auto backup interval
+       App::auto_recover->set_timeout(auto_backup_interval.get_value() * 1000);
+
        App::distance_system=Distance::System(widget_enum->get_value());
 
        App::save_settings();
@@ -257,7 +274,7 @@ void
 Dialog_Setup::refresh()
 {
        // Refresh the temporary gamma; do this before adjusting the sliders,
-       // or variables will be used before their initialisation.
+       // or variables will be used before their initialization.
        gamma_pattern.set_gamma_r(App::gamma.get_gamma_r());
        gamma_pattern.set_gamma_g(App::gamma.get_gamma_g());
        gamma_pattern.set_gamma_b(App::gamma.get_gamma_b());
@@ -281,6 +298,12 @@ Dialog_Setup::refresh()
 
        // Refresh the status of the use_colorspace_gamma flag
        toggle_use_colorspace_gamma.set_active(App::use_colorspace_gamma);
+
+       // Refresh the status of the single_threaded flag
+       toggle_single_threaded.set_active(App::single_threaded);
+
+       // Refresh the value of the auto backup interval
+       auto_backup_interval.set_value(App::auto_recover->get_timeout() / 1000);
 }
 
 GammaPattern::GammaPattern():
@@ -489,7 +512,7 @@ BlackLevelSelector::on_event(GdkEvent *event)
 
 
 void
-Dialog_Setup::set_time_format(Time::Format x)
+Dialog_Setup::set_time_format(synfig::Time::Format x)
 {
        time_format=x;
        if(x<=Time::FORMAT_VIDEO)