diff options
author | Glynn Foster <glynn.foster@sun.com> | 2003-01-13 16:48:45 +0000 |
---|---|---|
committer | Glynn Foster <gman@src.gnome.org> | 2003-01-13 16:48:45 +0000 |
commit | 69636459e1faf1ce41685550cf7aec59acfbac39 (patch) | |
tree | 738383852b10b0fcdc7e1d82e4e0e0d1dc301514 /src/main.c | |
parent | Fix up the date string, although I guess this should be localized. (diff) | |
download | zenity-69636459e1faf1ce41685550cf7aec59acfbac39.tar.gz zenity-69636459e1faf1ce41685550cf7aec59acfbac39.tar.bz2 zenity-69636459e1faf1ce41685550cf7aec59acfbac39.zip |
Improve error handling. Make --list actually return something useful,
2003-01-13 Glynn Foster <glynn.foster@sun.com>
* src/main.c: Improve error handling.
* src/tree.c: Make --list actually return something
useful, although I still need to actually seperate
things out so it's actually decipherable.
* TODO: Update accordingly.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -842,6 +842,9 @@ void zenity_parse_options_callback (poptContext ctx, const char *arg, void *data) { + static gboolean parse_option_text = FALSE; + static gboolean parse_option_file = FALSE; + if (reason == POPT_CALLBACK_REASON_POST) { return; } @@ -956,6 +959,12 @@ void zenity_parse_options_callback (poptContext ctx, case OPTION_QUESTIONTEXT: case OPTION_PROGRESSTEXT: case OPTION_WARNINGTEXT: + if (parse_option_text == TRUE) { + g_printerr (_("--text given twice for the same dialog\n")); + zenity_free_parsing_options (); + exit (-1); + } + switch (results->mode) { case MODE_CALENDAR: results->calendar_data->dialog_text = g_strdup (arg); @@ -977,6 +986,7 @@ void zenity_parse_options_callback (poptContext ctx, zenity_free_parsing_options (); exit (-1); } + parse_option_text = TRUE; break; case OPTION_DAY: if (results->mode != MODE_CALENDAR) { @@ -1045,6 +1055,12 @@ void zenity_parse_options_callback (poptContext ctx, break; case OPTION_FILENAME: case OPTION_TEXTFILE: + if (parse_option_file == TRUE) { + g_printerr (_("--filename given twice for the same dialog\n")); + zenity_free_parsing_options (); + exit (-1); + } + switch (results->mode) { case MODE_FILE: results->file_data->uri = g_strdup (arg); @@ -1057,6 +1073,7 @@ void zenity_parse_options_callback (poptContext ctx, zenity_free_parsing_options (); exit (-1); } + parse_option_file = TRUE; break; case OPTION_COLUMN: if (results->mode != MODE_LIST) { |