[kupfer] ui: Fix bug when ui context from command result was none



commit 14c43cf135b78b2e81809acec550c58e95128ec7
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Mar 31 19:46:47 2011 +0200

    ui: Fix bug when ui context from command result was none

 kupfer/ui/browser.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/ui/browser.py b/kupfer/ui/browser.py
index d1c278d..126e0c1 100644
--- a/kupfer/ui/browser.py
+++ b/kupfer/ui/browser.py
@@ -2027,7 +2027,10 @@ class WindowController (pretty.OutputMixin):
 		self._window_hide_timer.set_ms(100, self.put_away)
 
 	def result_callback(self, sender, result_type, ui_ctx):
-		self.on_present(sender, ui_ctx.get_display(), ui_ctx.get_timestamp())
+		if ui_ctx:
+			self.on_present(sender, ui_ctx.get_display(), ui_ctx.get_timestamp())
+		else:
+			self.on_present(sender, "", gtk.get_current_event_time())
 
 	def _lost_focus(self, window, event):
 		# Close at unfocus.



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