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
Added ability to import multiple files #2439
Conversation
Hi, nickleus27! Please (re?)read the second approach proposed by ice0 here: #2403 (comment) |
@ice0 and @rodolforg I didn't understand ice0 example at first reading, but going through it again I see that it is a really great idea. I appreciate you showing me how to do that. I think it helped me learn. 💯 I added a commit with ice0's suggestion. |
Hi, Nick!
I made a commit to see changes in this method. So let's check them.
Here you can use the passed parameter (
This part sets the currently selected filename in the dialog. This brings up an additional question. If we allow multiple selection, do we need to open a window with multiple selected files? Now this part:
Take a look at this line:
This code saves the last opened folder in the preferences so that you can open it next time when you open the dialog box.
So you can get that path from the first file.
P.S. I'm not sure if filenames can be empty after selection, so it's better to check this.
|
@ice0
Originally filename was passed in from
would this work for this line?
From how the code was previously it seems that filename is always passed in as "*.*" from CanvasView::import_file(). Unless I am mis-understanding something? |
It is also used in
If the user wants to open multiple files, then we we open last opened directory, without selecting any files.
Yes, but it can be called with different filename mask from |
@ice0 Thank you, That makes sense now. I failed to recognize |
Hi @ice0 and @rodolforg! I think these changes are looking a lot better. Thank you for all the help along the way. |
@ice0 Hey ice how are you? As you can probably tell I am a super newb at github. I tried to git merge and then git push to keep this branch up to date with master. But after doing so it added other peoples commits it seems. Did i do this correctly? Thanks for being patient with answering my questions. |
Hi, Nick! Please try After that you will need to force push your changes (since this rewrites git history). Good documentation on |
@ice0 thank you ice! Much appreciated! |
…er to set_select_multiple
857eedb
to
c914de2
Compare
@ice0 Thank you that worked great, and this is looking a lot better now. So |
I am excited to say I figured out what I did wrong with the previous push. :) |
@nickleus27 |
@ice0 can you look over my |
@nickleus27 Looks good to me! |
Merged. Thank you! |
#2403
@ice0 This pull request allows users of the gui to select and import multiple files at once from the import dialog. I overloaded the dialog_open_file with this:
App::dialog_open_file(const std::string &title, std::vector<std::string> &filenames, std::string preference)
which adds the the parameters that is a string vector. This PR adds a lot of lines of code since I overloaded the original function. I tried making it work a bool parameter, but to be honest I was a little confused how to make it work. I know I can figure out how to make it work if need be to make maintaining code easier.