EO_NUM_COLUMNS /* must be last */
};
+static eo_protocoldata_reset_cb eo_protocoldata_reset = NULL;
+
static void
eo_remember_this_row(GtkTreeModel *model _U_, GtkTreePath *path,
/* Free the GSList elements */
g_slist_free(object_list->entries);
g_free(object_list);
+
+ /* Free the private export_object_xxx data */
+ if (eo_protocoldata_reset != NULL) eo_protocoldata_reset();
}
static gboolean
}
static GString *
-eo_massage_str(const gchar *in_str, guint maxlen, gchar dup)
+eo_massage_str(const gchar *in_str, gsize maxlen, gchar dup)
{
gchar *tmp_ptr;
/* The characters in "reject" come from:
object_list->entries = NULL;
object_list->iter = NULL;
object_list->row_selected = -1;
+
+ if (eo_protocoldata_reset != NULL) eo_protocoldata_reset();
}
static void
}
void
-export_object_window(const gchar *tapname, const gchar *name, tap_packet_cb tap_packet)
+export_object_window(const gchar *tapname, const gchar *name, tap_packet_cb tap_packet, eo_protocoldata_reset_cb eo_protocoldata_resetfn)
{
GtkWidget *sw;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
GtkWidget *vbox, *bbox, *help_bt, *cancel_bt, *save_bt, *save_all_bt;
- GtkTooltips *button_bar_tips;
GString *error_msg;
export_object_list_t *object_list;
gchar *window_title;
+ /* Initialize the pointer to the private data clearing function */
+ eo_protocoldata_reset = eo_protocoldata_resetfn;
+
/* Initialize our object list structure */
object_list = g_malloc0(sizeof(export_object_list_t));
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't register %s tap: %s\n", name, error_msg->str);
g_string_free(error_msg, TRUE);
+ g_free(object_list);
return;
}
/* Setup our GUI window */
- button_bar_tips = gtk_tooltips_new();
-
window_title = g_strdup_printf("Wireshark: %s object list", name);
object_list->dlg = dlg_window_new(window_title);
g_free(window_title);
/* Help button */
help_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_HELP);
g_signal_connect(help_bt, "clicked", G_CALLBACK(topic_cb), (gpointer)HELP_EXPORT_OBJECT_LIST);
- gtk_tooltips_set_tip(GTK_TOOLTIPS(button_bar_tips), help_bt,
- "Show help for this dialog.", NULL);
+ gtk_widget_set_tooltip_text(help_bt, "Show help for this dialog.");
/* Save All button */
save_all_bt = g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_SAVE_ALL);
g_signal_connect(save_all_bt, "clicked", G_CALLBACK(eo_save_all_clicked_cb),
object_list);
- gtk_tooltips_set_tip(GTK_TOOLTIPS(button_bar_tips), save_all_bt,
- "Save all listed objects with their displayed "
- "filenames.", NULL);
+ gtk_widget_set_tooltip_text(save_all_bt, "Save all listed objects with their displayed filenames.");
/* Save As button */
save_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_SAVE_AS);
g_signal_connect(save_bt, "clicked", G_CALLBACK(eo_save_clicked_cb), object_list);
- gtk_tooltips_set_tip(GTK_TOOLTIPS(button_bar_tips), save_bt,
- "Saves the currently selected content to a file.",
- NULL);
+ gtk_widget_set_tooltip_text(save_bt, "Saves the currently selected content to a file.");
/* Cancel button */
cancel_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
- gtk_tooltips_set_tip(GTK_TOOLTIPS(button_bar_tips), cancel_bt,
- "Cancel this dialog.", NULL);
-
+ gtk_widget_set_tooltip_text(cancel_bt, "Cancel this dialog.");
/* Pack the buttons into the "button box" */
gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);