From Giles Scott:

in GTK+ 2.x, center dialogs on the parent;

	make the file selection dialogs transient for the main window,
	just as other dialogs are.

Update Gerald's e-mail address.

svn path=/trunk/; revision=8503
This commit is contained in:
Guy Harris 2003-09-20 04:59:43 +00:00
parent d4a5694c99
commit d532ea7b17
2 changed files with 12 additions and 4 deletions

View File

@ -1,13 +1,12 @@
/* dlg_utils.c
* Utilities to use when constructing dialogs
*
* $Id: dlg_utils.c,v 1.10 2002/11/10 11:00:29 oabad Exp $
* $Id: dlg_utils.c,v 1.11 2003/09/20 04:59:43 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@ -50,6 +49,7 @@ dlg_window_new(const gchar *title)
win = gtk_window_new(GTK_WINDOW_DIALOG);
#else
win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER_ON_PARENT);
#endif
gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(top_level));
gtk_window_set_title(GTK_WINDOW(win), title);

View File

@ -1,7 +1,7 @@
/* file_dlg.c
* Dialog boxes for handling files
*
* $Id: file_dlg.c,v 1.59 2003/09/15 22:48:42 guy Exp $
* $Id: file_dlg.c,v 1.60 2003/09/20 04:59:43 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -95,6 +95,10 @@ file_open_cmd_cb(GtkWidget *w, gpointer data _U_)
}
file_open_w = gtk_file_selection_new ("Ethereal: Open Capture File");
gtk_window_set_transient_for(GTK_WINDOW(file_open_w), GTK_WINDOW(top_level));
#if GTK_MAJOR_VERSION >= 2
gtk_window_set_position(GTK_WINDOW(file_open_w), GTK_WIN_POS_CENTER_ON_PARENT);
#endif
SIGNAL_CONNECT(file_open_w, "destroy", file_open_destroy_cb, NULL);
#if GTK_MAJOR_VERSION < 2
@ -448,6 +452,10 @@ file_save_as_cmd_cb(GtkWidget *w _U_, gpointer data _U_)
filetype = cfile.cd_t;
file_save_as_w = gtk_file_selection_new ("Ethereal: Save Capture File As");
gtk_window_set_transient_for(GTK_WINDOW(file_save_as_w), GTK_WINDOW(top_level));
#if GTK_MAJOR_VERSION >= 2
gtk_window_set_position(GTK_WINDOW(file_save_as_w), GTK_WIN_POS_CENTER_ON_PARENT);
#endif
SIGNAL_CONNECT(file_save_as_w, "destroy", file_save_as_destroy_cb, NULL);
/* If we've opened a file, start out by showing the files in the directory