For file browsing dialog boxes, the affirmative button should be "OK",

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
This commit is contained in:
Guy Harris 2004-09-30 02:02:35 +00:00
parent 5f57d42dac
commit 2398487dc2
4 changed files with 23 additions and 4 deletions

View 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

View 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

View 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);
}

View 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);
}