summaryrefslogtreecommitdiff
path: root/ui/gtk/pixmap_save.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-05-14 21:53:57 +0000
committerGuy Harris <guy@alum.mit.edu>2013-05-14 21:53:57 +0000
commit89afc91ccfd137785840d9ced9ec1929e6a13a5b (patch)
treedc9b39f072b5df6440a12c570dbab907c46cc974 /ui/gtk/pixmap_save.c
parent732380177904489e2d45d1b418080e0187b71d11 (diff)
downloadwireshark-89afc91ccfd137785840d9ced9ec1929e6a13a5b.tar.gz
Give file_selection_new() an argument to specify the parent window of
the file selection dialog. Call gtk_file_chooser_set_do_overwrite_confirmation() in file_selection_new() for FILE_SELECTION_SAVE file selection dialogs, rather than doing it in the individual callers of file_selection_new(). Use gtk_dialog_set_alternative_button_order() in file_selection_new() to set the alternative button order, rather than using #ifdefs. Use file_selection_new() and file_selection_run() in the graph analysis code. (We should clean up other code that uses file_selection_new() to use file_selection_run(), and clean up other code that uses gtk_file_chooser_dialog_new() to use file_selection_new() and file_selection_run().) svn path=/trunk/; revision=49308
Diffstat (limited to 'ui/gtk/pixmap_save.c')
-rw-r--r--ui/gtk/pixmap_save.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/gtk/pixmap_save.c b/ui/gtk/pixmap_save.c
index a2fdecce2b..9122b7b127 100644
--- a/ui/gtk/pixmap_save.c
+++ b/ui/gtk/pixmap_save.c
@@ -58,7 +58,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
GdkPixbufFormat *pixbuf_format;
GtkWidget *main_vb, *save_as_type_hb, *type_lb, *type_cm;
GSList *file_formats,*ffp;
- GdkWindow *parent;
+ GtkWidget *parent;
gchar *format_name;
guint format_index = 0;
@@ -84,9 +84,10 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
return;
}
+ parent = gtk_widget_get_toplevel(w);
save_as_w = file_selection_new("Wireshark: Save Graph As ...",
+ GTK_WINDOW(parent),
FILE_SELECTION_SAVE);
- gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(save_as_w), TRUE);
/* Container for each row of widgets */
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 0, FALSE);
@@ -111,7 +112,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
pixbuf_format = (GdkPixbufFormat *)ffp->data;
if (gdk_pixbuf_format_is_writable(pixbuf_format)) {
format_name = gdk_pixbuf_format_get_name(pixbuf_format);
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(type_cm),
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(type_cm),
format_name);
if (!(g_ascii_strcasecmp(format_name, "png")))
default_index = format_index;
@@ -126,8 +127,7 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr _U_)
gtk_widget_show(save_as_w);
window_present(save_as_w);
- parent = gtk_widget_get_parent_window(w);
- gdk_window_set_transient_for(gtk_widget_get_window(save_as_w), parent);
+ gtk_window_set_transient_for(GTK_WINDOW(save_as_w), GTK_WINDOW(parent));
/*
* Loop until the user either selects a file or gives up.