Fix path not filled when file is selected#40
Merged
Conversation
Currently if one presses any folder button on the dock to the right, nothing happens. This is because the popup first emits `popup_hide` and then `file_selected`, causing the signal connection to break before `file_selected` is fired. To solve this I propose adding an enum that will change depending on the button is pressed. It'll be redundant to use 4 identical `EditorFileDialog`, we can still use one and change it's parameters. A new variable will hold the enum of the button pressed, and `file_selected` will execute `_on_file_selected` method that'll do a match on the selected enum and perform the correct action. If the FileDialog is canceled then `file_selected0` is not fired and the enum continues holding the past value. This value is overriden when a new button is pressed. If for some reason we end up with UNKNOWN that means this function was called from somewhere else other than the 4 buttons, which is not expected.
Contributor
Author
|
This fixes #36. |
Owner
|
Thanks for the PR @videlanicolas! I'll try to have a look tomorrow. |
Contributor
Author
|
Thanks! |
Owner
|
Great improvement! |
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.
Checklist for this pull request
Description
Currently if one presses any folder button on the dock to the right, nothing happens. This is because the popup first emits
popup_hideand thenfile_selected, causing the signal connection to break beforefile_selectedis fired.To solve this I propose adding an enum that will change depending on the button is pressed. It'll be redundant to use 4 identical
EditorFileDialog, we can still use one and change it's parameters. A new variable will hold the enum of the button pressed, andfile_selectedwill execute_on_file_selectedmethod that'll do a match on the selected enum and perform the correct action. If the FileDialog is canceled thenfile_selected0is not fired and the enum continues holding the past value. This value is overriden when a new button is pressed.If for some reason we end up with UNKNOWN that means this function was called from somewhere else other than the 4 buttons, which is not expected.