[kupfer: 65/67] ui: Use detailed signal handler in WindowController



commit 8c980b6da1bafdd886cdee7172d167bf4a2710e3
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat Mar 19 01:53:41 2011 +0100

    ui: Use detailed signal handler in WindowController

 kupfer/ui/browser.py |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/kupfer/ui/browser.py b/kupfer/ui/browser.py
index 7aea9ac..f456651 100644
--- a/kupfer/ui/browser.py
+++ b/kupfer/ui/browser.py
@@ -1578,10 +1578,12 @@ class WindowController (pretty.OutputMixin):
 			except AttributeError:
 				self._statusicon = None
 
-	def _settings_changed(self, setctl, section, key, value):
-		if section == "Kupfer" and key == "showstatusicon":
-			if value: self.show_statusicon()
-			else: self.hide_statusicon()
+	def _showstatusicon_changed(self, setctl, section, key, value):
+		"callback from SettingsController"
+		if value:
+			self.show_statusicon()
+		else:
+			self.hide_statusicon()
 
 	def _setup_menu(self, context_menu=False):
 		menu = gtk.Menu()
@@ -1952,7 +1954,8 @@ class WindowController (pretty.OutputMixin):
 		setctl = settings.GetSettingsController()
 		if setctl.get_show_status_icon():
 			self.show_statusicon()
-		setctl.connect("value-changed", self._settings_changed)
+		setctl.connect("value-changed::kupfer.showstatusicon",
+		               self._showstatusicon_changed)
 		keystr = setctl.get_keybinding()
 		magickeystr = setctl.get_magic_keybinding()
 



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