Commit 501ac484 authored by Kai Willadsen's avatar Kai Willadsen

filediff: Handle save responses better in delete events (bgo#744081)

The "you have modified files" dialog offers a "Close without saving"
option, which returns a CLOSE response code instead of our usual OK.
This was being handled correctly in most places, but not when the tab
was being closed via a delete event. This patch fixes it so that the
check_save_modified() always returns either OK or CANCEL, since that's
really the only thing we need out of it.

This commit also removes a stray delete-event handler on a widget that
should never ever be loaded.
parent a6297539
......@@ -280,7 +280,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">window1</property>
<signal name="destroy" handler="on_delete_event" swapped="no"/>
<child>
<object class="GtkVBox" id="filediff">
<property name="visible">True</property>
......
......@@ -883,6 +883,9 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
elif response == Gtk.ResponseType.DELETE_EVENT:
response = Gtk.ResponseType.CANCEL
if response == Gtk.ResponseType.CLOSE:
response = Gtk.ResponseType.OK
if response == Gtk.ResponseType.OK and self.meta:
parent = self.meta.get('parent', None)
saved = self.meta.get('middle_saved', False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment