From 2106faabe3c5b0229ad39423c600d706323312cd Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Tue, 10 Feb 2009 21:26:16 +0000 Subject: add a stock icon "WIRESHARK_STOCK_MAP" to display a map svn path=/trunk/; revision=27413 --- gtk/dlg_utils.c | 19 +++++++++++++++++++ gtk/stock_icons.c | 6 ++++++ gtk/stock_icons.h | 3 +++ 3 files changed, 28 insertions(+) (limited to 'gtk') diff --git a/gtk/dlg_utils.c b/gtk/dlg_utils.c index 85d115f6b2..c0ed74d068 100644 --- a/gtk/dlg_utils.c +++ b/gtk/dlg_utils.c @@ -129,6 +129,9 @@ dlg_button_row_new(const gchar *stock_id_first, ...) const gchar *save_all = NULL; const gchar *stop = NULL; const gchar *yes = NULL; +#ifdef HAVE_GEOIP + const gchar *map = NULL; +#endif /* HAVE_GEOIP */ va_start(stock_id_list, stock_id_first); @@ -161,6 +164,10 @@ dlg_button_row_new(const gchar *stock_id_first, ...) } else if (strcmp(stock_id, WIRESHARK_STOCK_CAPTURE_STOP) == 0) { cap_stop = stock_id; #endif /* HAVE_LIBPCAP */ +#ifdef HAVE_GEOIP + } else if (strcmp(stock_id, WIRESHARK_STOCK_MAP) == 0) { + map = stock_id; +#endif /* HAVE_GEOIP */ } else if (strcmp(stock_id, GTK_STOCK_STOP) == 0) { stop = stock_id; } else if (strcmp(stock_id, GTK_STOCK_HELP) == 0) { @@ -235,6 +242,18 @@ dlg_button_row_new(const gchar *stock_id_first, ...) buttons--; } +#ifdef HAVE_GEOIP + /* do we have a map button? -> special handling for it */ + if (map) { + button = gtk_button_new_from_stock(map); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + g_object_set_data(G_OBJECT(hbox), map, button); + gtk_box_pack_start(GTK_BOX(help_hbox), button, FALSE, FALSE, 0); + gtk_widget_show(button); + buttons--; + } +#endif /* HAVE_GEOIP */ + /* if more than one button, sort buttons from left to right */ /* (the whole button cluster will then be right aligned) */ gtk_button_box_set_layout (GTK_BUTTON_BOX(button_hbox), GTK_BUTTONBOX_END); diff --git a/gtk/stock_icons.c b/gtk/stock_icons.c index 3105c1b5a7..8850ee0b76 100644 --- a/gtk/stock_icons.c +++ b/gtk/stock_icons.c @@ -97,6 +97,9 @@ void stock_icons_init(void) { { WIRESHARK_STOCK_CAPTURE_FILTER, "_CFilter", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY, "_Capture Filter:", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_DETAILS, "_Details", 0, 0, NULL }, +#endif +#ifdef HAVE_GEOIP + { WIRESHARK_STOCK_MAP, "Map", 0, 0, NULL }, #endif { WIRESHARK_STOCK_DISPLAY_FILTER, "_Filter", 0, 0, NULL }, { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY, "F_ilter:", 0, 0, NULL }, @@ -154,6 +157,9 @@ void stock_icons_init(void) { { WIRESHARK_STOCK_CAPTURE_FILTER, capture_filter_24_xpm }, { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY, capture_filter_24_xpm }, { WIRESHARK_STOCK_CAPTURE_DETAILS, capture_details_24_xpm }, +#endif +#ifdef HAVE_GEOIP + { WIRESHARK_STOCK_MAP, internet_24_xpm}, #endif { WIRESHARK_STOCK_DISPLAY_FILTER, display_filter_24_xpm }, { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY, display_filter_24_xpm }, diff --git a/gtk/stock_icons.h b/gtk/stock_icons.h index 64a4482427..0bd0eb900e 100644 --- a/gtk/stock_icons.h +++ b/gtk/stock_icons.h @@ -37,6 +37,9 @@ #define WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY "Wireshark_Stock_CaptureFilter_Entry" #define WIRESHARK_STOCK_CAPTURE_DETAILS "Wireshark_Stock_CaptureDetails" #endif +#ifdef HAVE_GEOIP +#define WIRESHARK_STOCK_MAP "Wireshark_Stock_Map" +#endif #define WIRESHARK_STOCK_DISPLAY_FILTER "Wireshark_Stock_DisplayFilter" #define WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY "Wireshark_Stock_DisplayFilter_Entry" #define WIRESHARK_STOCK_BROWSE "Wireshark_Stock_Browse" -- cgit v1.2.3