For file browsing dialog boxes, the affirmative button should be "OK",
authorGuy Harris <guy@alum.mit.edu>
Thu, 30 Sep 2004 02:02:35 +0000 (02:02 -0000)
committerGuy Harris <guy@alum.mit.edu>
Thu, 30 Sep 2004 02:02:35 +0000 (02:02 -0000)
not "Save".

In UN*X with GTK+ 2.x, put the affirmative button in file dialogs to the
right of the cancel button, as is done with other dialogs.

svn path=/trunk/; revision=12146

gtk/dlg_utils.c
gtk/dlg_utils.h
gtk/print_dlg.c
gtk/print_prefs.c

index 04ea76510f9b7e3de06138c8eddee35f0b768525..6e2c138f4b785d016be25ebedb683e0a4978ec70 100644 (file)
@@ -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
index e8dc130d0a0280d7af68b8e77c7ae77274a66d79..f0cba2c98ef02e6a55f02d987ec49b28f37541ac 100644 (file)
@@ -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
index d73bc57c6d8cff0e1fc2986f9b1e23fd0068e2d4..938c236e261de5e8640f1b73bfd5360fe6563ce6 100644 (file)
@@ -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);
 }
 
 
index a55614b82a3ecdf600f6dca04f55100b80238cd5..ad6e13327a91fd453c85d74d2ad38faab710c45a 100644 (file)
@@ -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);
 }