forked from 1b-agent/opencadstudio-upstream
Give saving its own page, with the two settings that had no control
General had become three unrelated controls: a language picker, a save format and a file association. The last two move to an Open and Save page, where they join the two saving preferences that have never had a widget. Automatic save has worked since the SAVETIME command was added and is persisted; the only way to change the interval was to type it. Same for the `.bak` copy from #205 and its ISAVEBAK command. Both are settings people expect to find in a dialog, and neither was in one. The page also carries a button through to the Plot dialog. Options holds the preferences; the plot device, paper and plot styles stay where they already work well. Note that the modal stack shows one dialog at a time, so the button replaces Options rather than stacking on it. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
1 parent
b1d2ac2744
commit
ec8d733857
4 files changed
+96
-2
No files matched your search
@@ -2007,6 +2007,10 @@ pub enum Message {
|
||||
ShiftToAddToggled(bool),
|
||||
/// Toggle press-and-drag drawing a rectangle instead of a lasso (PICKDRAG).
|
||||
PickDragRectToggled(bool),
|
||||
/// Change the automatic-save interval in minutes; 0 disables it (SAVETIME).
|
||||
SaveTimeChanged(i32),
|
||||
/// Toggle keeping a `.bak` copy when overwriting a drawing (ISAVEBAK).
|
||||
BackupOnSaveChanged(bool),
|
||||
/// Restore Model Space display/canvas appearance to defaults.
|
||||
RestoreModelSpaceDisplayDefaults,
|
||||
/// Restore Selection visual effect settings to defaults.
|
||||
|
||||
@@ -6188,6 +6188,18 @@ impl OpenCADStudio {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::SaveTimeChanged(minutes) => {
|
||||
self.savetime_min = minutes.max(0);
|
||||
self.persist_settings_if_changed();
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::BackupOnSaveChanged(enabled) => {
|
||||
self.backup_on_save = enabled;
|
||||
self.persist_settings_if_changed();
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::PickDragRectToggled(rectangle) => {
|
||||
self.pick_drag_rect = rectangle;
|
||||
self.persist_settings_if_changed();
|
||||
|
||||
@@ -192,6 +192,10 @@ impl OpenCADStudio {
|
||||
pick_drag_rect: self.pick_drag_rect,
|
||||
grip_object_limit: self.grip_object_limit,
|
||||
},
|
||||
crate::ui::window::options::AppPrefs {
|
||||
savetime_min: self.savetime_min,
|
||||
backup_on_save: self.backup_on_save,
|
||||
},
|
||||
self.double_click_block_refedit,
|
||||
self.double_click_block_attedit,
|
||||
self.cursor_type,
|
||||
|
||||
Reference in new issue
Block a user