diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-08-20 22:28:49 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-08-20 22:28:49 +0000 |
commit | ce8ac34225e9c2f297f3aed71cf9bcac2f9be039 (patch) | |
tree | 859be6e44274b47ced7fcf9cb70cbe6a1acb12fd /gtk/gsm_map_stat.c | |
parent | 65064719d3770c5d892f6eaea98555179af20642 (diff) |
The routines registered with "register_stat_cmd_arg()" *are* called if
you use the "-z" command-line options for them; make them pop up the
appropriate windows.
Move the calls to "register_stat_cmd_arg()" after the code to register
the tap, just as the calls to "register_stat_menu_item()" are done after
registering the tap.
Use "g_strdup_printf()" rather than formatting into a fixed-length
buffer and "g_strdup()"ing that buffer.
svn path=/trunk/; revision=15489
Diffstat (limited to 'gtk/gsm_map_stat.c')
-rw-r--r-- | gtk/gsm_map_stat.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/gtk/gsm_map_stat.c b/gtk/gsm_map_stat.c index 336b21ec07..8d5b32a4c3 100644 --- a/gtk/gsm_map_stat.c +++ b/gtk/gsm_map_stat.c @@ -392,24 +392,12 @@ gsm_map_stat_gtk_win_create( } -/* - * Never gets called ? - */ -static void -gsm_map_stat_gtk_init( - const char *optarg _U_) -{ - /* does not appear to be called */ -} - - static void gsm_map_stat_gtk_cb( GtkWidget *w _U_, gpointer d _U_) { int i; - char str[100]; /* @@ -426,8 +414,8 @@ gsm_map_stat_gtk_cb( i = 0; while (gsm_map_opr_code_strings[i].strptr) { - g_snprintf(str, 100, "%u", gsm_map_opr_code_strings[i].value); - dlg.entries[0] = g_strdup(str); + dlg.entries[0] = g_strdup_printf("%u", + gsm_map_opr_code_strings[i].value); dlg.entries[1] = g_strdup(gsm_map_opr_code_strings[i].strptr); @@ -449,14 +437,20 @@ gsm_map_stat_gtk_cb( } +static void +gsm_map_stat_gtk_init( + const char *optarg _U_) +{ + gsm_map_stat_gtk_cb(NULL, NULL); +} + + void register_tap_listener_gtkgsm_map_stat(void) { GString *err_p; - register_stat_cmd_arg("gsm_map,", gsm_map_stat_gtk_init); - memset((void *) &gsm_map_stat, 0, sizeof(gsm_map_stat_t)); err_p = @@ -475,4 +469,5 @@ register_tap_listener_gtkgsm_map_stat(void) register_stat_menu_item("GSM/MAP Operation", REGISTER_STAT_GROUP_TELEPHONY, gsm_map_stat_gtk_cb, NULL, NULL, NULL); + register_stat_cmd_arg("gsm_map", gsm_map_stat_gtk_init); } |