Need of a cancel button

Bug #117450 reported by David Boucher
2
Affects Status Importance Assigned to Milestone
gNumExp
Fix Committed
Low
Unassigned

Bug Description

I open a plot window. I draw a function.

Then, I enter CTRL-Q to close the window and then I realize I should not quit. gNumExp only proposes me to save my work or to quit without saving.

It could be cool to have the choice to cancel my last action to continue my work.

Remark : If I click on the close button of the window, I have the three choices, say CANCEL, CLOSE wihout saving and save my work.

But those two actions are different... Maybe we could also have a CTRL-W shortcut to close the window attached to a menu item Close the window.

Revision history for this message
Gustavo Carneiro (gjc) wrote :

This behaviour was copied from gedit, at the time I wrote it. Meanwhile even gedit has changed behaviour to do what you want, so I guess it must be OK.
I can't fix it right now because I would have to update gnumexp to use the new goocanvas API, and I have little time for gnumexp right now :(

However, if you want to fix it's trivial; just go to gnumex/src/main.py and around line 300 you'll find this method:

    def close(self, quitting=False):
        close = self.document_save_hook(can_cancel=(not quitting))
        if close:
            self.destroy()

I think it is pretty obvious how to fix the code ;-)

Changed in gnumexp:
importance: Undecided → Low
status: Unconfirmed → Confirmed
Revision history for this message
David Boucher (bouda1) wrote :

I just changed (following Gustavo's idea) this:

def close(self, quitting=False):
- close = self.document_save_hook(can_cancel=(not quitting))
+ close = self.document_save_hook(can_cancel=True)

Nothing else was changed. It's not beautiful but I don't know if I don't see if can_cancel argument may have an interest.

Changed in gnumexp:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.