[kupfer: 7/51] preferences: Implement show_on_screen



commit 3280e54a4ea45145e234868cec0b9624b55e57ef
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Mon Mar 28 16:51:41 2011 +0200

    preferences: Implement show_on_screen

 kupfer/kupferui.py       |    6 +++++-
 kupfer/ui/preferences.py |    3 +++
 2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/kupferui.py b/kupfer/kupferui.py
index 47df6c6..947e565 100644
--- a/kupfer/kupferui.py
+++ b/kupfer/kupferui.py
@@ -60,7 +60,11 @@ def _response_callback(dialog, response_id):
 def show_preferences(ctx=None):
 	from kupfer.ui import preferences
 	win = preferences.GetPreferencesWindowController()
-	win.show(_get_time(ctx))
+	if ctx:
+		win.show_on_screen(ctx.environment.get_timestamp(),
+		                   ctx.environment.get_screen())
+	else:
+		win.show(_get_time(ctx))
 
 def show_plugin_info(plugin_id, ctx=None):
 	from kupfer.ui import preferences
diff --git a/kupfer/ui/preferences.py b/kupfer/ui/preferences.py
index 313b5a6..04dca7a 100644
--- a/kupfer/ui/preferences.py
+++ b/kupfer/ui/preferences.py
@@ -802,6 +802,9 @@ class PreferencesWindowController (pretty.OutputMixin):
 
 	def show(self, timestamp):
 		self.window.present_with_time(timestamp)
+	def show_on_screen(self, timestamp, screen):
+		self.window.set_screen(screen)
+		self.show(timestamp)
 
 	def show_focus_plugin(self, plugin_id, timestamp):
 		"""



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