From cad901b85ecbbc2914607a9a131fa37e54be9863 Mon Sep 17 00:00:00 2001 From: dooglus Date: Thu, 7 Feb 2008 11:46:12 +0000 Subject: [PATCH] Add a setting in the gui for the auto-backup interval. git-svn-id: http://svn.voria.com/code@1618 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/dialog_setup.cpp | 11 +++++++++++ synfig-studio/trunk/src/gtkmm/dialog_setup.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/synfig-studio/trunk/src/gtkmm/dialog_setup.cpp b/synfig-studio/trunk/src/gtkmm/dialog_setup.cpp index 0382ce7..17c0ea4 100644 --- a/synfig-studio/trunk/src/gtkmm/dialog_setup.cpp +++ b/synfig-studio/trunk/src/gtkmm/dialog_setup.cpp @@ -38,6 +38,7 @@ #include #include #include "widget_enum.h" +#include "autorecover.h" #include #include @@ -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(): diff --git a/synfig-studio/trunk/src/gtkmm/dialog_setup.h b/synfig-studio/trunk/src/gtkmm/dialog_setup.h index d16aac6..c83597a 100644 --- a/synfig-studio/trunk/src/gtkmm/dialog_setup.h +++ b/synfig-studio/trunk/src/gtkmm/dialog_setup.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -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); -- 2.7.4