aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/dlg_utils.c15
-rw-r--r--gtk/dlg_utils.h6
-rw-r--r--gtk/print_dlg.c3
-rw-r--r--gtk/print_prefs.c3
4 files changed, 23 insertions, 4 deletions
diff --git a/gtk/dlg_utils.c b/gtk/dlg_utils.c
index 04ea76510f..6e2c138f4b 100644
--- a/gtk/dlg_utils.c
+++ b/gtk/dlg_utils.c
@@ -378,11 +378,21 @@ file_selection_new(const gchar *title, file_selection_action_t action)
ok_button_text = GTK_STOCK_OPEN;
break;
+ case FILE_SELECTION_READ_BROWSE:
+ gtk_action = GTK_FILE_CHOOSER_ACTION_OPEN;
+ ok_button_text = GTK_STOCK_OK;
+ break;
+
case FILE_SELECTION_SAVE:
gtk_action = GTK_FILE_CHOOSER_ACTION_SAVE;
ok_button_text = GTK_STOCK_SAVE;
break;
+ case FILE_SELECTION_WRITE_BROWSE:
+ gtk_action = GTK_FILE_CHOOSER_ACTION_SAVE;
+ ok_button_text = GTK_STOCK_OK;
+ break;
+
default:
g_assert_not_reached();
gtk_action = -1;
@@ -390,8 +400,13 @@ file_selection_new(const gchar *title, file_selection_action_t action)
break;
}
win = gtk_file_chooser_dialog_new(title, GTK_WINDOW(top_level), gtk_action,
+#ifndef _WIN32
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ ok_button_text, GTK_RESPONSE_ACCEPT,
+#else
ok_button_text, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+#endif
NULL);
/* If we've opened a file before, start out by showing the files in the directory
diff --git a/gtk/dlg_utils.h b/gtk/dlg_utils.h
index e8dc130d0a..f0cba2c98e 100644
--- a/gtk/dlg_utils.h
+++ b/gtk/dlg_utils.h
@@ -99,8 +99,10 @@ extern GtkWidget *dlg_window_new(const gchar *title);
/** the action a file selection is designed for */
typedef enum {
- FILE_SELECTION_OPEN, /**< open a file */
- FILE_SELECTION_SAVE /**< save/export a file */
+ FILE_SELECTION_OPEN, /**< open a file */
+ FILE_SELECTION_READ_BROWSE, /**< browse for a file to read */
+ FILE_SELECTION_SAVE, /**< save/export a file */
+ FILE_SELECTION_WRITE_BROWSE /**< browse for a file to write to */
} file_selection_action_t;
/** Create a file selection dialog box window that belongs to Ethereal's
diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c
index d73bc57c6d..938c236e26 100644
--- a/gtk/print_dlg.c
+++ b/gtk/print_dlg.c
@@ -321,7 +321,8 @@ export_pdml_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
static void
print_browse_file_cb(GtkWidget *file_bt, GtkWidget *file_te)
{
- file_selection_browse(file_bt, file_te, "Ethereal: Print to File", FILE_SELECTION_SAVE);
+ file_selection_browse(file_bt, file_te, "Ethereal: Print to File",
+ FILE_SELECTION_WRITE_BROWSE);
}
diff --git a/gtk/print_prefs.c b/gtk/print_prefs.c
index a55614b82a..ad6e13327a 100644
--- a/gtk/print_prefs.c
+++ b/gtk/print_prefs.c
@@ -134,7 +134,8 @@ GtkWidget * printer_prefs_show(void)
static void
printer_browse_file_cb(GtkWidget *file_bt, GtkWidget *file_te)
{
- file_selection_browse(file_bt, file_te, "Ethereal: Print to a File", FILE_SELECTION_SAVE);
+ file_selection_browse(file_bt, file_te, "Ethereal: Print to a File",
+ FILE_SELECTION_WRITE_BROWSE);
}