Complete.Org: Mailing Lists: Archives: offlineimap: January 2009:
[PATCH] add delete event handler
Home

[PATCH] add delete event handler

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: [PATCH] add delete event handler
From: Christoph Höger <choeger@xxxxxxxxxxxxxxx>
Date: Sat, 17 Jan 2009 14:38:45 +0100

        * developed against gnomeui branch
        * This handler prevents the Dialog from being destroyed
          when the close button is pressed.
Signed-off-by: Christoph Höger <choeger@xxxxxxxxxxxxxxx>
---
 offlineimap/ui/Gnome.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/offlineimap/ui/Gnome.py b/offlineimap/ui/Gnome.py
index ec2a926..faca702 100644
--- a/offlineimap/ui/Gnome.py
+++ b/offlineimap/ui/Gnome.py
@@ -292,6 +292,7 @@ class GnomeUILogWindow(gtk.Dialog):
                                     gtk.STOCK_OK, gtk.RESPONSE_OK))
                self.set_default_size(640, 480)
                self.connect('response', self.response_cb)
+               self.connect('delete-event',self.close_on_delete_cb)
 
                box = gtk.VBox(False, 8)
                self.vbox.pack_start(box, True, True, 0)
@@ -379,6 +380,10 @@ class GnomeUILogWindow(gtk.Dialog):
                gtk.gdk.threads_leave()
                return False
 
+       def close_on_delete_cb(self, widget, event):
+               # response_cb will handle everything
+               return True
+
        def response_cb(self, widget, response):
                self.ui.debug("GnomeUILogWindow.response_cb()")
                if response == gtk.RESPONSE_CANCEL:
-- 
1.5.6.6

-- Attached file included as plaintext by Ecartis --
-- File: signature.asc
-- Desc: Dies ist ein digital signierter Nachrichtenteil

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAklx32IACgkQhMBO4cVSGS/oRACeIaU0Rrtwut7r7pbwmRUcY7VV
2J4AnRN2SDs9G690TUIAZo4vwhdaUdVi
=XCVe
-----END PGP SIGNATURE-----




[Prev in Thread] Current Thread [Next in Thread]