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/fileselection.c | |
parent | 99c2048a45c2836b0c55d4a29c82d13b75a1337d (diff) |
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/fileselection.c')
-rw-r--r-- | src/fileselection.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/fileselection.c b/src/fileselection.c index 995ba03..fdd40fd 100644 --- a/src/fileselection.c +++ b/src/fileselection.c @@ -34,11 +34,22 @@ void zenity_fileselection (ZenityData *data, ZenityFileData *file_data) GtkWidget *dialog; gchar *dir; gchar *basename; + GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; zen_data = data; + if (file_data->directory) { + if (file_data->save) + action = GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER; + else + action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER; + } else { + if (file_data->save) + action = GTK_FILE_CHOOSER_ACTION_SAVE; + } + dialog = gtk_file_chooser_dialog_new (NULL, NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, + action, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); |