Add a setting in the gui for the auto-backup interval.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 7 Feb 2008 11:46:12 +0000 (11:46 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 7 Feb 2008 11:46:12 +0000 (11:46 +0000)
git-svn-id: http://svn.voria.com/code@1618 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/dialog_setup.cpp
synfig-studio/trunk/src/gtkmm/dialog_setup.h

index 0382ce7..17c0ea4 100644 (file)
@@ -38,6 +38,7 @@
 #include <gtkmm/notebook.h>
 #include <gtkmm/spinbutton.h>
 #include "widget_enum.h"
+#include "autorecover.h"
 
 #include <ETL/stringf>
 #include <ETL/misc>
@@ -186,6 +187,10 @@ Dialog_Setup::Dialog_Setup():
        // 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();
 }
 
@@ -216,6 +221,9 @@ Dialog_Setup::on_apply_pressed()
        // 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();
@@ -293,6 +301,9 @@ Dialog_Setup::refresh()
 
        // 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():
index d16aac6..c83597a 100644 (file)
@@ -35,6 +35,7 @@
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/optionmenu.h>
 #include <gtkmm/checkbutton.h>
+#include <gtkmm/widget_time.h>
 
 #include <synfig/gamma.h>
 #include <synfig/time.h>
@@ -168,6 +169,8 @@ class Dialog_Setup : public Gtk::Dialog
 
        Gtk::Menu *timestamp_menu;
        Widget_Enum *widget_enum;
+
+       Widget_Time auto_backup_interval;
 public:
 
        void set_time_format(synfig::Time::Format time_format);