Skip to content

Author distrobox.ini files from a GUI form - #213

Open
kacperpaczos wants to merge 3 commits into
Dvlv:masterfrom
kacperpaczos:feat/assemble-ini-generator
Open

Author distrobox.ini files from a GUI form#213
kacperpaczos wants to merge 3 commits into
Dvlv:masterfrom
kacperpaczos:feat/assemble-ini-generator

Conversation

@kacperpaczos

Copy link
Copy Markdown
Contributor

Closes #208

A form for authoring distrobox.ini files, from the Needs External Help list. Section name, image, packages, home and the init/nvidia switches, with a live preview of the exact file underneath, and Save writing it wherever you pick (defaulting to <section>.ini in Documents).

assemble INI generator

This branch also tidies two things I hit while finishing it: the .ini body was built by two identical blocks (preview and save), which I've merged into one tested build_assemble_ini, and the save was let _ = fs::write(...) — a failed write vanished silently and closed the dialog as if it had worked; it now raises a dialog and keeps the form open.

Testing

  • The live preview in the screenshot is rendered by the same build_assemble_ini the save uses, and it matches the unit tests exactly — I drove the dialog and watched the preview update as I filled the packages field and flipped init.
  • Unit tests pin the minimal, all-set and blank-optional shapes of the generated file.
  • The save-error dialog is a defensive path I've reasoned through rather than triggered — worth a glance in review.

Note on lints

clippy count is unchanged from this branch's own baseline (I measured before and after). The two lints it carries (too_many_arguments on the preview helper, an unnecessary_to_owned) predate my commit and are the closure-wiring in the original branch; I left them alone to keep this focused, happy to clean them up if you'd like.

BoxBuddy Contributor and others added 2 commits August 22, 2026 20:21
Adds 'Create Assemble INI…' to the application menu (between 'Set
Preferred Terminal' and 'About BoxBuddy'). The dialog exposes the most
common keys - image, additional_packages, home, init, nvidia - with a
live monospace preview of the file that will be written. Save opens a
FileDialog in save mode with the *.ini filter pre-applied, defaulting
to ~/Documents/<section>.ini.

Resolves the 'Create Assemble ini files via GUI' item on the
project's Roadmap.

The shape of distrobox.ini is flat: one section per box, key=value
per option. Anything beyond the six exposed fields has to be edited by
hand; documented in the function-level comment.
The .ini body was assembled twice by identical push_str blocks - once for
the live preview, once at save - so the two could drift. Both now call a
single build_assemble_ini in the handler, which comes with unit tests
pinning the minimal, all-set and blank-optional shapes.

The save itself was `let _ = std::fs::write(...)`, which threw away any
error and destroyed the dialog as if it had worked. A failed write now
raises a dialog naming the error and leaves the form open so the work
isn't lost.
The six signal hooks each re-listed the same eight arguments for a
nested helper. A single Rc closure that reads the rows itself now does
the re-render; every changed/notify hook just calls it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Author distrobox.ini files from a GUI form (Roadmap: Needs External Help)

1 participant