<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,14 @@
 2009-02-27  John Stowers  &lt;john.stowers@gmail.com&gt;
 
+	* conduit/libconduit.py:
+	* tools/eog-plugin/conduit.py:
+	* tools/nautilus-extension/conduit.py:
+	* tools/totem-plugin/conduit.py: Store all plugin
+	config data in XDG_CONFIG_HOME, and be more robust when
+	conduit is started and stopped per session
+
+2009-02-27  John Stowers  &lt;john.stowers@gmail.com&gt;
+
 	* conduit/gtkui/Makefile.am:
 	* conduit/gtkui/SimpleConfigurator.py: Delete SimpleConfigurator,
 	it has been obsoleted by the new config system.</diff>
      <filename>ChangeLog</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,10 @@
-import os
+import os.path
 import gobject
 import gtk
 import dbus, dbus.glib
 
+PLUGIN_CONFIG_DIR = os.environ.get(&quot;XDG_CONFIG_HOME&quot;, os.path.join(os.environ['HOME'], &quot;.config&quot;, &quot;conduit&quot;, &quot;plugin-config&quot;))
+
 APPLICATION_DBUS_IFACE=&quot;org.conduit.Application&quot;
 CONDUIT_DBUS_IFACE=&quot;org.conduit.Conduit&quot;
 EXPORTER_DBUS_IFACE=&quot;org.conduit.Exporter&quot;
@@ -14,7 +16,7 @@ SYNCSET_NOGUI_PATH = '/syncset/dbus'
 
 class ConduitWrapper:
 
-    CONFIG_PATH='~/.conduit/test-plugin'
+    CONFIG_NAME=&quot;test-plugin&quot;
     NAME_IDX=0
     URI_IDX=1
     STATUS_IDX=2
@@ -46,6 +48,14 @@ class ConduitWrapper:
                         dbus_interface=CONDUIT_DBUS_IFACE
                         )
 
+        self.config_path = os.path.join(PLUGIN_CONFIG_DIR, self.CONFIG_NAME)
+        if not os.path.exists(self.config_path):
+            self._debug(&quot;Creating config dir: %s&quot; % self.config_path)
+            try:
+                os.makedirs(self.config_path)
+            except OSError:
+                pass
+
     def _debug(self, msg):
         if self.debug:
             print &quot;LCW: &quot;, msg
@@ -55,14 +65,12 @@ class ConduitWrapper:
         Gets the latest configuration for a given
         dataprovider
         &quot;&quot;&quot;
-        config_path = os.path.expanduser(self.CONFIG_PATH)
         xml = None
-
         try:
-            if not os.path.exists(os.path.join(config_path, self.name)):
+            if not os.path.exists(os.path.join(self.config_path, self.name)):
                 return
 
-            f = open(os.path.join(config_path, self.name), 'r')
+            f = open(os.path.join(self.config_path, self.name), 'r')
             xml = f.read()
             f.close()
         except OSError, e:
@@ -76,13 +84,8 @@ class ConduitWrapper:
         &quot;&quot;&quot;
         Saves the configuration XML from a given dataprovider again
         &quot;&quot;&quot;
-        config_path = os.path.expanduser(self.CONFIG_PATH)
-
         try:
-            if not os.path.exists(config_path):
-                os.mkdir(config_path)
-
-            f = open(os.path.join(config_path, self.name), 'w')
+            f = open(os.path.join(self.config_path, self.name), 'w')
             f.write(xml)
             f.close()
         except OSError, e:
@@ -107,7 +110,8 @@ class ConduitWrapper:
             self.conduit.Sync(dbus_interface=CONDUIT_DBUS_IFACE)
 
     def _configure_error_handler(self, error):
-        pass
+        self._debug(&quot;CONFIGURE ERROR: %s&quot; % error)
+        self.store.set_value(self._get_rowref(), self.STATUS_IDX, &quot;aborted&quot;)
 
     def _on_sync_started(self):
         self.store.set_value(self._get_rowref(), self.STATUS_IDX, &quot;uploading&quot;)
@@ -324,6 +328,9 @@ class ConduitApplicationWrapper(gobject.GObject):
             self._debug(&quot;Starting conduit via DBus activation&quot;)
             self.dbus_iface.StartServiceByName(APPLICATION_DBUS_IFACE, 0)
             return False
+        else:
+            #not running, not started
+            return False
 
     def sync(self):
         if self.connected():</diff>
      <filename>conduit/libconduit.py</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,7 @@ if DEBUG:
 
 class EogConduitWrapper(libconduit.ConduitWrapper):
 
-    CONFIG_PATH='~/.conduit/eog-plugin'
+    CONFIG_NAME=&quot;eog-plugin&quot;
 
     def add_rowref(self):
         #store the rowref in the store with the icon conduit gave us
@@ -47,7 +47,7 @@ class ConduitPlugin(eog.Plugin):
                                         debug=self.debug
                                         )
         self.conduit.connect(&quot;conduit-started&quot;, self._on_conduit_started)
