Prefs: add a way to backup preferences file
[scilab.git] / scilab / modules / preferences / etc / XConfiguration-preference.xsl
1 <?xml version='1.0' encoding='utf-8'?>
2 <xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4   <xsl:template match="preference" mode="tooltip">Preferences</xsl:template>
5   <xsl:template match="backups">
6     <xsl:variable name="name" select="@name"/>
7     <Title text="Preferences backup">
8     <Grid>
9       <Label gridx="1" gridy="1" weightx="0" text="Select a backup file "/>
10       <FileSelector gridx="2" gridy="1" weightx="1" anchor="above_baseline"
11                     listener="EntryListener"
12                     href="{@restore-path}"
13                     mask="*.xml"
14                     desc="Scilab Configuration files"
15                     dir-selection="false"
16                     check-entry="false">
17         <entryChanged choose="restore-path">
18           <xsl:call-template name="context"/>
19         </entryChanged>
20       </FileSelector>
21       <Panel gridx="3" gridy="1" weightx="1" fill="both"/>
22       <Button gridx="4" gridy="1" text="Restore" listener="ActionListener">
23         <actionPerformed callback="Restore Backup">
24           <xsl:attribute name="path">
25             <xsl:value-of select="@restore-path"/>
26           </xsl:attribute>
27           <xsl:call-template name="context"/>
28         </actionPerformed>
29       </Button>
30       <Label gridx="1" gridy="2" weightx="0" text="Create a backup file "/>
31       <FileSelector gridx="2" gridy="2" weightx="1" anchor="above_baseline"
32                     listener="EntryListener"
33                     href="{@save-path}"
34                     mask="*.xml"
35                     desc="Scilab Configuration files"
36                     dir-selection="false"
37                     check-entry="false">
38         <entryChanged choose="save-path">
39           <xsl:call-template name="context"/>
40         </entryChanged>
41       </FileSelector>
42       <Panel gridx="3" gridy="2" weightx="1" fill="both"/>
43       <Button gridx="4" gridy="2" text="Save" listener="ActionListener">
44         <actionPerformed callback="Save Backup">
45           <xsl:attribute name="path">
46             <xsl:value-of select="@save-path"/>
47           </xsl:attribute>
48           <xsl:call-template name="context"/>
49         </actionPerformed>
50       </Button>
51     </Grid>
52     </Title>
53   </xsl:template>
54 </xsl:stylesheet>