Improve output step with individual operation summary rows
Replace single-line arrow-delimited summary with a proper ListBox showing each enabled operation as its own row with check icons. Dynamically rebuilt when navigating to the output step. Also make walk_widgets public for cross-module use.
This commit is contained in:
@@ -2518,25 +2518,30 @@ fn update_output_summary(ui: &WizardUi) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let summary_text = if ops.is_empty() {
|
// Find the ops-summary-list ListBox and populate it
|
||||||
"No operations configured".to_string()
|
|
||||||
} else {
|
|
||||||
ops.join(" -> ")
|
|
||||||
};
|
|
||||||
|
|
||||||
walk_widgets(&page.child(), &|widget| {
|
walk_widgets(&page.child(), &|widget| {
|
||||||
if let Some(row) = widget.downcast_ref::<adw::ActionRow>() {
|
if let Some(list_box) = widget.downcast_ref::<gtk::ListBox>()
|
||||||
let subtitle_str = row.subtitle().unwrap_or_default();
|
&& list_box.widget_name().as_str() == "ops-summary-list"
|
||||||
if row.title().as_str() == "No operations configured"
|
|
||||||
|| subtitle_str.contains("->")
|
|
||||||
|| subtitle_str.contains("configured")
|
|
||||||
{
|
{
|
||||||
|
// Clear existing rows
|
||||||
|
while let Some(child) = list_box.first_child() {
|
||||||
|
list_box.remove(&child);
|
||||||
|
}
|
||||||
|
|
||||||
if ops.is_empty() {
|
if ops.is_empty() {
|
||||||
row.set_title("No operations configured");
|
let row = adw::ActionRow::builder()
|
||||||
row.set_subtitle("Go back and configure your workflow settings");
|
.title("No operations configured")
|
||||||
|
.subtitle("Go back and configure your workflow settings")
|
||||||
|
.build();
|
||||||
|
row.add_prefix(>k::Image::from_icon_name("dialog-information-symbolic"));
|
||||||
|
list_box.append(&row);
|
||||||
} else {
|
} else {
|
||||||
row.set_title(&format!("{} operations", ops.len()));
|
for op in &ops {
|
||||||
row.set_subtitle(&summary_text);
|
let row = adw::ActionRow::builder()
|
||||||
|
.title(op.as_str())
|
||||||
|
.build();
|
||||||
|
row.add_prefix(>k::Image::from_icon_name("emblem-ok-symbolic"));
|
||||||
|
list_box.append(&row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2568,7 +2573,7 @@ fn find_widget_by_type<T: IsA<gtk::Widget>>(page: &adw::NavigationPage) -> Optio
|
|||||||
result.into_inner()
|
result.into_inner()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn walk_widgets(widget: &Option<gtk::Widget>, f: &dyn Fn(>k::Widget)) {
|
pub fn walk_widgets(widget: &Option<gtk::Widget>, f: &dyn Fn(>k::Widget)) {
|
||||||
let Some(w) = widget else { return };
|
let Some(w) = widget else { return };
|
||||||
f(w);
|
f(w);
|
||||||
let mut child = w.first_child();
|
let mut child = w.first_child();
|
||||||
|
|||||||
@@ -16,19 +16,19 @@ pub fn build_output_page(state: &AppState) -> adw::NavigationPage {
|
|||||||
.margin_end(24)
|
.margin_end(24)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Operation summary - dynamically updated when this step is shown
|
// Operation summary - dynamically rebuilt when this step is shown
|
||||||
let summary_group = adw::PreferencesGroup::builder()
|
let summary_group = adw::PreferencesGroup::builder()
|
||||||
.title("Operation Summary")
|
.title("Operation Summary")
|
||||||
.description("Review your processing settings before starting")
|
.description("Review your processing settings before starting")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
let summary_row = adw::ActionRow::builder()
|
let summary_box = gtk::ListBox::builder()
|
||||||
.title("No operations configured")
|
.selection_mode(gtk::SelectionMode::None)
|
||||||
.subtitle("Go back and configure your workflow settings")
|
.css_classes(["boxed-list"])
|
||||||
.build();
|
.build();
|
||||||
summary_row.add_prefix(>k::Image::from_icon_name("dialog-information-symbolic"));
|
summary_box.set_widget_name("ops-summary-list");
|
||||||
|
|
||||||
summary_group.add(&summary_row);
|
summary_group.add(&summary_box);
|
||||||
content.append(&summary_group);
|
content.append(&summary_group);
|
||||||
|
|
||||||
// Output directory
|
// Output directory
|
||||||
|
|||||||
Reference in New Issue
Block a user