and when changing profile. Not sure why I have to invalidate cfile.dfilter
in macro_update(), because this will be done in macros_post_update(),
but unless this we get a crash when renaming a macro...
This is a fix for bug 5002.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34011
f5534014-38df-0310-8fa8-
9805f1628bb7
#include <ctype.h>
#include <string.h>
+#include "globals.h"
#include "dfilter-int.h"
#include "dfilter.h"
#include "dfilter-macro.h"
}
}
+ /* Invalidate the display filter in case it's in use */
+ g_free (cfile.dfilter);
+ cfile.dfilter = NULL;
+
parts = g_ptr_array_new();
args_pos = g_array_new(FALSE,FALSE,sizeof(int));
macro_copy,
macro_update,
macro_free,
- NULL,
+ NULL, /* Note: This is set in macros_init () */
uat_fields);
fvt_cache = g_hash_table_new(g_str_hash,g_str_equal);
#include <gtk/gtk.h>
#include <epan/dfilter/dfilter-macro.h>
-#include <epan/uat.h>
+#include <epan/uat-int.h>
+#include "globals.h"
#include "gtk/uat_gui.h"
#include "gtk/macros_dlg.h"
+#include "gtk/gtkglobals.h"
+
+static void macros_post_update(void) {
+ g_free (cfile.dfilter);
+ cfile.dfilter = NULL;
+ g_signal_emit_by_name(main_display_filter_widget, "changed");
+}
+
+void macros_init (void) {
+ void* dfmuat;
+ dfilter_macro_get_uat(&dfmuat);
+ ((uat_t*)dfmuat)->post_update_cb = macros_post_update;
+}
void macros_dialog_cb(GtkWidget *w _U_, gpointer data _U_) {
- void* dfmuat;
- dfilter_macro_get_uat(&dfmuat);
- uat_window_cb(NULL,dfmuat);
+ void* dfmuat;
+ dfilter_macro_get_uat(&dfmuat);
+ uat_window_cb(NULL,dfmuat);
}
#ifndef __MACROS_DLG_H__
#define __MACROS_DLG_H__
+void macros_init (void);
void macros_dialog_cb(GtkWidget*, gpointer);
#endif /* __MACROS_DLG_H__ */
#include "gtk/main_airpcap_toolbar.h"
#include "gtk/main_filter_toolbar.h"
#include "gtk/menus.h"
+#include "gtk/macros_dlg.h"
#include "gtk/main_packet_list.h"
#include "gtk/main_statusbar.h"
#include "gtk/main_statusbar_private.h"
font_init();
+ macros_init();
+
stock_icons_init();
/* close the splash screen, as we are going to open the main window now */