summaryrefslogtreecommitdiff
path: root/src/fileselection.c
diff options
context:
space:
mode:
authorMike Newman <MikeGTN@src.gnome.org>2003-06-07 14:41:56 +0000
committerMike Newman <MikeGTN@src.gnome.org>2003-06-07 14:41:56 +0000
commit5bade6fe6a14cce50508ee5d510a4560ebe3e421 (patch)
tree35710759f2f1c24923983e246cb86e57b014995d /src/fileselection.c
parent3aab6a19a521c0374ef4c83fd7877154ea8636b5 (diff)
Support user-defined return values via env vars, like dialog did.
Diffstat (limited to 'src/fileselection.c')
-rw-r--r--src/fileselection.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fileselection.c b/src/fileselection.c
index ec46f0c..69fc658 100644
--- a/src/fileselection.c
+++ b/src/fileselection.c
@@ -35,7 +35,7 @@ void zenity_fileselection (ZenityData *data, ZenityFileData *file_data)
glade_dialog = zenity_util_load_glade_file ("zenity_fileselection_dialog");
if (glade_dialog == NULL) {
- data->exit_code = -1;
+ data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
return;
}
@@ -73,19 +73,20 @@ zenity_fileselection_dialog_response (GtkWidget *widget, int response, gpointer
switch (response) {
case GTK_RESPONSE_OK:
- zen_data->exit_code = 0;
+ zen_data->exit_code = zenity_util_return_exit_code
+ (ZENITY_OK);
g_printerr ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (widget)));
gtk_main_quit ();
break;
case GTK_RESPONSE_CANCEL:
- zen_data->exit_code = 1;
+ zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
gtk_main_quit ();
break;
default:
/* Esc dialog */
- zen_data->exit_code = 1;
+ zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
}