end = ltt_time_sub(time_span.end_time, time_span.start_time);
event_viewer_data->vadjust_c->upper = ltt_time_to_double(end);
- g_signal_emit_by_name(event_viewer_data->vadjust_c, "value-changed");
+
+ /* Reset the positions */
+ lttv_traceset_context_position_destroy(
+ event_viewer_data->currently_selected_position);
+ lttv_traceset_context_position_destroy(
+ event_viewer_data->first_event);
+ lttv_traceset_context_position_destroy(
+ event_viewer_data->last_event);
+
+ event_viewer_data->currently_selected_position =
+ lttv_traceset_context_position_new(tsc);
+ event_viewer_data->first_event =
+ lttv_traceset_context_position_new(tsc);
+ event_viewer_data->last_event =
+ lttv_traceset_context_position_new(tsc);
+
+ get_events(event_viewer_data->vadjust_c->value, event_viewer_data);
// event_viewer_data->vadjust_c->value = 0;
return FALSE;
event_viewer_data->main_win_filter =
(LttvFilter*)call_data;
- g_signal_emit_by_name(event_viewer_data->vadjust_c, "value-changed");
+ get_events(event_viewer_data->vadjust_c->value, event_viewer_data);
return FALSE;
}
LttvTracesetContext *tsc =
LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
TimeInterval time_span = tsc->time_span;
- TimeWindow new_time_window;
- LttTime new_current_time;
+ TimeWindow new_time_window = tab->time_window;
+ LttTime new_current_time = tab->current_time;
/* Set the tab's time window and current time if
* out of bounds */
LttTime tmp_time;
if(ltt_time_compare(lttvwindow_default_time_width,
- ltt_time_sub(time_span.end_time, time_span.start_time)) < 0)
+ ltt_time_sub(time_span.end_time, time_span.start_time)) < 0
+ ||
+ ltt_time_compare(time_span.end_time, time_span.start_time) == 0)
tmp_time = lttvwindow_default_time_width;
else
tmp_time = time_span.end_time;
new_time_window.end_time = ltt_time_add(new_time_window.start_time,
new_time_window.time_width) ;
}
- time_change_manager(tab, new_time_window);
- current_time_change_manager(tab, new_current_time);
- //FIXME : we delete the filter tree, when it should be updated.
- lttv_filter_destroy(tab->filter);
- tab->filter = NULL;
-
+
+
#if 0
/* Set scrollbar */
GtkAdjustment *adjustment = gtk_range_get_adjustment(GTK_RANGE(tab->scrollbar));
if(tmp == NULL) retval = 1;
else lttv_hooks_call(tmp,traceset);
+ time_change_manager(tab, new_time_window);
+ current_time_change_manager(tab, new_current_time);
+
+ if(tab->filter)
+ lttv_filter_update(tab->filter);
+
return retval;
}
for(i = 0; i < nb_trace; i++){
trace_v = lttv_traceset_get(tab->traceset_info->traceset, i);
trace = lttv_trace(trace_v);
- name[i] = ltt_trace_name(trace);
+ name[i] = g_quark_to_string(ltt_trace_name(trace));
}
remove_trace_name = get_remove_trace(name, nb_trace);
/* We can clone the filter, as we copy the trace set also */
/* The filter must always be in sync with the trace set */
tab->filter = lttv_filter_clone(copy_tab->filter);
- tab->time_window = copy_tab->time_window;
- tab->current_time = copy_tab->current_time;
} else {
tab->traceset_info->traceset = lttv_traceset_new();
tab->filter = NULL;
- tab->time_window.start_time = ltt_time_zero;
- tab->time_window.time_width = lttvwindow_default_time_width;
- tab->time_window.end_time = ltt_time_add(tab->time_window.start_time,
- tab->time_window.time_width);
- tab->current_time = ltt_time_zero;
}
-
#ifdef DEBUG
lttv_attribute_write_xml(
lttv_traceset_attribute(tab->traceset_info->traceset),
TRUE, /* expand */
TRUE, /* Give the extra space to the child */
0); /* No padding */
+
+// if(copy_tab) {
+// tab->time_window = copy_tab->time_window;
+// tab->current_time = copy_tab->current_time;
+// }
/* Create the timebar */
{
// always show : not if(g_list_length(list)>1)
gtk_notebook_set_show_tabs(notebook, TRUE);
+ if(copy_tab) {
+ lttvwindow_report_time_window(tab, copy_tab->time_window);
+ lttvwindow_report_current_time(tab, copy_tab->current_time);
+ } else {
+ TimeWindow time_window;
+
+ time_window.start_time = ltt_time_zero;
+ time_window.end_time = ltt_time_add(time_window.start_time,
+ lttvwindow_default_time_width);
+ time_window.time_width = lttvwindow_default_time_width;
+ time_window.time_width_double = ltt_time_to_double(time_window.time_width);
+
+ lttvwindow_report_time_window(tab, time_window);
+ lttvwindow_report_current_time(tab, ltt_time_zero);
+ }
+
+ LttvTraceset *traceset = tab->traceset_info->traceset;
+ SetTraceset(tab, traceset);
+
return tab;
}