diff options
author | Glynn Foster <glynn.foster@sun.com> | 2003-01-06 21:09:22 +0000 |
---|---|---|
committer | Glynn Foster <gman@src.gnome.org> | 2003-01-06 21:09:22 +0000 |
commit | 8924d5c401829efc59380fda8823bedca5994bcb (patch) | |
tree | 9ce3f220f79aa3f449ffcb98f2b11631812dd769 /src/main.c | |
parent | Life is pleasant. Death is peaceful. It's the transition that's troublesome. (diff) | |
download | zenity-8924d5c401829efc59380fda8823bedca5994bcb.tar.gz zenity-8924d5c401829efc59380fda8823bedca5994bcb.tar.bz2 zenity-8924d5c401829efc59380fda8823bedca5994bcb.zip |
I love featuritis. Instead of fixing stuff so it actually works, I add
2003-01-06 Glynn Foster <glynn.foster@sun.com>
* src/main.c, src/msg.c, src/zenity.glade,
src/zenity.h: I love featuritis. Instead of fixing
stuff so it actually works, I add more stuff. Add
support for info dialog.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -35,6 +35,7 @@ typedef enum { MODE_QUESTION, MODE_TEXTINFO, MODE_WARNING, + MODE_INFO, MODE_LAST } ZenityDialogMode; @@ -55,6 +56,7 @@ enum { OPTION_CALENDAR = 1, OPTION_ENTRY, OPTION_ERROR, + OPTION_INFO, OPTION_FILE, OPTION_LIST, OPTION_PROGRESS, @@ -71,6 +73,7 @@ enum { OPTION_INPUTTEXT, OPTION_HIDETEXT, OPTION_ERRORTEXT, + OPTION_INFOTEXT, OPTION_FILENAME, OPTION_COLUMN, OPTION_CHECKLIST, @@ -129,6 +132,15 @@ struct poptOption options[] = { NULL }, { + "info", + '\0', + POPT_ARG_NONE, + NULL, + OPTION_INFO, + N_("Display info dialog"), + NULL + }, + { "file-selection", '\0', POPT_ARG_NONE, @@ -327,6 +339,28 @@ struct poptOption error_options[] = { POPT_TABLEEND }; +struct poptOption info_options[] = { + { + NULL, + '\0', + POPT_ARG_CALLBACK | POPT_CBFLAG_POST, + zenity_parse_options_callback, + 0, + NULL, + NULL + }, + { + "text", + '\0', + POPT_ARG_STRING, + NULL, + OPTION_INFOTEXT, + N_("Set the dialog text"), + NULL + }, + POPT_TABLEEND +}; + struct poptOption file_selection_options[] = { { NULL, @@ -549,6 +583,15 @@ struct poptOption application_options[] = { NULL, '\0', POPT_ARG_INCLUDE_TABLE, + info_options, + 0, + N_("Info options"), + NULL + }, + { + NULL, + '\0', + POPT_ARG_INCLUDE_TABLE, error_options, 0, N_("Error options"), @@ -673,6 +716,7 @@ zenity_free_parsing_options (void) { case MODE_ERROR: case MODE_QUESTION: case MODE_WARNING: + case MODE_INFO: g_free (results->msg_data->dialog_text); break; case MODE_FILE: @@ -730,6 +774,7 @@ main (gint argc, gchar **argv) { case MODE_ERROR: case MODE_QUESTION: case MODE_WARNING: + case MODE_INFO: zenity_msg (results->data, results->msg_data); break; case MODE_FILE: @@ -779,6 +824,10 @@ void zenity_parse_options_callback (poptContext ctx, results->mode = MODE_ERROR; results->msg_data->mode = ZENITY_MSG_ERROR; break; + case OPTION_INFO: + results->mode = MODE_INFO; + results->msg_data->mode = ZENITY_MSG_INFO; + break; case OPTION_FILE: results->mode = MODE_FILE; break; @@ -821,6 +870,7 @@ void zenity_parse_options_callback (poptContext ctx, case MODE_ERROR: case MODE_QUESTION: case MODE_WARNING: + case MODE_INFO: results->msg_data->dialog_text = g_strdup (arg); break; case MODE_PROGRESS: |