diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2008-04-18 14:29:54 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2008-04-18 14:29:54 +0000 |
commit | b205017b3ee5e1fe839ce85a186bcbd956ebc56a (patch) | |
tree | e16f1e0b00856764c0674e6daf10af289202aac8 | |
parent | 2f78f0145d2a4c0436d1f2cb2b221c5699acd1d7 (diff) |
Display the interface comment if defined.
On non-win32 also display the interface name.
svn path=/trunk/; revision=25114
-rw-r--r-- | capture_ui_utils.c | 2 | ||||
-rw-r--r-- | capture_ui_utils.h | 6 | ||||
-rw-r--r-- | gtk/main_welcome.c | 22 |
3 files changed, 24 insertions, 6 deletions
diff --git a/capture_ui_utils.c b/capture_ui_utils.c index 0c58a0ccd1..be5f9fa65e 100644 --- a/capture_ui_utils.c +++ b/capture_ui_utils.c @@ -40,7 +40,7 @@ * Find user-specified capture device description that matches interface * name, if any. */ -static char * +char * capture_dev_user_descr_find(const gchar *if_name) { char *p; diff --git a/capture_ui_utils.h b/capture_ui_utils.h index 8370b31d4a..4093ae4cb2 100644 --- a/capture_ui_utils.h +++ b/capture_ui_utils.h @@ -31,6 +31,12 @@ * GList of available capture interfaces. */ +/** + * Find user-specified capture device description that matches interface + * name, if any. + */ +char *capture_dev_user_descr_find(const gchar *if_name); + /** Return as descriptive a name for an interface as we can get. * If the user has specified a comment, use that. Otherwise, * if get_interface_list() supplies a description, use that, diff --git a/gtk/main_welcome.c b/gtk/main_welcome.c index a416f4a9e2..6a116b19d9 100644 --- a/gtk/main_welcome.c +++ b/gtk/main_welcome.c @@ -38,6 +38,7 @@ #include "capture.h" #include "capture-pcap-util.h" #include "capture_opts.h" +#include "capture_ui_utils.h" #include "simple_dialog.h" #include "wiretap/file_util.h" @@ -435,7 +436,7 @@ welcome_if_panel_new(void) gchar *err_str; int ifs; GList *curr; - + gchar *descr; panel_vb = gtk_vbox_new(FALSE, 0); @@ -458,11 +459,22 @@ welcome_if_panel_new(void) continue; } - if (if_info->description != NULL) - interface_hb = welcome_if_new(if_info->description, &topic_content_bg, g_strdup(if_info->name)); - else + descr = capture_dev_user_descr_find(if_info->name); + if (descr) { +#ifndef _WIN32 + gchar *comment = descr; + descr = g_strdup_printf("%s (%s)", comment, if_info->name); + g_free (comment); +#endif + interface_hb = welcome_if_new(descr, &topic_content_bg, g_strdup(if_info->name)); + g_free (descr); + } else if (if_info->description != NULL) { + interface_hb = welcome_if_new(if_info->description, &topic_content_bg, g_strdup(if_info->name)); + } else { interface_hb = welcome_if_new(if_info->name, &topic_content_bg, g_strdup(if_info->name)); - gtk_box_pack_start(GTK_BOX(panel_vb), interface_hb, FALSE, FALSE, 2); + } + + gtk_box_pack_start(GTK_BOX(panel_vb), interface_hb, FALSE, FALSE, 2); } free_interface_list(if_list); |