From 3a3a047a710700afd4fe6dde22f7f0f8eeae87bb Mon Sep 17 00:00:00 2001 From: Breda McColgan Date: Wed, 18 Aug 2004 18:10:27 +0000 Subject: help/C/zenity.xml help/C/zenity-C.omf 2004-08-18 Breda McColgan * Updated the following files: * help/C/zenity.xml * help/C/zenity-C.omf * help/C/figures/zenity-calendar-screenshot.png * help/C/figures/zenity-entry-screenshot.png * help/C/figures/zenity-error-screenshot.png * help/C/figures/zenity-fileselection-screenshot.png * help/C/figures/zenity-information-screenshot.png * help/C/figures/zenity-list-screenshot.png * help/C/figures/zenity-progress-screenshot.png * help/C/figures/zenity-question-screenshot.png * help/C/figures/zenity-text-screenshot.png * help/C/figures/zenity-warning-screenshot.png * Added the following files: * help/C/l10n.txt * help/C/l10n_scripts/ * help/C/l10n_scripts/calendar.sh * help/C/l10n_scripts/cvs.txt * help/C/l10n_scripts/error.sh * help/C/l10n_scripts/filesel.sh * help/C/l10n_scripts/info.sh * help/C/l10n_scripts/list.sh * help/C/l10n_scripts/progress.sh * help/C/l10n_scripts/question.sh * help/C/l10n_scripts/text_entry.sh * help/C/l10n_scripts/text_info.sh * help/C/l10n_scripts/warning.sh See the help/C/l10n.txt file for information about l10n_scripts. --- help/C/figures/zenity-calendar-screenshot.png | Bin 16251 -> 15151 bytes help/C/figures/zenity-entry-screenshot.png | Bin 6357 -> 8317 bytes help/C/figures/zenity-error-screenshot.png | Bin 7214 -> 8392 bytes help/C/figures/zenity-fileselection-screenshot.png | Bin 20965 -> 45662 bytes help/C/figures/zenity-information-screenshot.png | Bin 8804 -> 9087 bytes help/C/figures/zenity-list-screenshot.png | Bin 17694 -> 19794 bytes help/C/figures/zenity-progress-screenshot.png | Bin 7280 -> 9029 bytes help/C/figures/zenity-question-screenshot.png | Bin 10455 -> 10920 bytes help/C/figures/zenity-text-screenshot.png | Bin 15419 -> 16246 bytes help/C/figures/zenity-warning-screenshot.png | Bin 9222 -> 10818 bytes help/C/l10n.txt | 88 ++ help/C/l10n_scripts/calendar.sh | 10 + help/C/l10n_scripts/cvs.txt | 51 + help/C/l10n_scripts/error.sh | 4 + help/C/l10n_scripts/filesel.sh | 13 + help/C/l10n_scripts/info.sh | 4 + help/C/l10n_scripts/list.sh | 8 + help/C/l10n_scripts/progress.sh | 18 + help/C/l10n_scripts/question.sh | 4 + help/C/l10n_scripts/text_entry.sh | 11 + help/C/l10n_scripts/text_info.sh | 17 + help/C/l10n_scripts/warning.sh | 4 + help/C/zenity-C.omf | 26 +- help/C/zenity.xml | 1087 +++++++++++--------- 24 files changed, 821 insertions(+), 524 deletions(-) create mode 100755 help/C/l10n.txt create mode 100755 help/C/l10n_scripts/calendar.sh create mode 100755 help/C/l10n_scripts/cvs.txt create mode 100755 help/C/l10n_scripts/error.sh create mode 100755 help/C/l10n_scripts/filesel.sh create mode 100755 help/C/l10n_scripts/info.sh create mode 100755 help/C/l10n_scripts/list.sh create mode 100755 help/C/l10n_scripts/progress.sh create mode 100755 help/C/l10n_scripts/question.sh create mode 100755 help/C/l10n_scripts/text_entry.sh create mode 100755 help/C/l10n_scripts/text_info.sh create mode 100755 help/C/l10n_scripts/warning.sh (limited to 'help/C') diff --git a/help/C/figures/zenity-calendar-screenshot.png b/help/C/figures/zenity-calendar-screenshot.png index 90589317..5dc3be6e 100644 Binary files a/help/C/figures/zenity-calendar-screenshot.png and b/help/C/figures/zenity-calendar-screenshot.png differ diff --git a/help/C/figures/zenity-entry-screenshot.png b/help/C/figures/zenity-entry-screenshot.png index 27266649..39d2fb24 100644 Binary files a/help/C/figures/zenity-entry-screenshot.png and b/help/C/figures/zenity-entry-screenshot.png differ diff --git a/help/C/figures/zenity-error-screenshot.png b/help/C/figures/zenity-error-screenshot.png index 36720d65..d26e0298 100644 Binary files a/help/C/figures/zenity-error-screenshot.png and b/help/C/figures/zenity-error-screenshot.png differ diff --git a/help/C/figures/zenity-fileselection-screenshot.png b/help/C/figures/zenity-fileselection-screenshot.png index 6c0f47cc..cc0d1a7e 100644 Binary files a/help/C/figures/zenity-fileselection-screenshot.png and b/help/C/figures/zenity-fileselection-screenshot.png differ diff --git a/help/C/figures/zenity-information-screenshot.png b/help/C/figures/zenity-information-screenshot.png index 3dad60d6..abb898ed 100644 Binary files a/help/C/figures/zenity-information-screenshot.png and b/help/C/figures/zenity-information-screenshot.png differ diff --git a/help/C/figures/zenity-list-screenshot.png b/help/C/figures/zenity-list-screenshot.png index 7f368243..6abf517e 100644 Binary files a/help/C/figures/zenity-list-screenshot.png and b/help/C/figures/zenity-list-screenshot.png differ diff --git a/help/C/figures/zenity-progress-screenshot.png b/help/C/figures/zenity-progress-screenshot.png index 56ba2a37..cf01c5e5 100644 Binary files a/help/C/figures/zenity-progress-screenshot.png and b/help/C/figures/zenity-progress-screenshot.png differ diff --git a/help/C/figures/zenity-question-screenshot.png b/help/C/figures/zenity-question-screenshot.png index 1ed334d0..e5363971 100644 Binary files a/help/C/figures/zenity-question-screenshot.png and b/help/C/figures/zenity-question-screenshot.png differ diff --git a/help/C/figures/zenity-text-screenshot.png b/help/C/figures/zenity-text-screenshot.png index 4efee26a..686b6007 100644 Binary files a/help/C/figures/zenity-text-screenshot.png and b/help/C/figures/zenity-text-screenshot.png differ diff --git a/help/C/figures/zenity-warning-screenshot.png b/help/C/figures/zenity-warning-screenshot.png index fe6ffce9..57f33082 100644 Binary files a/help/C/figures/zenity-warning-screenshot.png and b/help/C/figures/zenity-warning-screenshot.png differ diff --git a/help/C/l10n.txt b/help/C/l10n.txt new file mode 100755 index 00000000..f03a73fe --- /dev/null +++ b/help/C/l10n.txt @@ -0,0 +1,88 @@ +Zenity Manual V2.0 + +------------------------ +SUMMARY OF CHANGES +------------------------ + +Created by: Breda McColgan +Date: July 2004 +Manual version: 2.0 + +------------------------ +SCREENSHOT INSTRUCTIONS +------------------------ + +To create the screenshots, perform the following steps: +1. Create a directory called /tmp/l10n_scripts. +2. Copy the scripts to the /tmp/l10n_scripts directory. +3. Edit the appropriate script (see below) + to replace the English text with the localised text, where applicable. +4. Ensure that all scripts are executable. + If necessary, run the following command: + chmod +x +5. Run the script from the /tmp/l10n_scripts directory, as follows: + cd /tmp/l10n_scripts + . ./ + + +zenity-calendar-screenshot.png +============================== + + = calendar.sh + + +zenity-entry-screenshot.png +=========================== + + = text_entry.sh + + + +zenity-error-screenshot.png +=========================== + + = error.sh + + +zenity-fileselection-screenshot.png +=================================== + + = file_sel.sh + + +zenity-information-screenshot.png +================================= + + = info.sh + + +zenity-list-screenshot.png +========================== + + = list.sh + + +zenity-progress-screenshot.png +============================== + + = progress.sh + + +zenity-question-screenshot.png +============================== + + = question.sh + + +zenity-text-screenshot.png +========================== + + = text_info.sh +Select cvs.txt from the File Selector dialog. +Resize the window so that only the text appears -- no blank space. + + +zenity-warning-screenshot.png +============================= + + = warning.sh diff --git a/help/C/l10n_scripts/calendar.sh b/help/C/l10n_scripts/calendar.sh new file mode 100755 index 00000000..cf0f45e3 --- /dev/null +++ b/help/C/l10n_scripts/calendar.sh @@ -0,0 +1,10 @@ +#!/bin/sh + + if zenity --calendar \ + --title="Select a Date" \ + --text="Click on a date to select that date." \ + --day=10 --month=8 --year=2004 + then echo $? + else echo "No date selected" + fi + diff --git a/help/C/l10n_scripts/cvs.txt b/help/C/l10n_scripts/cvs.txt new file mode 100755 index 00000000..f470f666 --- /dev/null +++ b/help/C/l10n_scripts/cvs.txt @@ -0,0 +1,51 @@ +Getting the most out of CVS in GNOME +==================================== + +Introductory Beginnings- + +Current Versions System, CVS, is a powerful +method of allowing many developers +to work on the same source code. It is used + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/help/C/l10n_scripts/error.sh b/help/C/l10n_scripts/error.sh new file mode 100755 index 00000000..7d93857f --- /dev/null +++ b/help/C/l10n_scripts/error.sh @@ -0,0 +1,4 @@ +#!/bin/bash + + zenity --error \ + --text="Could not find /var/log/syslog." diff --git a/help/C/l10n_scripts/filesel.sh b/help/C/l10n_scripts/filesel.sh new file mode 100755 index 00000000..e9abe1d3 --- /dev/null +++ b/help/C/l10n_scripts/filesel.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +FILE=`zenity --file-selection --title="Select a File"` + +case $? in + 0) + echo "\"$FILE\" selected.";; + 1) + echo "No file selected.";; + -1) + echo "No file selected.";; +esac + diff --git a/help/C/l10n_scripts/info.sh b/help/C/l10n_scripts/info.sh new file mode 100755 index 00000000..2c19cfb1 --- /dev/null +++ b/help/C/l10n_scripts/info.sh @@ -0,0 +1,4 @@ +#!/bin/bash + + zenity --info \ + --text="Merge complete. Updated 3 of 10 files." diff --git a/help/C/l10n_scripts/list.sh b/help/C/l10n_scripts/list.sh new file mode 100755 index 00000000..cc8304d3 --- /dev/null +++ b/help/C/l10n_scripts/list.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +zenity --list \ + --title="Choose the Bugs You Wish to View" \ + --column="Bug Number" --column="Severity" --column="Description" \ + 992383 Normal "GtkTreeView crashes on multiple selections" \ + 293823 High "GNOME Dictionary does not handle proxy" \ + 393823 Critical "Menu editing does not work in GNOME 2.0" diff --git a/help/C/l10n_scripts/progress.sh b/help/C/l10n_scripts/progress.sh new file mode 100755 index 00000000..225c90ab --- /dev/null +++ b/help/C/l10n_scripts/progress.sh @@ -0,0 +1,18 @@ +#!/bin/sh +( +echo "10" ; sleep 1 +echo "# Updating mail logs" ; sleep 1 +echo "20" ; sleep 1 +echo "# Resetting cron jobs" ; sleep 1 +echo "50" ; sleep 1 +echo "This line will just be ignored" ; sleep 1 +echo "75" ; sleep 1 +echo "# Rebooting system" ; sleep 1 +echo "100" ; sleep 1 +) | +zenity --progress --title="Update System Logs" --text="Scanning mail logs..." --percentage=0 + +if [ "$?" = -1 ] ; then + zenity --error --text="Update cancelled." +fi + diff --git a/help/C/l10n_scripts/question.sh b/help/C/l10n_scripts/question.sh new file mode 100755 index 00000000..6ed9374d --- /dev/null +++ b/help/C/l10n_scripts/question.sh @@ -0,0 +1,4 @@ +#!/bin/bash + + zenity --question \ + --text="Are you sure you wish to proceed?" diff --git a/help/C/l10n_scripts/text_entry.sh b/help/C/l10n_scripts/text_entry.sh new file mode 100755 index 00000000..4afd006e --- /dev/null +++ b/help/C/l10n_scripts/text_entry.sh @@ -0,0 +1,11 @@ +#!/bin/sh + + if zenity --entry \ + --title="Add an Entry" \ + --text="Enter your _password:" \ + --entry-text "password" \ + --hide-text + then echo $? + else echo "No password entered" + fi + diff --git a/help/C/l10n_scripts/text_info.sh b/help/C/l10n_scripts/text_info.sh new file mode 100755 index 00000000..711e51d8 --- /dev/null +++ b/help/C/l10n_scripts/text_info.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +FILE=`zenity --file-selection \ + --title="Select a File"` + +case $? in + 0) + zenity --text-info \ + --title=$FILE \ + --filename=$FILE \ + --editable 2>/tmp/tmp.txt;; + 1) + echo "No file selected.";; + -1) + echo "No file selected.";; +esac + diff --git a/help/C/l10n_scripts/warning.sh b/help/C/l10n_scripts/warning.sh new file mode 100755 index 00000000..a39af9ac --- /dev/null +++ b/help/C/l10n_scripts/warning.sh @@ -0,0 +1,4 @@ +#!/bin/bash + + zenity --warning \ + --text="Disconnect the power cable to avoid electrical shock." diff --git a/help/C/zenity-C.omf b/help/C/zenity-C.omf index a36c5180..1c0c646a 100644 --- a/help/C/zenity-C.omf +++ b/help/C/zenity-C.omf @@ -2,33 +2,25 @@ - Glynn Foster <glynn.foster@sun.com> + Sun Java Desktop System Documentation Team - - Glynn Foster <glynn.foster@sun.com> + Sun Java Desktop System Documentation Team - - - Zenity - - 2003-15-01 + 2004-08-17 - - - + + - User manual for Zenity. + User manual for the Zenity desktop application. - + + user's guide + diff --git a/help/C/zenity.xml b/help/C/zenity.xml index 4dc745d6..66c99a0d 100644 --- a/help/C/zenity.xml +++ b/help/C/zenity.xml @@ -1,9 +1,15 @@ - - Zenity"> + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ + + + + + + Zenity"> + + + ]> @@ -11,67 +17,89 @@
- Zenity Manual + &appname; + &appname; Desktop Application Manual V&manrevision; 2003 - Sun Microsystems + 2004 + &publisher; - GNOME Documentation Project + &publisher; - Version 1.0 of Zenity Manual + &legal; - - Feedback Information - - To report a bug or make a suggestion regarding this - application or this documentation, please see the - - GNOME Feedback Page - - - - - Glynn - Foster - - GNOME Documentation Project - - - - Nicholas - Curran - - GNOME Documentation Project - - + + &author1; + &author2; + &publisher; + + + Glynn + Foster + + GNOME Documentation Project + + + + Nicholas + Curran + + GNOME Documentation Project + + - - 1.0 - 18-01-2003 - - Glynn Foster - - GNOME Documentation Project - - - + + &appname; Desktop Application Manual V&manrevision; + &date; + + &author1; &author2; + &publisher; + + + + + Zenity Manual V1.0 + January 2003 + + Glynn Foster + GNOME Documentation Project + + + + This manual describes version &appversion; of &appname;. + + + + Feedback + + To send feedback, follow the directions in the Feedback Page. + + + + + + zenity command + + + dialog creator + @@ -80,212 +108,286 @@ Introduction - &app; displays simple GNOME dialogs. - - - - &app; can display the following dialogs: + &app; enables you to create the following types of simple dialog: - - Calendar dialog. - - - Text entry dialog. - - Various message dialogs including: + Calendar + File selection + List + Message - - Error dialog. - - - Information dialog. - - - Question dialog. - - - Warning dialog. - + Error + Information + Question + Warning - - File selection dialog. - - - List options dialog. - - - Progress dialog. - - - Text dialog. - + Progress + Text entry + Text information - - - Basic Use + + + + Usage - &app; creates simple dialogs. You can use &app; to create a script that - interacts graphically with the user. - - - - When the user closes the dialog, - &app; prints text produced by the dialog to standard error. + When you write scripts, you can use &app; to create simple dialogs that interact graphically with the user, as follows: - + + + + You can create a dialog to obtain information from the user. For example, you can prompt the user to select a date from a calendar dialog, or to select a file from a file selection dialog. + + + + + You can create a dialog to provide the user with information. For example, you can use a progress dialog to indicate the current status of an operation, or use a warning message dialog to alert the user. + + + - Ensure that all arguments to &app; are surrounded by quotes. For example, use - zenity --calendar --title="Holiday Planner" instead of - zenity --calendar --title=Holiday Planner. - If you do not use quotes, you can get unexpected results. + When the user closes the dialog, &app; prints the text produced by the dialog to standard error. - NOTE + + When you write &app; commands, ensure that you place quotation marks around each argument. + + + For example, use: zenity --calendar --title="Holiday Planner" Do not use: zenity --calendar --title=Holiday Planner + + + If you do not use quotation marks, you might get unexpected results. + + + + + Access Keys - Some dialogs support the use of keyboard mnemonics. To specify the character to use as - the mnemonic, place an underscore before that character in the text of the dialog. For - example, to specify the 'P' as the keyboard mnemonic in the following sentence, use - "_Please choose a name". + An access key is a key that enables you to perform an action from the keyboard rather than use the mouse to choose a command from a menu or dialog. Each access key is identified by an underlined letter on a menu or dialog option. - + + Some &app; dialogs support the use of access keys. To specify the character to use as the access key, place an underscore before that character in the text of the dialog. The following example shows how to specify the letter 'C' as the access key: + + "_Choose a name". + + + Exit Codes &app; returns the following exit codes: + + + + + + + + Exit Code + + Description + + + + + + 0 + + + The user has pressed either OK or Close. + + + + + 1 + + + The user has either pressed Cancel, or used the window functions to close the dialog. + + + + + -1 + + + An unexpected error has occurred. + + + + + + + + + + + + + General Options + + + All &app; dialogs support the following general options: + + - 0 + =title - The user has pressed either 'OK' or 'Close'. + Specifies the title of a dialog. - + + + =icon_path + + Specifies the icon that is displayed in the window frame of the dialog. + + + - 1 + =width - The user has pressed either 'Cancel' or closed the dialog through the window functions. + Specifies the width of the dialog. - -1 + =height - An unexpected error has occurred. + Specifies the height of the dialog. - + - + - - General Options + + Help Options - All dialogs have the following general options: + &app; provides the following help options: - --title=TITLE + - Specifies the title of a dialog. + Displays help text. You can also use -? to specify this option. - --window-icon=ICON_PATH + - Specifies the icon that should appear in the window frame of the dialog. + Displays brief usage text. + + + + + + + + Miscellaneous Options + + + &app; also provides the following miscellaneous options: + + + + - --width=WIDTH + - Specifies the width of the dialog. + Displays the About &appname; dialog, which contains &app; version information, copyright information, and developer information. - --height=HEIGHT + - Specifies the height of the dialog. + Displays the version number of &app;. - + + + + + GTK+ Options + + + &app; supports the standard GTK+ options. For more information about the GTK+ options, execute the zenity -? command. + + + + + Calendar Dialog - Use --calendar to create a Calendar dialog. &app; returns the - date selected to standad error. The current date will be used by the dialog if - no date is given on the command line. + Use the option to create a calendar dialog. &app; returns the selected date to standard error. If no date is specified on the command line, the dialog uses the current date. - The Calendar dialog has the following options: + The calendar dialog supports the following options: - --text=TEXT + =text - Specifies the text to appear in the Calendar dialog. + Specifies the text that is displayed in the calendar dialog. - --day=DAY + =day - Specifies the day to be pre-selected in the Calendar dialog. The day - ust be a number between 1 and 31. + Specifies the day that is selected in the calendar dialog. day must be a number between 1 and 31 inclusive. - --month=MONTH + =month - Specifies the day to be pre-selected in the Calendar dialog. The day must be - a number between 1 and 12. + Specifies the month that is selected in the calendar dialog. month must be a number between 1 and 12 inclusive. - --year=YEAR + =year - Specifies the year to be pre-selected in the Calendar dialog. + Specifies the year that is selected in the calendar dialog. - --date-format=FORMAT + =format - Specifies the format to be returned from the Calendar dialog after - the selection has been made. The default format depends - on your locale. The format must be of strftime - style, for example "%A %d/%m%y". + Specifies the format that is returned from the calendar dialog after date selection. The default format depends on your locale. format must be a format that is acceptable to the strftime function, for example %A %d/%m/%y. @@ -293,27 +395,32 @@ - The following script is an example of how to use the Calendar dialog: + The following example script shows how to create a calendar dialog: + + + #!/bin/sh + - - #!/bin/sh + if zenity --calendar \ + --title="Select a Date" \ + --text="Click on a date to select that date." \ + --day=10 --month=8 --year=2004 + then echo $? + else echo "No date selected" + fi + - if zenity --calendar --title="Calendar selection" --text="Select a date from below" --day=18 --month=1 --year=2003 - then echo $? - else echo "No date selected" - fi -
- Calendar dialog example + Calendar Dialog Example - &app; Calendar dialog example + &app; calendar dialog example @@ -321,71 +428,173 @@ - - - Text Entry Dialog + + + + File Selection Dialog - Use --entry to create a Text Entry dialog. - &app; returns the - contents of the text entry to standard error. - - - The Text Entry dialog has the following options: + Use the option to create a file selection dialog. &app; returns the selected files or directories to standard error. + + + The file selection dialog supports the following options: - --text=TEXT + =filename - Specifies the text to appear in the Text Entry dialog. + Specifies the file or directory that is selected in the file selection dialog when the dialog is first shown. - --entry-text=TEXT + - Specifies the text to appear in the entry field of the Text Entry dialog. + Allows the selection of multiple filenames in the file selection dialog. - --hide-text + =separator - Specifies that the text in the entry field of the Text Entry dialog be hidden. + Specifies the string that is used to divide the returned list of filenames. - The following script is an example of how to use the Text Entry dialog: + The following example script shows how to create a file selection dialog: + + + #!/bin/sh + + FILE=`zenity --file-selection --title="Select a File"` + + case $? in + 0) + echo "\"$FILE\" selected.";; + 1) + echo "No file selected.";; + -1) + echo "No file selected.";; + esac + + - - #!/bin/sh +
+ File Selection Dialog Example + + + + + + + &app; file selection dialog example + + + +
- if zenity --entry --title="Add a new entry" --text="Enter your _Password" --hide-text - then echo $? - else echo "No password entered" - fi -
+
+ + + + + List Dialog + + + Use the option to create a list dialog. &app; returns the entries in the first column of text of selected rows to standard error. -
- Text Entry dialog example + + Data for the dialog must specified column by column, row by row. Data can be provided to the dialog through standard input. Each entry must be separated by a newline character. + + + + If you use the or options, each row must start with either 'TRUE' or 'FALSE'. + + + + The list dialog supports the following options: + + + + + + =column + + Specifies the column headers that are displayed in the list dialog. You must specify a option for each column that you want to display in the dialog. + + + + + + + + Specifies that the first column in the list dialog contains check boxes. + + + + + + + + Specifies that the first column in the list dialog contains radio boxes. + + + + + + + + Allows the displayed items to be edited. + + + + + + =separator + + Specifies what string is used when the list dialog returns the selected entries. + + + + + + + + The following example script shows how to create a list dialog: + + #!/bin/sh + + zenity --list \ + --title="Choose the Bugs You Wish to View" \ + --column="Bug Number" --column="Severity" --column="Description" \ + 992383 Normal "GtkTreeView crashes on multiple selections" \ + 293823 High "GNOME Dictionary does not handle proxy" \ + 393823 Critical "Menu editing does not work in GNOME 2.0" + + + + +
+ List Dialog Example - + - &app; Text Entry dialog example + &app; list dialog example
+ @@ -394,62 +603,55 @@ Message Dialogs - &app; can create four types of message dialog. - Use the --text option to set the text shown in the - dialog. + &app; can create four types of message dialog: - - Warning Dialog + + + Error + + + Information + + + Question + + + Warning + + + + +For each type, use the option to specify the text that is displayed in the dialog. + + + + Error Dialog - Use --warning to create a Warning dialog. + Use the option to create an error dialog. - The following script is an example of how to use the Warning message dialog: + The following example script shows how to create an error dialog: - - #!/bin/bash + + #!/bin/bash - FILE_TYPE=$(file -b $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS|awk '{ print $1}') + zenity --error \ + --text="Could not find /var/log/syslog." + - if [ "$FILE_TYPE" != "PNG" ]; then - zenity --warning --text="Could not rotate image :" --hide-text - fi - - - -
- Warning dialog example - - - - - - - &app; Warning dialog example - - - -
-
- - - Error Dialog - - - Use --error to create an Error dialog.
- Error dialog example + Error Dialog Example - &app; Error dialog example + &app; error dialog example @@ -460,18 +662,30 @@ Information Dialog - Use --info to create an Information dialog. + Use the option to create an information dialog. + + + + The following example script shows how to create an information dialog: + + + #!/bin/bash + + zenity --info \ + --text="Merge complete. Updated 3 of 10 files." + +
- Informational dialog example + Information Dialog Example - &app; Informational dialog example + &app; information dialog example @@ -482,209 +696,159 @@ Question Dialog - Use --question to create a Question dialog. + Use the option to create a question dialog. + + + + The following example script shows how to create a question dialog: + + + #!/bin/bash + + zenity --question \ + --text="Are you sure you wish to proceed?" + +
- Question dialog example + Question Dialog Example - &app; Question dialog example + &app; question dialog example
- - - - - - File Selection Dialog - - - Use --file-selection to create a file selection - dialog. &app; returns - the files or directories selected to standard error. - - - The File Selection dialog has the following options: - - - - - - --filename=FILENAME - - Specifies the file or directory to be selected in the File Selection dialog - when the dialog is first shown. - - + + Warning Dialog - - --multiple - - Allows selection of multiple filenames in the File Selection dialog. - - + + Use the option to create a warning dialog. + - - --separator=SEPARATOR - - Specifies the string used to divide the returned list of filenames. - - + + The following example script shows how to create a warning dialog: - + + #!/bin/bash + + zenity --warning \ + --text="Disconnect the power cable to avoid electrical shock." + - - The following script is an example of how to use the File Selection dialog: - - - #!/bin/sh - - FILE=`zenity --file-selection --title="Select a file"' - - case $? in - 0) - echo "\"$FILE\" selected.";; - 1) - echo "No file selected.";; - -1) - echo "No file selected.";; - esac - - + -
- File Selection dialog example - - - - - - - &app; File Selection dialog example - - - -
+
+ Warning Dialog Example + + + + + + + &app; warning dialog example + + + +
+
- - - - List Dialog + - - Use --list to create a list dialog. &app; returns the entries in - the first column of text of selected rows to standard error. - + + Progress Dialog - Every column must be specified by the --column option. Data for - the dialog must specified column by column, row by row. Data can be provided to - the dialog through standard input. Each entry must be separated by a newline. + Use the option to create a progress dialog. - If you use the --checklist or --radiolist - options, each row must start with either 'TRUE' or 'FALSE'. + &app; reads data from standard input line by line. If a line is prefixed with #, the text is updated with the text on that line. If a line contains only a number, the percentage is updated with that number. - + - The List dialog has the following options: + The progress dialog supports the following options: - --text=TEXT - - Specifies the text to appear in the List dialog. - - - - - --column=COLUMN + =text - Specifies the column headers to appear in the List dialog. - You must call the --column option for - each column you want to appear in the dialog. - + Specifies the text that is displayed in the progress dialog. - --checklist + =percentage - Specifies that the first column should contain check boxes in the List dialog. - + Specifies the initial percentage that is set in the progress dialog. - --radiolist + - Specifies that the first column should contain radio boxes in the List dialog. - - - - - - --editable - - Allows the displayed items to be edited. - - - - - - --seperator=SEPERATOR - - Specifies what string should be used when the List dialog returns the selected entries. - + Closes the progress dialog when 100% has been reached. - --print-column=COLUMN + - Specifies what column should be printed to standard output. The default is to return - the first column. 'ALL' may be specified to print out all columns. - + Specifies that the progress bar pulsates until an EOF character is read from standard input. - The following commandline is an example of how to use the List dialog: - - zenity --list --title="Choose bugs you wish to view" \ - --text="Select items from the list below." \ - --column="Bug Number" --column="Severity" --column="Description" \ - 992383 Normal "GtkTreeView crashes on multiple selections" \ - 293823 High "GNOME Dictionary does not handle proxy" \ - 393823 Critical "Menu editing does not work in GNOME 2.0" - + The following example script shows how to create a progress dialog: + + #!/bin/sh + ( + echo "10" ; sleep 1 + echo "# Updating mail logs" ; sleep 1 + echo "20" ; sleep 1 + echo "# Resetting cron jobs" ; sleep 1 + echo "50" ; sleep 1 + echo "This line will just be ignored" ; sleep 1 + echo "75" ; sleep 1 + echo "# Rebooting system" ; sleep 1 + echo "100" ; sleep 1 + ) | + zenity --progress \ + --title="Update System Logs" \ + --text="Scanning mail logs..." \ + --percentage=0 + + if [ "$?" = -1 ] ; then + zenity --error \ + --text="Update canceled." + fi + + + -
- List Selection dialog example +
+ Progress Dialog Example - + - &app; List dialog example + &app; progress dialog example @@ -692,96 +856,74 @@ - - - - Progress Dialog + - - Use --progress to create a Progress dialog. - + + Text Entry Dialog - &app; reads data from - standard input line by line. If a line is prefixed with a hash (#), the text is - updated with the text on that line. If a line contains only a number, the percentage - is updated with that number. - - - - The Progress dialog has the following options: + Use the option to create a text entry dialog. &app; returns the contents of the text entry to standard error. + + + The text entry dialog supports the following options: - --text=TEXT + =text - Specifies the text to appear in the Progress dialog. + Specifies the text that is displayed in the text entry dialog. - --percentage=PERCENTAGE + =text - Specifies the initial percentage that should be set in the Progress dialog. + Specifies the text that is displayed in the entry field of the text entry dialog. - --auto-close + - Closes the progress dialog when 100% has been reached. - - - - - --pulsate - - Specifies that the Progress dialog should pulsate until an EOF character is read - from standard input. + Hides the text in the entry field of the text entry dialog. - The following script is an example of how to use the Progress dialog: - - #!/bin/sh - ( - echo "10" ; sleep 1 - echo "# Updating mail logs" ; sleep 1 - echo "20" ; sleep 1 - echo "# Resetting cron jobs" ; sleep 1 - echo "50" ; sleep 1 - echo "This line will just be ignored" ; sleep 1 - echo "75" ; sleep 1 - echo "# Rebooting system" ; sleep 1 - echo "100" ; sleep 1 - ) | - zenity --progress --title="Update System Logs" --text="Scanning mail logs..." --percentage=0 - - if [ "$?" = -1 ] ; then - zenity --error --text="Update cancelled." - fi - + The following example script shows how to create a text entry dialog: + + + #!/bin/sh + + if zenity --entry \ + --title="Add an Entry" \ + --text="Enter your _password:" \ + --entry-text "password" \ + --hide-text + then echo $? + else echo "No password entered" + fi + + -
- Progress dialog example +
+ Text Entry Dialog Example - + - &app; Progress dialog example + &app; text entry dialog example
- @@ -790,60 +932,63 @@ Text Information Dialog - Use --text-info to create a Text Information dialog. + Use the option to create a text information dialog. - The Text Information dialog has the following options: + The text information dialog supports the following options: - --filename=FILENAME + =filename - Specifies a file to be loaded in the Text Information dialog. + Specifies a file that is loaded in the text information dialog. - --editable + - Allows the displayed text to be edited. The edited text is - returned to standard error when the dialog is closed. + Allows the displayed text to be edited. The edited text is returned to standard error when the dialog is closed. - The following script is an example of how to use the Text Infomation dialog: - - #!/bin/sh - - FILE=`zenity --file-selection --title="Select a file"' - - case $? in - 0) - zenity --text-info --title=$FILE --filename=$FILE --editable 2>/tmp/tmp.txt - - 1) - echo "No file selected.";; - -1) - echo "No file selected.";; - esac - + The following example script shows how to create a text information dialog: + + #!/bin/sh + + FILE=`zenity --file-selection \ + --title="Select a File"` + + case $? in + 0) + zenity --text-info \ + --title=$FILE \ + --filename=$FILE \ + --editable 2>/tmp/tmp.txt;; + 1) + echo "No file selected.";; + -1) + echo "No file selected.";; + esac + +
- Text Information dialog example + Text Information Dialog Example - &app; Text Information dialog example + &app; text information dialog example @@ -851,76 +996,4 @@ - - - - Miscellaneous Options - - - &app; has the following miscellaneous options: - - - - - - --about - - Displays some information about &app;. - - - - - --version - - Prints the version number of &app;. - - - - - - - - - - License - - This program is free software; you can redistribute - it and/or modify it under the terms of the - - GNU General Public License - - as published by the Free Software Foundation; either - version 2 of the License, of (at your option) any later - version. - - - This program is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A - PARTICULAR PURPOSE. See the - GNU General Public License - for more details. - - - A copy of the - GNU General Public License - is included as an appendix to the - GNOME Users Guide - . You may also obtain a copy of the - GNU General Public License - from the Free Software Foundation by visiting - - their Web site - - or by writing to -
Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, - MA - 02111-1307 - USA -
-
-
-
-- cgit