diff --git a/ChangeLog b/ChangeLog index 2402157..6251285 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,35 @@ +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. + 2004-08-17 Glynn Foster * src/about.c: Add translator comment from Christian Rose, diff --git a/help/C/figures/zenity-calendar-screenshot.png b/help/C/figures/zenity-calendar-screenshot.png index 9058931..5dc3be6 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 2726664..39d2fb2 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 36720d6..d26e029 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 6c0f47c..cc0d1a7 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 3dad60d..abb898e 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 7f36824..6abf517 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 56ba2a3..cf01c5e 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 1ed334d..e536397 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 4efee26..686b600 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 fe6ffce..57f3308 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 0000000..f03a73f --- /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 0000000..cf0f45e --- /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 0000000..f470f66 --- /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 0000000..7d93857 --- /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 0000000..e9abe1d --- /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 0000000..2c19cfb --- /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 0000000..cc8304d --- /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 0000000..225c90a --- /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 0000000..6ed9374 --- /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 0000000..4afd006 --- /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 0000000..711e51d --- /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 0000000..a39af9a --- /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 a36c518..1c0c646 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 4dc745d..66c99a0 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,148 +108,159 @@ 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 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. + + + - When the user closes the dialog, - &app; prints text produced by the dialog to standard error. - - - - 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 - - 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". - + + 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 + + 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. + + + + + - - 0 - - The user has pressed either 'OK' or 'Close'. - - - - - 1 - - The user has pressed either 'Cancel' or closed the dialog through the window functions. - - + - - -1 - - An unexpected error has occurred. - - - + - - - - - + General Options - All dialogs have the following general options: + All &app; dialogs support the following general options: - --title=TITLE + =title Specifies the title of a dialog. - --window-icon=ICON_PATH + =icon_path - Specifies the icon that should appear in the window frame of the dialog. + Specifies the icon that is displayed in the window frame of the dialog. - --width=WIDTH + =width Specifies the width of the dialog. - --height=HEIGHT + =height Specifies the height of the dialog. @@ -229,63 +268,126 @@ - + + + + + Help Options + + + &app; provides the following help options: + + + + + + + + Displays help text. You can also use -? to specify this option. + + + + + + + Displays brief usage text. + + + + + + + + + + + Miscellaneous Options + + + &app; also provides the following miscellaneous options: + + + + + + + + Displays the About &appname; dialog, which contains &app; version information, copyright information, and developer information. + + + + + + + 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,186 +428,6 @@ - - - - Text Entry 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: - - - - - - --text=TEXT - - Specifies the text to appear in the Text Entry dialog. - - - - - --entry-text=TEXT - - Specifies the text to appear in the entry field of the Text Entry dialog. - - - - - --hide-text - - Specifies that the text in the entry field of the Text Entry dialog be hidden. - - - - - - - The following script is an example of how to use the Text Entry dialog: - - - #!/bin/sh - - if zenity --entry --title="Add a new entry" --text="Enter your _Password" --hide-text - then echo $? - else echo "No password entered" - fi - - - -
- Text Entry dialog example - - - - - - - &app; Text Entry dialog example - - - -
-
- - - - - Message Dialogs - - - &app; can create four types of message dialog. - Use the --text option to set the text shown in the - dialog. - - - Warning Dialog - - - Use --warning to create a Warning dialog. - - - - The following script is an example of how to use the Warning message dialog: - - - #!/bin/bash - - FILE_TYPE=$(file -b $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS|awk '{ print $1}') - - 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 - - - - - - - &app; Error dialog example - - - -
-
- - - Information Dialog - - - Use --info to create an Information dialog. - - -
- Informational dialog example - - - - - - - &app; Informational dialog example - - - -
-
- - - Question Dialog - - - Use --question to create a Question dialog. - - -
- Question dialog example - - - - - - - &app; Question dialog example - - - -
-
- -
@@ -508,68 +435,65 @@ File Selection Dialog - Use --file-selection to create a file selection - dialog. &app; returns - the files or directories selected to standard error. + Use the option to create a file selection dialog. &app; returns the selected files or directories to standard error. - The File Selection dialog has the following options: + The file selection dialog supports the following options: - --filename=FILENAME + =filename - Specifies the file or directory to be selected in the File Selection dialog - when the dialog is first shown. + Specifies the file or directory that is selected in the file selection dialog when the dialog is first shown. - --multiple + - Allows selection of multiple filenames in the File Selection dialog. + Allows the selection of multiple filenames in the file selection dialog. - --separator=SEPARATOR + =separator - Specifies the string used to divide the returned list of filenames. + Specifies the string that is used to divide the returned list of filenames. - The following script is an example of how to use the File Selection dialog: + The following example script shows how to create a file selection dialog: - - #!/bin/sh + + #!/bin/sh - FILE=`zenity --file-selection --title="Select a file"' + 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 - + case $? in + 0) + echo "\"$FILE\" selected.";; + 1) + echo "No file selected.";; + -1) + echo "No file selected.";; + esac +
- File Selection dialog example + File Selection Dialog Example - &app; File Selection dialog example + &app; file selection dialog example @@ -583,62 +507,49 @@ 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. + Use the option to create a list dialog. &app; returns the entries in the first column of text of selected rows to standard error. - 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. + 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 --checklist or --radiolist - options, each row must start with either 'TRUE' or 'FALSE'. + If you use the or options, each row must start with either 'TRUE' or 'FALSE'. - The List dialog has the following options: + The list dialog supports the following options: - --text=TEXT + =column - Specifies the text to appear in the List dialog. - - - - - --column=COLUMN - - 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 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. - --checklist + - Specifies that the first column should contain check boxes in the List dialog. + Specifies that the first column in the list dialog contains check boxes. - --radiolist + - Specifies that the first column should contain radio boxes in the List dialog. + Specifies that the first column in the list dialog contains radio boxes. - --editable + Allows the displayed items to be edited. @@ -646,18 +557,9 @@ - --seperator=SEPERATOR + =separator - Specifies what string should be used when the List dialog returns the selected entries. - - - - - - --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 what string is used when the list dialog returns the selected entries. @@ -665,26 +567,29 @@ - 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 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 Selection dialog example + List Dialog Example - &app; List dialog example + &app; list dialog example @@ -692,91 +597,258 @@ + + + + Message Dialogs + + + &app; can create four types of message dialog: + + + + Error + + + Information + + + Question + + + Warning + + + + +For each type, use the option to specify the text that is displayed in the dialog. + + + + Error Dialog + + + Use the option to create an error dialog. + + + + The following example script shows how to create an error dialog: + + + #!/bin/bash + + zenity --error \ + --text="Could not find /var/log/syslog." + + + + +
+ Error Dialog Example + + + + + + + &app; error dialog example + + + +
+
+ + + 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." + + + + +
+ Information Dialog Example + + + + + + + &app; information dialog example + + + +
+
+ + + 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 + + + + + + + &app; question dialog example + + + +
+
+ + + Warning Dialog + + + Use the option to create a warning dialog. + + + + The following example script shows how to create a warning dialog: + + + #!/bin/bash + + zenity --warning \ + --text="Disconnect the power cable to avoid electrical shock." + + + + +
+ Warning Dialog Example + + + + + + + &app; warning dialog example + + + +
+
+ +
+ Progress Dialog - Use --progress to create a Progress dialog. + Use the option to create a progress 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. + &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 Progress dialog has the following options: + The progress 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 progress dialog. - --percentage=PERCENTAGE + =percentage - Specifies the initial percentage that should be set in the Progress dialog. + Specifies the initial percentage that is set in the progress 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. + Specifies that the progress bar pulsates until an EOF character is read from standard input. - 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 + 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 + + - if [ "$?" = -1 ] ; then - zenity --error --text="Update cancelled." - fi -
- Progress dialog example + Progress Dialog Example - &app; Progress dialog example + &app; progress dialog example @@ -784,66 +856,139 @@ + + + + Text Entry Dialog + + + 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 + + Specifies the text that is displayed in the text entry dialog. + + + + + =text + + Specifies the text that is displayed in the entry field of the text entry dialog. + + + + + + + Hides the text in the entry field of the text entry dialog. + + + + + + + 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 + + + + +
+ Text Entry Dialog Example + + + + + + + &app; text entry dialog example + + + +
+
+ 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 + The following example script shows how to create a text information dialog: + + #!/bin/sh - FILE=`zenity --file-selection --title="Select a file"' + 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 + - 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 -
-
-
-