-
-
Notifications
You must be signed in to change notification settings - Fork 101
Add a Create Folder Button to FileDialog #192
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
Conversation
Thanks for contributing this.
Some other minor comments:
cancel_button->onPress([wnd = create_folder_window.get()] {
wnd->destroy();
} ); |
Thanks for the feedback! I still have to iron out two bugs I found, where the new folder is not correctly created. But after that the PR should be good to go. |
db69290
to
719e64d
Compare
The PR is now ready for review. I would maybe open up another PR after this one is closed, where I implement this, but maybe you want to do it yourself, which could be a bit faster than going through the whole PR process again. |
If you are going to add it immediately then we might as well just add it as another commit to this PR instead of starting a new one.
Of course, that's mainly why I posted it.
I would just disable the button like in Thunar. The file manager from my screenshot is Nautilus-based indeed, it's Nemo to be precise. |
31fb7a7
to
e26e1f0
Compare
e26e1f0
to
f005892
Compare
So, I finally got it done, after fighting a merge conflict for a while, but it works quite well. Regarding Nemo, I actually did not know about its existence until now, though I used Nautilus 'till a few months ago until they changed the UI so drastically that I switched over to Thunar. But I think, I am gonna give Nemo a try, it looks promising! |
Thanks again, it seems to work great.
|
This is a draft pull request to add a button to the FileDialog class which creates a folder with a given name in the current directory.
The functionality is pretty much complete, my only concern right now is a big memory leak that is created after the ChildWindow which handles the naming of the new folder is created, and then the application is closed.This leaks were fixed now, I had to, of course, remove all widgets from the ChildWindow, before destroying.
There is still a memory leak, that occurs on closing the ChildWindow with the x-button, but I'll have to look into that later.
I would also be happy to receive feedback on how good the code confirms to the tgui code style (or SFML's, according to the CONTRIBUTING.md 🙂).
I am also a bit conflicted on how the ChildWindow is created. I feel it's most comfortable to let this just happen in a function, and not add members of it to the FileDialog class.
I'm also thinking about maybe putting the creation of the ChildWindow in a seperate function, for readability's sake, like this: