aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-08-18 23:00:42 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-08-18 23:00:42 +0000
commita47a4a52424356dbd1af10a8ca7a9f50e3c4f366 (patch)
treeaede65cc3153be9fcaf07ab43d02a244ccae0bb8 /gtk
parente2c8640c8d254cb890166c191cf94c7b2cd60988 (diff)
Add new_packet_list_recent_write_all().
svn path=/trunk/; revision=29469
Diffstat (limited to 'gtk')
-rw-r--r--gtk/new_packet_list.c26
-rw-r--r--gtk/new_packet_list.h8
-rw-r--r--gtk/recent.c8
3 files changed, 41 insertions, 1 deletions
diff --git a/gtk/new_packet_list.c b/gtk/new_packet_list.c
index 8b71960ad8..4fa107acec 100644
--- a/gtk/new_packet_list.c
+++ b/gtk/new_packet_list.c
@@ -851,5 +851,31 @@ new_packet_list_copy_summary_cb(GtkWidget * w _U_, gpointer data _U_, gint copy_
}
g_string_free(text,TRUE);
}
+
+/* XXX fore some reason this does not work in th .h file XXX*/
+#define RECENT_KEY_COL_WIDTH "column.width"
+
+void
+new_packet_list_recent_write_all(FILE *rf)
+{
+ gint col;
+ GtkTreeViewColumn *tree_column;
+
+ fprintf (rf, "%s:", RECENT_KEY_COL_WIDTH);
+ for (col = 0; col < cfile.cinfo.num_cols; col++) {
+ if (cfile.cinfo.col_fmt[col] == COL_CUSTOM) {
+ fprintf (rf, " %%Cus:%s,", get_column_custom_field(col));
+ } else {
+ fprintf (rf, " %s,", col_format_to_string(cfile.cinfo.col_fmt[col]));
+ }
+ tree_column = gtk_tree_view_get_column(GTK_TREE_VIEW(GTK_TREE_VIEW(packetlist->view)), col);
+ fprintf (rf, " %d", gtk_tree_view_column_get_width(tree_column));
+ if (col != cfile.cinfo.num_cols-1) {
+ fprintf (rf, ",");
+ }
+ }
+ fprintf (rf, "\n");
+}
+
#endif /* NEW_PACKET_LIST */
diff --git a/gtk/new_packet_list.h b/gtk/new_packet_list.h
index 4480c3dcbf..c9d229ecd9 100644
--- a/gtk/new_packet_list.h
+++ b/gtk/new_packet_list.h
@@ -28,6 +28,8 @@
#ifdef NEW_PACKET_LIST
#include <gtk/gtk.h>
+#define RECENT_KEY_COL_WIDTH "column.width"
+
GtkWidget *new_packet_list_create(void);
void new_packet_list_resize_columns_cb(GtkWidget *widget _U_, gpointer data _U_);
gboolean new_packet_list_get_event_row_column(GdkEventButton *event_button, gint *physical_row, gint *row, gint *column);
@@ -62,6 +64,12 @@ typedef enum {
*/
void new_packet_list_copy_summary_cb(GtkWidget * w _U_, gpointer data _U_, copy_summary_type copy_type);
+/** Write all packet list geometry values to the recent file.
+ *
+ * @param rf recent file handle from caller
+ */
+extern void new_packet_list_recent_write_all(FILE *rf);
+
#endif /* NEW_PACKET_LIST */
#endif /* __NEW_PACKET_LIST_H__ */
diff --git a/gtk/recent.c b/gtk/recent.c
index 924a02b5e5..3c329e625b 100644
--- a/gtk/recent.c
+++ b/gtk/recent.c
@@ -46,7 +46,11 @@
#include "gtk/main.h"
#include "gtk/menus.h"
#include "gtk/gui_utils.h"
+#ifdef NEW_PACKET_LIST
+#include "gtk/new_packet_list.h"
+#else
#include "gtk/main_packet_list.h"
+#endif /*NEW_PACKET_LIST */
#include "gtk/file_dlg.h"
#include "gtk/cfilter_combo_utils.h"
#include "gtk/u3.h"
@@ -373,7 +377,9 @@ write_profile_recent(void)
fprintf(rf, "\n# Packet list column pixel widths.\n");
fprintf(rf, "# Each pair of strings consists of a column format and its pixel width.\n");
-#ifndef NEW_PACKET_LIST
+#ifdef NEW_PACKET_LIST
+ new_packet_list_recent_write_all(rf);
+#else
packet_list_recent_write_all(rf);
#endif