SVG Import cannot be canceled.

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
leoheck
Posts: 479
Joined: Tue Mar 13, 2018 5:56 pm

SVG Import cannot be canceled.

Post by leoheck » Sat Oct 10, 2020 6:45 pm

SVG import dialog cannot be canceled. This X button does nothing when there is nothing selected
When something is selected, then the X works but it loads the file anyways instead of canceling the operation.

Actually, a cancel button would be nice here, otherwise, there is no way to cancel this window.


OS: Ubuntu 20.04.1 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: d76124b61e35d3ce7ffec128bf3c07756d7e79a3
Python version: 3.8.5
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
Screenshot-20201010154241-375x319.png
Screenshot-20201010154241-375x319.png (36.54 KiB) Viewed 234 times
openBrain
Posts: 4836
Joined: Fri Nov 09, 2018 5:38 pm

Re: SVG Import cannot be canceled.

Post by openBrain » Sat Oct 17, 2020 10:47 pm

I have this tab open for a pretty long time but wanted to check the code.
The mentioned behavior is on purpose, and I think allowing at this dialog to be canceled wouldn't be trivial.
From my PoV, this is quite correct though. When you import a STEP (where there is no subsequent option), you can't cancel once the 'Import' button of the file dialog has been clicked. That's same here, except there is an intermediate choice that shall be done (even if you mistook the original import action and have then to cancel).
IMO what could be a sensible change is to remove the 'X' close button of the dialog (and nothing more).
leoheck
Posts: 479
Joined: Tue Mar 13, 2018 5:56 pm

Re: SVG Import cannot be canceled.

Post by leoheck » Wed Oct 21, 2020 6:49 pm

Hi OpenBrain,

Thanks for the reply.

I was about to import an .step file.. then I clicked on an .svg file by mistake which is acceptable since end-users do these kinds of mistakes.
Then I was not able to cancel this dialog which is ok, but not good since I am seeing this X button available for that thing.
Then I have to choose the option that I don't want.
It is not a big deal, but it looks like the software is kind of broken or something...

So, why is it such a hard task to cancel/dismiss this popup thing?
Also, why not consider one workaround then...
Maybe the X button could select one of the options, load the file and close it immediately.
openBrain
Posts: 4836
Joined: Fri Nov 09, 2018 5:38 pm

Re: SVG Import cannot be canceled.

Post by openBrain » Wed Oct 21, 2020 7:17 pm

leoheck wrote:
Wed Oct 21, 2020 6:49 pm
So, why is it such a hard task to cancel/dismiss this popup thing?
Also, why not consider one workaround then...
Maybe the X button could select one of the options, load the file and close it immediately.
Not sure how hard it would be, but sure not trivial. I don't know how deep you expect the explanation, but this is due to some implementation choices. They have been made to make the addition of new importers easier and more flexible. The dialog you see is displayed as soon as there are more than one importer module for a same file type. And it is automatically populated with the list of import modules currently available on the user's computer. What is expected as a return value (when the dialog is closed) is -- in a simplified way -- the chosen module. Oppositely to other standard dialogs where the return value is a status : accept, cancel,... A cancelation mechanism hasn't been implemented (on purpose IMO) and willing to do so would imply to carefully check all side effects, and potentially rewrite a part of the existing code. ATM it looks to me as it's not worth the hassle. ;)
Post Reply

Who is online

Users browsing this forum: m0n5t3r and 26 guests