[kupfer] preferences: Gray out comboboxes if there are no alternatives



commit 57157604fe7eaf286150e30a58d2b12fb8d957f9
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Mon Mar 21 15:22:38 2011 +0100

    preferences: Gray out comboboxes if there are no alternatives
    
    There is by default only one Icon renderer so it is grayed out, until
    a plugin is loaded.

 kupfer/ui/preferences.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/ui/preferences.py b/kupfer/ui/preferences.py
index 5547eb2..9367c2d 100644
--- a/kupfer/ui/preferences.py
+++ b/kupfer/ui/preferences.py
@@ -802,7 +802,10 @@ class PreferencesWindowController (pretty.OutputMixin):
 				term_iter = _it
 		# Update selection
 		term_iter = term_iter or combobox_store.get_iter_first()
-		combobox.set_active_iter(term_iter)
+		combobox.set_sensitive(len(combobox_store) > 1)
+		if term_iter:
+			combobox.set_active_iter(term_iter)
+
 
 	def _on_alternatives_changed(self, setctl, category_key):
 		if category_key == 'terminal':



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