#include "airpcap_loader.h"
#include "airpcap_gui_utils.h"
#endif
+#if defined(HAVE_AIRPCAP) || defined(HAVE_PCAP_REMOTE)
+#include "../image/toolbar/capture_airpcap_16.xpm"
+#endif
/* XXX */
extern gint if_list_comparator_alph (const void *first_arg, const void *second_arg);
static GtkWidget *welcome_hb = NULL;
static GtkWidget *header_lb = NULL;
/* Foreground colors are set using Pango markup */
+#if GTK_CHECK_VERSION(3,0,0)
+static GdkRGBA rgba_welcome_bg = {0.901, 0.901, 0.901, 1.0 };
+static GdkRGBA rgba_header_bar_bg = { 0.094, 0.360, 0.792, 1.0 };
+static GdkRGBA rgba_topic_header_bg = { 0.004, 0.224, 0.745, 1.0 };
+static GdkRGBA rgba_topic_content_bg = { 1, 1, 1, 1.0 };
+static GdkRGBA rgba_topic_item_idle_bg;
+static GdkRGBA rgba_topic_item_entered_bg = { 0.827, 0.847, 0.854, 1.0 };
+#else
static GdkColor welcome_bg = { 0, 0xe6e6, 0xe6e6, 0xe6e6 };
static GdkColor header_bar_bg = { 0, 0x1818, 0x5c5c, 0xcaca };
static GdkColor topic_header_bg = { 0, 0x0101, 0x3939, 0xbebe };
static GdkColor topic_content_bg = { 0, 0xffff, 0xffff, 0xffff };
static GdkColor topic_item_idle_bg;
static GdkColor topic_item_entered_bg = { 0, 0xd3d3, 0xd8d8, 0xdada };
-
+#endif
static GtkWidget *welcome_file_panel_vb = NULL;
#ifdef HAVE_LIBPCAP
static GtkWidget *welcome_if_panel_vb = NULL;
+static GtkWidget *if_view = NULL;
+static GtkWidget *swindow;
+static GArray *interfaces = NULL;
#endif
static GSList *status_messages = NULL;
+#ifdef USE_THREADS
+static GMutex *recent_mtx = NULL;
+#endif
+
/* The "scroll box dynamic" is a (complicated) pseudo widget to */
/* place a vertically list of widgets in (currently the interfaces and recent files). */
/* Once this list get's higher than a specified amount, */
#define SCROLL_BOX_MAX_CHILDS "ScrollBoxDynamic_MaxChilds"
#define SCROLL_BOX_SCROLLW_Y_SIZE "ScrollBoxDynamic_Scrollw_Y_Size"
#define SCROLL_BOX_SCROLLW "ScrollBoxDynamic_Scrollw"
-
+#define TREE_VIEW_INTERFACES "TreeViewInterfaces"
static GtkWidget *
-scroll_box_dynamic_new(GtkBox *child_box, guint max_childs, guint scrollw_y_size) {
+scroll_box_dynamic_new(GtkWidget *child_box, guint max_childs, guint scrollw_y_size) {
GtkWidget * parent_box;
static gboolean
welcome_item_enter_cb(GtkWidget *eb, GdkEventCrossing *event _U_, gpointer user_data _U_)
{
- gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &topic_item_entered_bg);
-
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(eb, GTK_STATE_NORMAL, &rgba_topic_item_entered_bg);
+#else
+ gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &topic_item_entered_bg);
+#endif
return FALSE;
}
static gboolean
welcome_item_leave_cb(GtkWidget *eb, GdkEventCrossing *event _U_, gpointer user_data _U_)
{
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(eb, GTK_STATE_NORMAL, &rgba_topic_item_idle_bg);
+#else
gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &topic_item_idle_bg);
-
+#endif
return FALSE;
}
{
GtkWidget *eb, *w, *item_hb, *text_vb;
gchar *formatted_text;
- GtkTooltips *tooltips;
-
-
- tooltips = gtk_tooltips_new();
item_hb = gtk_hbox_new(FALSE, 1);
/* event box (for background color and events) */
eb = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(eb), item_hb);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(eb, GTK_STATE_NORMAL, &rgba_topic_item_idle_bg);
+#else
gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &topic_item_idle_bg);
+#endif
if(tooltip != NULL) {
- gtk_tooltips_set_tip(tooltips, eb, tooltip, "");
+ gtk_widget_set_tooltip_text(eb, tooltip);
}
g_signal_connect(eb, "enter-notify-event", G_CALLBACK(welcome_item_enter_cb), NULL);
/* colorize vbox */
eb = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(eb), item_vb);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(eb, GTK_STATE_NORMAL, &rgba_header_bar_bg);
+#else
gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &header_bar_bg);
-
+#endif
item_hb = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(item_vb), item_hb, FALSE, FALSE, 10);
- icon = xpm_to_widget_from_parent(top_level, wssplash_xpm);
+ /*icon = xpm_to_widget_from_parent(top_level, wssplash_xpm);*/
+ icon = xpm_to_widget(wssplash_xpm);
gtk_box_pack_start(GTK_BOX(item_hb), icon, FALSE, FALSE, 10);
header_lb = gtk_label_new(NULL);
welcome_header_set_message(NULL);
- gtk_misc_set_alignment (GTK_MISC(header_lb), 0.0f, 0.5f);
+ gtk_label_set_selectable(GTK_LABEL(header_lb), TRUE);
+ gtk_misc_set_alignment(GTK_MISC(header_lb), 0.0f, 0.5f);
gtk_box_pack_start(GTK_BOX(item_hb), header_lb, TRUE, TRUE, 5);
gtk_widget_show_all(eb);
/* colorize vbox */
eb = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(eb), w);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(eb, GTK_STATE_NORMAL, &rgba_topic_header_bg);
+#else
gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &topic_header_bg);
-
+#endif
return eb;
}
/* colorize vbox (we need an event box for this!) */
topic_eb = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(topic_eb), topic_vb);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(topic_eb, GTK_STATE_NORMAL, &rgba_topic_content_bg);
+#else
gtk_widget_modify_bg(topic_eb, GTK_STATE_NORMAL, &topic_content_bg);
+#endif
*to_fill = layout_vb;
return topic_eb;
return FALSE;
}
+typedef struct _recent_item_status {
+ gchar *filename;
+ GtkWidget *label;
+ GObject *menu_item;
+ GString *str;
+ gboolean stat_done;
+ int err;
+ guint timer;
+} recent_item_status;
+
+/*
+ * Fetch the status of a file.
+ * This function might be called as a thread. We can't use any drawing
+ * routines here: http://developer.gnome.org/gdk/2.24/gdk-Threads.html
+ */
+static void *get_recent_item_status(void *data)
+{
+ recent_item_status *ri_stat = (recent_item_status *) data;
+ ws_statb64 stat_buf;
+ int err;
+
+ if (!ri_stat) {
+ return NULL;
+ }
+
+ /*
+ * Add file size. We use binary prefixes instead of IEC because that's what
+ * most OSes use.
+ */
+ err = ws_stat64(ri_stat->filename, &stat_buf);
+#ifdef USE_THREADS
+ g_mutex_lock(recent_mtx);
+#endif
+ ri_stat->err = err;
+ if(err == 0) {
+ if (stat_buf.st_size/1024/1024/1024 > 10) {
+ g_string_append_printf(ri_stat->str, " (%" G_GINT64_MODIFIER "d GB)", (gint64) (stat_buf.st_size/1024/1024/1024));
+ } else if (stat_buf.st_size/1024/1024 > 10) {
+ g_string_append_printf(ri_stat->str, " (%" G_GINT64_MODIFIER "d MB)", (gint64) (stat_buf.st_size/1024/1024));
+ } else if (stat_buf.st_size/1024 > 10) {
+ g_string_append_printf(ri_stat->str, " (%" G_GINT64_MODIFIER "d KB)", (gint64) (stat_buf.st_size/1024));
+ } else {
+ g_string_append_printf(ri_stat->str, " (%" G_GINT64_MODIFIER "d Bytes)", (gint64) (stat_buf.st_size));
+ }
+ /* pango format string */
+ g_string_prepend(ri_stat->str, "<span foreground='blue'>");
+ g_string_append(ri_stat->str, "</span>");
+ } else {
+ g_string_append(ri_stat->str, " [not found]");
+ }
+
+ if (!ri_stat->label) { /* The widget went away while we were busy. */
+ g_free(ri_stat->filename);
+ g_string_free(ri_stat->str, TRUE);
+ g_free(ri_stat);
+ } else {
+ ri_stat->stat_done = TRUE;
+ }
+#ifdef USE_THREADS
+ g_mutex_unlock(recent_mtx);
+#endif
+
+ return NULL;
+}
+
+/* Timeout callback for recent items */
+static gboolean
+update_recent_items(gpointer data)
+{
+ recent_item_status *ri_stat = (recent_item_status *) data;
+ gboolean again = TRUE;
+
+ if (!ri_stat) {
+ return FALSE;
+ }
+
+#ifdef USE_THREADS
+ g_mutex_lock(recent_mtx);
+#endif
+ if (ri_stat->stat_done) {
+ again = FALSE;
+ gtk_label_set_markup(GTK_LABEL(ri_stat->label), ri_stat->str->str);
+ if (ri_stat->err == 0) {
+ gtk_widget_set_sensitive(ri_stat->label, TRUE);
+#ifdef MAIN_MENU_USE_UIMANAGER
+ gtk_action_set_sensitive((GtkAction *) ri_stat->menu_item, TRUE);
+#else
+ gtk_widget_set_sensitive(GTK_WIDGET(ri_stat->menu_item), TRUE);
+#endif
+ }
+ ri_stat->timer = 0;
+ }
+ /* Else append some sort of Unicode or ASCII animation to the label? */
+#ifdef USE_THREADS
+ g_mutex_unlock(recent_mtx);
+#endif
+ return again;
+}
+
+static void welcome_filename_destroy_cb(GtkWidget *w _U_, gpointer data) {
+ recent_item_status *ri_stat = (recent_item_status *) data;
+
+ if (!ri_stat) {
+ return;
+ }
+
+#ifdef USE_THREADS
+ g_mutex_lock(recent_mtx);
+#endif
+ if (ri_stat->timer) {
+ g_source_remove(ri_stat->timer);
+ ri_stat->timer = 0;
+ }
+
+ g_object_unref(ri_stat->menu_item);
+
+ if (ri_stat->stat_done) {
+ g_free(ri_stat->filename);
+ g_string_free(ri_stat->str, TRUE);
+ g_free(ri_stat);
+ } else {
+ ri_stat->label = NULL;
+ }
+#ifdef USE_THREADS
+ g_mutex_unlock(recent_mtx);
+#endif
+}
/* create a "file link widget" */
static GtkWidget *
-welcome_filename_link_new(const gchar *filename, GtkWidget **label)
+welcome_filename_link_new(const gchar *filename, GtkWidget **label, GObject *menu_item)
{
GtkWidget *w;
GtkWidget *eb;
glong uni_len;
gsize uni_start, uni_end;
const glong max = 60;
- int err;
- ws_statb64 stat_buf;
- GtkTooltips *tooltips;
-
-
- tooltips = gtk_tooltips_new();
+ recent_item_status *ri_stat;
/* filename */
str = g_string_new(filename);
/* escape the possibly shortened filename before adding pango language */
str_escaped=g_markup_escape_text(str->str, -1);
g_string_free(str, TRUE);
- str=g_string_new(str_escaped);
- g_free(str_escaped);
-
- /*
- * Add file size. We use binary prefixes instead of IEC because that's what
- * most OSes use.
- */
- err = ws_stat64(filename, &stat_buf);
- if(err == 0) {
- if (stat_buf.st_size/1024/1024/1024 > 10) {
- g_string_append_printf(str, " (%" G_GINT64_MODIFIER "d GB)", (gint64) (stat_buf.st_size/1024/1024/1024));
- } else if (stat_buf.st_size/1024/1024 > 10) {
- g_string_append_printf(str, " (%" G_GINT64_MODIFIER "d MB)", (gint64) (stat_buf.st_size/1024/1024));
- } else if (stat_buf.st_size/1024 > 10) {
- g_string_append_printf(str, " (%" G_GINT64_MODIFIER "d KB)", (gint64) (stat_buf.st_size/1024));
- } else {
- g_string_append_printf(str, " (%" G_GINT64_MODIFIER "d Bytes)", (gint64) (stat_buf.st_size));
- }
- } else {
- g_string_append(str, " [not found]");
- }
-
- /* pango format string */
- if(err == 0) {
- g_string_prepend(str, "<span foreground='blue'>");
- g_string_append(str, "</span>");
- }
/* label */
- w = gtk_label_new(str->str);
+ w = gtk_label_new(str_escaped);
*label = w;
- gtk_label_set_markup(GTK_LABEL(w), str->str);
gtk_misc_set_padding(GTK_MISC(w), 5, 2);
+ gtk_misc_set_alignment (GTK_MISC(w), 0.0f, 0.0f);
+ gtk_widget_set_sensitive(w, FALSE);
+
+ ri_stat = g_malloc(sizeof(recent_item_status));
+ ri_stat->filename = g_strdup(filename);
+ ri_stat->label = w;
+ ri_stat->menu_item = menu_item;
+ ri_stat->str = g_string_new(str_escaped);
+ ri_stat->stat_done = FALSE;
+ ri_stat->timer = 0;
+ g_object_ref(G_OBJECT(menu_item));
+ g_signal_connect(w, "destroy", G_CALLBACK(welcome_filename_destroy_cb), ri_stat);
+ g_free(str_escaped);
+
+#ifdef USE_THREADS
+ g_thread_create(get_recent_item_status, ri_stat, FALSE, NULL);
+ ri_stat->timer = g_timeout_add(200, update_recent_items, ri_stat);
+#else
+ get_recent_item_status(ri_stat);
+ update_recent_items(ri_stat);
+#endif
/* event box */
eb = gtk_event_box_new();
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(eb, GTK_STATE_NORMAL, &rgba_topic_item_idle_bg);
+#else
+ gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &topic_item_idle_bg);
+#endif
gtk_container_add(GTK_CONTAINER(eb), w);
- gtk_tooltips_set_tip(tooltips, eb, filename, "");
- if(err != 0) {
- gtk_widget_set_sensitive(w, FALSE);
- }
+ gtk_widget_set_tooltip_text(eb, filename);
g_signal_connect(eb, "enter-notify-event", G_CALLBACK(welcome_item_enter_cb), w);
g_signal_connect(eb, "leave-notify-event", G_CALLBACK(welcome_item_leave_cb), w);
g_signal_connect(eb, "button-press-event", G_CALLBACK(welcome_filename_link_press_cb), (gchar *) filename);
- g_string_free(str, TRUE);
-
return eb;
}
/* add a new file to the list of recent files */
void
-main_welcome_add_recent_capture_files(const char *widget_cf_name)
+main_welcome_add_recent_capture_file(const char *widget_cf_name, GObject *menu_item)
{
GtkWidget *w;
GtkWidget *child_box;
GtkWidget *label;
- w = welcome_filename_link_new(widget_cf_name, &label);
- gtk_widget_modify_bg(w, GTK_STATE_NORMAL, &topic_item_idle_bg);
- gtk_misc_set_alignment (GTK_MISC(label), 0.0f, 0.0f);
+ w = welcome_filename_link_new(widget_cf_name, &label, menu_item);
child_box = scroll_box_dynamic_add(welcome_file_panel_vb);
gtk_box_pack_start(GTK_BOX(child_box), w, FALSE, FALSE, 0);
gtk_widget_show_all(w);
gtk_widget_show_all(child_box);
}
-
#ifdef HAVE_LIBPCAP
-/* user clicked on an interface button */
-static gboolean
-welcome_if_press_cb(GtkWidget *widget _U_, GdkEventButton *event _U_, gpointer data)
+static gboolean select_current_ifaces(GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer userdata)
{
- cap_settings_t cap_settings;
-
- g_free(global_capture_opts.iface);
- g_free(global_capture_opts.iface_descr);
-
- global_capture_opts.iface = g_strdup(data);
- global_capture_opts.iface_descr = NULL;
- /* XXX - fix this */
- /*global_capture_opts.iface_descr = get_interface_descriptive_name(global_capture_opts.iface);*/
- cap_settings = capture_get_cap_settings (global_capture_opts.iface);;
- global_capture_opts.monitor_mode = cap_settings.monitor_mode;
- global_capture_opts.linktype = cap_settings.linktype;
-
- /* XXX - remove this? */
- if (global_capture_opts.save_file) {
- g_free(global_capture_opts.save_file);
- global_capture_opts.save_file = NULL;
+ guint i;
+ gchar *if_name;
+ gboolean found = FALSE;
+
+ GtkTreeSelection *selection = (GtkTreeSelection *)userdata;
+ gtk_tree_model_get (model, iter, IFACE_NAME, &if_name, -1);
+ for (i = 0; i < global_capture_opts.ifaces->len; i++) {
+ if (strcmp(g_array_index(global_capture_opts.ifaces, interface_options, i).name, if_name) == 0) {
+ if (!gtk_tree_selection_path_is_selected(selection, path)) {
+ gtk_tree_selection_select_iter(selection, iter);
+ }
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found) {
+ gtk_tree_selection_unselect_iter(selection, iter);
}
-
-#ifdef HAVE_AIRPCAP
- airpcap_if_active = get_airpcap_if_from_name(airpcap_if_list, global_capture_opts.iface);
- airpcap_if_selected = airpcap_if_active;
- airpcap_set_toolbar_start_capture(airpcap_if_active);
-#endif
-
- capture_start_cb(NULL, NULL);
-
return FALSE;
}
-
-/* create a single interface entry */
-static GtkWidget *
-welcome_if_new(const if_info_t *if_info, const gchar *user_descr, GdkColor *topic_bg _U_, gpointer interf)
+gboolean on_selection_changed(GtkTreeSelection *selection _U_,
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ gboolean path_currently_selected,
+ gpointer data _U_)
{
- GtkWidget *interface_hb;
- GtkWidget *w;
- GString *message;
- GtkWidget *eb;
+ GtkTreeIter iter;
+ gchar *if_name;
+ interface_options interface_opts;
+ guint i, j;
+ cap_settings_t cap_settings;
+ gboolean found = FALSE;
+ displayed_interface d_interface;
+
+ d_interface.name = NULL;
+ d_interface.descr = NULL;
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_model_get (model, &iter, IFACE_NAME, &if_name, -1);
+ if (global_capture_opts.ifaces->len > 0) {
+ for (i = 0; i < global_capture_opts.ifaces->len; i++) {
+ if (strcmp(g_array_index(global_capture_opts.ifaces, interface_options, i).name, if_name) == 0) {
+ found = TRUE;
+ if (path_currently_selected) {
+ interface_opts = g_array_index(global_capture_opts.ifaces, interface_options, i);
+ global_capture_opts.ifaces = g_array_remove_index(global_capture_opts.ifaces, i);
+ if (gtk_widget_is_focus(g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES)) && interfaces_dialog_window_present()) {
+ update_selected_interface(g_strdup(interface_opts.name), FALSE);
+ }
+ if (gtk_widget_is_focus(g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES)) && dlg_window_present()) {
+ enable_selected_interface(interface_opts.name, FALSE);
+ }
+ g_free(interface_opts.name);
+ g_free(interface_opts.descr);
+ g_free(interface_opts.cfilter);
+#ifdef HAVE_PCAP_REMOTE
+ g_free(interface_opts.remote_host);
+ g_free(interface_opts.remote_port);
+ g_free(interface_opts.auth_username);
+ g_free(interface_opts.auth_password);
+#endif
+ break;
+ }
+ }
+ }
+ }
+ if (!found && !path_currently_selected) {
+ for (j = 0; j < interfaces->len; j++) {
+ d_interface = g_array_index(interfaces, displayed_interface, j);
+ if (strcmp(d_interface.name, if_name) == 0) {
+ interface_opts.name = g_strdup(d_interface.name);
+ interface_opts.descr = g_strdup(d_interface.descr);
+ interface_opts.linktype = capture_dev_user_linktype_find(interface_opts.name);
+ interface_opts.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
+ interface_opts.has_snaplen = global_capture_opts.default_options.has_snaplen;
+ interface_opts.snaplen = global_capture_opts.default_options.snaplen;
+ cap_settings = capture_get_cap_settings (interface_opts.name);;
+ interface_opts.promisc_mode = global_capture_opts.default_options.promisc_mode;
+#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
+ interface_opts.buffer_size = global_capture_opts.default_options.buffer_size;
+#endif
+ interface_opts.monitor_mode = cap_settings.monitor_mode;
+#ifdef HAVE_PCAP_REMOTE
+ if (d_interface.remote_opts.src_type == CAPTURE_IFREMOTE) {
+ interface_opts.src_type = d_interface.remote_opts.src_type;
+ interface_opts.remote_host = g_strdup(d_interface.remote_opts.remote_host_opts.remote_host);
+ interface_opts.remote_port = g_strdup(d_interface.remote_opts.remote_host_opts.remote_port);
+ interface_opts.auth_type = d_interface.remote_opts.remote_host_opts.auth_type;
+ interface_opts.auth_username = g_strdup(d_interface.remote_opts.remote_host_opts.auth_username);
+ interface_opts.auth_password = g_strdup(d_interface.remote_opts.remote_host_opts.auth_password);
+ interface_opts.datatx_udp = d_interface.remote_opts.remote_host_opts.datatx_udp;
+ interface_opts.nocap_rpcap = d_interface.remote_opts.remote_host_opts.nocap_rpcap;
+ interface_opts.nocap_local = d_interface.remote_opts.remote_host_opts.nocap_local;
+#ifdef HAVE_PCAP_SETSAMPLING
+ interface_opts.sampling_method = d_interface.remote_opts.sampling_method;
+ interface_opts.sampling_param = d_interface.remote_opts.sampling_param;
+#endif
+ } else {
+ interface_opts.src_type = global_capture_opts.default_options.src_type;
+ interface_opts.remote_host = g_strdup(global_capture_opts.default_options.remote_host);
+ interface_opts.remote_port = g_strdup(global_capture_opts.default_options.remote_port);
+ interface_opts.auth_type = global_capture_opts.default_options.auth_type;
+ interface_opts.auth_username = g_strdup(global_capture_opts.default_options.auth_username);
+ interface_opts.auth_password = g_strdup(global_capture_opts.default_options.auth_password);
+ interface_opts.datatx_udp = global_capture_opts.default_options.datatx_udp;
+ interface_opts.nocap_rpcap = global_capture_opts.default_options.nocap_rpcap;
+ interface_opts.nocap_local = global_capture_opts.default_options.nocap_local;
+#ifdef HAVE_PCAP_SETSAMPLING
+ interface_opts.sampling_method = global_capture_opts.default_options.sampling_method;
+ interface_opts.sampling_param = global_capture_opts.default_options.sampling_param;
+#endif
+ }
+#endif
+ g_array_append_val(global_capture_opts.ifaces, interface_opts);
+ if (gtk_widget_is_focus(g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES)) && interfaces_dialog_window_present()) {
+ update_selected_interface(g_strdup(interface_opts.name), TRUE);
+ }
+ if (gtk_widget_is_focus(g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES)) && dlg_window_present()) {
+ enable_selected_interface(interface_opts.name, TRUE);
+ }
+ break;
+ }
+ }
+ }
+ return TRUE;
+}
- /* event box */
- eb = gtk_event_box_new();
- gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &topic_item_idle_bg);
+static gboolean activate_ifaces(GtkTreeModel *model,
+ GtkTreePath *path _U_,
+ GtkTreeIter *iter,
+ gpointer userdata)
+{
+ gchar *if_name;
+ GtkWidget *view;
+ GtkTreeSelection *selection;
+ selected_name_t *entry = (selected_name_t *)userdata;
+
+ view = g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES);
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
+ gtk_tree_model_get (model, iter, IFACE_NAME, &if_name, -1);
+ if (strcmp(if_name, entry->name) == 0) {
+ if (entry->activate) {
+ gtk_tree_selection_select_iter(selection, iter);
+ } else {
+ gtk_tree_selection_unselect_iter(selection, iter);
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
- g_signal_connect(eb, "enter-notify-event", G_CALLBACK(welcome_item_enter_cb), NULL);
- g_signal_connect(eb, "leave-notify-event", G_CALLBACK(welcome_item_leave_cb), NULL);
- g_signal_connect(eb, "button-press-event", G_CALLBACK(welcome_if_press_cb), interf);
+void change_interface_selection(gchar* name, gboolean activate)
+{
+ GtkWidget *view;
+ GtkTreeModel *model;
+ selected_name_t entry;
+
+ view = g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES);
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
+ entry.name = g_strdup(name);
+ entry.activate = activate;
+ gtk_tree_model_foreach(GTK_TREE_MODEL(model), (GtkTreeModelForeachFunc)(activate_ifaces), (gpointer) &entry);
+}
- interface_hb = gtk_hbox_new(FALSE, 5);
- gtk_container_add(GTK_CONTAINER(eb), interface_hb);
+void change_selection_for_all(gboolean enable)
+{
+ guint i;
- /* icon */
- w = capture_get_if_icon(if_info);
- gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 5);
-
- if (user_descr != NULL)
- message = g_string_new(user_descr);
- else if (if_info->description != NULL)
- message = g_string_new(if_info->description);
- else
- message = g_string_new(if_info->name);
-
- /* truncate string if it's too long */
- /* (the number of chars is a bit arbitrary, though) */
- if(message->len > 48) {
- g_string_truncate(message, 45);
- g_string_append (message, " ...");
+ if (interfaces) {
+ for (i = 0; i < interfaces->len; i++) {
+ change_interface_selection(g_array_index(interfaces, displayed_interface, i).name, enable);
}
- g_string_prepend(message, "<span foreground='blue'>");
- g_string_append (message, "</span>");
- w = gtk_label_new(message->str);
- gtk_label_set_markup(GTK_LABEL(w), message->str);
- g_string_free(message, TRUE);
-
- gtk_misc_set_alignment (GTK_MISC(w), 0.0f, 0.0f);
- gtk_box_pack_start(GTK_BOX(interface_hb), w, FALSE, FALSE, 0);
-
- return eb;
+ }
}
+#endif
-/* load the sorted list of interfaces */
-static GList *
-welcome_if_panel_get_if_list(void)
+void
+select_ifaces(void)
{
- GList *if_list;
- int err;
- gchar *err_str = NULL;
+#ifdef HAVE_LIBPCAP
+ GtkWidget *view;
+ GtkTreeModel *model;
+ GtkTreeSelection *entry;
+
+ if (global_capture_opts.ifaces->len > 0 && swindow) {
+ view = g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES);
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
+ entry = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
+ gtk_tree_model_foreach(GTK_TREE_MODEL(model), select_current_ifaces, (gpointer) entry);
+ gtk_widget_grab_focus(view);
+ }
+#endif
+}
- /* 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);
- } else if (err_str) {
- g_free(err_str);
+#ifdef HAVE_PCAP_REMOTE
+void
+add_interface_to_list(gchar *name, gchar *descr, remote_options *remote_opts)
+{
+ GtkWidget *view, *icon;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gint size;
+ gchar *lines;
+ displayed_interface d_interface;
+
+ d_interface.name = g_strdup(name);
+ d_interface.descr = g_strdup(descr);
+ d_interface.remote_opts.src_type = remote_opts->src_type;
+ d_interface.remote_opts.remote_host_opts.remote_host = g_strdup(remote_opts->remote_host_opts.remote_host);
+ d_interface.remote_opts.remote_host_opts.remote_port = g_strdup(remote_opts->remote_host_opts.remote_port);
+ d_interface.remote_opts.remote_host_opts.auth_type = remote_opts->remote_host_opts.auth_type;
+ d_interface.remote_opts.remote_host_opts.auth_username = g_strdup(remote_opts->remote_host_opts.auth_username);
+ d_interface.remote_opts.remote_host_opts.auth_password = g_strdup(remote_opts->remote_host_opts.auth_password);
+ d_interface.remote_opts.remote_host_opts.datatx_udp = remote_opts->remote_host_opts.datatx_udp;
+ d_interface.remote_opts.remote_host_opts.nocap_rpcap = remote_opts->remote_host_opts.nocap_rpcap;
+ d_interface.remote_opts.remote_host_opts.nocap_local = remote_opts->remote_host_opts.nocap_local;
+#ifdef HAVE_PCAP_SETSAMPLING
+ d_interface.remote_opts.sampling_method = remote_opts->sampling_method;
+ d_interface.remote_opts.sampling_param = remote_opts->sampling_param;
+#endif
+ icon = xpm_to_widget(capture_airpcap_16_xpm);
+ d_interface.icon = icon;
+ view = g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES);
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
+ size = gtk_tree_model_iter_n_children(model, NULL);
+ lines = g_strdup_printf("%d", size-1);
+ g_array_append_val(interfaces, d_interface);
+ if (gtk_tree_model_get_iter_from_string(model, &iter, lines)) {
+ gtk_list_store_append (GTK_LIST_STORE(model), &iter);
+ gtk_list_store_set(GTK_LIST_STORE(model), &iter, ICON, gtk_image_get_pixbuf(GTK_IMAGE(icon)), IFACE_DESCR, descr, IFACE_NAME, name, -1);
}
- return if_list;
}
+#endif
/* list the interfaces */
-static void
-welcome_if_panel_list(GList *if_list)
+void
+welcome_if_tree_load(void)
{
- GtkWidget *child_box;
- GtkWidget *interface_hb;
-
- if_info_t *if_info;
- int ifs;
- GList *curr;
- gchar *user_descr;
-
-
- /* List the interfaces */
- for(ifs = 0; (curr = g_list_nth(if_list, ifs)); ifs++) {
- /*g_string_assign(if_tool_str, "");*/
- if_info = curr->data;
+#ifdef HAVE_LIBPCAP
+ if_info_t *if_info;
+ GList *if_list;
+ int err;
+ guint i;
+ gchar *err_str = NULL;
+ GList *curr;
+ gchar *user_descr;
+ GtkListStore *store = NULL;
+ GtkTreeIter iter;
+ GtkWidget *icon, *view;
+ GtkTreeSelection *entry;
+ displayed_interface d_interface;
+
+ view = g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES);
+ entry = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
+ gtk_tree_selection_unselect_all(entry);
+ store = gtk_list_store_new(NUMCOLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
- /* Continue if capture device is hidden */
- if (prefs_is_capture_device_hidden(if_info->name)) {
- continue;
+ /* LOAD THE INTERFACES */
+ if (interfaces && interfaces->len > 0) {
+ for (i = 0; i < interfaces->len; i++) {
+ d_interface = g_array_index(interfaces, displayed_interface, i);
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter, ICON, d_interface.icon, IFACE_DESCR, d_interface.descr, IFACE_NAME, d_interface.name, -1);
}
-
- user_descr = capture_dev_user_descr_find(if_info->name);
- if (user_descr) {
+ } else {
+ interfaces = g_array_new(TRUE, TRUE, sizeof(displayed_interface));
+ 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);
+ return;
+ } else if (err_str) {
+ g_free(err_str);
+ }
+ if (g_list_length(if_list) > 0) {
+ /* List the interfaces */
+ for (curr = g_list_first(if_list); curr; curr = g_list_next(curr)) {
+ if_info = curr->data;
+ /* Continue if capture device is hidden */
+ if (prefs_is_capture_device_hidden(if_info->name)) {
+ continue;
+ }
+ gtk_list_store_append (store, &iter);
+ d_interface.name = g_strdup(if_info->name);
+#ifdef HAVE_PCAP_REMOTE
+ d_interface.remote_opts.src_type = CAPTURE_IFLOCAL;
+#endif
+#ifdef HAVE_AIRPCAP
+ if (get_airpcap_if_from_name(airpcap_if_list,if_info->name) != NULL)
+ icon = xpm_to_widget(capture_airpcap_16_xpm);
+ else
+ icon = capture_get_if_icon(if_info);
+#else
+ icon = capture_get_if_icon(if_info);
+#endif
+ d_interface.icon = icon;
+ user_descr = capture_dev_user_descr_find(if_info->name);
+ if (user_descr) {
#ifndef _WIN32
- gchar *comment = user_descr;
- user_descr = g_strdup_printf("%s (%s)", comment, if_info->name);
- g_free (comment);
+ gchar *comment = user_descr;
+ user_descr = g_strdup_printf("%s (%s)", comment, if_info->name);
+ g_free (comment);
#endif
- interface_hb = welcome_if_new(if_info, user_descr, &topic_content_bg, g_strdup(if_info->name));
- g_free (user_descr);
- } else {
- interface_hb = welcome_if_new(if_info, NULL, &topic_content_bg, g_strdup(if_info->name));
+ gtk_list_store_set(store, &iter, ICON, gtk_image_get_pixbuf(GTK_IMAGE(icon)), IFACE_DESCR, user_descr, IFACE_NAME, if_info->name, -1);
+ d_interface.descr = g_strdup(user_descr);
+ g_free (user_descr);
+ } else if (if_info->description) {
+ gtk_list_store_set (store, &iter, ICON, gtk_image_get_pixbuf(GTK_IMAGE(icon)), IFACE_DESCR, if_info->description, IFACE_NAME, if_info->name, -1);
+ d_interface.descr = g_strdup(if_info->description);
+ } else {
+ gtk_list_store_set (store, &iter, ICON, gtk_image_get_pixbuf(GTK_IMAGE(icon)), IFACE_DESCR, if_info->name, IFACE_NAME, if_info->name, -1);
+ d_interface.descr = g_strdup(if_info->name);
+ }
+ g_array_append_val(interfaces, d_interface);
+ }
}
-
- child_box = scroll_box_dynamic_add(welcome_if_panel_vb);
- gtk_box_pack_start(GTK_BOX(child_box), interface_hb, FALSE, FALSE, 1);
+ free_interface_list(if_list);
+ gtk_tree_view_set_model(GTK_TREE_VIEW(if_view), GTK_TREE_MODEL (store));
+ if (global_capture_opts.ifaces->len > 0) {
+ gtk_tree_model_foreach(GTK_TREE_MODEL(store), select_current_ifaces, (gpointer) entry);
+ gtk_widget_grab_focus(view);
+ }
+ gtk_tree_selection_set_select_function(entry, on_selection_changed, NULL, NULL);
}
-}
#endif /* HAVE_LIBPCAP */
+}
/* reload the list of interfaces */
GList* child_list;
GList* child_list_item;
-
if(welcome_if_panel_vb) {
- GList *if_list;
child_box = scroll_box_dynamic_reset(welcome_if_panel_vb);
child_list = gtk_container_get_children(GTK_CONTAINER(child_box));
child_list_item = child_list;
}
g_list_free(child_list);
-
- if_list = welcome_if_panel_get_if_list();
- welcome_if_panel_list(if_list);
- free_interface_list(if_list);
-
+ welcome_if_tree_load();
gtk_widget_show_all(welcome_if_panel_vb);
}
#endif /* HAVE_LIBPCAP */
}
+#ifdef HAVE_LIBPCAP
+static void capture_if_start(GtkWidget *w _U_, gpointer data _U_)
+{
+#ifdef HAVE_AIRPCAP
+ interface_options interface_opts;
+#endif
+
+ if (global_capture_opts.ifaces->len == 0) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "You didn't specify an interface on which to capture packets.");
+ return;
+ }
+#ifndef USE_THREADS
+ if (global_capture_opts.ifaces->len > 1) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "You specified multiple interfaces for capturing which this version of Wireshark doesn't support.");
+ return;
+ }
+#endif
+
+ /* XXX - remove this? */
+ if (global_capture_opts.save_file) {
+ g_free(global_capture_opts.save_file);
+ global_capture_opts.save_file = NULL;
+ }
+#ifdef HAVE_AIRPCAP
+ interface_opts = g_array_index(global_capture_opts.ifaces, interface_options, 0);
+ airpcap_if_active = get_airpcap_if_from_name(airpcap_if_list, interface_opts.name);
+ airpcap_if_selected = airpcap_if_active;
+ airpcap_set_toolbar_start_capture(airpcap_if_active);
+#endif
+ capture_start_cb(NULL, NULL);
+}
+#endif
/* create the welcome page */
GtkWidget *
GtkWidget *header;
GtkWidget *topic_vb;
GtkWidget *topic_to_fill;
-#ifdef HAVE_LIBPCAP
- GtkWidget *if_child_box;
- GList *if_list;
-#endif /* HAVE_LIBPCAP */
GtkWidget *file_child_box;
gchar *label_text;
#ifdef _WIN32
DWORD chimney_enabled = 0;
DWORD ce_size = sizeof(chimney_enabled);
#endif
+#ifdef HAVE_LIBPCAP
+ GtkTreeSelection *selection;
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+ GList *if_list;
+ int err;
+ gchar *err_str = NULL;
+#endif
/* prepare colors */
+#if 0
+ /* Allocating collor isn't necessary? */
/* "page" background */
get_color(&welcome_bg);
/* topic content background color */
get_color(&topic_content_bg);
-
+#endif
+#if GTK_CHECK_VERSION(3,0,0)
+ rgba_topic_item_idle_bg = rgba_topic_content_bg;
+#else
topic_item_idle_bg = topic_content_bg;
-
+#endif
+#if 0
+ /* Allocating collor isn't necessary? */
/* topic item entered color */
get_color(&topic_item_entered_bg);
-
+#endif
welcome_scrollw = scrolled_window_new(NULL, NULL);
welcome_vb = gtk_vbox_new(FALSE, 0);
welcome_eb = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(welcome_eb), welcome_vb);
- gtk_widget_modify_bg(welcome_eb, GTK_STATE_NORMAL, &welcome_bg);
-
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(welcome_eb, GTK_STATE_NORMAL, &rgba_welcome_bg);
+#else
+ gtk_widget_modify_bg(welcome_eb, GTK_STATE_NORMAL, &welcome_bg);
+#endif
/* header */
header = welcome_header_new();
gtk_box_pack_start(GTK_BOX(welcome_vb), header, FALSE, FALSE, 0);
/* column capture */
column_vb = gtk_vbox_new(FALSE, 10);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_background_color(column_vb, GTK_STATE_NORMAL, &rgba_welcome_bg);
+#else
gtk_widget_modify_bg(column_vb, GTK_STATE_NORMAL, &welcome_bg);
+#endif
gtk_box_pack_start(GTK_BOX(welcome_hb), column_vb, TRUE, TRUE, 0);
/* capture topic */
gtk_box_pack_start(GTK_BOX(column_vb), topic_vb, TRUE, TRUE, 0);
#ifdef HAVE_LIBPCAP
- if_list = welcome_if_panel_get_if_list();
+ if_list = capture_interface_list(&err, &err_str);
if (g_list_length(if_list) > 0) {
-
item_hb = welcome_button(WIRESHARK_STOCK_CAPTURE_INTERFACES,
"Interface List",
"Live list of the capture interfaces\n(counts incoming packets)",
welcome_button_callback_helper, capture_if_cb);
gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
- label_text = g_strdup("<span foreground=\"black\">Start capture on interface:</span>");
- w = gtk_label_new(label_text);
- gtk_label_set_markup(GTK_LABEL(w), label_text);
- g_free (label_text);
- gtk_misc_set_alignment (GTK_MISC(w), 0.0f, 0.0f);
- gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 5);
-
- if_child_box = gtk_vbox_new(FALSE, 0);
- /* 8 capture interfaces or 150 pixels height is about the size */
- /* that still fits on a screen of about 1000*700 */
- welcome_if_panel_vb = scroll_box_dynamic_new(GTK_BOX(if_child_box), 8, 150);
- gtk_box_pack_start(GTK_BOX(topic_to_fill), welcome_if_panel_vb, FALSE, FALSE, 0);
- welcome_if_panel_list(if_list);
+ swindow = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_set_size_request(swindow, FALSE, 100);
+ gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(swindow), GTK_SHADOW_IN);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+ if_view = gtk_tree_view_new ();
+ g_object_set(G_OBJECT(if_view), "headers-visible", FALSE, NULL);
+ g_signal_connect(if_view, "row-activated", G_CALLBACK(options_interface_cb), (gpointer)welcome_hb);
+ g_object_set_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES, if_view);
+ renderer = gtk_cell_renderer_pixbuf_new();
+ column = gtk_tree_view_column_new_with_attributes ("",
+ GTK_CELL_RENDERER(renderer),
+ "pixbuf", ICON,
+ NULL);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(if_view), column);
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes ("",
+ GTK_CELL_RENDERER(renderer),
+ "text", IFACE_DESCR,
+ NULL);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(if_view), column);
+ gtk_tree_view_column_set_resizable(gtk_tree_view_get_column(GTK_TREE_VIEW(if_view), 0), TRUE);
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes ("",
+ GTK_CELL_RENDERER(renderer),
+ "text", IFACE_NAME,
+ NULL);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(if_view), column);
+ gtk_tree_view_column_set_visible(column, FALSE);
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(if_view));
+ gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
+#ifdef USE_THREADS
+ item_hb = welcome_button(WIRESHARK_STOCK_CAPTURE_START,
+ "Start",
+ "Choose one or more interfaces to capture from, then <b>Start</b>",
+ "Same as Capture/Interfaces with default options",
+ (welcome_button_callback_t)capture_if_start, (gpointer)if_view);
+#else
+ item_hb = welcome_button(WIRESHARK_STOCK_CAPTURE_START,
+ "Start",
+ "Choose exactly one interface to capture from, then <b>Start</b>",
+ "Same as Capture/Interfaces with default options",
+ (welcome_button_callback_t)capture_if_start, (gpointer)if_view);
+#endif
+ gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
+ welcome_if_tree_load();
+ gtk_container_add (GTK_CONTAINER (swindow), if_view);
+ gtk_container_add(GTK_CONTAINER(topic_to_fill), swindow);
item_hb = welcome_button(WIRESHARK_STOCK_CAPTURE_OPTIONS,
- "Capture Options",
- "Start a capture with detailed options",
- "Same as Capture/Options menu or toolbar item",
- welcome_button_callback_helper, capture_prep_cb);
+ "Capture Options",
+ "Start a capture with detailed options",
+ "Same as Capture/Options menu or toolbar item",
+ welcome_button_callback_helper, capture_prep_cb);
gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
#ifdef _WIN32
/* Check for chimney offloading */
NULL, NULL, (LPBYTE) &chimney_enabled, &ce_size);
if (reg_ret == ERROR_SUCCESS && chimney_enabled) {
item_hb = welcome_button(WIRESHARK_STOCK_WIKI,
- "Offloading Detected",
- "TCP Chimney offloading is enabled. You \nmight not capture much data.",
- topic_online_url(ONLINEPAGE_CHIMNEY),
- topic_menu_cb, GINT_TO_POINTER(ONLINEPAGE_CHIMNEY));
+ "Offloading Detected",
+ "TCP Chimney offloading is enabled. You \nmight not capture much data.",
+ topic_online_url(ONLINEPAGE_CHIMNEY),
+ topic_menu_cb, GINT_TO_POINTER(ONLINEPAGE_CHIMNEY));
gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
}
#endif /* _WIN32 */
} else {
label_text = g_strdup("No interface can be used for capturing in\n"
"this system with the current configuration.\n\n"
- "See Capture Help for details.");
+ "See Capture Help below for details.");
w = gtk_label_new(label_text);
gtk_label_set_markup(GTK_LABEL(w), label_text);
g_free (label_text);
gtk_misc_set_alignment (GTK_MISC(w), 0.0f, 0.0f);
gtk_box_pack_start(GTK_BOX(topic_to_fill), w, FALSE, FALSE, 5);
}
-
+
free_interface_list(if_list);
/* capture help topic */
topic_menu_cb, GINT_TO_POINTER(ONLINEPAGE_NETWORK_MEDIA));
gtk_box_pack_start(GTK_BOX(topic_to_fill), item_hb, FALSE, FALSE, 5);
#else
- label_text = g_strdup("<span foreground=\"black\">Capturing is not compiled into this version of Wireshark!</span>");
+ label_text = g_strdup("<span foreground=\"black\">Capturing is not compiled into\nthis version of Wireshark!</span>");
w = gtk_label_new(label_text);
gtk_label_set_markup(GTK_LABEL(w), label_text);
g_free (label_text);
file_child_box = gtk_vbox_new(FALSE, 1);
/* 17 file items or 300 pixels height is about the size */
/* that still fits on a screen of about 1000*700 */
- welcome_file_panel_vb = scroll_box_dynamic_new(GTK_BOX(file_child_box), 17, 300);
+ welcome_file_panel_vb = scroll_box_dynamic_new(GTK_WIDGET(file_child_box), 17, 300);
gtk_box_pack_start(GTK_BOX(topic_to_fill), welcome_file_panel_vb, FALSE, FALSE, 0);
item_hb = welcome_button(WIRESHARK_STOCK_WIKI,
welcome_eb);
gtk_widget_show_all(welcome_scrollw);
+#ifdef USE_THREADS
+ recent_mtx = g_mutex_new();
+#endif
+
return welcome_scrollw;
}
+GtkWidget* get_welcome_window(void)
+{
+ return welcome_hb;
+}
+
+displayed_interface get_interface_data(gint index)
+{
+ return g_array_index(interfaces, displayed_interface, index);
+}
+