Rename new_packet_list_set_time_width() -> new_packet_list_resize_column() because it contains no time format specific code. Further this change also ensures that new_packet_list_resize_columns() uses the newly introduced new_packet_list_resize_column()
svn path=/trunk/; revision=29782
This commit is contained in:
parent
4662b8c326
commit
8d909ba79e
4
file.c
4
file.c
|
@ -237,7 +237,7 @@ cf_timestamp_auto_precision(capture_file *cf)
|
|||
"command-line-specified" format. */
|
||||
for (i = 0; i < cf->cinfo.num_cols; i++) {
|
||||
if (col_has_time_fmt(&cf->cinfo, i)) {
|
||||
new_packet_list_set_time_width(i);
|
||||
new_packet_list_resize_column(i);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2992,7 +2992,7 @@ cf_change_time_formats(capture_file *cf)
|
|||
for (i = 0; i < cf->cinfo.num_cols; i++) {
|
||||
if (col_has_time_fmt(&cf->cinfo, i)) {
|
||||
#ifdef NEW_PACKET_LIST
|
||||
new_packet_list_set_time_width(i);
|
||||
new_packet_list_resize_column(i);
|
||||
#else
|
||||
packet_list_set_time_width(cf->cinfo.col_fmt[i], i);
|
||||
#endif
|
||||
|
|
|
@ -269,26 +269,30 @@ new_packet_list_recreate_visible_rows(void)
|
|||
packet_list_recreate_visible_rows(packetlist);
|
||||
}
|
||||
|
||||
void new_packet_list_resize_column(gint col)
|
||||
{
|
||||
PangoLayout *layout;
|
||||
GtkTreeViewColumn *column;
|
||||
gint col_width;
|
||||
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW(packetlist->view), col);
|
||||
layout = gtk_widget_create_pango_layout(packetlist->view,
|
||||
packet_list_get_widest_column_string(packetlist, col));
|
||||
pango_layout_get_pixel_size(layout, &col_width, NULL);
|
||||
gtk_tree_view_column_set_fixed_width(column, col_width);
|
||||
g_object_unref(G_OBJECT(layout));
|
||||
}
|
||||
|
||||
static void
|
||||
new_packet_list_resize_columns(void)
|
||||
{
|
||||
gint progbar_loop_max;
|
||||
gint progbar_loop_var;
|
||||
gint progbar_loop_max;
|
||||
gint progbar_loop_var;
|
||||
|
||||
progbar_loop_max = cfile.cinfo.num_cols;
|
||||
progbar_loop_max = cfile.cinfo.num_cols;
|
||||
|
||||
for (progbar_loop_var = 0; progbar_loop_var < progbar_loop_max; ++progbar_loop_var) {
|
||||
PangoLayout *layout;
|
||||
GtkTreeViewColumn *column;
|
||||
gint col_width;
|
||||
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW(packetlist->view), progbar_loop_var);
|
||||
layout = gtk_widget_create_pango_layout(packetlist->view,
|
||||
packet_list_get_widest_column_string(packetlist, progbar_loop_var));
|
||||
pango_layout_get_pixel_size(layout, &col_width, NULL);
|
||||
gtk_tree_view_column_set_fixed_width(column, col_width);
|
||||
g_object_unref(G_OBJECT(layout));
|
||||
}
|
||||
for (progbar_loop_var = 0; progbar_loop_var < progbar_loop_max; ++progbar_loop_var)
|
||||
new_packet_list_resize_column(progbar_loop_var);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -853,18 +857,5 @@ void new_packet_list_colorize_packets(void)
|
|||
gtk_widget_queue_draw (packetlist->view);
|
||||
}
|
||||
|
||||
void new_packet_list_set_time_width(gint col)
|
||||
{
|
||||
PangoLayout *layout;
|
||||
GtkTreeViewColumn *column;
|
||||
gint col_width;
|
||||
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW(packetlist->view), col);
|
||||
layout = gtk_widget_create_pango_layout(packetlist->view, get_column_width_string(get_column_format(col), col));
|
||||
pango_layout_get_pixel_size(layout, &col_width, NULL);
|
||||
gtk_tree_view_column_set_fixed_width(column, col_width);
|
||||
g_object_unref(G_OBJECT(layout));
|
||||
|
||||
}
|
||||
#endif /* NEW_PACKET_LIST */
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ void new_packet_list_select_last_row(void);
|
|||
void new_packet_list_moveto_end(void);
|
||||
gboolean new_packet_list_check_end(void);
|
||||
gint new_packet_list_find_row_from_data(gpointer data, gboolean select);
|
||||
void new_packet_list_set_time_width(gint);
|
||||
void new_packet_list_resize_column(gint col);
|
||||
#else
|
||||
/* packet list related functions */
|
||||
void packet_list_clear(void);
|
||||
|
|
Loading…
Reference in New Issue