~ubuntu-branches/ubuntu/precise/zenity/precise-updates

« back to all changes in this revision

Viewing changes to help/oc/file-selection.page

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-03-29 14:50:15 UTC
  • mfrom: (1.1.45)
  • Revision ID: package-import@ubuntu.com-20120329145015-p6jkb44cf19r2qyi
Tags: 3.4.0-0ubuntu1
* New upstream release:
  - Add support for lists and trees with --forms
  - Fix warning reading list from stdin
* debian/zenity-common.install:
  - Doesn't install omf files anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="file-selection" xml:lang="oc">
 
3
  <info>
 
4
    <link type="guide" xref="index#dialogs"/>
 
5
    <desc>Use the <cmd>--file-selection</cmd> option.</desc>
 
6
  </info>
 
7
  <title>File Selection Dialog</title>
 
8
    <p>
 
9
        Use the <cmd>--file-selection</cmd> option to create a file selection dialog. <app>Zenity</app> returns the selected files or directories to standard 
 
10
        output. The default mode of the file selection dialog is open.
 
11
    </p>
 
12
    <p>
 
13
        The file selection dialog supports the following options:
 
14
    </p>
 
15
 
 
16
    <terms>
 
17
 
 
18
      <item>
 
19
        <title><cmd>--filename</cmd>=<var>filename</var></title>
 
20
        <p>Specifies the file or directory that is selected in the file selection dialog when the dialog is first shown.</p>
 
21
      </item>
 
22
 
 
23
      <item>
 
24
        <title><cmd>--multiple</cmd></title>
 
25
        <p>Allows the selection of multiple filenames in the file selection dialog.</p>
 
26
      </item>
 
27
 
 
28
      <item>
 
29
        <title><cmd>--directory</cmd></title>
 
30
        <p>Allows only selection of directories in the file selection dialog.</p>
 
31
      </item>
 
32
 
 
33
      <item>
 
34
        <title><cmd>--save</cmd></title>
 
35
        <p>Set the file selection dialog into save mode.</p>
 
36
      </item>
 
37
 
 
38
      <item>
 
39
        <title><cmd>--separator</cmd>=<var>separator</var></title>
 
40
        <p>Specifies the string that is used to divide the returned list of filenames.</p>
 
41
      </item>
 
42
 
 
43
    </terms>
 
44
 
 
45
    <p>
 
46
      The following example script shows how to create a file selection dialog:
 
47
    </p>
 
48
 
 
49
<code>
 
50
#!/bin/sh
 
51
 
 
52
FILE=`zenity --file-selection --title="Select a File"`
 
53
 
 
54
case $? in
 
55
         0)
 
56
                echo "\"$FILE\" selected.";;
 
57
         1)
 
58
                echo "No file selected.";;
 
59
        -1)
 
60
                echo "An unexpected error has occurred.";;
 
61
esac
 
62
</code>
 
63
 
 
64
    <figure id="zenity-fileselection-screenshot">
 
65
      <title>File Selection Dialog Example</title>
 
66
      <desc><app>Zenity</app> file selection dialog example</desc>
 
67
      <media type="image" mime="image/png" src="figures/zenity-fileselection-screenshot.png"/>
 
68
    </figure>
 
69
</page>