conduit r1517 - in trunk: . conduit conduit/dataproviders conduit/gtkui conduit/hildonui conduit/modules conduit/modules/BackpackModule conduit/modules/BansheeModule conduit/modules/BoxDotNetModule conduit/modules/EvolutionModule conduit/modules/FacebookModule conduit/modules/FeedModule conduit/modules/FileModule conduit/modules/FlickrModule conduit/modules/FspotModule conduit/modules/GConfModule conduit/modules/GoogleModule conduit/modules/N800Module conduit/modules/NetworkModule conduit/modules/PhoneModule conduit/modules/PicasaDesktopModule conduit/modules/RTMModule conduit/modules/ShutterflyModule conduit/modules/SmugMugModule conduit/modules/ZotoModule conduit/modules/iPodModule



Author: jstowers
Date: Mon Jun  9 04:00:44 2008
New Revision: 1517
URL: http://svn.gnome.org/viewvc/conduit?rev=1517&view=rev

Log:
Merge no-config branch.\nAPI Change: If you want the configure right click menu option to be clickable, add _configurable_ = True to class properties

Modified:
   trunk/   (props changed)
   trunk/ChangeLog
   trunk/conduit/ModuleWrapper.py
   trunk/conduit/dataproviders/DataProvider.py
   trunk/conduit/gtkui/Canvas.py
   trunk/conduit/hildonui/Canvas.py
   trunk/conduit/modules/BackpackModule/BackpackModule.py
   trunk/conduit/modules/BansheeModule/BansheeModule.py
   trunk/conduit/modules/BoxDotNetModule/BoxDotNetModule.py
   trunk/conduit/modules/EvolutionModule/EvolutionModule.py
   trunk/conduit/modules/FacebookModule/FacebookModule.py
   trunk/conduit/modules/FeedModule/FeedModule.py
   trunk/conduit/modules/FileModule/FileModule.py
   trunk/conduit/modules/FlickrModule/FlickrModule.py
   trunk/conduit/modules/FspotModule/FspotModule.py
   trunk/conduit/modules/GConfModule/GConfModule.py
   trunk/conduit/modules/GoogleModule/GoogleModule.py
   trunk/conduit/modules/N800Module/N800Module.py
   trunk/conduit/modules/NetworkModule/Server.py
   trunk/conduit/modules/NetworkModule/XMLRPCUtils.py
   trunk/conduit/modules/PhoneModule/PhoneModule.py
   trunk/conduit/modules/PicasaDesktopModule/PicasaDesktopModule.py
   trunk/conduit/modules/RTMModule/RTMModule.py
   trunk/conduit/modules/ShutterflyModule/ShutterflyModule.py
   trunk/conduit/modules/SmugMugModule/SmugMugModule.py
   trunk/conduit/modules/SynceModule.py
   trunk/conduit/modules/TestModule.py
   trunk/conduit/modules/TomboyModule.py
   trunk/conduit/modules/ZotoModule/ZotoModule.py
   trunk/conduit/modules/iPodModule/iPodModule.py

Modified: trunk/conduit/ModuleWrapper.py
==============================================================================
--- trunk/conduit/ModuleWrapper.py	(original)
+++ trunk/conduit/ModuleWrapper.py	Mon Jun  9 04:00:44 2008
@@ -48,6 +48,7 @@
             self.module_type =      getattr(klass, "_module_type_", "")
             self.in_type =          getattr(klass, "_in_type_", "")
             self.out_type =         getattr(klass, "_out_type_", "")
+            self.configurable =     getattr(klass, "_configurable_", False)
             self.classname =        klass.__name__
         else:
             self.name =             "Unknown"
@@ -57,6 +58,7 @@
             self.in_type =          ""
             self.out_type =         ""
             self.classname =        ""
+            self.configurable =     False
 
         self.dndKey = None
         self.enabled = True

