add Autosave continuous backups by Andras Reuss and Andrew-R
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / appearanceprefs.C
index 71bef32121dc69e8f88f904b2d8cfb4ecab0d57e..c80ee26bef23c2a00ff0557087ca65fdbdc33700 100644 (file)
@@ -232,7 +232,9 @@ void AppearancePrefs::create_objects()
        UseUnsafeGUI *unsafe_gui = new UseUnsafeGUI(pwindow, x, y);
        add_subwindow(unsafe_gui);
        y += unsafe_gui->get_h() + ys5;
        UseUnsafeGUI *unsafe_gui = new UseUnsafeGUI(pwindow, x, y);
        add_subwindow(unsafe_gui);
        y += unsafe_gui->get_h() + ys5;
-
+       OngoingBackups *ongoing_backups = new OngoingBackups(pwindow, x, y);
+       add_subwindow(ongoing_backups);
+       y += ongoing_backups->get_h() + ys5;
 
        x = get_w() / 3 + xs30;
        y = y1;
 
        x = get_w() / 3 + xs30;
        y = y1;
@@ -672,6 +674,20 @@ int UseUnsafeGUI::handle_event()
        return 1;
 }
 
        return 1;
 }
 
+OngoingBackups::OngoingBackups(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, pwindow->thread->preferences->ongoing_backups,
+       _("Autosave continuous backups"))
+{
+       this->pwindow = pwindow;
+       set_tooltip(_("When you stop Cinelerra, all but the newest 50 will be deleted but you risk \n running out of disk space if you do a lot of work without restarting."));
+}
+
+int OngoingBackups::handle_event()
+{
+       pwindow->thread->preferences->ongoing_backups = get_value();
+       return 1;
+}
+
 BD_WarnRoot::BD_WarnRoot(PreferencesWindow *pwindow, int x, int y)
  : BC_CheckBox(x, y, pwindow->thread->preferences->bd_warn_root,
        _("Create Bluray warns if not root"))
 BD_WarnRoot::BD_WarnRoot(PreferencesWindow *pwindow, int x, int y)
  : BC_CheckBox(x, y, pwindow->thread->preferences->bd_warn_root,
        _("Create Bluray warns if not root"))