conduit r1295 - in trunk: . conduit conduit/gtkui



Author: jstowers
Date: Sat Feb  9 22:29:33 2008
New Revision: 1295
URL: http://svn.gnome.org/viewvc/conduit?rev=1295&view=rev

Log:
2008-02-10  John Stowers  <john stowers gmail com>

	* conduit/Conduit.py:
	* conduit/gtkui/UI.py: Show the conflict resolution icons in the
	preferences dialog to help the user become familiar with them.



Modified:
   trunk/ChangeLog
   trunk/conduit/Conduit.py
   trunk/conduit/gtkui/UI.py

Modified: trunk/conduit/Conduit.py
==============================================================================
--- trunk/conduit/Conduit.py	(original)
+++ trunk/conduit/Conduit.py	Sat Feb  9 22:29:33 2008
@@ -13,7 +13,15 @@
 
 CONFLICT_POLICY_NAMES = ("conflict", "deleted")
 CONFLICT_POLICY_VALUES = ("ask","skip","replace")
-
+CONFLICT_POLICY_VALUE_ICONS = {
+    "conflict_ask"      :   "conduit-conflict-skip",
+    "conflict_skip"     :   "conduit-conflict-skip",
+    "conflict_replace"  :   "conduit-conflict-right",
+    "deleted_ask"       :   "conduit-conflict-skip",
+    "deleted_skip"      :   "conduit-conflict-skip",
+    "deleted_replace"   :   "conduit-conflict-delete"
+}
+    
 class Conduit(gobject.GObject):
     """
     Model of a Conduit, which is a one-to-many bridge of DataSources to

Modified: trunk/conduit/gtkui/UI.py
==============================================================================
--- trunk/conduit/gtkui/UI.py	(original)
+++ trunk/conduit/gtkui/UI.py	Sat Feb  9 22:29:33 2008
@@ -330,9 +330,16 @@
 
         #restore the current policy
         for policyName in Conduit.CONFLICT_POLICY_NAMES:
-            policyValue = conduit.GLOBALS.settings.get("default_policy_%s" % policyName)
-            widgetName = "%s_%s" % (policyName,policyValue)
-            tree.get_widget(widgetName).set_active(True)
+            currentValue = conduit.GLOBALS.settings.get("default_policy_%s" % policyName)
+            for policyValue in Conduit.CONFLICT_POLICY_VALUES:
+                widgetName = "%s_%s" % (policyName,policyValue)
+                widget = tree.get_widget(widgetName)
+                widget.set_image(
+                        gtk.image_new_from_icon_name(
+                                Conduit.CONFLICT_POLICY_VALUE_ICONS[widgetName],
+                                gtk.ICON_SIZE_MENU))
+                if currentValue == policyValue:
+                    widget.set_active(True)
                                         
         #Show the dialog
         dialog = tree.get_widget("PreferencesDialog")



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