Prefs: manage the toolboxes 10/7410/3
Calixte DENIZET [Wed, 6 Jun 2012 09:41:11 +0000 (11:41 +0200)]
Just enter addModulePreferences("My Scilab Toolbox", SCI+"/contrib/toolbox_skeleton/", SCI+"/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xml") to test
Change-Id: I882db13bb1621d954b85bf489b6150393ca05ad2

16 files changed:
scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xsl
scilab/modules/commons/src/java/org/scilab/modules/commons/xml/XConfiguration.java
scilab/modules/console/etc/XConfiguration-console.xml
scilab/modules/console/etc/XConfiguration-general.xml
scilab/modules/gui/etc/XConfiguration-colors.xml
scilab/modules/gui/etc/XConfiguration-font.xml
scilab/modules/gui/etc/XConfiguration-toolbars.xml
scilab/modules/history_manager/etc/XConfiguration-history.xml
scilab/modules/preferences/etc/XConfiguration.xml
scilab/modules/preferences/sci_gateway/cpp/sci_addModulePreferences.cpp
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XCommonManager.java
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XConfigManager.java
scilab/modules/preferences/src/xslt/XConfiguration.xsl
scilab/modules/scinotes/etc/XConfiguration-scinotes.xml
scilab/modules/ui_data/etc/XConfiguration-variables.xml
scilab/modules/xcos/etc/XConfiguration-xcos.xml

index 70f1cf0..3d57d0d 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version='1.0' encoding='utf-8'?>
 <xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
-  <xsl:import href="XCommon.xsl"/>
+  <xsl:import href="$SCI/modules/preferences/src/xslt/XCommon.xsl"/>
 
-  <xsl:template match="environment" mode="tooltip">Environment</xsl:template>
-  <xsl:template match="environment">
+  <xsl:template match="toolbox_skeleton" mode="tooltip">Environment</xsl:template>
+  <xsl:template match="toolbox_skeleton">
     <VSpace height="25"/>
     <Title text="Environment">
       <HBox>
index 944ebb0..a680c3f 100644 (file)
@@ -13,6 +13,8 @@
 package org.scilab.modules.commons.xml;
 
 import java.awt.Color;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.FileFilter;
@@ -145,6 +147,41 @@ public class XConfiguration {
     }
 
     /**
+     * Save the modifications
+     */
+    public static String dumpNode(Node written) {
+        Transformer transformer = null;
+        try {
+            transformer = ScilabTransformerFactory.newInstance().newTransformer();
+        } catch (TransformerConfigurationException e1) {
+            System.err.println("Cannot dump xml");
+            return "";
+        } catch (TransformerFactoryConfigurationError e1) {
+            System.err.println("Cannot dump xml");
+            return "";
+        }
+        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+
+        ByteArrayOutputStream stream = new ByteArrayOutputStream();
+        StreamResult result = new StreamResult(new BufferedOutputStream(stream));
+        DOMSource source = new DOMSource(written);
+        String str = "";
+        try {
+            transformer.transform(source, result);
+            str = stream.toString();
+        } catch (TransformerException e) {
+            System.err.println("Cannot dump xml");
+            return str;
+        } finally {
+            try {
+                stream.close();
+            } catch (Exception e) { }
+        }
+
+        return str;
+    }
+
+    /**
      * Create a document in using the XConfiguration-*.xml found in SCI/modules/MODULE_NAME/etc/
      * @return the built document
      */
@@ -237,8 +274,9 @@ public class XConfiguration {
         }
     }
 
