aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/capture_if_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-05-19 03:05:40 +0000
committerGuy Harris <guy@alum.mit.edu>2010-05-19 03:05:40 +0000
commit15e546e65db5f9920091fbfe02627d96d6b67648 (patch)
treea6b2a74ae583bb7f0e77a6a241255e0c30ed20af /gtk/capture_if_dlg.c
parentc1e651802ec438aede4e3cc13e2566874017a729 (diff)
If the user asks for the Capture -> Interfaces dialog, and there are no
network interfaces, pop up a dialog saying that, rather than popping up an empty Interfaces dialog. svn path=/trunk/; revision=32884
Diffstat (limited to 'gtk/capture_if_dlg.c')
-rw-r--r--gtk/capture_if_dlg.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gtk/capture_if_dlg.c b/gtk/capture_if_dlg.c
index 2604485a1f..2496b4f450 100644
--- a/gtk/capture_if_dlg.c
+++ b/gtk/capture_if_dlg.c
@@ -622,9 +622,19 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_)
/* LOAD THE INTERFACES */
if_list = capture_interface_list(&err, &err_str);
if_list = g_list_sort (if_list, if_list_comparator_alph);
- if (if_list == NULL && err == CANT_GET_INTERFACE_LIST) {
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_str);
- g_free(err_str);
+ if (if_list == NULL) {
+ switch (err) {
+
+ case CANT_GET_INTERFACE_LIST:
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_str);
+ g_free(err_str);
+ break;
+
+ case NO_INTERFACES_FOUND:
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "There are no interfaces on which a capture can be done.");
+ break;
+ }
return;
}