[FIX] Save dialogs: Avoid weird behavior with extensions on macOS#7195
[FIX] Save dialogs: Avoid weird behavior with extensions on macOS#7195markotoplak merged 1 commit intobiolab:masterfrom
Conversation
d376297 to
d7aadbd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7195 +/- ##
=======================================
Coverage 88.91% 88.91%
=======================================
Files 335 335
Lines 73978 74074 +96
=======================================
+ Hits 65779 65866 +87
- Misses 8199 8208 +9 🚀 New features to boost your workflow:
|
| def initial_start_dir(self): | ||
| if self.filename and os.path.exists(os.path.split(self.filename)[0]): | ||
| return self.filename | ||
| return os.path.splitext(self.filename)[0] |
There was a problem hiding this comment.
This change might affect Windows. We need to check and, if necessary, do this only for macOS.
| """ | ||
| if self.filename and os.path.exists(os.path.split(self.filename)[0]): | ||
| return self.filename | ||
| return os.path.splitext(self.filename)[0] |
There was a problem hiding this comment.
The same change as in the base class. See whether this is OK for Windows, too.
|
Saving data (.tab), workflows (.ows) and reports (.pdf..) works as expected on Windows on this PR - no complaints about the extension, and only a single overwrite dialog when necessary. |
|
@MatejBevec , thanks! I tried to install Windows into a virtual machine in VirtualBox on my macOs, but doesn't seem to work on Arm. It is said to work with VmWare, but I gave up. |
|
@markotoplak , can you just try this on Linux, merge if OK, and then I guess we're ready for a release? |
|
On Linux it works in a very linuxy way: if I use a filename without an extension, it is NOT added, and I do NOT get any questions about it. I personally like this a lot. The master branch exhibits the same behavior. |
Issue
Fixes #7156.
On macOS, the native file dialog added a (correct) extension and then complained that, e.g. extension .tab is invalid and that the required extension is .tab. This may be due to changed behavior in Qt6 or macOS Sequoia.
Furthermore, macOS native dialog already asks whether to override the file (the flag
DontConfirmOverwriteis ignored), hence the user was asked twice.Description of changes
This seems to be fixed by
a. keeping the
*in filters andb. by not giving the extension to the initial file name.
Point a won't affect Window because we already had * there. Point 2 can; we need to try and patch if necessary.
I removed the confirmation dialog for macOS, but kept it for Windows.
Includes