aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2012-03-30 08:57:57 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2012-03-30 08:57:57 +0000
commit019008548bbaf3f575469c3c8f917a1b59331e12 (patch)
tree3906023cb44520e084508998a714584fe01f6153 /ui
parenteb262d2cc2cf5db5176bea81a815efe67e9e682f (diff)
Recreate the packet list when changing UAT for header fields.
This fixes a crash when changing settings for fields used as a custom column. svn path=/trunk/; revision=41840
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/uat_gui.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/ui/gtk/uat_gui.c b/ui/gtk/uat_gui.c
index bea21d33d4..4329ac2750 100644
--- a/ui/gtk/uat_gui.c
+++ b/ui/gtk/uat_gui.c
@@ -69,6 +69,7 @@
#include "ui/gtk/gui_stat_menu.h"
#include "ui/gtk/main.h"
#include "ui/gtk/uat_gui.h"
+#include "ui/gtk/new_packet_list.h"
#include "ui/gtk/old-gtk-compat.h"
# define BUTTON_SIZE_X -1
@@ -714,6 +715,15 @@ static void uat_down_cb(GtkButton *button _U_, gpointer u) {
set_buttons(uat,row);
}
+static void uat_apply_changes(uat_t *uat) {
+ if(strcmp(uat->category, UAT_CAT_FIELDS) == 0) {
+ /* Recreate list with new fields and redissect packets */
+ new_packet_list_recreate ();
+ } else if(cfile.state != FILE_CLOSED) {
+ redissect_packets ();
+ }
+}
+
static void uat_cancel_cb(GtkWidget *button _U_, gpointer u) {
uat_t* uat = u;
gchar* err = NULL;
@@ -726,7 +736,7 @@ static void uat_cancel_cb(GtkWidget *button _U_, gpointer u) {
report_failure("Error while loading %s: %s",uat->name,err);
}
- redissect_packets ();
+ uat_apply_changes (uat);
}
g_signal_handlers_disconnect_by_func(uat->rep->window, uat_window_delete_event_cb, uat);
@@ -741,7 +751,7 @@ static void uat_apply_cb(GtkButton *button _U_, gpointer u) {
if (uat->changed) {
if (uat->post_update_cb) uat->post_update_cb();
- redissect_packets ();
+ uat_apply_changes (uat);
}
}
@@ -757,7 +767,7 @@ static void uat_ok_cb(GtkButton *button _U_, gpointer u) {
}
if (uat->post_update_cb) uat->post_update_cb();
- redissect_packets ();
+ uat_apply_changes (uat);
}
g_signal_handlers_disconnect_by_func(uat->rep->window, uat_window_delete_event_cb, uat);