Skip to content

fix: open file dialogs in a sensible default directory instead of the working directory#11256

Open
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:fix/locate-file-dialog-start-dir
Open

fix: open file dialogs in a sensible default directory instead of the working directory#11256
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:fix/locate-file-dialog-start-dir

Conversation

@BenJule

@BenJule BenJule commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Several wxFileDialog call sites passed an empty directory, so they opened in the current working directory (which can be a temp folder) instead of somewhere useful.

Relocation dialogs (a file path is known) now open in that file's own folder, falling back to the last used directory:

  • "Select a new file" (replace a volume's source file)
  • "Please select a file" (locate a missing input on project load)

Open dialogs (no prior path) now open in the last used directory:

  • Select a G-code file (GUI_App)
  • Import bed shape / texture / model (BedShapeDialog)
  • Select images (StatusPanel)
  • Open CA certificate file (PhysicalPrinterDialog)

No functional changes — only the dialogs' initial directory. Adjacent to the temp-working-dir behaviour reported in #11253, though it does not by itself fix the Import-3mf / Save-As default there.

@BenJule BenJule changed the title fix: open file-selection dialogs in the referenced file's folder Jun 22, 2026
@Haidiye00

Copy link
Copy Markdown
Contributor

Hi, please merge it into one patch and then submit your test results. Thanks.

… working directory

File-selection dialogs opened in the process working directory. Open them in a
sensible location instead: the referenced file's own folder where one exists,
otherwise the last-used directory. Covers the open/import/export/replace dialogs
across BedShapeDialog, PhysicalPrinterDialog, StatusPanel, Plater and GUI_App.
@BenJule BenJule force-pushed the fix/locate-file-dialog-start-dir branch from e7f1b6d to 44318cf Compare June 27, 2026 15:31
@BenJule

BenJule commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Done - squashed into a single commit.

On the change itself: all the affected dialogs (open/import/export/replace across BedShapeDialog, PhysicalPrinterDialog, StatusPanel, Plater and GUI_App) now start in a sensible folder - the referenced file's own directory when there is one, otherwise the last-used directory - instead of the process working directory. The behaviour to check is: open one of these dialogs, pick a file in some folder, reopen the same dialog and confirm it starts in that folder again rather than the CWD.

Full disclosure: I don't have a macOS/Windows GUI build environment here, so I've verified the logic by tracing the code paths rather than capturing a recorded run. If a maintainer build is handy, those are the flows to confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants