From 18760d406d64f71f7ca6fec5a7a01978418fa8f5 Mon Sep 17 00:00:00 2001 From: Glynn Foster Date: Sat, 18 Jan 2003 18:02:14 +0000 Subject: Only some examples and some screenshots and we're mostly done for a first 2003-01-18 Glynn Foster * help/C/zenity.xml: Only some examples and some screenshots and we're mostly done for a first draft. * src/calendar.c: Don't set the text if it's NULL. * src/main.c: Swap the order of the commandline dialogs so that we're alphabetical. * src/zenity.glade: Add some default strings. --- ChangeLog | 12 ++ help/C/zenity.xml | 401 ++++++++++++++++++++++++++++++++++++++++++++++-------- src/calendar.c | 4 +- src/main.c | 24 ++-- src/zenity.glade | 2 +- 5 files changed, 375 insertions(+), 68 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0effc2..79b6664 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2003-01-18 Glynn Foster + + * help/C/zenity.xml: Only some examples and some screenshots + and we're mostly done for a first draft. + + * src/calendar.c: Don't set the text if it's NULL. + + * src/main.c: Swap the order of the commandline dialogs so + that we're alphabetical. + + * src/zenity.glade: Add some default strings. + 2003-01-18 Glynn Foster * data/Makefile.am, data/zenity.png, src/about.c: Hooray! diff --git a/help/C/zenity.xml b/help/C/zenity.xml index 53e96f6..95984ac 100644 --- a/help/C/zenity.xml +++ b/help/C/zenity.xml @@ -86,74 +86,118 @@ --calendar - Display a Calendar dialog + Display a Calendar dialog. --entry - Display a Text Entry dialog + Display a Text Entry dialog. - + --error - Display an Error dialog + Display an Error dialog. - + --info - Display an Informational dialog + Display an Informational dialog. --file-selection - Display a File Slection dialog + Display a File Selection dialog. --list - Display a List dialog + Display a List dialog. --progress - Display a Progress dialog + Display a Progress dialog. --question - Display a Question dialog + Display a Question dialog. --text-info - Display a Text Information dialog + Display a Text Information dialog. --warning - Display a Warning dialog + Display a Warning dialog. + + + + + + Basic Use + + + &app; can only be used to create relatively simple dialogs, but is especially useful + when used in scripts. When a user has completed an action requested of them, and the + dialog closes, &app; prints any text specific to the dialog to standard error and + an exit code is returned. Information about what text is printed to standard error will be + detailed in the individual dialog sections. + + + + The following exit codes are observed by &app;: + + + + + + 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. + + + + + @@ -176,72 +220,321 @@ --title=TITLE - Specify the title of a dialog + Specify the title of a dialog. --window-icon=ICON_PATH - Specify the icon that should appear in the window frame of the dialog + Specify the icon that should appear in the window frame of the dialog. + + + + + + + + + + + Calendar + + + To create a Calendar dialog, use --calendar. &app; will return the + date selected to standard error. The following list of options are also available for + the Calendar dialog: + + + + + + --text=TEXT + + Specify the text to appear in the Calendar dialog. + + + + + --day=DAY + + Specify the day to be pre-selected in the Calendar dialog. This must be a + number between 1 and 31. + + + + + + --month=MONTH + + Specify the day to be pre-selected in the Calendar dialog. This must be + a number between 1 and 12. + + + + + + --year=YEAR + + Specify the year to be pre-selected in the Calendar dialog. + + + + + --data-format=FORMAT + + Specify the format to be returned from the Calendar dialog after + the selection has been made. This defaults to a format depending + on your locale. The format must be of strftime + style eg. "%A %d/%m%y" + + + - -Calendar options - --text=STRING Set the dialog text - --day=INT Set the calendar day - --month=INT Set the calendar month - --year=INT Set the calendar year - --date-format=STRING Set the format for the returned date + + Text Entry -Text entry options - --text=STRING Set the dialog text - --entry-text=STRING Set the entry text - --hide-text Hide the entry text + + To create a Text Entry dialog, use --text-entry. &app; returns the + contents of the text entry to standard error. The following list of options are also + available for the Text Entry dialog: + -Info options - --text=STRING Set the dialog text + -Error options - --text=STRING Set the dialog text + + --text=TEXT + + Specify the text to appear in the Text Entry dialog. + + -File selection options - --filename=FILENAME Set the filename + + --entry-text=TEXT + + Specify the text to appear in the entry field of the Text Entry dialog. + + -List options - --column=STRING Set the column header - --checklist Use check boxes for first column - --radiolist Use radio buttons for first column - --separator=STRING Set output separator character + + --hide-text + + Specify that the text in the entry field of the Text Entry dialog be hidden. + + -Progress options - --text=STRING Set the dialog text - --percentage=INT Set initial percentage - --pulsate Pulsate progress bar + + + -Question options - --text=STRING Set the dialog text + -Text options - --filename=FILENAME Open file + + Messages -Warning options - --text=STRING Set the dialog text + + There are 4 types of message dialogs in &app; - Error, Informational, Question and Warning. To + create an Error dialog, use --error. To create an Informational dialog, use + --info. To create a Question dialog, use --question. To + create a Warning dialog, use --question. The following list of options is + available for the message dialogs. + -Miscellaneous options - --about About zenity - --version Print version + -Help options - -?, --help Show this help message - --usage Display brief usage message - ---> + + --text=TEXT + + Specify the text to appear in the message dialog. + + + + + + + + + + + + + File Selection + + + To create a File Selection dialog, use --file-selection. &app; returns + the file or directory selected to standard error. The following list of options are also + available for the File Selection dialog: + + + + + + --filename=FILENAME + + Specify the file or directory to be pre-selected in the File Selection dialog. + + + + + + + + + + + + + Lists + + + To create a List dialog, use --list. &app; returns the entries of + the first columns selected to standard error. If --checklist or + --radiolist is used, then &app; will return the entries of the + second columns selected to standard error. The following list of options are also + available for the File Selection dialog: + + + + + + --column=COLUMN + + Specify the column headers to appear in the List dialog. This option must be + called for each column that you want to appear in the dialog. + + + + + + --checklist + + Specify if the first column should contain check boxes in the List dialog. + + + + + + --radiolist + + Specify if the first column should contain radio boxes in the List dialog. + + + + + + --seperator=SEPERATOR + + Specify what seperator character should be used when the List dialog returns the selected entries. The + default character is '\'. If you want to specify a newline, use '\n'. + + + + + + + + + + + + + + Progress + + + To create a Progress dialog, use --progress. The following list + of options are also available for the Progress dialog: + + + + + + --text=TEXT + + Specify the text to appear in the Progress dialog. + + + + + --percentage=PERCENTAGE + + Specify the initial percentage that should be set in the Progress dialog. + + + + + --pulsate + + Specify if the Progress dialog should pulsate until an EOF character is read + from standard input. + + + + + + + + + + + + Text Information + + + To create a Text Information dialog, use --text-info. The following list + of options are also available for the Text Information dialog: + + + + + + --filename=FILENAME + + Specify the file to be loaded in the Text Information dialog. + + + + + + + + + + + + + Miscellaneous + + + The following list of options are also available for &app;: + + + + + + --about + + Display some information about &app;. + + + + + --version + + Print the version number of &app;. + + + + + + diff --git a/src/calendar.c b/src/calendar.c index 65c2bf9..68956e7 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -64,7 +64,9 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) zenity_util_set_window_icon (dialog, ZENITY_IMAGE_FULLPATH ("zenity-calendar.png")); text = glade_xml_get_widget (glade_dialog, "zenity_calendar_text"); - gtk_label_set_text (GTK_LABEL (text), cal_data->dialog_text); + + if (cal_data->dialog_text) + gtk_label_set_text (GTK_LABEL (text), cal_data->dialog_text); calendar = glade_xml_get_widget (glade_dialog, "zenity_calendar"); diff --git a/src/main.c b/src/main.c index 58bb13e..0e76247 100644 --- a/src/main.c +++ b/src/main.c @@ -137,21 +137,21 @@ struct poptOption options[] = { NULL }, { - "info", + "file-selection", '\0', POPT_ARG_NONE, NULL, - OPTION_INFO, - N_("Display info dialog"), + OPTION_FILE, + N_("Display file selection dialog"), NULL }, { - "file-selection", + "info", '\0', POPT_ARG_NONE, NULL, - OPTION_FILE, - N_("Display file selection dialog"), + OPTION_INFO, + N_("Display info dialog"), NULL }, { @@ -614,27 +614,27 @@ struct poptOption application_options[] = { NULL, '\0', POPT_ARG_INCLUDE_TABLE, - info_options, + error_options, 0, - N_("Info options"), + N_("Error options"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, - error_options, + file_selection_options, 0, - N_("Error options"), + N_("File selection options"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, - file_selection_options, + info_options, 0, - N_("File selection options"), + N_("Info options"), NULL }, { diff --git a/src/zenity.glade b/src/zenity.glade index 3ea0bab..f22c101 100644 --- a/src/zenity.glade +++ b/src/zenity.glade @@ -74,7 +74,7 @@ True - Select a date from below + Select a date from below. False True GTK_JUSTIFY_LEFT -- cgit v1.2.3-54-g00ecf