-        self.running = self.conduit.connect_to_conduit(startConduit=True)
+        self.running = self.conduit.connect_to_conduit(startConduit=False)
 
         #dictionary holding items that are set sensitive or not when
         #conduit is started/stopped</diff>
      <filename>tools/eog-plugin/conduit.py</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,6 @@ except ImportError:
 DEBUG = True
 FOLDER_TWOWAY = &quot;FolderTwoWay&quot;
 FOLDER_TWOWAY_CONFIG = &quot;&lt;configuration&gt;&lt;folder type='string'&gt;%s&lt;/folder&gt;&lt;folderGroupName type='string'&gt;Home&lt;/folderGroupName&gt;&lt;includeHidden type='bool'&gt;False&lt;/includeHidden&gt;&lt;/configuration&gt;&quot;
-CONFIG_PATH = '~/.conduit/nautilus-extension'
 SUPPORTED_SINKS = {
     &quot;FlickrTwoWay&quot;      :   &quot;Upload to Flickr&quot;,
     &quot;PicasaTwoWay&quot;      :   &quot;Upload to Picasa&quot;,
@@ -59,6 +58,13 @@ class ItemCallbackHandler:
         self.conduitApp = conduitApplication
         self.conduit = None
 
+        self.config_path = os.path.join(libconduit.PLUGIN_CONFIG_DIR, &quot;nautilus-extension&quot;)
+        if not os.path.exists(self.config_path):
+            try:
+                os.makedirs(self.config_path)
+            except OSError:
+                pass
+
     def activate_cb(self, menu, folder):
         &quot;&quot;&quot;
         This is the callback method that can be attached to the
@@ -120,12 +126,10 @@ class ItemCallbackHandler:
         Gets the latest configuration for a given
         dataprovider
         &quot;&quot;&quot;
-        config_path = os.path.expanduser(CONFIG_PATH)
-
-        if not os.path.exists(os.path.join(config_path, sink_name)):
+        if not os.path.exists(os.path.join(self.config_path, sink_name)):
            return
 
-        f = open(os.path.join(config_path, sink_name), 'r')
+        f = open(os.path.join(self.config_path, sink_name), 'r')
         xml = f.read ()
         f.close()
 
@@ -135,12 +139,7 @@ class ItemCallbackHandler:
         &quot;&quot;&quot;
         Saves the configuration xml from a given dataprovider again
         &quot;&quot;&quot;
-        config_path = os.path.expanduser(CONFIG_PATH)
-
-        if not os.path.exists(config_path):
-           os.mkdir(config_path)
-
-        f = open(os.path.join(config_path, sink_name), 'w')
+        f = open(os.path.join(self.config_path, sink_name), 'w')
         f.write(xml)
         f.close()
         
@@ -163,10 +162,8 @@ class ItemCallbackHandler:
         self.conduit.Sync(dbus_interface=libconduit.CONDUIT_DBUS_IFACE)
 
     def _configure_error_handler(self, error):
-        &quot;&quot;&quot;
-        Nothing to do anymore
-        &quot;&quot;&quot;
-        pass
+        print &quot;CONFIGURE ERROR: %s&quot; % error
+        self.ss.DeleteConduit(self.conduit, dbus_interface=libconduit.SYNCSET_DBUS_IFACE)
 
 class ConduitExtension(nautilus.MenuProvider):
     &quot;&quot;&quot;</diff>
      <filename>tools/nautilus-extension/conduit.py</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ if DEBUG:
 
 class TotemConduitWrapper(libconduit.ConduitWrapper):
 
-    CONFIG_PATH='~/.conduit/totem-plugin'
+    CONFIG_NAME=&quot;totem-plugin&quot;
 
     def add_rowref(self):
         #store the rowref in the store with the icon conduit gave us</diff>
      <filename>tools/totem-plugin/conduit.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d0f89f8ee09c64409ddd8bc09174c50228a42684</id>
    </parent>
  </parents>
  <author>
    <name>John Stowers</name>
    <email>john.stowers@gmail.com</email>
  </author>
  <url>http://github.com/Jc2k/conduit/commit/6a2855eb4f4b9f4fc9602f2f48bae5622c90cad1</url>
  <id>6a2855eb4f4b9f4fc9602f2f48bae5622c90cad1</id>
  <committed-date>2009-02-28T02:40:51-08:00</committed-date>
  <authored-date>2009-02-28T02:40:51-08:00</authored-date>
  <message>Store all plugin config data in XDG_CONFIG_HOME, and be more robust when

2009-02-27  John Stowers  &lt;john.stowers@gmail.com&gt;

	* conduit/libconduit.py:
	* tools/eog-plugin/conduit.py:
	* tools/nautilus-extension/conduit.py:
	* tools/totem-plugin/conduit.py: Store all plugin
	config data in XDG_CONFIG_HOME, and be more robust when
	conduit is started and stopped per session


svn path=/trunk/; revision=1918</message>
  <tree>a8c2ab14bfa5bd73cc3220fbe27ab16c89571dc4</tree>
  <committer>
    <name>John Stowers</name>
    <email>jstowers@src.gnome.org</email>
  </committer>
</commit>
