conduit r1913 - in trunk: . conduit/modules/N800Module



Author: jstowers
Date: Thu Feb 26 13:03:29 2009
New Revision: 1913
URL: http://svn.gnome.org/viewvc/conduit?rev=1913&view=rev

Log:
2009-02-27  John Stowers  <john stowers gmail com>

	* conduit/modules/N800Module/N800Module.py:
	Port to new config system.



Modified:
   trunk/ChangeLog
   trunk/conduit/modules/N800Module/N800Module.py

Modified: trunk/conduit/modules/N800Module/N800Module.py
==============================================================================
--- trunk/conduit/modules/N800Module/N800Module.py	(original)
+++ trunk/conduit/modules/N800Module/N800Module.py	Thu Feb 26 13:03:29 2009
@@ -53,12 +53,8 @@
     
     #Translators: Translate this in derived classes.
     DEFAULT_FOLDER = _("Conduit")
-    #Translators: Format string used to describe the acceptable formats the 
-    #device accepts. The first arg is replaced with DEFAULT_FOLDER and the second
-    #arg is a comma seperated list of encodings
-    FORMAT_CONVERSION_STRING = _("%s Format (%s)")
     #Signifies that a conversion should not take place
-    NO_CONVERSION_STRING = _("unchanged")
+    NO_CONVERSION_STRING = _("None")
 
     _configurable_ = True
 
@@ -73,26 +69,15 @@
         self.mount = mount
         self.udi = udi
         self.encodings =  {}
-        self.encoding = ""
-
-    def configure(self, window):
-        import gtk
-        import conduit.gtkui.SimpleConfigurator as SimpleConfigurator
-
-        def setEnc(param):
-            self.encoding = str(param)
-
-        encodings = self.encodings.keys()+[self.NO_CONVERSION_STRING]
-        items = [
-                    {
-                    "Name" : self.FORMAT_CONVERSION_STRING % (self.DEFAULT_FOLDER, ",".join(encodings)),
-                    "Widget" : gtk.Entry,
-                    "Callback" : setEnc,
-                    "InitialValue" : self.encoding
-                    }
-                ]
-        dialog = SimpleConfigurator.SimpleConfigurator(window, self._name_, items)
-        dialog.run()
+        self.update_configuration(
+            encoding = ""
+        )
+
+    def config_setup(self, config):
+        config.add_item(_("Encoding"), "radio",
+            config_name = "encoding",
+            choices = self.encodings.keys()+[self.NO_CONVERSION_STRING]
+        )
 
     def refresh(self):
         d = File.File(URI=self.folder)
@@ -109,9 +94,6 @@
         except KeyError:
             return {}
             
-    def get_configuration(self):
-        return {'encoding':self.encoding}
-
     def get_UID(self):
         return "%s" % self.udi
 



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