Add visual format cards, per-image remove, shortcuts dialog, wire threads
Convert step: replace ComboRow with visual format card grid showing icon, name, and description for each format. Much more beginner-friendly. Images step: add per-image remove button on each file row so users can exclude individual images from the batch. Shortcuts: use adw::Dialog with structured layout since GtkShortcutsWindow is deprecated in GTK 4.18+. Add file management and undo shortcuts. Settings: wire thread count selection to actually save/restore the ThreadCount config value instead of always defaulting to Auto.
This commit is contained in:
@@ -89,6 +89,13 @@ pub fn build_settings_dialog() -> adw::PreferencesDialog {
|
||||
.build();
|
||||
let threads_model = gtk::StringList::new(&["Auto", "1", "2", "4", "8"]);
|
||||
threads_row.set_model(Some(&threads_model));
|
||||
threads_row.set_selected(match config.thread_count {
|
||||
pixstrip_core::config::ThreadCount::Auto => 0,
|
||||
pixstrip_core::config::ThreadCount::Manual(1) => 1,
|
||||
pixstrip_core::config::ThreadCount::Manual(2) => 2,
|
||||
pixstrip_core::config::ThreadCount::Manual(n) if n <= 4 => 3,
|
||||
pixstrip_core::config::ThreadCount::Manual(_) => 4,
|
||||
});
|
||||
|
||||
let error_row = adw::ComboRow::builder()
|
||||
.title("On error")
|
||||
@@ -192,7 +199,13 @@ pub fn build_settings_dialog() -> adw::PreferencesDialog {
|
||||
1 => SkillLevel::Detailed,
|
||||
_ => SkillLevel::Simple,
|
||||
},
|
||||
thread_count: pixstrip_core::config::ThreadCount::Auto,
|
||||
thread_count: match threads_row.selected() {
|
||||
1 => pixstrip_core::config::ThreadCount::Manual(1),
|
||||
2 => pixstrip_core::config::ThreadCount::Manual(2),
|
||||
3 => pixstrip_core::config::ThreadCount::Manual(4),
|
||||
4 => pixstrip_core::config::ThreadCount::Manual(8),
|
||||
_ => pixstrip_core::config::ThreadCount::Auto,
|
||||
},
|
||||
error_behavior: match error_row.selected() {
|
||||
1 => ErrorBehavior::PauseOnError,
|
||||
_ => ErrorBehavior::SkipAndContinue,
|
||||
|
||||
Reference in New Issue
Block a user