/* color_dlg.c
* Definitions for dialog boxes for color filters
*
- * $Id: color_dlg.c,v 1.47 2004/05/01 17:22:09 obiot Exp $
+ * $Id: color_dlg.c,v 1.48 2004/05/22 19:56:18 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/* dialog window */
edit_dialog = dlg_window_new ("Ethereal: Edit Color Filter");
gtk_window_set_default_size(GTK_WINDOW(edit_dialog), 500, -1);
- /* gtk_window_set_position(GTK_WINDOW(edit_dialog), GTK_WIN_POS_MOUSE); */
OBJECT_SET_DATA(edit_dialog, "edit_dialog", edit_dialog);
colorf->edit_dialog = edit_dialog;
/* dlg_utils.c
* Utilities to use when constructing dialogs
*
- * $Id: dlg_utils.c,v 1.30 2004/05/21 00:25:04 ulfl Exp $
+ * $Id: dlg_utils.c,v 1.31 2004/05/22 19:56:18 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
}
-#if GTK_MAJOR_VERSION >= 2
/* this is called, when a dialog was closed */
-void on_dialog_destroyed(GtkWidget *dialog _U_, gpointer data)
+void on_dialog_destroyed(GtkWidget *dialog _U_, gpointer data _U_)
{
- /* bring main window back to front (workaround for a bug in win32 GTK2.x)
- XXX - do this only on Windows? */
- gtk_window_present(GTK_WINDOW(data));
-}
+#if GTK_MAJOR_VERSION >= 2
+ if(top_level) {
+ /* bring main window back to front (workaround for a bug in win32 GTK2.x)
+ XXX - do this only on Windows? */
+ gtk_window_present(GTK_WINDOW(top_level));
+ }
#endif
+ /* XXX - saved the size of this dialog */
+ /* currently unclear, how the dialogs should be identified */
+}
+
/* Create a dialog box window that belongs to Ethereal's main window. */
GtkWidget *
if (top_level) {
gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(top_level));
}
+
+ SIGNAL_CONNECT(win, "destroy", on_dialog_destroyed, win);
+
+ return win;
+}
+
+void
+dlg_window_present(GtkWidget *win, GtkWindowPosition pos)
+{
+
+ /* to stay compatible with GTK1.x, only these three pos values are allowed */
+ g_assert(
+ pos == GTK_WIN_POS_NONE ||
+ pos == GTK_WIN_POS_CENTER ||
+ pos == GTK_WIN_POS_MOUSE); /* preferred for most dialogs */
+
#if GTK_MAJOR_VERSION >= 2
- gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER_ON_PARENT);
- if(top_level)
- SIGNAL_CONNECT(win, "destroy", on_dialog_destroyed, top_level);
gtk_window_present(GTK_WINDOW(win));
+
+ if(pos == GTK_WIN_POS_CENTER) {
+ pos = GTK_WIN_POS_CENTER_ON_PARENT;
+ }
#endif
- return win;
+ gtk_window_set_position(GTK_WINDOW(win), pos);
+
+ /* XXX - set a previously saved size of this dialog */
+ /* currently unclear, how the dialogs should be identified */
}
+
/* Create a file selection dialog box window that belongs to Ethereal's
main window. */
#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2
/* dlg_utils.h
* Declarations of utilities to use when constructing dialogs
*
- * $Id: dlg_utils.h,v 1.12 2004/03/29 22:55:13 guy Exp $
+ * $Id: dlg_utils.h,v 1.13 2004/05/22 19:56:18 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/* Create a dialog box window that belongs to Ethereal's main window. */
extern GtkWidget *dlg_window_new(const gchar *);
+/* Show the created dialog box window. */
+/* use GTK_WIN_POS_CENTER or GTK_WIN_POS_MOUSE only! */
+extern void dlg_window_present(GtkWidget *win, GtkWindowPosition pos);
+
/* Create a file selection dialog box window that belongs to Ethereal's
main window. */
typedef enum {
/* follow_dlg.c
*
- * $Id: follow_dlg.c,v 1.58 2004/05/09 10:03:40 guy Exp $
+ * $Id: follow_dlg.c,v 1.59 2004/05/22 19:56:18 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
fclose(data_out_file);
/* The data_out_filename file now has all the text that was in the session */
- streamwindow = window_new(GTK_WINDOW_TOPLEVEL, "Follow TCP stream");
+ streamwindow = dlg_window_new("Follow TCP stream");
/* needed in follow_filter_out_stream(), is there a better way? */
follow_info->streamwindow = streamwindow;
*
* Modified from summary_dlg.c
*
- * $Id: gsm_map_summary.c,v 1.1 2004/04/21 17:57:31 guy Exp $
+ * $Id: gsm_map_summary.c,v 1.2 2004/05/22 19:56:18 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/* initial compututations */
seconds = summary.stop_time - summary.start_time;
- sum_open_w = window_new(GTK_WINDOW_TOPLEVEL, "GSM MAP Statistics: Summary");
+ sum_open_w = dlg_window_new("GSM MAP Statistics: Summary");
/* Container for each row of widgets */
main_vb = gtk_vbox_new(FALSE, 3);
been selected. */
dlg_set_cancel(sum_open_w, close_bt);
- gtk_window_set_position(GTK_WINDOW(sum_open_w), GTK_WIN_POS_MOUSE);
gtk_widget_show(sum_open_w);
}
* h225 message counter for ethereal
* Copyright 2003 Lars Roland
*
- * $Id: h225_counter.c,v 1.18 2004/04/12 08:53:02 ulfl Exp $
+ * $Id: h225_counter.c,v 1.19 2004/05/22 19:56:18 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
h225counter_reset(hs);
- hs->win=window_new(GTK_WINDOW_TOPLEVEL, NULL);
+ hs->win=dlg_window_new("Ethereal: H225 counters");
SIGNAL_CONNECT(hs->win, "destroy", win_destroy_cb, hs);
hs->vbox=gtk_vbox_new(FALSE, 3);
/* help_dlg.c
*
- * $Id: help_dlg.c,v 1.51 2004/05/22 04:25:57 guy Exp $
+ * $Id: help_dlg.c,v 1.52 2004/05/22 19:56:18 ulfl Exp $
*
* Laurent Deniel <laurent.deniel@free.fr>
*
return;
}
- help_w = window_new(GTK_WINDOW_TOPLEVEL, "Ethereal: Help");
+ help_w = dlg_window_new("Ethereal: Help");
SIGNAL_CONNECT(help_w, "destroy", help_destroy_cb, NULL);
/* XXX: improve this, e.g. remember the last window size in a file */
WIDGET_SET_SIZE(help_w, DEF_WIDTH, DEF_HEIGHT);
main_vb = gtk_vbox_new(FALSE, 1);
gtk_container_border_width(GTK_CONTAINER(main_vb), 1);
gtk_container_add(GTK_CONTAINER(help_w), main_vb);
- gtk_widget_show(main_vb);
/* help topics container */
help_nb = gtk_notebook_new();
}
fclose(help_toc_file);
- gtk_widget_show(help_nb);
/* Buttons (only "Ok" for now) */
bbox = dlg_button_row_new(GTK_STOCK_OK, NULL);
-
gtk_box_pack_end(GTK_BOX(main_vb), bbox, FALSE, FALSE, 5);
- gtk_widget_show(bbox);
close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_OK);
SIGNAL_CONNECT(close_bt, "clicked", help_close_cb, help_w);
been selected. */
dlg_set_cancel(help_w, close_bt);
- gtk_widget_show(help_w);
+ gtk_widget_show_all(help_w);
+ dlg_window_present(help_w, GTK_WIN_POS_MOUSE);
} /* help_cb */
/* io_stat.c
* io_stat 2002 Ronnie Sahlberg
*
- * $Id: io_stat.c,v 1.74 2004/04/17 01:01:22 guy Exp $
+ * $Id: io_stat.c,v 1.75 2004/05/22 19:56:18 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
GtkWidget *bt_close;
/* create the main window */
- io->window=window_new(GTK_WINDOW_TOPLEVEL, NULL);
-
- gtk_widget_set_name(io->window, "I/O Statistics");
+ io->window=dlg_window_new("I/O Graphs");
vbox=gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(io->window), vbox);
* mgcp-statistics for ethereal
* Copyright 2003 Lars Roland
*
- * $Id: mgcp_stat.c,v 1.33 2004/03/27 11:13:02 guy Exp $
+ * $Id: mgcp_stat.c,v 1.34 2004/05/22 19:56:19 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
mgcpstat_reset(ms);
- ms->win=window_new(GTK_WINDOW_TOPLEVEL, NULL);
+ ms->win=dlg_window_new("MGCP SRT");
SIGNAL_CONNECT(ms->win, "destroy", win_destroy_cb, ms);
ms->vbox=gtk_vbox_new(FALSE, 0);
*
* Modified from gsm_map_summary.c
*
- * $Id: mtp3_summary.c,v 1.1 2004/04/21 17:57:31 guy Exp $
+ * $Id: mtp3_summary.c,v 1.2 2004/05/22 19:56:19 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/* initial compututations */
seconds = summary.stop_time - summary.start_time;
- sum_open_w = window_new(GTK_WINDOW_TOPLEVEL, "MTP3 Statistics: Summary");
+ sum_open_w = dlg_window_new("MTP3 Statistics: Summary");
/* Container for each row of widgets */
main_vb = gtk_vbox_new(FALSE, 3);
been selected. */
dlg_set_cancel(sum_open_w, close_bt);
- gtk_window_set_position(GTK_WINDOW(sum_open_w), GTK_WIN_POS_MOUSE);
gtk_widget_show_all(sum_open_w);
}
/* rtp_analysis.c
* RTP analysis addition for ethereal
*
- * $Id: rtp_analysis.c,v 1.40 2004/03/13 12:09:27 ulfl Exp $
+ * $Id: rtp_analysis.c,v 1.41 2004/05/22 19:56:19 ulfl Exp $
*
* Copyright 2003, Alcatel Business Systems
* By Lars Ruoff <lars.ruoff@gmx.net>
column_arrows *col_arrows_rev;
- window = window_new (GTK_WINDOW_TOPLEVEL, "Ethereal: RTP Stream Analysis");
- gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+ window = dlg_window_new("Ethereal: RTP Stream Analysis");
SIGNAL_CONNECT(window, "destroy", on_destroy, user_data);
/* Container for each row of widgets */
/* summary_dlg.c
* Routines for capture file summary window
*
- * $Id: summary_dlg.c,v 1.31 2004/05/21 08:55:07 ulfl Exp $
+ * $Id: summary_dlg.c,v 1.32 2004/05/22 19:56:19 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
been selected. */
dlg_set_cancel(sum_open_w, close_bt);
- gtk_window_set_position(GTK_WINDOW(sum_open_w), GTK_WIN_POS_MOUSE);
gtk_widget_show_all(sum_open_w);
}