Author distrobox.ini files from a GUI form - #213
Open
kacperpaczos wants to merge 3 commits into
Open
Conversation
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.
kacperpaczos
force-pushed
the
feat/assemble-ini-generator
branch
from
August 22, 2026 18:32
64cdb06 to
4de3a02
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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>.iniin Documents).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 waslet _ = 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
build_assemble_inithe 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.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_argumentson the preview helper, anunnecessary_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.