Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set caption default for opendir_dialog #1171

Closed
wants to merge 1 commit into from

Conversation

jackrsteiner
Copy link

Changes the caption default value to 'Browse...' for opendir_dialog as per issue #1167. I think this will only impact systems that use Qt implemented file browsers, not system using the system default file browser.

Changes the caption default value to 'Browse...' for opendir_dialog as per issue git-cola#1167. I think this will only impact systems that use Qt implemented file browsers, not system using the system default file browser.
@jackrsteiner
Copy link
Author

As this change I think has no impact on my system, whoever is seeking this change probably needs to test it first.

@@ -440,7 +440,7 @@ def open_files(title, directory=None, filters=''):
return result[0]


def opendir_dialog(caption, path):
def opendir_dialog(path, caption='Browse...'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would have to updated at the call site since different call sites have different captions. I guess Browse... would be okay. I figured the more specific caption was helpful.

Would an alternative for that issue be to use a more specific caption such as, "Open Git Repository..."?

Alternatively, if we wanted to make most of the call sites not specify a value, then it'd be best to use the value of None as the default value here, and then when it's None we can call N_('Browse...') to get the caption within the function body.

We have to defer the call to N_(...) until after the translations have been activated so we cannot N_(...) when providing default values for keyword arguments. Keyword arg defaults are global variables evaluated at module scope (not deferred) which is why we'd have to use the None trick to defer it.

@davvid
Copy link
Member

davvid commented Feb 18, 2023

Sorry for not noticing this open PR. This was fixed in bcdbf65 and further refined when @nakanoi updated the startup dialog in #1280

@davvid davvid closed this Feb 18, 2023
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.

None yet

2 participants