When using the new packet list select the first packet when the file read is complete. This should take care of the crash when closing WS.

svn path=/trunk/; revision=29186
This commit is contained in:
Anders Broman 2009-07-24 08:10:33 +00:00
parent b86e69f348
commit 9bf46cd286
3 changed files with 20 additions and 2 deletions

7
file.c
View File

@ -597,12 +597,15 @@ cf_read(capture_file *cf)
cf_callback_invoke(cf_cb_file_read_finished, cf);
#ifndef NEW_PACKET_LIST
/* If we have any displayed packets to select, select the first of those
packets by making the first row the selected row. */
if (cf->first_displayed != NULL)
if (cf->first_displayed != NULL){
#ifdef NEW_PACKET_LIST
new_packet_list_select_first_row();
#else
packet_list_select_row(0);
#endif /* NEW_PACKET_LIST */
}
if(stop_flag) {
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,

View File

@ -206,6 +206,20 @@ new_packet_list_prev(void)
{
g_warning("*** new_packet_list_prev() not yet implemented.");
}
void
new_packet_list_select_first_row(void)
{
GtkTreeModel *model = GTK_TREE_MODEL(packetlist);
GtkTreeSelection *selection;
GtkTreeIter iter;
if(!gtk_tree_model_get_iter_first(model, &iter))
return;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(packetlist->view));
gtk_tree_selection_select_iter (selection, &iter);
new_packet_list_select_cb(GTK_TREE_VIEW(packetlist->view), NULL);
}
gint
new_packet_list_find_row_from_data(gpointer data, gboolean select)

View File

@ -62,6 +62,7 @@ void new_packet_list_prev(void);
guint new_packet_list_append(column_info *cinfo, frame_data *fdata);
frame_data * new_packet_list_get_row_data(gint row);
void new_packet_list_enable_color(gboolean enable);
void new_packet_list_select_first_row(void);
gint new_packet_list_find_row_from_data(gpointer data, gboolean select);
#else
/* packet list related functions */