c5f9953061a1720722a1807c4d9a73aea3fa457a
[scilab.git] / scilab / modules / console / etc / XConfiguration-general.xsl
1 <?xml version='1.0' encoding='utf-8'?>
2 <xsl:stylesheet version ="1.0"
3                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                 >
5     <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
6        ::
7        ::     M A I N   P A N E L :   G E N E R A L
8        ::
9   -->
10     <xsl:template match="environment" mode="tooltip">Settings environment</xsl:template>
11     <xsl:template match="environment">
12         <Title text="_(Environment)">
13             <Grid>
14                 <Label gridx="1" gridy="1" weightx="0" text="_(Floating point exception (ieee): )"/>
15                 <Panel gridx="2" gridy="1" weightx="1"/>
16                 <Select gridx="3" gridy="1" listener="ActionListener">
17                     <xsl:variable name="fpe" select="@fpe"/>
18                     <actionPerformed choose="fpe">
19                         <xsl:call-template name="context"/>
20                     </actionPerformed>
21                     <xsl:for-each select="fpe">
22                         <option value="{@floating-point-exception}" key="{@code}">
23                             <xsl:if test="@code=$fpe">
24                                 <xsl:attribute name="selected">selected</xsl:attribute>
25                             </xsl:if>
26                         </option>
27                     </xsl:for-each>
28                 </Select>
29
30                 <Label gridx="1" gridy="2" weightx="0" text="_(Printing format: )"/>
31                 <Select gridx="3" gridy="2" listener="ActionListener">
32                     <xsl:variable name="pf" select="@printing-format"/>
33                     <actionPerformed choose="printing-format">
34                         <xsl:call-template name="context"/>
35                     </actionPerformed>
36                     <xsl:for-each select="printing-format">
37                         <option value="{@format}" key="{@code}">
38                             <xsl:if test="@code=$pf">
39                                 <xsl:attribute name="selected">selected</xsl:attribute>
40                             </xsl:if>
41                         </option>
42                     </xsl:for-each>
43                 </Select>
44                 <Label gridx="1" gridy="3" weightx="0" text="_(Width: )"/>
45                 <NumericalSpinner gridx="3"
46                           gridy="3"
47                           weightx="0"
48                           min-value="2"
49                           max-value="25"
50                           increment="1"
51                           length="3"
52                           listener="ActionListener"
53                           value="{@width}">
54                     <actionPerformed choose="width">
55                         <xsl:call-template name="context"/>
56                     </actionPerformed>
57                 </NumericalSpinner>
58                 <Label gridx="1" gridy="4" weightx="0" text="_(Recursion limit: )"/>
59                 <Panel gridx="2" gridy="1" weightx="1"/>
60                 <NumericalSpinner gridx="3" gridy="4" weightx="0" length="3"
61                     increment="1"
62                     min-value="10"
63                     listener="ActionListener"
64                     value="{@recursion-limit}">
65                     <actionPerformed choose="recursion-limit">
66                         <xsl:call-template name="context"/>
67                     </actionPerformed>
68                 </NumericalSpinner>
69             </Grid>
70         </Title>
71     </xsl:template>
72     
73     <xsl:template match="languages">
74         <xsl:if test="$OS='Windows'">
75             <VSpace height="10"/>
76             <Title text="_(Language setting)">
77                 <Grid>
78                     <Label text="_(Default language: )" gridx="1" gridy="1" anchor="baseline" weightx="0"/>
79                     <Panel gridx="2" gridy="1" weightx="1"/>
80                     <Select gridx="3" gridy="1" listener="ActionListener">
81                         <actionPerformed choose="lang">
82                             <xsl:call-template name="context"/>
83                         </actionPerformed>
84                         <xsl:variable name="code" select="@lang"/>
85                         <xsl:for-each select="language">
86                             <option value="{@desc}" key="{@code}">
87                                 <xsl:if test="@code=$SCILAB_LANGUAGE or @code=$code">
88                                     <xsl:attribute name="selected">selected</xsl:attribute>
89                                 </xsl:if>
90                             </option>
91                         </xsl:for-each>
92                     </Select>
93                     <Label text="_((This requires a restart of Scilab))" font-face="bold" gridx="1" gridy="2" anchor="west" weightx="0"/>
94                     <Panel gridx="2" gridy="2" weightx="1" fill="both"/>
95                 </Grid>
96             </Title>
97         </xsl:if>
98     </xsl:template>
99     
100     <xsl:template match="java-heap-memory" mode="tooltip"> and java heap size.</xsl:template>
101     <xsl:template match="java-heap-memory">
102         <VSpace height="10"/>
103         <Title text="_(Java Heap Memory)">
104             <Grid>
105                 <Label text="_(Select the memory (in MB) available in Java: )" gridx="1" gridy="1" anchor="baseline" weightx="0"/>
106                 <Panel gridx="2" gridy="1" weightx="1"/>
107                 <NumericalSpinner min-value="0"
108                           increment="128"
109                           length="6"
110                           listener="ActionListener"
111                           value="{@heap-size}"
112                           gridx="3" gridy="1" anchor="baseline" weightx="0">
113                     <actionPerformed choose="heap-size">
114                         <xsl:call-template name="context"/>
115                     </actionPerformed>
116                 </NumericalSpinner>
117                 <Label text="_((This requires a restart of Scilab))" font-face="bold" gridx="1" gridy="2" anchor="west" weightx="0"/>
118                 <Panel gridx="2" gridy="2" weightx="1" fill="both"/>
119             </Grid>
120         </Title>
121     </xsl:template>
122
123     <xsl:template match="startup">
124         <VSpace height="10"/>
125         <Title text="_(Start-up directory)">
126             <Grid>
127                 <Radiobutton value="{@use}" expected-value="current" listener="ActionListener" text="_(Use current working directory)" gridx="1" gridy="1" fill="none" weightx="0" anchor="west">
128                     <actionPerformed choose="use">
129                         <xsl:call-template name="context"/>
130                     </actionPerformed>
131                 </Radiobutton>
132                 
133                 <Radiobutton value="{@use}" expected-value="previous" listener="ActionListener" text="_(Use previous working directory)" gridx="1" gridy="2" fill="none" weightx="0" anchor="west">
134                     <actionPerformed choose="use">
135                         <xsl:call-template name="context"/>
136                     </actionPerformed>
137                 </Radiobutton>
138                 
139                 <Radiobutton value="{@use}" expected-value="default" listener="ActionListener" text="_(Use default directory)" gridx="1" gridy="3" fill="none" weightx="0" anchor="west">
140                     <actionPerformed choose="use">
141                         <xsl:call-template name="context"/>
142                     </actionPerformed>
143                 </Radiobutton>
144                 
145                 <FileSelector gridx="2" gridy="3" weightx="1" anchor="above_baseline"
146                               listener="EntryListener"
147                               href="{@default}"
148                               desc="_(Default startup directory)"
149                               dir-selection="true"
150                               check-entry="true">
151                     <xsl:attribute name="enable">
152                         <xsl:if test="@use='default'">
153                             <xsl:text>true</xsl:text>
154                         </xsl:if>
155                     </xsl:attribute>
156                     <entryChanged choose="default">
157                         <xsl:call-template name="context"/>
158                     </entryChanged>
159                 </FileSelector>
160             </Grid>
161         </Title>
162     </xsl:template>
163     
164     <xsl:template match="tools">
165         <Title text="_(Confirmation dialogs)">
166             <Grid>
167                 <xsl:for-each select="tool">
168                     <Checkbox
169               gridy="{position() + 1}"
170               gridx="1"
171               listener="ActionListener"
172               checked="{@state}"
173               text="{@description}">
174                         <actionPerformed choose="state">
175                             <xsl:call-template name="context"/>
176                         </actionPerformed>
177                     </Checkbox>
178                 </xsl:for-each>
179             </Grid>
180         </Title>
181     </xsl:template>
182     
183     <xsl:template match="layouts">
184         <xsl:variable name="id" select="@id"/>
185         <Title text="_(Desktop Layout)">
186             <Grid>
187                 <Label gridx="1" gridy="1" weightx="0" text="_(Select a layout)"/>
188                 <Panel gridx="2" gridy="1" gridheight="1" fill="both"/>
189                 <Select gridx="3" gridy="1" listener="ActionListener">
190                     <actionPerformed choose="id">
191                         <xsl:call-template name="context"/>
192                     </actionPerformed>
193                     <xsl:for-each select="layout">
194                         <option value="{@name}" key="{@id}">
195                             <xsl:if test="@id=$id">
196                                 <xsl:attribute name="selected">selected</xsl:attribute>
197                             </xsl:if>
198                         </option>
199                     </xsl:for-each>
200                 </Select>
201                 <Label text="_((Modifying the layout requires to restart Scilab))" font-face="bold" gridx="1" gridy="2" anchor="west" weightx="0"/>
202                 <Panel gridx="1" gridy="3">
203                     <VSpace height="10"/>
204                 </Panel>
205                 <Image gridx="1" gridy="4" gridwidth="3">
206                     <xsl:attribute name="url">
207                         <xsl:value-of select="layout[@id=$id]/@image"/>
208                     </xsl:attribute>
209                 </Image>
210                 <Panel gridx="1" gridy="5">
211                     <VSpace height="10"/>
212                 </Panel>
213                 <Checkbox gridx="1" gridy="6" weightx="0" text="_(Save layout on exiting)" checked="{@save-desktop}" selected-value="true" unselected-value="false" listener="ActionListener">
214                     <actionPerformed choose="save-desktop">
215                         <xsl:call-template name="context"/>
216                     </actionPerformed>
217                 </Checkbox>
218                 <Button gridx="3" gridy="6" weightx="0" text="_(Reset layout)" listener="ActionListener">
219                     <actionPerformed callback="Reset layout"/>
220                 </Button>
221             </Grid>
222         </Title>
223     </xsl:template>
224     
225     <xsl:template match="actions">
226         <xsl:variable name="name" select="@name"/>
227         <xsl:variable name="current-item" select="action-folder[@name=$name]/action[number(@item)]"/>
228         <Title text="_(Keys binding)" fixed-height="false">
229             <VBox fixed-height="false">
230                 <Grid>
231                     <Label gridy="1" gridx="1" gridwidth="2" text="_(Filter on action name: )"/>
232                     <Entry gridy="2" gridx="1" gridwidth="2" text="{@filter}" listener="EntryListener">
233                         <entryChanged choose="filter">
234                             <xsl:call-template name="context"/>
235                         </entryChanged>
236                     </Entry>
237                 </Grid>
238                 <VSpace height="10"/>
239                 <Grid>
240                     <VBox gridx="1" gridy="1" weightx="0" anchor="north">
241                         <Label text="_(Component)"/>
242                         <List item="{@name}" nb-visible-rows="4" listener="ActionListener">
243                             <actionPerformed choose="name">
244                                 <xsl:call-template name="context"/>
245                             </actionPerformed>
246                             <xsl:for-each select="action-folder">
247                                 <listElement name="{@name}"/>
248                             </xsl:for-each>
249                         </List>
250                     </VBox>
251                     <Panel gridx="2" gridy="1" weightx="0" width="30" height="1" fixed-width="true"/>
252                     <Grid gridx="3" gridy="1" weightx="1" anchor="north">
253                         <Label gridx="1" gridy="1" weightx="0" weighty="0" anchor="north" text="_(Name: )"/>
254                         <Label gridx="2" gridy="1" weightx="0" weighty="0" anchor="west">
255                             <xsl:attribute name="text">
256                                 <xsl:value-of select="$current-item/@name"/>
257                             </xsl:attribute>
258                         </Label>
259                         <Label gridx="1" gridy="2" weightx="0" weighty="0" anchor="north" text="_(Description: )"/>
260                         <TextArea gridx="2" gridy="2" weightx="1" weighty="0" anchor="west" editable="false" rows="4">
261                             <xsl:attribute name="text">
262                                 <xsl:value-of select="$current-item/@description"/>
263                             </xsl:attribute>
264                         </TextArea>
265                         <Label gridx="1" gridy="3" weightx="0" weighty="0" anchor="baseline" text="_(Binding: )"/>
266                         <Entry gridx="2" gridy="3" weightx="0" weighty="0" anchor="baseline" listener="EntryListener">
267                             <xsl:attribute name="text">
268                                 <xsl:value-of select="$current-item/@key"/>
269                             </xsl:attribute>
270                             <entryChanged choose="key">
271                                 <xsl:attribute name="context">
272                                     <xsl:for-each select="$current-item/ancestor-or-self::*">
273                                         <xsl:if test="not(.=/)">
274                                             <xsl:value-of select="count(preceding-sibling::*)+1"/>
275                                             <xsl:text>/</xsl:text>
276                                         </xsl:if>
277                                     </xsl:for-each>
278                                 </xsl:attribute>
279                             </entryChanged>
280                         </Entry>
281                     </Grid>
282                 </Grid>
283                 <VSpace height="10"/>
284                 <Table mode="select" listener="TableListener" fixed-height="false">
285                     <!-- we change this useless attribute (which is not an actuator) to force the table reload) -->
286                     <xsl:attribute name="name">
287                         <xsl:value-of select="concat($name,@filter)"/>
288                     </xsl:attribute>
289                     <tableSelect choose="item">
290                         <xsl:call-template name="context"/>
291                     </tableSelect>
292                     <xsl:for-each select="action-folder[@name=$name]/action[contains(
293                                 translate(@name,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
294                                 translate(current()/@filter,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'))]">
295                         <tableRow binding="{@key}" command="{@name}"/>
296                     </xsl:for-each>
297                     <tableCol title="_(Action name)" attr="command"/>
298                     <tableCol title="_(Key binding)" attr="binding"/>
299                 </Table>
300                 <Glue/>
301             </VBox>
302         </Title>
303     </xsl:template>
304
305     <xsl:template match="demos">
306         <Title text="_(Demos)">
307             <Grid>
308                 <Checkbox
309                       gridx="1"
310                       gridy="1"
311                       listener="ActionListener"
312                       checked="{@demoGUIisDockable}"
313                       text="_(The demo interface is dockable)"
314                       >
315                     <actionPerformed choose="demoGUIisDockable">
316                         <xsl:call-template name="context"/>
317                     </actionPerformed>
318                 </Checkbox>
319             </Grid>
320         </Title>
321     </xsl:template>
322 </xsl:stylesheet>