diff options
author | Glynn Foster <glynn.foster@sun.com> | 2004-09-13 04:56:26 +0000 |
---|---|---|
committer | Glynn Foster <gman@src.gnome.org> | 2004-09-13 04:56:26 +0000 |
commit | 03f3e5b060977c9566bd66bc8e4eaac14c4ee781 (patch) | |
tree | a9c6c9dfcfcf0392c5da3ceed7e337b097343a98 /src/main.c | |
parent | Post release bump, for unstable 2.9.x development. (diff) | |
download | zenity-03f3e5b060977c9566bd66bc8e4eaac14c4ee781.tar.gz zenity-03f3e5b060977c9566bd66bc8e4eaac14c4ee781.tar.bz2 zenity-03f3e5b060977c9566bd66bc8e4eaac14c4ee781.zip |
Update Update. Patch from Lucas Rocha to implement save and directory
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* THANKS: Update
* src/about.c: Update.
* src/fileselection.c, src/main.c, src/zenity.h:
Patch from Lucas Rocha to implement save and
directory selection in the file selection dialog.
Fixes #138342.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -94,6 +94,8 @@ enum { OPTION_INFOTEXT, OPTION_FILENAME, OPTION_MULTIFILE, + OPTION_DIR, + OPTION_SAVE, OPTION_TEXTFILENAME, OPTION_LISTTEXT, OPTION_COLUMN, @@ -441,6 +443,24 @@ struct poptOption file_selection_options[] = { NULL }, { + "directory", + '\0', + POPT_ARG_NONE, + NULL, + OPTION_DIR, + N_("Activate directory-only selection"), + NULL + }, + { + "save", + '\0', + POPT_ARG_NONE, + NULL, + OPTION_SAVE, + N_("Activate save mode"), + NULL + }, + { "separator", '\0', POPT_ARG_STRING, @@ -971,6 +991,8 @@ zenity_init_parsing_options (void) { results->calendar_data->year = 0; results->calendar_data->dialog_text = NULL; results->file_data->multi = FALSE; + results->file_data->directory = FALSE; + results->file_data->save = FALSE; results->file_data->separator = g_strdup ("|"); results->text_data->editable = FALSE; results->tree_data->separator = g_strdup ("|"); @@ -1409,6 +1431,18 @@ zenity_parse_options_callback (poptContext ctx, results->file_data->multi = TRUE; break; + case OPTION_DIR: + if (results->mode != MODE_FILE) + zenity_error ("--directory", ERROR_SUPPORT); + + results->file_data->directory = TRUE; + break; + case OPTION_SAVE: + if (results->mode != MODE_FILE) + zenity_error ("--save", ERROR_SUPPORT); + + results->file_data->save = TRUE; + break; case OPTION_COLUMN: if (results->mode != MODE_LIST) zenity_error ("--column", ERROR_SUPPORT); |