Skip to content
Browse files

Merge pull request #205 from tkdchen/fix-crash-when-show-about-dialog

fix crash when show About dialog
  • Loading branch information...
2 parents d15c544 + f6b1213 commit f23c85961e06478ac3368d0f5278b6cda5cef559 @toupeira toupeira committed Nov 26, 2014
Showing with 14 additions and 2 deletions.
  1. +14 −2 src/hamster/about.py
View
16 src/hamster/about.py
@@ -20,6 +20,7 @@
from os.path import join
from configuration import runtime
+import gobject
import gtk
def on_email(about, mail):
@@ -31,8 +32,15 @@ def on_url(about, link):
gtk.about_dialog_set_email_hook(on_email)
gtk.about_dialog_set_url_hook(on_url)
-class About(object):
+
+class About(gtk.Object):
+ __gsignals__ = {
+ "on-close": (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
+ }
+
def __init__(self, parent = None):
+ gtk.Object.__init__(self)
+
about = gtk.AboutDialog()
self.window = about
infos = {
@@ -60,5 +68,9 @@ def __init__(self, parent = None):
about.set_logo_icon_name("hamster-applet")
- about.connect("response", lambda self, *args: self.destroy())
+ about.connect("response", self.on_about_response)
about.show_all()
+
+ def on_about_response(self, dialog, response_id, *args):
+ dialog.destroy()
+ self.emit('on-close')

0 comments on commit f23c859

Please sign in to comment.
Something went wrong with that request. Please try again.