Skip to content

Commit

Permalink
pnp export window: add customisation reset button
Browse files Browse the repository at this point in the history
changelog: Enhancements/Board Editor: add pick&place customisation reset
button
  • Loading branch information
carrotIndustries committed Jan 22, 2025
1 parent f7fc2eb commit 6a0a996
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/imp/pnp_export_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,24 @@ PnPExportWindow::PnPExportWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk
update_preview();
});
}

{
auto reset_button = Gtk::manage(new Gtk::Button("Reset to default"));
reset_button->set_tooltip_text("Reset position format, side and column names to default values");
reset_button->set_margin_top(10);

reset_button->signal_clicked().connect([this] {
for (const auto &[id, name] : pnp_column_names) {
column_name_entries[id]->set_text(name);
}
const PnPExportSettings default_settings;
top_side_entry->set_text(default_settings.top_side);
bottom_side_entry->set_text(default_settings.bottom_side);
position_format_entry->set_text(default_settings.position_format);
});
customize_grid->attach(*reset_button, 0, top++, 2, 1);
reset_button->show();
}
}
customize_check->set_active(settings.customize);
customize_revealer->set_reveal_child(settings.customize);
Expand Down

0 comments on commit 6a0a996

Please sign in to comment.