state update hooks are added by the main window
[lttv.git] / ltt / branches / poly / lttv / modules / guiStatistic / guiStatistic.c
index 432efe3d3695c5d12e049535a8673b6e579da0d7..c7ed6e6dc42494deb780af974430d17b613bd3bb 100644 (file)
@@ -312,6 +312,11 @@ gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key)
                    G_OBJECT(statistic_viewer_data->hpaned_v),
                    TRACESET_TIME_SPAN,
                    &statistic_viewer_data->time_span);
+  
+  if(statistic_viewer_data->calculate_stats){
+    if(lttv_stats_load_statistics(statistic_viewer_data->stats))
+      statistic_viewer_data->calculate_stats = FALSE;
+  }
 
   if(statistic_viewer_data->calculate_stats == FALSE){
     statistic_viewer_data->size = 1;
@@ -559,6 +564,7 @@ gboolean statistic_show_viewer(void * hook_data, void * call_data)
     show_traceset_stats(statistic_viewer_data);
     if(statistic_viewer_data->calculate_stats){
       statistic_remove_context_hooks(statistic_viewer_data,tsc);
+      lttv_stats_save_statistics((LttvTracesetStats*)tsc);
     }
   }
 
@@ -622,7 +628,7 @@ void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data,
   }  
 
   //add state and stats hooks
-  state_add_event_hooks_api(statistic_viewer_data->mw);
+  //state_add_event_hooks_api(statistic_viewer_data->mw);  //it will be added in the main window
   stats_add_event_hooks_api(statistic_viewer_data->mw);
   
 }
@@ -674,7 +680,7 @@ void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data,
   }
 
   //remove state and stats hooks
-  state_remove_event_hooks_api(statistic_viewer_data->mw);
+  //state_remove_event_hooks_api(statistic_viewer_data->mw); //it will be done in the main window
   stats_remove_event_hooks_api(statistic_viewer_data->mw);
 }
 
This page took 0.026065 seconds and 4 git commands to generate.