-
Notifications
You must be signed in to change notification settings - Fork 134
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
Multiselection of folders in sources tab #1871
base: master
Are you sure you want to change the base?
Conversation
If it doesn't get to complicated go ahead! |
Committed the changes, multiselection and addition of directories to sources is working now. |
This needs some changes to the tests, will commit them soon. |
So apparently, some tests are failing due to the changes I've made to the mocker.patch('os.access', return_value=False)
tab.source_add(want_folder=True) We are getting a |
src/vorta/utils.py
Outdated
dialog.exec() | ||
return dialog.selectedFiles() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change that? Using the non-blocking open
with a slot is probably better then using exec
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change that? Using the non-blocking
open
with a slot is probably better then usingexec
.
For some reason that way was not working out, the directories (if selected multiple) were not getting added to the sources.
Have a look at pytest fixtures. vorta/tests/integration/conftest.py Lines 183 to 201 in 5b36fab
This mocking function still returns a dialog while the code expects a list of selected files resulting in the exception. |
@real-yfprojects now I understand how this tests, when the
I'm quite lost in what I could be still missing atm. |
Before you change the fixture returned a function, now its a list. The return value of the fixture is available in tests using the fixture through the |
113244d
to
aa8f26c
Compare
Thank you for the assistance @real-yfprojects Finally done, multiselection working and tests pass now. untitled.mp4 |
PR #1938 provides a more detailed implementation that accounts for different types of file dialog views (QListView and QTreeView). |
Just checked it out, it does account for two different types of view. |
Co-authored-by: real-yfprojects
fixed this in this little commit. |
Description
In the source, multiple folders cant be selected, due to some limitations in
QFileDialog
.Fixes #1869
Motivation and Context
It would be more convenient if one can select multiple directories in one go, not having to open add folder dialog window multiple time, saving previous time and clicks.
How Has This Been Tested?
By running them in my system. No actual tests edited so far.
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.