aboutsummaryrefslogtreecommitdiffstats
path: root/epan/column.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2010-10-09 15:22:53 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2010-10-09 15:22:53 +0000
commitccfe41300c2379e66404f60e7464a90c2adc72c3 (patch)
tree4a7ce48818a46730e140189780f0af5436acf97f /epan/column.c
parent20cdf3194c15e0da673e7b808a86fa3f46ffcb1f (diff)
Added "Edit Column Details" functions to the packet list heading popup.
Removed "Rename Column Title" as this is moved to "Edit Column Details". svn path=/trunk/; revision=34444
Diffstat (limited to 'epan/column.c')
-rw-r--r--epan/column.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/epan/column.c b/epan/column.c
index ef5a3ce503..3cbbb6d876 100644
--- a/epan/column.c
+++ b/epan/column.c
@@ -629,6 +629,21 @@ get_column_format(const gint col)
return(get_column_format_from_str(cfmt->fmt));
}
+void
+set_column_format(const gint col, const gint fmt)
+{
+ GList *clp = g_list_nth(prefs.col_list, col);
+ fmt_data *cfmt;
+
+ if (!clp) /* Invalid column requested */
+ return;
+
+ cfmt = (fmt_data *) clp->data;
+
+ g_free (cfmt->fmt);
+ cfmt->fmt = g_strdup(col_format_to_string(fmt));
+}
+
gint
get_column_format_from_str(const gchar *str)
{
@@ -655,6 +670,21 @@ get_column_title(const gint col)
return(cfmt->title);
}
+void
+set_column_title(const gint col, const gchar *title)
+{
+ GList *clp = g_list_nth(prefs.col_list, col);
+ fmt_data *cfmt;
+
+ if (!clp) /* Invalid column requested */
+ return;
+
+ cfmt = (fmt_data *) clp->data;
+
+ g_free (cfmt->title);
+ cfmt->title = g_strdup (title);
+}
+
gboolean
get_column_visible(const gint col)
{
@@ -725,6 +755,21 @@ get_column_custom_field(const gint col)
return(cfmt->custom_field);
}
+void
+set_column_custom_field(const gint col, const char *custom_field)
+{
+ GList *clp = g_list_nth(prefs.col_list, col);
+ fmt_data *cfmt;
+
+ if (!clp) /* Invalid column requested */
+ return;
+
+ cfmt = (fmt_data *) clp->data;
+
+ g_free (cfmt->custom_field);
+ cfmt->custom_field = g_strdup (custom_field);
+}
+
gint
get_column_custom_occurrence(const gint col)
{
@@ -740,6 +785,20 @@ get_column_custom_occurrence(const gint col)
}
void
+set_column_custom_occurrence(const gint col, const gint custom_occurrence)
+{
+ GList *clp = g_list_nth(prefs.col_list, col);
+ fmt_data *cfmt;
+
+ if (!clp) /* Invalid column requested */
+ return;
+
+ cfmt = (fmt_data *) clp->data;
+
+ cfmt->custom_occurrence = custom_occurrence;
+}
+
+void
build_column_format_array(column_info *cinfo, const gint num_cols, const gboolean reset_fences)
{
int i;