fix(qt): add non-native file dialog option#7309
fix(qt): add non-native file dialog option#7309thepastaclaw wants to merge 1 commit intodashpay:developfrom
Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
|
🕓 Ready for review — 2 ahead in queue (commit e1c4012) |
WalkthroughThis PR introduces a new Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/qt/intro.cpp`:
- Line 328: The call to GUIUtil::getExistingDirectory in
on_ellipsisButton_clicked uses a bare string and nullptr parent; wrap the
caption in tr() and pass the Intro widget as the parent instead of nullptr.
Update the invocation of GUIUtil::getExistingDirectory(nullptr, "Choose data
directory", ui->dataDirectory->text()) to use tr("Choose data directory") for
translation and use this (the Intro/QWidget instance) as the parent so the file
chooser is localized and properly parented to the Intro dialog.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0521312b-907f-4b6d-8ac1-9d711b04bc65
📒 Files selected for processing (4)
src/qt/bitcoin.cppsrc/qt/guiutil.cppsrc/qt/guiutil.hsrc/qt/intro.cpp
f9c8fe4 to
d0de36d
Compare
d0de36d to
e1c4012
Compare
|
The remaining red |
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
Small Qt GUI change adding -nativefiledialogs (default true) to opt out of native file dialogs on desktop environments where they hang. The wrapper plumbing is consistent and the default preserves existing behavior. Codex found no issues; only one minor maintainability nit retained.
Reviewed commit: e1c4012
💬 1 nitpick(s)
| static QFileDialog::Options GetFileDialogOptions() | ||
| { | ||
| return gArgs.GetBoolArg("-nativefiledialogs", /*fDefault=*/true) | ||
| ? QFileDialog::Options() | ||
| : QFileDialog::Options(QFileDialog::DontUseNativeDialog); | ||
| } |
There was a problem hiding this comment.
💬 Nitpick: Default value for -nativefiledialogs is duplicated
The default true is hardcoded in two places: in SetupUIArgs at src/qt/bitcoin.cpp:509 (the help text uses strprintf(... %u, true)) and in GetFileDialogOptions() at src/qt/guiutil.cpp:502 (gArgs.GetBoolArg("-nativefiledialogs", /*fDefault=*/true)). If the default ever changes, both sites must be updated in lock-step. Hoisting a static constexpr bool DEFAULT_NATIVE_FILE_DIALOGS = true; (alongside DEFAULT_SPLASHSCREEN / similar) and reusing it in both locations would single-source the value. Not a correctness issue — the surrounding code (e.g. -splash two lines below) follows the same %u + bool pattern, so this is consistent with existing style.
source: ['claude']
PR Body
Summary
-nativefiledialogsGUI option.-nativefiledialogs=0, central save/open dialogs use Qt dialogs.GUIUtilwrapper.Fixes #6935.
Motivation
Some Linux desktop environments can hang or freeze in native Qt file dialogs
before Dash reaches the export or wallet-backup code paths.
This keeps the default UX unchanged while adding a narrow escape hatch for
affected users.
Validation
git diff --check upstream/develop...HEADcode-review dashpay/dash upstream/develop fix/file-dialog-nonnative-optionreturned
shipQFileDialogsave/open/directory call sites undersrc/qtroute throughGUIUtilon this branch.No GUI runtime test was run in this macOS worktree. The reported freeze requires
an affected Linux/KDE/native-dialog environment to reproduce.