From db8bc91756aba1610e896aa1e9eee184843f3970 Mon Sep 17 00:00:00 2001 From: compudj Date: Sun, 8 Aug 2004 01:34:13 +0000 Subject: [PATCH] time bar fixes git-svn-id: http://ltt.polymtl.ca/svn@672 04897980-b3bd-0310-b5e0-8ef037075253 --- .../gui/lttvwindow/lttvwindow/callbacks.c | 7 ++--- .../gui/lttvwindow/lttvwindow/lttvwindow.c | 28 ++++++++++++++----- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index d7da3f4c..7a7d19c9 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -3477,13 +3477,12 @@ void current_time_change_manager (Tab *tab, LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context); TimeInterval time_span = tsc->time_span; - tab->current_time = new_current_time; - /* current seconds */ gtk_spin_button_set_range(GTK_SPIN_BUTTON(tab->MEntry5), (double)time_span.start_time.tv_sec, (double)time_span.end_time.tv_sec); - + gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry5), + (double)new_current_time.tv_sec); /* start nanoseconds */ if(new_current_time.tv_sec == time_span.start_time.tv_sec) { gtk_spin_button_set_range(GTK_SPIN_BUTTON(tab->MEntry6), @@ -3503,7 +3502,7 @@ void current_time_change_manager (Tab *tab, gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry6), (double)new_current_time.tv_nsec); - lttvwindow_report_current_time(tab, tab->current_time); + set_current_time(tab, &new_current_time); tab->current_time_manager_lock = FALSE; } diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c index a37077e3..a0971163 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c @@ -76,6 +76,27 @@ void set_time_window(Tab *tab, const TimeWindow *time_window) } +/* set_current_time + * + * It updates the current time of the tab, then calls the updatetimewindow + * hooks of each viewer. + * + * This is called whenever the current time value changes. + */ + +void set_current_time(Tab *tab, const LttTime *current_time) +{ + LttvAttributeValue value; + LttvHooks * tmp; + + tab->current_time = *current_time; + + g_assert(lttv_iattribute_find_by_path(tab->attributes, + "hooks/updatecurrenttime", LTTV_POINTER, &value)); + tmp = (LttvHooks*)*(value.v_pointer); + if(tmp != NULL) lttv_hooks_call(tmp, &tab->current_time); +} + void add_toolbar_constructor(MainWindow *mw, LttvToolbarClosure *toolbar_c) { LttvIAttribute *attributes = mw->attributes; @@ -743,13 +764,6 @@ void lttvwindow_report_current_time(Tab *tab, LttvHooks * tmp; current_time_change_manager(tab, time); - - g_assert(lttv_iattribute_find_by_path(tab->attributes, - "hooks/updatecurrenttime", LTTV_POINTER, &value)); - tmp = (LttvHooks*)*(value.v_pointer); - - if(tmp == NULL)return; - lttv_hooks_call(tmp, &tab->current_time); } /** -- 2.34.1