-    public static void clearModifiedPath() {
+    public static void invalidate() {
         modifiedPaths.clear();
+        doc = null;
     }
 
     public static void addXConfigurationListener(XConfigurationListener listener) {
index 8b2a6eb..f5fc7b6 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
-<console>
+<console title="Console">
   <body>
     <display wrap-lines="true" lines-to-display="100" columns-to-display="100" tab-size="4" scroll-size="3000"/>
     <accessibility/>
   </body>
-</console>
\ No newline at end of file
+</console>
index 87d9ead..095ade3 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
-<general>
+<general title="General">
   <body>
     <environment floating-point-exception="Produces a warning" printing-format="long" width="10"/>
     <java-heap-memory heap-size="128"/>
   </body>
-  <confirmation-dialogs>
+  <confirmation-dialogs title="Confirmation dialogs"> 
     <body>
       <tools order="ascending">
         <tool state="checked" name="Scinotes" description="Prompt"/>
@@ -13,7 +13,7 @@
       </tools>
     </body>
   </confirmation-dialogs>
-  <shortcuts>
+  <shortcuts title="Shortcuts">
     <body>
       <actions active="scilab" name="Console" item="1" browse="--choose a file --" filter="">
         <action-folder name="Console">
index f8732e4..214f66e 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<colors>
+<colors title="Colors">
   <body>
     <desktop-colors use-system-color="true" text="#000000" background="#ffffff" cursor="#000000"/>
     <syntax-highlighting-colors name="Default">
@@ -32,4 +32,4 @@
       <item name="OpenClose" color="#4A55DB" bold="false" italic="false" underline="false" strike-through="false"/>
     </syntax-highlighting-colors>
   </body>
-</colors>
\ No newline at end of file
+</colors>
index ac0525e..51a11ad 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<fonts>
+<fonts title="Fonts">
   <body>
     <fonts item="Console" system="true" font-name="Monospaced" font-face="plain" font-size="10">
       <item name="Console" desktop="false" font-name="Monospaced" font-face="plain" font-size="10"/>
@@ -10,4 +10,4 @@
       <item name="Variables Editor" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
     </fonts>
   </body>
-</fonts>
\ No newline at end of file
+</fonts>
index 9165748..b897eba 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<toolbar>
+<toolbar title="Toolbar">
   <body>
     <toolbars select="scilab">
       <toolbar title="scilab" position="1" selection="0">
@@ -14,4 +14,4 @@
       </toolbar>
     </toolbars>
   </body>
-</toolbar>
\ No newline at end of file
+</toolbar>
index 25ad2e6..f11b26b 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<command-history>
+<command-history title="Command history">
   <body>
     <history-save kind="quit" after="1"/>
     <history-settings history-file="" history-lines="1000"/>
index feaa6e2..f550c61 100644 (file)
@@ -62,9 +62,9 @@ int sci_addModulePreferences(char * fname, unsigned long fname_len)
                 }
             }
             return 0;
-       }
-       
-       getAllocatedSingleString(pvApiCtx, addr, array[i]);
+        }
+
+        getAllocatedSingleString(pvApiCtx, addr, array[i]);
     }
 
     expTbxPath = expandPathVariable(const_cast<char *>(tbxPath));
@@ -77,7 +77,17 @@ int sci_addModulePreferences(char * fname, unsigned long fname_len)
     catch (const GiwsException::JniException & e)
     {
         Scierror(999, _("%s: A Java exception arised:\n%s"), fname, e.what());
-        error = true;
+        for (int i = 0; i < Rhs; i++)
+        {
+            if (array[i])
+            {
+                freeAllocatedSingleString(*(array[i]));
+            }
+        }
+        FREE(expTbxPath);
+        FREE(expTbxPrefFile);
+
+        return 0;
     }
 
     for (int i = 0; i < Rhs; i++)
@@ -90,11 +100,8 @@ int sci_addModulePreferences(char * fname, unsigned long fname_len)
     FREE(expTbxPath);
     FREE(expTbxPrefFile);
 
-    if (!error)
-    {
-        LhsVar(1) = 0;
-        PutLhsVar();
-    }
+    LhsVar(1) = 0;
+    PutLhsVar();
 
     return 0;
 }
index 34e3124..84e28d0 100644 (file)
@@ -27,6 +27,7 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.StringReader;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -40,11 +41,13 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.URIResolver;
 import javax.xml.transform.dom.DOMResult;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
