conduit r1899 - in trunk: . conduit/modules/ZotoModule



Author: arosenfeld
Date: Mon Feb 23 07:26:17 2009
New Revision: 1899
URL: http://svn.gnome.org/viewvc/conduit?rev=1899&view=rev

Log:
2009-02-23  Alexandre Rosenfeld  <airmind gmail com>

	* conduit/modules/ZotoModule/ZotoModule.py:
	* conduit/modules/ZotoModule/zoto.glade:
	* conduit/modules/ZotoModule/Makefile.am:
	Port to new config system.



Removed:
   trunk/conduit/modules/ZotoModule/zoto.glade
Modified:
   trunk/ChangeLog
   trunk/conduit/modules/ZotoModule/Makefile.am
   trunk/conduit/modules/ZotoModule/ZotoModule.py

Modified: trunk/conduit/modules/ZotoModule/Makefile.am
==============================================================================
--- trunk/conduit/modules/ZotoModule/Makefile.am	(original)
+++ trunk/conduit/modules/ZotoModule/Makefile.am	Mon Feb 23 07:26:17 2009
@@ -1,8 +1,5 @@
 conduit_handlersdir = $(libdir)/conduit/modules/ZotoModule.py
 conduit_handlers_PYTHON = ZotoModule.py
 
-conduit_handlers_DATA = zoto.glade
-EXTRA_DIST = zoto.glade
-
 clean-local:
 	rm -rf *.pyc *.pyo

Modified: trunk/conduit/modules/ZotoModule/ZotoModule.py
==============================================================================
--- trunk/conduit/modules/ZotoModule/ZotoModule.py	(original)
+++ trunk/conduit/modules/ZotoModule/ZotoModule.py	Mon Feb 23 07:26:17 2009
@@ -159,9 +159,11 @@
     
     def __init__(self, *args):
         Image.ImageTwoWay.__init__(self)
-        self.username = ""
-        self.password = ""
-        self.albumName = ""
+        self.update_configuration(
+            username = "",
+            password = "",
+            albumName = "",
+        )
         self.albumId = None
         self.sphotos = None
         self.zapi = None
@@ -237,43 +239,20 @@
         
         return Rid(uid=fotoId)
 
-    def configure(self, window):
-        """
-        Configures the ZotoSink
-        """
-        widget = Utils.dataprovider_glade_get_widget(
-                __file__,
-                "zoto.glade",
-                "ZotoSinkConfigDialog")
-                
-        # Get configuration widgets
-        username = widget.get_widget("username")
-        password = widget.get_widget("password")
-        album = widget.get_widget("album")
-                
-        # Load the widgets with presets
-        username.set_text(self.username)
-        password.set_text(self.password)
-        album.set_text(self.albumName)
-                
-        dlg = widget.get_widget("ZotoSinkConfigDialog")
-        
-        response = Utils.run_dialog(dlg, window)
-                
-        if response == True:
-            self.username = username.get_text()
-            self.password = password.get_text()
-            self.albumName = album.get_text()
-                
-        dlg.destroy()
-        
-    def get_configuration(self):
-        return {
-                "username" : self.username, 
-                "password" : self.password, 
-                "albumName" : self.albumName
-                }
-        
+    def config_setup(self, config):
+        config.add_section('Account details')
+        config.add_item('Username', 'text',
+            config_name = 'username',
+        )
+        config.add_item('Password', 'text',
+            config_name = 'password',
+            password = True
+        )
+        config.add_section('Saved photo settings')
+        config.add_item('Album', 'text',
+            config_name = 'albumName',
+        )
+
     def is_configured(self, isSource, isTwoWay):
         if len(self.username) < 1:
             return False



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