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

Fixed "Open" button being enabled when nothing is selected in a FileDialog while in "Open folder" mode #16710

Merged

Conversation

YeldhamDev
Copy link
Member

Also changed the _tree_dc_selected binding to match the function's name.

@ghost ghost added this to the 3.1 milestone Feb 15, 2018
@@ -756,7 +754,7 @@ void FileDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("_unhandled_input"), &FileDialog::_unhandled_input);

ClassDB::bind_method(D_METHOD("_tree_selected"), &FileDialog::_tree_selected);
ClassDB::bind_method(D_METHOD("_tree_db_selected"), &FileDialog::_tree_dc_selected);
ClassDB::bind_method(D_METHOD("_tree_dc_selected"), &FileDialog::_tree_dc_selected);
Copy link
Member

Choose a reason for hiding this comment

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

Any clue about what dc means in this method? Maybe it should be made more explicit.

Copy link
Member Author

@YeldhamDev YeldhamDev Feb 20, 2018

Choose a reason for hiding this comment

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

"double click", it's tied to the Tree's "item_activated" signal. Should it be renamed "_tree_double_clicked"?

Or better yet, "_tree_item_activated", to represent which signal it's tied with (See #16839).

@YeldhamDev YeldhamDev force-pushed the filedialog_nothing_disabled branch from 934e702 to db80d56 Compare February 20, 2018 15:21
@YeldhamDev
Copy link
Member Author

I renamed the _tree_dc_selected function to _tree_item_activated. Also cleaned some dead code.

@@ -756,7 +754,7 @@ void FileDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("_unhandled_input"), &FileDialog::_unhandled_input);

ClassDB::bind_method(D_METHOD("_tree_selected"), &FileDialog::_tree_selected);
ClassDB::bind_method(D_METHOD("_tree_db_selected"), &FileDialog::_tree_dc_selected);
ClassDB::bind_method(D_METHOD("_tree_item_activated"), &FileDialog::_tree_item_activated);
Copy link
Member

Choose a reason for hiding this comment

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

Actually my bad, the original name needs to be kept for the binding to avoid breaking compatibility (but the C++ name can still be changed). Will add this one to #16863.

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that it starts with an underscore, I think this is not a problem.

This won't be listed in documentation or autocompleted in GDScript. If anyone uses underscore-starting methods, they should be prepared to fix their messy hacks.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough. :)

@akien-mga akien-mga merged commit 35053e5 into godotengine:master Feb 21, 2018
@ghost ghost mentioned this pull request Feb 21, 2018
@YeldhamDev YeldhamDev deleted the filedialog_nothing_disabled branch February 21, 2018 14:19
@hpvb hpvb removed the cherrypick label Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants