Améliorations de l'extension pour OpenOffice.org :
authorProgfou <jean-christophe.andre@auf.org>
Wed, 15 Jul 2009 21:19:49 +0000 (04:19 +0700)
committerProgfou <jean-christophe.andre@auf.org>
Wed, 15 Jul 2009 21:19:49 +0000 (04:19 +0700)
  * Ajout d'une catégorie d'options « Extensions AUF » et d'une page
    d'options « Support Reflets-TSE (CODA) » afin de faciliter le
    paramétrage du délai pour le copier/coller.
  * Ajout d'un logo AUF, d'une description de l'extension et son auteur
    pour un affichage plus officiel dans le gestionnaire des extensions.

16 files changed:
auf-poste-client-reflets/Makefile
auf-poste-client-reflets/debian/changelog
auf-poste-client-reflets/debian/preinst
auf-poste-client-reflets/debian/prerm
auf-poste-client-reflets/openoffice/DialogHandler.py [new file with mode: 0644]
auf-poste-client-reflets/openoffice/META-INF/manifest.xml
auf-poste-client-reflets/openoffice/OptionsDialog.xcu [new file with mode: 0644]
auf-poste-client-reflets/openoffice/description.xml [new file with mode: 0644]
auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog.xdl [new file with mode: 0644]
auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog_fr_FR.default [new file with mode: 0644]
auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog_fr_FR.properties [new file with mode: 0644]
auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog.xdl [new file with mode: 0644]
auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog_fr_FR.default [new file with mode: 0644]
auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog_fr_FR.properties [new file with mode: 0644]
auf-poste-client-reflets/openoffice/dialogs/dialog.xlb [new file with mode: 0644]
auf-poste-client-reflets/openoffice/images/logo-auf.png [new file with mode: 0644]

index 81657fd..1ef79d4 100644 (file)
@@ -5,6 +5,7 @@ all: build
 
 build:
        rm -f auf-reflets-tse.oxt
+       sed -i '/^ <version /s/="[^"]*"/="'$(VERSION)'"/' openoffice/description.xml
        cd openoffice ; zip -9rpD ../auf-reflets-tse.oxt .
 
 install:
index 1095c41..6abdffc 100644 (file)
@@ -1,8 +1,13 @@
 auf-poste-client-reflets (1.8) jaunty; urgency=low
 
   * Réactivation de l'extension "auf-reflets-tse.oxt" pour OpenOffice.org.
+  * Ajout d'une catégorie d'options « Extensions AUF » et d'une page
+    d'options « Support Reflets-TSE (CODA) » afin de faciliter le
+    paramétrage du délai pour le copier/coller.
+  * Ajout d'un logo AUF, d'une description de l'extension et son auteur
+    pour un affichage plus officiel dans le gestionnaire des extensions.
 
- -- Progfou <jean-christophe.andre@auf.org>  Thu, 16 Jul 2009 00:55:20 +0700
+ -- Progfou <jean-christophe.andre@auf.org>  Thu, 16 Jul 2009 04:03:05 +0700
 
 auf-poste-client-reflets (1.7) hardy; urgency=low
 
index 9eeef3c..74cddb7 100644 (file)
@@ -22,7 +22,7 @@ remove_extension() {
 
 if [ "$1" = "upgrade" ]; then
   # this is a legacy package, so we need to find it first...
-  id=`/usr/lib/openoffice/program/unopkg list --shared | grep Identifier:.*auf-reflets-tse | cut -d":" -f2`
+  id=`/usr/lib/openoffice/program/unopkg list --shared | grep Identifier:.*auf.*reflets | cut -d":" -f2`
   remove_extension $id
 fi
 
index 5752d83..c90d2d0 100644 (file)
@@ -22,7 +22,7 @@ remove_extension() {
 
 if [ "$1" = "remove" ]; then
   # this is a legacy package, so we need to find it first...
-  id=`/usr/lib/openoffice/program/unopkg list --shared | grep Identifier:.*auf-reflets-tse | cut -d":" -f2`
+  id=`/usr/lib/openoffice/program/unopkg list --shared | grep Identifier:.*auf.*reflets | cut -d":" -f2`
   remove_extension $id
 fi
 
diff --git a/auf-poste-client-reflets/openoffice/DialogHandler.py b/auf-poste-client-reflets/openoffice/DialogHandler.py
new file mode 100644 (file)
index 0000000..c4daf91
--- /dev/null
@@ -0,0 +1,111 @@
+#!
+# -*- coding: utf_8 -*-
+import uno
+import unohelper
+
+# interfaces
+from com.sun.star.lang import XServiceInfo
+from com.sun.star.awt import XContainerWindowEventHandler
+
+# main class
+class DialogHandler(unohelper.Base, XServiceInfo, XContainerWindowEventHandler):
+    def __init__(self, ctx):
+        self.ctx = ctx;
+        self.cp = self.ctx.ServiceManager.createInstanceWithContext( 
+            "com.sun.star.configuration.ConfigurationProvider",
+            self.ctx)
+        node = uno.createUnoStruct("com.sun.star.beans.PropertyValue")
+        node.Name = "nodepath"
+        node.Value = "/org.openoffice.VCL/Settings/Transfer"
+        self.node = node
+        self.cfg_names = ("SelectionTimeout",)
+        return
+
+    # XContainerWindowEventHandler
+    def callHandlerMethod(self, window, eventObject, method):
+        if method == "external_event":
+            try:
+                self.handleExternalEvent(window, eventObject)
+            except:
+                pass
+        return True
+
+    # XContainerWindowEventHandler
+    def getSupportedMethodNames(self):
+        return ("external_event",)
+
+    def supportsService(self, name):
+        return False
+
+    def getImplementationName(self):
+        return "org.auf.openoffice.reflets.DialogHandler"
+
+    def getSupportedServiceNames(self):
+        return ()
+
+    def handleExternalEvent(self, window, eventName):
+        if eventName == "ok":
+            self.saveData(window)
+        elif eventName == "back":
+            self.loadData(window, "back")
+        elif eventName == "initialize":
+            self.loadData(window, "initialize")
+        return True
+
+    # load and set the data
+    def loadData(self, window, ev):
+        name = window.getModel().Name
+        if name != "RefletsDialog":
+            return
+        settings = self.configreader()
+        if not settings:
+            return
+        for name in self.cfg_names:
+            window.getControl(name).setValue(settings.get(name, ''))
+        return
+
+    # making the save data
+    def saveData(self,window):
+        name = window.getModel().Name
+        if name != "RefletsDialog":
+            return
+        settings = []
+        for name in self.cfg_names:
+            settings.append(str(int(window.getControl(name).Value)))
+        self.configwriter(tuple(settings))
+        return
+
+    # read configuration
+    def configreader(self):
+        settings = {}
+        try:
+            ConfigReader = self.cp.createInstanceWithArguments( 
+                "com.sun.star.configuration.ConfigurationAccess",
+                (self.node,))
+            #cfg_values = ConfigReader.getPropertyValues(self.cfg_names)
+            for i in range(len(self.cfg_names)):
+                cfg_value = ConfigReader.getByName(self.cfg_names[i])
+                settings[self.cfg_names[i]] = cfg_value
+        except:
+            pass
+        return settings
+
+    # write configuration, cfg_values: tuple
+    # keep the order of the values
+    def configwriter(self, cfg_values):
+        try:
+            ConfigWriter = self.cp.createInstanceWithArguments( 
+                "com.sun.star.configuration.ConfigurationUpdateAccess",
+                (self.node,))
+            #ConfigWriter.setPropertyValues(self.cfg_names, cfg_values)
+            for i in range(len(self.cfg_names)):
+                ConfigWriter.replaceByName(self.cfg_names[i], cfg_values[i])
+            ConfigWriter.commitChanges()
+        except:
+            pass
+
+# uno implementation
+g_ImplementationHelper = unohelper.ImplementationHelper()
+g_ImplementationHelper.addImplementation( \
+    DialogHandler, "org.auf.openoffice.reflets.DialogHandler", \
+    ("org.auf.openoffice.reflets.DialogHandler",),)
index cf6bb23..c1ad8b5 100644 (file)
@@ -2,4 +2,7 @@
 <!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
 <manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="rdesktop.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="OptionsDialog.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Python" manifest:full-path="DialogHandler.py"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.dialog-library" manifest:full-path="dialogs/"/>
 </manifest:manifest>
diff --git a/auf-poste-client-reflets/openoffice/OptionsDialog.xcu b/auf-poste-client-reflets/openoffice/OptionsDialog.xcu
new file mode 100644 (file)
index 0000000..f8591ed
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="OptionsDialog" oor:package="org.openoffice.Office">
+<node oor:name="Nodes">
+ <node oor:name="org.auf.openoffice.Addons" oor:op="fuse">
+  <prop oor:name="Label">
+   <value xml:lang="fr-FR">Extensions AUF</value>
+  </prop>
+  <prop oor:name="OptionsPage">
+   <value>%origin%/dialogs/Extensions/ExtensionsDialog.xdl</value>
+  </prop>
+  <prop oor:name="AllModules">
+   <value>true</value>
+  </prop>
+  <node oor:name="Leaves">
+   <node oor:name="org.auf.openoffice.reflets" oor:op="replace">
+    <prop oor:name="Id">
+     <value>org.auf.openoffice.reflets.General</value>
+    </prop>
+    <prop oor:name="Label">
+     <value xml:lang="fr-FR">Support Reflets-TSE (CODA)</value>
+    </prop>
+    <prop oor:name="OptionsPage">
+     <value>%origin%/dialogs/Reflets/RefletsDialog.xdl</value>
+    </prop>
+    <prop oor:name="EventHandlerService">
+     <value>org.auf.openoffice.reflets.DialogHandler</value>
+    </prop>
+   </node>
+  </node>
+ </node>
+</node>
+</oor:component-data>
diff --git a/auf-poste-client-reflets/openoffice/description.xml b/auf-poste-client-reflets/openoffice/description.xml
new file mode 100644 (file)
index 0000000..7f0b646
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <identifier value="org.auf.openoffice.reflets" />
+ <version value="1.8ubuntu1" />
+ <platform value="all" />
+
+ <dependencies>
+  <OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0" />
+ </dependencies>
+
+ <!-- If you uploaded your extension to the repository (which should be
+      the default!) you do not need to have this one.
+ <update-information>
+  <src xlink:href="http://reflets.openoffice.auf.org/update.xml" />
+ </update-information>
+ -->
+
+ <!-- Check if this is already generated by repository.
+      Otherwise you may like to provide it manually.
+ -->
+ <publisher>
+  <name xlink:href="http://www.auf.org/" lang="fr">AUF / ARI / Jean Christophe André</name>
+ </publisher>
+
+ <display-name>
+  <name lang="fr">Support Reflets-TSE (CODA)</name>
+ </display-name>
+
+ <icon>
+  <default xlink:href="images/logo-auf.png" />
+ </icon>
+
+ <!--
+ <extension-description>
+  <src xlink:href="description/desc_en.txt" lang="fr" />
+ </extension-description>
+ -->
+
+</description>
diff --git a/auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog.xdl b/auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog.xdl
new file mode 100644 (file)
index 0000000..3aaeedf
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="ExtensionsDialog" dlg:left="11" dlg:top="91" dlg:width="263" dlg:height="185" dlg:help-text="&amp;38.ExtensionsDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&amp;39.ExtensionsDialog.Title" dlg:withtitlebar="false">
+ <dlg:styles>
+  <dlg:style dlg:style-id="0" dlg:font-height="12"/>
+  <dlg:style dlg:style-id="1" dlg:border="none"/>
+ </dlg:styles>
+ <dlg:bulletinboard>
+  <dlg:text dlg:style-id="0" dlg:id="label_title" dlg:tab-index="1" dlg:left="31" dlg:top="10" dlg:width="220" dlg:height="17" dlg:help-text="&amp;40.ExtensionsDialog.label_title.HelpText" dlg:value="&amp;41.ExtensionsDialog.label_title.Label"/>
+  <dlg:img dlg:style-id="1" dlg:id="image_icon" dlg:tab-index="3" dlg:left="8" dlg:top="8" dlg:width="20" dlg:height="20" dlg:help-text="&amp;42.ExtensionsDialog.image_icon.HelpText"/>
+  <dlg:text dlg:id="label_description" dlg:tab-index="2" dlg:left="32" dlg:top="47" dlg:width="220" dlg:height="121" dlg:help-text="&amp;43.ExtensionsDialog.label_description.HelpText" dlg:value="&amp;44.ExtensionsDialog.label_description.Label"/>
+  <dlg:fixedline dlg:id="line_separator" dlg:tab-index="0" dlg:left="5" dlg:top="33" dlg:width="252" dlg:height="1" dlg:help-text="&amp;45.ExtensionsDialog.line_separator.HelpText" dlg:value="&amp;46.ExtensionsDialog.line_separator.Label"/>
+ </dlg:bulletinboard>
+</dlg:window>
diff --git a/auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog_fr_FR.default b/auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog_fr_FR.default
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog_fr_FR.properties b/auf-poste-client-reflets/openoffice/dialogs/Extensions/ExtensionsDialog_fr_FR.properties
new file mode 100644 (file)
index 0000000..96cc5e2
--- /dev/null
@@ -0,0 +1,10 @@
+# ExtensionsDialog strings
+38.ExtensionsDialog.HelpText=
+39.ExtensionsDialog.Title=
+40.ExtensionsDialog.label_title.HelpText=
+41.ExtensionsDialog.label_title.Label=Extensions AUF
+42.ExtensionsDialog.image_icon.HelpText=
+43.ExtensionsDialog.label_description.HelpText=
+44.ExtensionsDialog.label_description.Label=Extensions AUF pour OpenOffice.org.
+45.ExtensionsDialog.line_separator.HelpText=
+46.ExtensionsDialog.line_separator.Label=
diff --git a/auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog.xdl b/auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog.xdl
new file mode 100644 (file)
index 0000000..a0ad05d
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="RefletsDialog" dlg:left="186" dlg:top="130" dlg:width="260" dlg:height="185" dlg:help-text="&amp;0.RefletsDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&amp;1.RefletsDialog.Title" dlg:withtitlebar="false">
+ <dlg:bulletinboard>
+  <dlg:titledbox dlg:id="FrameControl1" dlg:tab-index="0" dlg:left="10" dlg:top="10" dlg:width="240" dlg:height="60" dlg:help-text="&amp;2.RefletsDialog.FrameControl1.HelpText">
+   <dlg:title dlg:value="&amp;3.RefletsDialog.FrameControl1.Label"/>
+  </dlg:titledbox>
+  <dlg:text dlg:id="SelectionTimeoutLabel" dlg:tab-index="0" dlg:left="15" dlg:top="20" dlg:width="70" dlg:height="12" dlg:help-text="&amp;4.RefletsDialog.SelectionTimeoutLabel.HelpText" dlg:value="&amp;5.RefletsDialog.SelectionTimeoutLabel.Label"/>
+  <dlg:numericfield dlg:id="SelectionTimeout" dlg:tab-index="1" dlg:left="90" dlg:top="18" dlg:width="20" dlg:height="12" dlg:help-text="&amp;6.RefletsDialog.SelectionTimeout.HelpText" dlg:value="&amp;7.RefletsDialog.SelectionTimeout.Label" dlg:decimal-accuracy="0" dlg:value-min="3"/>
+ </dlg:bulletinboard>
+</dlg:window>
diff --git a/auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog_fr_FR.default b/auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog_fr_FR.default
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog_fr_FR.properties b/auf-poste-client-reflets/openoffice/dialogs/Reflets/RefletsDialog_fr_FR.properties
new file mode 100644 (file)
index 0000000..789858d
--- /dev/null
@@ -0,0 +1,9 @@
+# RefletsDialog strings
+0.RefletsDialog.HelpText=
+1.RefletsDialog.Title=
+2.RefletsDialog.FrameControl1.HelpText=
+3.RefletsDialog.FrameControl1.Label=
+4.RefletsDialog.SelectionTimeoutLabel.HelpText=
+5.RefletsDialog.SelectionTimeoutLabel.Label=D\u00e9lai pour le copier/coller :
+6.RefletsDialog.SelectionTimeout.HelpText=D\u00e9lai maximum, en secondes, pour le copier/coller (conseil : 30)
+7.RefletsDialog.SelectionTimeout.Label=30
diff --git a/auf-poste-client-reflets/openoffice/dialogs/dialog.xlb b/auf-poste-client-reflets/openoffice/dialogs/dialog.xlb
new file mode 100644 (file)
index 0000000..80ecbfa
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="reflets" library:readonly="false" library:passwordprotected="false"/>
diff --git a/auf-poste-client-reflets/openoffice/images/logo-auf.png b/auf-poste-client-reflets/openoffice/images/logo-auf.png
new file mode 100644 (file)
index 0000000..4c05e9e
Binary files /dev/null and b/auf-poste-client-reflets/openoffice/images/logo-auf.png differ