From Pontus Fuchs:

Refresh wireless toolbar too

    The recently improved refresh interfaces code forgot the wireless
    toolbar. Make sure to refresh it too.

svn path=/trunk/; revision=43568
This commit is contained in:
Guy Harris 2012-07-05 02:01:43 +00:00
parent eb38ae49b1
commit b1ab794baa
3 changed files with 17 additions and 7 deletions

View File

@ -42,6 +42,7 @@
#include "ui/gtk/capture_if_dlg.h"
#include "ui/gtk/capture_globals.h"
#include "ui/gtk/main_welcome.h"
#include "ui/gtk/main_80211_toolbar.h"
#include "ui/gtk/iface_lists.h"
@ -348,6 +349,9 @@ refresh_local_interface_lists(void)
/* If the welcome screen is up, refresh its interface list. */
if (get_welcome_window() != NULL)
welcome_if_panel_reload();
/* Refresh the 802.11 toolbar. */
tb80211_refresh_interfaces();
}
/*

View File

@ -49,7 +49,7 @@
#include <ws80211_utils.h>
#include "capture_sync.h"
static GtkWidget *tb80211_iface_list_box, *tb80211_freq_list_box, *tb80211_chan_type_box, *tb80211_info_label;
static GtkWidget *tb80211_tb, *tb80211_iface_list_box, *tb80211_freq_list_box, *tb80211_chan_type_box, *tb80211_info_label;
static GArray *tb80211_interfaces;
static struct ws80211_interface *tb80211_current_iface;
@ -279,14 +279,17 @@ out_free:
g_free(active);
}
static void
tb80211_update_interfaces(void)
void
tb80211_refresh_interfaces(void)
{
struct ws80211_interface *iface;
unsigned int i;
gboolean same = FALSE;
gchar *selected_iface = NULL, *info;
if (!tb80211_tb)
return;
if (tb80211_interfaces) {
selected_iface = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(tb80211_iface_list_box));
@ -333,7 +336,7 @@ out_free:
static void
tb80211_update_iface_cb(GtkWidget *widget _U_, gpointer data _U_)
{
tb80211_update_interfaces();
tb80211_refresh_interfaces();
}
static void
@ -353,7 +356,6 @@ tb80211_add_label(gchar *text, GtkWidget *tb)
GtkWidget *
ws80211_toolbar_new(void)
{
GtkWidget *tb80211_tb;
GtkToolItem *ti;
int ret;
@ -424,7 +426,7 @@ ws80211_toolbar_new(void)
if(ret) {
tb80211_set_info("<b>Failed to initialize ws80211</b>");
} else {
tb80211_update_interfaces();
tb80211_refresh_interfaces();
}
return tb80211_tb;

View File

@ -25,6 +25,10 @@
#ifndef __80211_TOOLBAR_H__
#define __80211_TOOLBAR_H__
GtkWidget *ws80211_toolbar_new(void);
GtkWidget
*ws80211_toolbar_new(void);
void
tb80211_refresh_interfaces(void);
#endif