conduit r1922 - in trunk: . conduit/gtkui conduit/modules/BackpackModule



Author: arosenfeld
Date: Tue Mar 10 22:54:46 2009
New Revision: 1922
URL: http://svn.gnome.org/viewvc/conduit?rev=1922&view=rev

Log:
2009-03-10  Alexandre Rosenfeld  <airmind gmail com>

	* conduit/gtkui/ConfigItems.py:
	Fixed regression in item count with list items.
	
	* conduit/modules/BackpackModule/BackpackModule.py:
	* conduit/modules/BackpackModule/Makefile.am:
	* conduit/modules/BackpackModule/config.glade:
	Port to new config system.



Removed:
   trunk/conduit/modules/BackpackModule/config.glade
Modified:
   trunk/ChangeLog
   trunk/conduit/gtkui/ConfigItems.py
   trunk/conduit/modules/BackpackModule/BackpackModule.py
   trunk/conduit/modules/BackpackModule/Makefile.am

Modified: trunk/conduit/gtkui/ConfigItems.py
==============================================================================
--- trunk/conduit/gtkui/ConfigItems.py	(original)
+++ trunk/conduit/gtkui/ConfigItems.py	Tue Mar 10 22:54:46 2009
@@ -690,7 +690,7 @@
     def _get_value(self):
         if not self._checked_items:
             self._checked_items = sorted([row[self.VALUE_COLUMN] for row in self.model if row[self.CHECKED_COLUMN]])
-            #self._update_total()
+            self._update_total()
         return self._checked_items
     
     def _set_value(self, value):

Modified: trunk/conduit/modules/BackpackModule/BackpackModule.py
==============================================================================
--- trunk/conduit/modules/BackpackModule/BackpackModule.py	(original)
+++ trunk/conduit/modules/BackpackModule/BackpackModule.py	Tue Mar 10 22:54:46 2009
@@ -25,8 +25,10 @@
     _configurable_ = True
     def __init__(self, *args):
         DataProvider.DataProviderBase.__init__(self)
-        self.username = ""
-        self.apikey = ""
+        self.update_configuration(
+            username = "",
+            apikey = ""
+        )
         self.ba = None
         self.loggedIn = False
 
@@ -64,8 +66,9 @@
     def __init__(self, *args):
         DataProvider.DataSink.__init__(self)
         BackpackBase.__init__(self, *args)
-
-        self.storeInPage = "Conduit"
+        self.update_configuration(
+            storeInPage = 'Conduit',
+        )
         self.pageID = None
         #there is no way to pragmatically see if a note exists so we list them
         #and cache the results. 
@@ -98,31 +101,18 @@
             self._notes[title] = (uid,timestamp,text)
             log.debug("Found existing note: %s (uid:%s timestamp:%s)" % (title, uid, timestamp))
 
-    def configure(self, window):
-        tree = Utils.dataprovider_glade_get_widget(
-                        __file__, 
-                        "config.glade",
-                        "BackpackNotesSinkConfigDialog")
-        
-        #get a whole bunch of widgets
-        usernameEntry = tree.get_widget("username")
-        apikeyEntry = tree.get_widget("apikey")
-        pagenameEntry = tree.get_widget("pagename")        
-        
-        #preload the widgets
-        usernameEntry.set_text(self.username)
-        apikeyEntry.set_text(self.apikey)
-        pagenameEntry.set_text(self.storeInPage)        
-        
-        dlg = tree.get_widget("BackpackNotesSinkConfigDialog")
-
-        response = Utils.run_dialog(dlg, window)
-        if response == True:
-            self.username = usernameEntry.get_text()
-            self.storeInPage = pagenameEntry.get_text()
-            if apikeyEntry.get_text() != self.apikey:
-                self.apikey = apikeyEntry.get_text()
-        dlg.destroy()
+    def config_setup(self, config):
+        config.add_section("Account details")
+        config.add_item("Login", "text",
+            config_name = "username"
+        )
+        config.add_item("API key", "text", 
+            config_name = "apikey"
+        )
+        config.add_section("Saved notes")
+        config.add_item("Save notes in page", "text",
+            config_name = "storeInPage"
+        )            
 
     def get(self, LUID):
         for title in self._notes:
@@ -172,13 +162,3 @@
 
     def get_UID(self):
         return "%s:%s" % (self.username,self.storeInPage)
-
-    def get_configuration(self):
-        return {
-            "username" : self.username,
-            "apikey" : self.apikey,
-            "storeInPage" : self.storeInPage
-            }
-
-
-

Modified: trunk/conduit/modules/BackpackModule/Makefile.am
==============================================================================
--- trunk/conduit/modules/BackpackModule/Makefile.am	(original)
+++ trunk/conduit/modules/BackpackModule/Makefile.am	Tue Mar 10 22:54:46 2009
@@ -3,8 +3,5 @@
 conduit_handlersdir = $(libdir)/conduit/modules/BackpackModule
 conduit_handlers_PYTHON = BackpackModule.py
 
-conduit_handlers_DATA = config.glade
-EXTRA_DIST = config.glade
-
 clean-local:
 	rm -rf *.pyc *.pyo



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