diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2004-05-23 23:24:07 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2004-05-23 23:24:07 +0000 |
commit | cc6836803788de14432c597fcda0ad3154b421e4 (patch) | |
tree | cd34c8b0e8333865247f8af8e7405c950d565350 /gtk/sip_stat.c | |
parent | 9332549e99c7bee165fa47b3332e683d39cbcdad (diff) |
use new functions in window API (ui_util.h),
use window_new instead of dlg_window_new for the statistics windows
(as these are no dialog windows)
do some code cleanup
svn path=/trunk/; revision=10979
Diffstat (limited to 'gtk/sip_stat.c')
-rw-r--r-- | gtk/sip_stat.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/gtk/sip_stat.c b/gtk/sip_stat.c index f0e6cf2780..3d68fdc244 100644 --- a/gtk/sip_stat.c +++ b/gtk/sip_stat.c @@ -1,7 +1,7 @@ /* sip_stat.c * sip_stat 2004 Martin Mathieson * - * $Id: sip_stat.c,v 1.5 2004/04/22 20:08:46 etxrab Exp $ + * $Id: sip_stat.c,v 1.6 2004/05/23 23:24:06 ulfl Exp $ * Copied from http_stat.c * * Ethereal - Network traffic analyzer @@ -495,17 +495,6 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) g_free(sp); } -static void -sipstat_gtk_dlg_close_cb( - GtkButton *button _U_, - gpointer user_data _U_) -{ - sipstat_t *sp = user_data; - - gtk_grab_remove(GTK_WIDGET(sp->win)); - gtk_widget_destroy(GTK_WIDGET(sp->win)); -} - /* Create a new instance of gtk_sipstat. */ static void @@ -536,6 +525,7 @@ gtk_sipstat_init(char *optarg) /* Create sip stats window structure */ sp = g_malloc(sizeof(sipstat_t)); + sp->win = window_new(GTK_WINDOW_TOPLEVEL, "sip-stat"); /* Set title to include any filter given */ if (filter) @@ -549,13 +539,9 @@ gtk_sipstat_init(char *optarg) title = g_strdup("SIP statistics"); } - /* Create underlying window */ - sp->win = dlg_window_new(title); + gtk_window_set_title(GTK_WINDOW(sp->win), title); g_free(title); - /* Set destroy callback for underlying window */ - SIGNAL_CONNECT(sp->win, "destroy", win_destroy_cb, sp); - /* Create container for all widgets */ main_vb = gtk_vbox_new(FALSE, 12); @@ -652,16 +638,15 @@ gtk_sipstat_init(char *optarg) gtk_box_pack_start(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0); bt_close = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - SIGNAL_CONNECT(bt_close, "clicked", sipstat_gtk_dlg_close_cb, sp); - gtk_widget_grab_default(bt_close); + window_set_cancel_button(sp->win, bt_close, window_cancel_button_cb); - /* Catch the "key_press_event" signal in the window, so that we can - catch the ESC key being pressed and act as if the "Close" button had - been selected. */ - dlg_set_cancel(sp->win, bt_close); + SIGNAL_CONNECT(sp->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(sp->win, "destroy", win_destroy_cb, sp); /* Display up-to-date contents */ gtk_widget_show_all(sp->win); + window_present(sp->win); + sip_init_hash(sp); retap_packets(&cfile); } |