@@ -115,7 +118,7 @@ public abstract class XCommonManager {
     /**
      * XSL Transformer factory.
      */
-    protected static TransformerFactory factory = ScilabTransformerFactory.newInstance();
+    protected static TransformerFactory factory;
 
     /**
      * XML Document builder factory.
@@ -134,6 +137,39 @@ public abstract class XCommonManager {
 
     private static String XSLCODE;
 
+    static {
+        factory = ScilabTransformerFactory.newInstance();
+        factory.setURIResolver(new URIResolver() {
+            public Source resolve(String href, String base) throws TransformerException {
+                if (href.startsWith("$SCI")) {
+                    href = href.replace("$SCI", SCI);
+                    base = null;
+                }
+
+                try {
+                    File baseDir = null;
+                    if (base != null && !base.isEmpty()) {
+                        baseDir = new File(new URI(base)).getParentFile();
+                    }
+                    File f;
+                    if (baseDir != null) {
+                        f = new File(baseDir, href);
+                    } else {
+                        f = new File(href);
+                    }
+
+                    if (f.exists() && f.canRead()) {
+                        return new StreamSource(f);
+                    }
+                } catch (Exception e) {
+                    System.out.println(e);
+                }
+
+                throw new TransformerException("Cannot find the file " + href + "::" + base);
+            }
+        });
+    }
+
     /**
      * Monitor time between calls.
      */
@@ -151,7 +187,7 @@ public abstract class XCommonManager {
      * @return whether XSL return a node or not.
      */
     public static boolean refreshDisplay() {
-        topDOM = generateViewDOM().getNode().getFirstChild();
+        topDOM = generateViewDOM().getNode().getFirstChild();//System.out.println(XConfiguration.dumpNode(generateViewDOM().getNode()));
         if (topDOM == null) {
             System.err.println("XSL does not give a node!");
             return false;
@@ -265,12 +301,34 @@ public abstract class XCommonManager {
             buffer.append("<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n");
             buffer.append("<xsl:import href=\"").append(SCI).append("/modules/preferences/src/xslt/XConfiguration.xsl").append("\"/>\n");
 
+            FilenameFilter filter = new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".xsl") && name.startsWith("XConfiguration");
+                }
+            };
+
+            // Include standard Scilab xsl files
             for (File etc : etcs) {
-                File[] xsls = etc.listFiles(new FilenameFilter() {
-                    public boolean accept(File dir, String name) {
-                        return name.endsWith(".xsl") && name.startsWith("XConfiguration");
+                File[] xsls = etc.listFiles(filter);
+                for (File xsl : xsls) {
+                    try {
+                        buffer.append("<xsl:import href=\"").append(xsl.getCanonicalPath()).append("\"/>\n");
+                    } catch (IOException e) {
+                        buffer.append("<xsl:import href=\"").append(xsl.getAbsolutePath()).append("\"/>\n");
                     }
-                });
+                }
+            }
+
+            // Include toolboxes xsl files
+            List<ScilabPreferences.ToolboxInfos> infos = ScilabPreferences.getToolboxesInfos();
+            filter = new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".xsl");
+                }
+            };
+            for (ScilabPreferences.ToolboxInfos i : infos) {
+                File etc = new File(i.getPrefFile()).getParentFile();
+                File[] xsls = etc.listFiles(filter);
                 for (File xsl : xsls) {
                     try {
                         buffer.append("<xsl:import href=\"").append(xsl.getCanonicalPath()).append("\"/>\n");
@@ -279,6 +337,7 @@ public abstract class XCommonManager {
                     }
                 }
             }
+
             buffer.append("</xsl:stylesheet>");
 
             XSLCODE = buffer.toString();
@@ -287,6 +346,10 @@ public abstract class XCommonManager {
         return XSLCODE;
     }
 
+    public static void invalidateXSL() {
+        XSLCODE = null;
+    }
+
     /**
      * Load XSL as XSL Transformer.
      */
index a9ae1e7..7e66acb 100644 (file)
@@ -63,6 +63,9 @@ public final class XConfigManager extends XCommonManager {
     /** User configuration file.*/
     private static final String USER_CONFIG_FILE = ScilabCommons.getSCIHOME() + "/XConfiguration.xml";
 
+    static {
+        //ScilabPreferences.addToolboxInfos("MyToolbox", System.getenv("SCI") + "/contrib/toolbox_skeleton/", System.getenv("SCI") + "/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xml");
+    }
 
     /**
      * Constructor blocked, singleton pattern.
@@ -94,7 +97,7 @@ public final class XConfigManager extends XCommonManager {
         //dialog.setResizable(false);
         dialog.addComponentListener(new ComponentAdapter() {
             public void componentResized(ComponentEvent e) {
-                Element element = (Element) document.getDocumentElement();
+                Element element = document.getDocumentElement();
                 Dimension dimension = dialog.getSize();
                 int height = XConfigManager.getInt(element, "height", 0);
                 int width = XConfigManager.getInt(element, "width",  0);
@@ -133,80 +136,87 @@ public final class XConfigManager extends XCommonManager {
     /** Read files to modify (and possibly create it).
      */
     private static void readUserDocuments() {
-        document = XConfiguration.getXConfigurationDocument();
-        NodeList toolboxes = document.getElementsByTagName("toolboxes");
-        if (toolboxes.getLength() != 1) {
-            System.err.println("Can't hook toolboxes [1]");
-            return;
-        }
+        /*
+         * The default document just contains an empty tag <toolboxes/>
+         * We add a body and the different toolbox entries to have something like
+         * <toolboxes>
+         *   <body/>
+         *   <mytoolbox1><body>...</body></mytoolbox1>
+         *   <mytoolbox2><body>...</body></mytoolbox2>
+         * </toolboxes>
+         */
 
-        // Toolboxes files
-        Element toolbox = (Element) toolboxes.item(0);
-        toolboxes = toolbox.getChildNodes();
+        document = XConfiguration.getXConfigurationDocument();
 
-        if (toolboxes.getLength() > 0) {
-            System.err.println("Recover from inconsistent state...");
-            while (toolbox.hasChildNodes()) {
-                toolbox.removeChild(toolbox.getFirstChild());
+        // We remove all the previous tags (should be empty but an error could have occured...)
+        NodeList toolboxes = document.getElementsByTagName("toolboxes");
+        for (int i = 0; i < toolboxes.getLength(); i++) {
+            try {
+                document.getDocumentElement().removeChild(toolboxes.item(i));
+            } catch (Exception e) {
+                // Maybe root is not the good parent...
             }
         }
 
+        Element tbxs = document.createElement("toolboxes");
+        document.getDocumentElement().appendChild(tbxs);
+
         // Body (rendered as XConfiguration.xsl example)
         Element body = document.createElement("body");
-        Element toolboxInfo = document.createElement("toolbox-info");
-        body.appendChild(toolboxInfo);
-        toolbox.appendChild(body);
+        tbxs.appendChild(body);
 
         List<ToolboxInfos> infos = ScilabPreferences.getToolboxesInfos();
-        System.out.println("" + infos.size() + " toolboxes loaded.");
-        for (int i = 0; i < infos.size(); i++) {
-            ToolboxInfos info = infos.get(i);
-            String UserToolboxToken = info.getName().replace(' ', '_');
-            String UserToolboxFile = ScilabCommons.getSCIHOME() + "/" + UserToolboxToken + ".xml";
-            createUserCopy(info.getPrefFile(), UserToolboxFile);
+        for (ToolboxInfos info: infos) {
+            String tbxTag = info.getName().replace(' ', '_');
+            String tbxFile = ScilabCommons.getSCIHOME() + "/" + tbxTag + ".xml";
+
+            // the copy is made only if needed
+            createUserCopy(info.getPrefFile(), tbxFile);
+
             // Building document fragment
-            Element token = document.createElement(UserToolboxToken);
+            Element token = document.createElement(tbxTag);
+            token.setAttribute("title", info.getName());
             DocumentFragment fragment = document.createDocumentFragment();
-            Document ToolboxDocument = readDocument(UserToolboxFile);
-            Node transferred = ToolboxDocument.getDocumentElement();
-            //-- System.out.println("-->" + transferred.getNodeName());
+            Document tbxDocument = readDocument(tbxFile);
+            Node transferred = tbxDocument.getDocumentElement();
+
             transferred = document.importNode(transferred, true);
             fragment.appendChild(transferred);
             token.insertBefore(fragment, null);
-            toolbox.appendChild(token);
-        }
-
-        toolboxes = toolbox.getChildNodes();
-        if (infos.size() + 1 != toolboxes.getLength()) {
-            System.err.println("Can't hook toolboxes [4]");
-            return;
+            tbxs.appendChild(token);
         }
     }
 
     private static void WriteUserDocuments() {
         // Toolboxes files
         NodeList toolboxes = document.getElementsByTagName("toolboxes");
-        Element toolbox = (Element) toolboxes.item(0);
-        if (toolbox.getFirstChild() != null) {
-            toolbox.removeChild(toolbox.getFirstChild()); // body
+        Element tbxs = null;
+        Element emptyTbxs;
+        if (toolboxes != null && toolboxes.getLength() != 0) {
+            tbxs = (Element) toolboxes.item(0);
             List<ToolboxInfos> infos = ScilabPreferences.getToolboxesInfos();
-            toolboxes = toolbox.getChildNodes();
-            if (infos.size() != toolboxes.getLength()) {
-                System.err.println("Can't hook toolboxes [3]");
-                return;
-            }
-            for (int i = 0; i < infos.size(); i++) {
-                Node ToolboxNode = toolboxes.item(i);
-                if (ToolboxNode != null) {
-                    ToolboxInfos info = infos.get(i);
-                    String UserToolboxFile = ScilabCommons.getSCIHOME() + "/" + info.getName().replace(' ', '_') + ".xml";
-                    XConfiguration.writeDocument(UserToolboxFile, ToolboxNode.getFirstChild());
-                    //toolbox.removeChild(ToolboxNode);
+            for (ToolboxInfos info: infos) {
+                String tbxTag = info.getName().replace(' ', '_');
+                NodeList list = tbxs.getElementsByTagName(tbxTag);
+                if (list != null && list.getLength() != 0) {
+                    Element mytbx = (Element) list.item(0);
+                    if (mytbx.hasChildNodes()) {
+                        String tbxFile = ScilabCommons.getSCIHOME() + "/" + tbxTag + ".xml";
+                        XConfiguration.writeDocument(tbxFile, mytbx.getFirstChild());
+                    }
                 }
             }
         }
-        // Main file
+
+        if (tbxs != null) {
+            document.getDocumentElement().removeChild(tbxs);
+        }
+
         XConfiguration.writeDocument(USER_CONFIG_FILE, document);
+
+        if (tbxs != null) {
+            document.getDocumentElement().appendChild(tbxs);
+        }
     }
 
     /** Interpret action.
@@ -239,8 +249,10 @@ public final class XConfigManager extends XCommonManager {
         if (callback.equals("Ok")) {
             WriteUserDocuments();
             dialog.dispose();
+            XCommonManager.invalidateXSL();
             updated = false;
             XConfiguration.fireXConfigurationEvent();
+            XConfiguration.invalidate();
             return true;
         }
         if (callback.equals("Apply")) {
@@ -250,14 +262,14 @@ public final class XConfigManager extends XCommonManager {
             return true;
         }
         if (callback.equals("Default")) {
+            XConfiguration.invalidate();
             reloadTransformer(SCILAB_CONFIG_XSL);
             document = XConfiguration.createDocument();
             writeDocument(USER_CONFIG_FILE, document);
             List<ToolboxInfos> infos = ScilabPreferences.getToolboxesInfos();
-            for (int i = 0; i < infos.size(); i++) {
-                ToolboxInfos info = infos.get(i);
-                String UserToolboxFile = ScilabCommons.getSCIHOME() + "/" + info.getName().replace(' ', '_') + ".xml";
-                refreshUserCopy(info.getPrefFile(), UserToolboxFile);
+            for (ToolboxInfos info : infos) {
+                String tbxFile = ScilabCommons.getSCIHOME() + "/" + info.getName().replace(' ', '_') + ".xml";
+                refreshUserCopy(info.getPrefFile(), tbxFile);
             }
             readUserDocuments();
             updated = false;
@@ -267,7 +279,13 @@ public final class XConfigManager extends XCommonManager {
         }
         if (callback.equals("Cancel")) {
             dialog.dispose();
-            XConfiguration.clearModifiedPath();
+            XCommonManager.invalidateXSL();
+            XConfiguration.invalidate();
+            NodeList toolboxes = document.getElementsByTagName("toolboxes");
+            if (toolboxes != null && toolboxes.getLength() != 0) {
+                Element tbxs = (Element) toolboxes.item(0);
+                document.getDocumentElement().removeChild(tbxs);
+            }
             updated = false;
             refreshDisplay();
             return true;
index 75dba3a..a7d7e5d 100644 (file)
 \r
 \r
   <xsl:template match="*" mode="left-tree">\r
-    <tableNode name="{local-name()}">\r
+    <tableNode>\r
+      <xsl:attribute name="name">\r
+       <xsl:value-of select="./@title"/> \r
+      </xsl:attribute>\r
       <xsl:apply-templates mode="left-tree"/>\r
     </tableNode>\r
   </xsl:template>\r
 \r
   <xsl:template match="toolboxes" mode="left-tree">\r
-    <xsl:if test="*[ not(self::body)]">\r
+    <xsl:if test="*[not(self::body)]">\r
       <tableNode name="{local-name()}">\r
-        <xsl:apply-templates mode="left-tree"/>\r
+       <xsl:apply-templates mode="left-tree"/>\r
       </tableNode>\r
     </xsl:if>\r
   </xsl:template>\r
         <xsl:call-template name="here"/>\r
       </xsl:for-each>\r
     </xsl:variable>\r
+    <!--xsl:message>\r
+      <xsl:value-of select="$local-path"/>::::::::<xsl:value-of select="$path"/>\r
+    </xsl:message-->\r
     <xsl:if test="$local-path=$path">\r
       <VBox path="{$path}" fill="both">\r
         <xsl:apply-templates/>\r
       </VBox>\r
     </xsl:if>\r
   </xsl:template>\r
-\r
-  <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\r
-       ::\r
-       ::     M A I N   P A N E L   E X E M P L E\r
-       ::\r
-       ::\r
-  -->\r
-\r
-  <xsl:template match="toolbox-info">\r
-    <Glue/>\r
-    <HBox>\r
-      <Glue/>\r
-      Select your toolbox in the left side navigation panel.\r
-      <Glue/>\r
-    </HBox>\r
-    <Glue/>\r
-  </xsl:template>\r
-\r
 </xsl:stylesheet>\r
 \r
index 7b104cf..ea06e26 100644 (file)
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
-<scinotes>
+<scinotes title="SciNotes">
   <body>
     <scinotes-preferences restart-reopen="true" add-line-termination="true" number-of-recently-open="5" encoding="utf-8" eol="Unix(LF)" scinotes="true" cmd="" external-cmd="true"/>
   </body>
-  <display>
+  <display title="Display">
     <body>
       <scinotes-display highlight-current-line="true" current-line-color="#FACADE" show-line-numbers="true" wrap-lines="true" keywords-colorization="true" highlight-brackets="true" brackets-color="#E40087" brackets-highlightment="Framed" brackets-onmouseover="true" highlight-keywords="true" keywords-color="#FFF3D2" keywords-highlightment="Filled" keywords-onmouseover="true" whereami="false" tab-size="4" use-spaces="true" indent-size="4" automatic-indent="true"/>
     </body>
   </display>
-  <autosave>
+  <autosave title="Autosave">
     <body>
       <scinotes-autosave enable="true" save-every="5" automatic-delete="true" append-with="~" replace-with="tmp" source-flag="true" single-directory=""/>
     </body>
index c826d9d..eb9d350 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<variables>
+<variables title="Variables">
   <body>
     <variable-browser maximum-array-size="500000"/>
     <variable-editor default-array-format="short" move-selection-after-enter="true" direction="Down" decimal-separator=","/>
index e62dfe0..e9ae731 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xcos>
+<xcos title="Xcos">
   <body>
     <xcos/>
   </body>
-</xcos>
\ No newline at end of file
+</xcos>