[hamster-applet] check if parent is a widget before looking for toplevel



commit 25423e114e3edb84d6fb0d82b0c2b9ccd474c9dc
Author: Toms Bauģis <toms baugis gmail com>
Date:   Fri Jul 16 15:30:07 2010 +0100

    check if parent is a widget before looking for toplevel

 src/hamster/configuration.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/hamster/configuration.py b/src/hamster/configuration.py
index a623081..b217184 100644
--- a/src/hamster/configuration.py
+++ b/src/hamster/configuration.py
@@ -110,7 +110,9 @@ class OneWindow(object):
         else:
             if parent:
                 dialog = self.get_dialog_class()(parent, **kwargs)
-                dialog.window.set_transient_for(parent.get_toplevel())
+
+                if isinstance(parent, gtk.Widget):
+                    dialog.window.set_transient_for(parent.get_toplevel())
 
                 # to make things simple, we hope that the target has defined self.window
                 dialog.window.connect("destroy",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]