Modified: trunk/conduit/dataproviders/DataProvider.py
==============================================================================
--- trunk/conduit/dataproviders/DataProvider.py	(original)
+++ trunk/conduit/dataproviders/DataProvider.py	Mon Jun  9 04:00:44 2008
@@ -44,6 +44,7 @@
     _icon_ = ""
     _module_type_ = "dataprovider"
     _category_ = conduit.dataproviders.CATEGORY_TEST
+    _configurable_ = False
     _out_type_ = ""
     _in_type_ = ""
     

Modified: trunk/conduit/gtkui/Canvas.py
==============================================================================
--- trunk/conduit/gtkui/Canvas.py	(original)
+++ trunk/conduit/gtkui/Canvas.py	Mon Jun  9 04:00:44 2008
@@ -207,6 +207,7 @@
         if event.type == gtk.gdk.BUTTON_PRESS:
             if event.button == 3:
                 if view.model.enabled and not view.model.module.is_busy():
+                    self.configureMenuItem.set_property("sensitive", view.model.configurable)
                     #show the menu
                     self.dataproviderMenu.popup(
                                 None, None, 
@@ -217,8 +218,8 @@
         elif event.type == gtk.gdk._2BUTTON_PRESS:
             if event.button == 1:
                 if view.model.enabled and not view.model.module.is_busy():
-                    #configure the DP
-                    self.on_configure_dataprovider_clicked(None)
+                    if view.model.configurable:
+                        self.on_configure_dataprovider_clicked(None)
 
         #dont propogate the event
         return True
@@ -355,16 +356,17 @@
         clicks on a dataprovider
         @type dataproviderPopupXML: C{gtk.glade.XML}
         """
-        self.conduitMenu = conduitPopupXML.get_widget("ConduitMenu")
+
         self.dataproviderMenu = dataproviderPopupXML.get_widget("DataProviderMenu")
+        self.configureMenuItem = dataproviderPopupXML.get_widget("configure")
 
+        self.conduitMenu = conduitPopupXML.get_widget("ConduitMenu")
         self.twoWayMenuItem = conduitPopupXML.get_widget("two_way_sync")
-        self.twoWayMenuItem.connect("toggled", self.on_two_way_sync_toggle)
-
         self.slowSyncMenuItem = conduitPopupXML.get_widget("slow_sync")
-        self.slowSyncMenuItem.connect("toggled", self.on_slow_sync_toggle)
-
         self.autoSyncMenuItem = conduitPopupXML.get_widget("auto_sync")
+
+        self.twoWayMenuItem.connect("toggled", self.on_two_way_sync_toggle)
+        self.slowSyncMenuItem.connect("toggled", self.on_slow_sync_toggle)
         self.autoSyncMenuItem.connect("toggled", self.on_auto_sync_toggle)
 
         #connect the conflict popups

Modified: trunk/conduit/hildonui/Canvas.py
==============================================================================
--- trunk/conduit/hildonui/Canvas.py	(original)
+++ trunk/conduit/hildonui/Canvas.py	Mon Jun  9 04:00:44 2008
@@ -68,6 +68,7 @@
         #single left click
         if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
             if view.model.enabled and not view.model.module.is_busy():
+                self.dataproviderMenu.configureMenuItem.set_property("sensitive", view.model.configurable)
                 self.dataproviderMenu.popup(None, None, 
                                             None, event.button, event.time)
 
@@ -269,6 +270,7 @@
         item = gtk.MenuItem(text)
         item.connect("activate", activate_cb)
         self.append(item)
+        return item
 
 class ConduitMenu(ContextMenu):
     def __init__(self, canvas):
@@ -293,7 +295,7 @@
         ContextMenu.__init__(self)
         self.canvas = canvas
 
-        self._add_menu_item("Configure", self._on_configure_activate)
+        self.configureMenuItem = self._add_menu_item("Configure", self._on_configure_activate)
         self._add_menu_item("Refresh", self._on_refresh_activate)
         self.append(gtk.SeparatorMenuItem())
         self._add_menu_item("Delete", self._on_delete_activate)

Modified: trunk/conduit/modules/BackpackModule/BackpackModule.py
==============================================================================
--- trunk/conduit/modules/BackpackModule/BackpackModule.py	(original)
+++ trunk/conduit/modules/BackpackModule/BackpackModule.py	Mon Jun  9 04:00:44 2008
@@ -22,6 +22,7 @@
 log.info("Module Information: %s" % Utils.get_module_information(backpack, None))
 
 class BackpackBase(DataProvider.DataProviderBase):
+    _configurable_ = True
     def __init__(self, *args):
         DataProvider.DataProviderBase.__init__(self)
         self.username = ""

Modified: trunk/conduit/modules/BansheeModule/BansheeModule.py
==============================================================================
--- trunk/conduit/modules/BansheeModule/BansheeModule.py	(original)
+++ trunk/conduit/modules/BansheeModule/BansheeModule.py	Mon Jun  9 04:00:44 2008
@@ -34,6 +34,7 @@
     _in_type_ = "file/audio"
     _out_type_ = "file/audio"
     _icon_ = "banshee"
+    _configurable_ = True
 
     MUSIC_DB = os.path.join(os.path.expanduser("~"),".config", "banshee", "banshee.db")
 

Modified: trunk/conduit/modules/BoxDotNetModule/BoxDotNetModule.py
==============================================================================
--- trunk/conduit/modules/BoxDotNetModule/BoxDotNetModule.py	(original)
+++ trunk/conduit/modules/BoxDotNetModule/BoxDotNetModule.py	Mon Jun  9 04:00:44 2008
@@ -33,6 +33,7 @@
     _in_type_ = "file"
     _out_type_ = "file"
     _icon_ = "boxdotnet"
+    _configurable_ = True
 
     API_KEY="nt0v6a232z6r47iftjx7g0azu6dg4p10"
 

Modified: trunk/conduit/modules/EvolutionModule/EvolutionModule.py
==============================================================================
--- trunk/conduit/modules/EvolutionModule/EvolutionModule.py	(original)
+++ trunk/conduit/modules/EvolutionModule/EvolutionModule.py	Mon Jun  9 04:00:44 2008
@@ -27,6 +27,7 @@
     log.info("Evolution support disabled")
 
 class EvoBase(DataProvider.TwoWay):
+    _configurable_ = True
     def __init__(self, sourceURI, *args):
         DataProvider.TwoWay.__init__(self)
         self.defaultSourceURI = sourceURI

Modified: trunk/conduit/modules/FacebookModule/FacebookModule.py
==============================================================================
--- trunk/conduit/modules/FacebookModule/FacebookModule.py	(original)
+++ trunk/conduit/modules/FacebookModule/FacebookModule.py	Mon Jun  9 04:00:44 2008
@@ -38,6 +38,7 @@
     _description_ = _("Sync your Facebook photos")
     _module_type_ = "sink"
     _icon_ = "facebook"
+    _configurable_ = False
 
     API_KEY="6ce1868c3292471c022c771c0d4d51ed"
     SECRET="20e2c82829f1884e40efc616a44e5d1f"

Modified: trunk/conduit/modules/FeedModule/FeedModule.py
==============================================================================
--- trunk/conduit/modules/FeedModule/FeedModule.py	(original)
+++ trunk/conduit/modules/FeedModule/FeedModule.py	Mon Jun  9 04:00:44 2008
@@ -34,6 +34,7 @@
     _in_type_ = ""
     _out_type_ = "file"
     _icon_ = "feed"
+    _configurable_ = True
 
     def __init__(self, *args):
         DataProvider.DataSource.__init__(self)

Modified: trunk/conduit/modules/FileModule/FileModule.py
==============================================================================
--- trunk/conduit/modules/FileModule/FileModule.py	(original)
+++ trunk/conduit/modules/FileModule/FileModule.py	Mon Jun  9 04:00:44 2008
@@ -22,6 +22,7 @@
 
     _name_ = _("Files")
     _description_ = _("Source for synchronizing multiple files")
+    _configurable_ = True
 
     def __init__(self, *args):
         FileDataProvider.FileSource.__init__(self)
@@ -61,6 +62,7 @@
 
     _name_ = _("Folder")
     _description_ = _("Synchronize folders")
+    _configurable_ = True
 
     DEFAULT_FOLDER = "file://"+os.path.expanduser("~")
     DEFAULT_GROUP = "Home"

Modified: trunk/conduit/modules/FlickrModule/FlickrModule.py
==============================================================================
--- trunk/conduit/modules/FlickrModule/FlickrModule.py	(original)
+++ trunk/conduit/modules/FlickrModule/FlickrModule.py	Mon Jun  9 04:00:44 2008
@@ -77,6 +77,7 @@
     _description_ = _("Sync your Flickr.com photos")
     _module_type_ = "twoway"
     _icon_ = "flickr"
+    _configurable_ = True
 
     API_KEY="65552e8722b21d299388120c9fa33580"
     SHARED_SECRET="03182987bf7fc4d1"

Modified: trunk/conduit/modules/FspotModule/FspotModule.py
==============================================================================
--- trunk/conduit/modules/FspotModule/FspotModule.py	(original)
+++ trunk/conduit/modules/FspotModule/FspotModule.py	Mon Jun  9 04:00:44 2008
@@ -26,6 +26,7 @@
     _description_ = _("Sync your F-Spot photos")
     _category_ = conduit.dataproviders.CATEGORY_PHOTOS
     _icon_ = "f-spot"
+    _configurable_ = True
 
     SERVICE_PATH = "org.gnome.FSpot"
     PHOTOREMOTE_IFACE = "org.gnome.FSpot.PhotoRemoteControl"

Modified: trunk/conduit/modules/GConfModule/GConfModule.py
==============================================================================
--- trunk/conduit/modules/GConfModule/GConfModule.py	(original)
+++ trunk/conduit/modules/GConfModule/GConfModule.py	Mon Jun  9 04:00:44 2008
@@ -25,6 +25,7 @@
     _in_type_ = "setting"
     _out_type_ = "setting"
     _icon_ = "preferences-desktop"
+    _configurable_ = False
     
     DEFAULT_WHITELIST = [
                 '/apps/metacity/*',

Modified: trunk/conduit/modules/GoogleModule/GoogleModule.py
==============================================================================
--- trunk/conduit/modules/GoogleModule/GoogleModule.py	(original)
+++ trunk/conduit/modules/GoogleModule/GoogleModule.py	Mon Jun  9 04:00:44 2008
@@ -51,6 +51,7 @@
 FORMAT_STRING = "%Y-%m-%dT%H:%M:%S"
 
 class _GoogleBase:
+    _configurable_ = True
     def __init__(self, service):
         self.username = ""
         self.password = ""

Modified: trunk/conduit/modules/N800Module/N800Module.py
==============================================================================
--- trunk/conduit/modules/N800Module/N800Module.py	(original)
+++ trunk/conduit/modules/N800Module/N800Module.py	Mon Jun  9 04:00:44 2008
@@ -59,6 +59,8 @@
     #Signifies that a conversion should not take place
     NO_CONVERSION_STRING = _("unchanged")
 
+    _configurable_ = True
+
     def __init__(self, mount, udi, folder):
         FileDataProvider.FolderTwoWay.__init__(self,
                             "file://"+folder,

Modified: trunk/conduit/modules/NetworkModule/Server.py
==============================================================================
--- trunk/conduit/modules/NetworkModule/Server.py	(original)
+++ trunk/conduit/modules/NetworkModule/Server.py	Mon Jun  9 04:00:44 2008
@@ -149,6 +149,7 @@
     _category_ = conduit.dataproviders.CATEGORY_MISC
     _module_type_ = "twoway"
     _icon_ = "network-idle"
+    _configurable_ = False
 
     def __init__(self):
         DataProvider.TwoWay.__init__(self)

Modified: trunk/conduit/modules/NetworkModule/XMLRPCUtils.py
==============================================================================
--- trunk/conduit/modules/NetworkModule/XMLRPCUtils.py	(original)
+++ trunk/conduit/modules/NetworkModule/XMLRPCUtils.py	Mon Jun  9 04:00:44 2008
@@ -108,6 +108,7 @@
     """
     Provides the Client portion of dataprovider proxying.
     """
+    _configurable_ = False
     def __init__(self, *args):
         DataProvider.TwoWay.__init__(self)
         clog.info("Connecting to remote DP on %s" % self.url)

Modified: trunk/conduit/modules/PhoneModule/PhoneModule.py
==============================================================================
--- trunk/conduit/modules/PhoneModule/PhoneModule.py	(original)
+++ trunk/conduit/modules/PhoneModule/PhoneModule.py	Mon Jun  9 04:00:44 2008
@@ -97,6 +97,7 @@
 class ObexFileDataProvider(FileDataProvider.FolderTwoWay):
 
     _name_ = "Pictures"
+    _configurable_ = False
 
     #FIXME: Does gnomevfs-obexftp support obexpush also?
     SUPPORTED_BLUETOOTH_CLASSES = (
@@ -123,6 +124,7 @@
     _name_ = "Test Phone"
     _description_ = "Test Phone"
     _module_type_ = "source"
+    _configurable_ = False
     def __init__(self, address, *args):
         DataProvider.DataSource.__init__(self)
 

Modified: trunk/conduit/modules/PicasaDesktopModule/PicasaDesktopModule.py
==============================================================================
--- trunk/conduit/modules/PicasaDesktopModule/PicasaDesktopModule.py	(original)
+++ trunk/conduit/modules/PicasaDesktopModule/PicasaDesktopModule.py	Mon Jun  9 04:00:44 2008
@@ -36,6 +36,7 @@
     _in_type_ = "file/photo"
     _out_type_ = "file/photo"
     _icon_ = "picasa"
+    _configurable_ = True
 
     def __init__(self, *args):
         DataProvider.DataSource.__init__(self)

Modified: trunk/conduit/modules/RTMModule/RTMModule.py
==============================================================================
--- trunk/conduit/modules/RTMModule/RTMModule.py	(original)
+++ trunk/conduit/modules/RTMModule/RTMModule.py	Mon Jun  9 04:00:44 2008
@@ -32,6 +32,7 @@
     _name_ = _("Remember The Milk Tasks")
     _description_ = _("Sync your tasks to Remember The Milk")
     _category_ = conduit.dataproviders.CATEGORY_OFFICE
+    _configurable_ = True
     _module_type_ = "twoway"
     _in_type_ = "event"
     _out_type_ = "event"

Modified: trunk/conduit/modules/ShutterflyModule/ShutterflyModule.py
==============================================================================
--- trunk/conduit/modules/ShutterflyModule/ShutterflyModule.py	(original)
+++ trunk/conduit/modules/ShutterflyModule/ShutterflyModule.py	Mon Jun  9 04:00:44 2008
@@ -27,6 +27,7 @@
 	_description_ = _("Sync your Shutterfly photos")
 	_module_type_ = "sink"
 	_icon_ = "shutterfly"
+    _configurable_ = True
 	
 	def __init__(self, *args):
 		Image.ImageSink.__init__(self)

Modified: trunk/conduit/modules/SmugMugModule/SmugMugModule.py
==============================================================================
--- trunk/conduit/modules/SmugMugModule/SmugMugModule.py	(original)
+++ trunk/conduit/modules/SmugMugModule/SmugMugModule.py	Mon Jun  9 04:00:44 2008
@@ -29,6 +29,7 @@
     _description_ = _("Sync your SmugMug.com photos")
     _module_type_ = "twoway"
     _icon_ = "smugmug"
+    _configurable_ = True
 
     def __init__(self, *args):
         Image.ImageTwoWay.__init__(self)

Modified: trunk/conduit/modules/SynceModule.py
==============================================================================
--- trunk/conduit/modules/SynceModule.py	(original)
+++ trunk/conduit/modules/SynceModule.py	Mon Jun  9 04:00:44 2008
@@ -215,6 +215,7 @@
     _out_type_ = "note"
     _icon_ = "contact-new"
     _type_id_ = SYNC_ITEM_CONTACTS
+    _configurable_ = False
 
 class SynceCalendarTwoWay(SynceTwoWay):
     _name_ = "Calendar"
@@ -224,6 +225,7 @@
     _out_type_ = "note"
     _icon_ = "contact-new"
     _type_id_ = SYNC_ITEM_CALENDAR
+    _configurable_ = False
 
 class SynceTasksTwoWay(SynceTwoWay):
     _name_ = "Tasks"
@@ -233,3 +235,5 @@
     _out_type_ = "note"
     _icon_ = "contact-new"
     _type_id_ = SYNC_ITEM_TASKS
+    _configurable_ = False
+

Modified: trunk/conduit/modules/TestModule.py
==============================================================================
--- trunk/conduit/modules/TestModule.py	(original)
+++ trunk/conduit/modules/TestModule.py	Mon Jun  9 04:00:44 2008
@@ -96,6 +96,7 @@
             return conduit.datatypes.COMPARISON_UNKNOWN
 
 class _TestBase(DataProvider.DataProviderBase):
+    _configurable_ = True
     def __init__(self):
         DataProvider.DataProviderBase.__init__(self)
         #Through an error on the nth time through
@@ -208,6 +209,7 @@
             }
             
 class _TestConversionBase(DataProvider.DataSink):
+    _configurable_ = True
     def __init__(self, *args):
         DataProvider.DataSink.__init__(self)
         self.encodings =  {}
@@ -581,6 +583,7 @@
     _in_type_ = "test_type"
     _out_type_ = "test_type"
     _icon_ = "applications-internet"
+    _configurable_ = True
 
     def __init__(self, *args):
         TestTwoWay.__init__(self)

Modified: trunk/conduit/modules/TomboyModule.py
==============================================================================
--- trunk/conduit/modules/TomboyModule.py	(original)
+++ trunk/conduit/modules/TomboyModule.py	Mon Jun  9 04:00:44 2008
@@ -105,6 +105,7 @@
     _in_type_ = "note/tomboy"
     _out_type_ = "note/tomboy"
     _icon_ = "tomboy"
+    _configurable_ = False
     
     TOMBOY_DBUS_PATH = "/org/gnome/Tomboy/RemoteControl"
     TOMBOY_DBUS_IFACE = "org.gnome.Tomboy"

Modified: trunk/conduit/modules/ZotoModule/ZotoModule.py
==============================================================================
--- trunk/conduit/modules/ZotoModule/ZotoModule.py	(original)
+++ trunk/conduit/modules/ZotoModule/ZotoModule.py	Mon Jun  9 04:00:44 2008
@@ -122,6 +122,7 @@
     _description_ = _("Sync your Zoto photos")
     _module_type_ = "twoway"
     _icon_ = "zoto"
+    _configurable_ = True
     
     def __init__(self, *args):
         Image.ImageTwoWay.__init__(self)

Modified: trunk/conduit/modules/iPodModule/iPodModule.py
==============================================================================
--- trunk/conduit/modules/iPodModule/iPodModule.py	(original)
+++ trunk/conduit/modules/iPodModule/iPodModule.py	Mon Jun  9 04:00:44 2008
@@ -338,6 +338,7 @@
     _in_type_ = "file/photo"
     _out_type_ = "file/photo"
     _icon_ = "image-x-generic"
+    _configurable_ = True
 
     SAFE_PHOTO_ALBUM = "Photo Library"
 



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