Author: jmorliaguet
Date: Tue Jun  6 20:54:46 2006
New Revision: 3338

Modified:
   cpsskins/branches/paris-sprint-2006/setup/configure.zcml
   cpsskins/branches/paris-sprint-2006/setup/manager.py

Log:

- use the storage name chooser for preset items too



Modified: cpsskins/branches/paris-sprint-2006/setup/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/configure.zcml    (original)
+++ cpsskins/branches/paris-sprint-2006/setup/configure.zcml    Tue Jun  6 
20:54:46 2006
@@ -60,6 +60,13 @@
       for="zope.app.appsetup.IDatabaseOpenedEvent"
   />
 
+  <!-- Name chooser for presets -->
+  <adapter
+      provides="zope.app.container.interfaces.INameChooser"
+      for=".presets.IPresets"
+      factory="cpsskins.storage.NameChooser"
+  />
+
   <!-- refresh presets in dev mode -->
   <subscriber
       handler=".registration.refreshPresetsEvent"

Modified: cpsskins/branches/paris-sprint-2006/setup/manager.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/manager.py        (original)
+++ cpsskins/branches/paris-sprint-2006/setup/manager.py        Tue Jun  6 
20:54:46 2006
@@ -47,7 +47,6 @@
         """
         presets = getThemeManager(context).getPresets()
         chooser = INameChooser(presets)
-        preset_name = chooser.chooseName(name, context)
         if context is None:
             preset = GlobalPreset(name=name, resource=resource,
                                   filename=filename)
@@ -57,6 +56,8 @@
         uri = IIdentifiable(preset).getURI()
         if uri in presets:
             self.unregister(uri, context)
+
+        preset_name = chooser.chooseName(name, preset)
         presets[preset_name] = preset
         presets.registerUtility(preset, IPreset, uri)
         return preset
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to