mega fix for states : per cpu and _not_ per tracefile state. We have many tracefiles...
[lttv.git] / ltt / branches / poly / lttv / modules / gui / lttvwindow / lttvwindow / callbacks.c
index a9bdac212f730a5464da842e91fe9f16269daae6..0002a3ccd0f5eb72507fb11c248aa058f83ae221 100644 (file)
@@ -73,12 +73,6 @@ Tab* create_tab(MainWindow * mw, Tab *copy_tab,
 
 static void insert_viewer(GtkWidget* widget, lttvwindow_viewer_constructor constructor);
 
-void checkbox_changed(GtkTreeView *treeview,
-                     GtkTreePath *arg1,
-                     GtkTreeViewColumn *arg2,
-                     gpointer user_data);
-void remove_trace_from_traceset_selector(GtkWidget * paned, unsigned i);
-void add_trace_into_traceset_selector(GtkWidget * paned, LttTrace * trace);
 Tab *create_new_tab(GtkWidget* widget, gpointer user_data);
 
 static gboolean lttvwindow_process_pending_requests(Tab *tab);
@@ -337,6 +331,18 @@ static void connect_focus_recursive(GtkWidget *widget,
                     (gpointer)viewer);
 }
 
+/* Stop all the processings and call gtk_main_quit() */
+static void mainwindow_quit()
+{
+  lttvwindowtraces_unregister_requests(g_quark_from_string("stats"));
+  lttvwindowtraces_unregister_requests(g_quark_from_string("state"));
+  lttvwindowtraces_unregister_computation_hooks(g_quark_from_string("stats"));
+  lttvwindowtraces_unregister_computation_hooks(g_quark_from_string("state"));
+
+  gtk_main_quit();
+}
+
+
 /* insert_viewer function constructs an instance of a viewer first,
  * then inserts the widget of the instance into the container of the
  * main window
@@ -429,6 +435,10 @@ int SetTraceset(Tab * tab, LttvTraceset *traceset)
   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));
@@ -959,8 +969,9 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
   }
 
   /* 0.2 Seek tracefiles positions to context position */
+  //g_assert(lttv_process_traceset_seek_position(tsc, sync_position) == 0);
   lttv_process_traceset_synchronize_tracefiles(tsc);
-
+  
   
   /* Events processing algorithm implementation */
   /* Warning : the gtk_events_pending takes a LOT of cpu time. So what we do
@@ -1102,6 +1113,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
                lttv_process_traceset_middle(tsc,
                                             events_request->start_time,
                                             G_MAXUINT, NULL);
+ //           g_assert(seek_count < 50000);
 
 
         } else {
@@ -1592,10 +1604,10 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
 
 
   }
-  
   /* C Unlock Traces */
   {
-    //lttv_process_traceset_get_sync_data(tsc);
+    lttv_process_traceset_get_sync_data(tsc);
+    //lttv_traceset_context_position_save(tsc, sync_position);
     
     guint iter_trace;
     
@@ -1607,7 +1619,6 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
       lttvwindowtraces_unlock(trace_v);
     }
   }
-
 #if 0
   //set the cursor back to normal
   gdk_window_set_cursor(win, NULL);  
@@ -1779,9 +1790,11 @@ void add_trace(GtkWidget * widget, gpointer user_data)
  * it will remove the trace,  recreate the traceset_contex,
  * and redraws all the viewer of the current tab. If there is on trace in the
  * current traceset, it will delete all viewers of the current tab
+ *
+ * It destroys the filter tree. FIXME... we should request for an update
+ * instead.
  */
 
-// MD : no filter version.
 void remove_trace(GtkWidget *widget, gpointer user_data)
 {
   LttTrace *trace;
@@ -2259,6 +2272,8 @@ Tab *create_new_tab(GtkWidget* widget, gpointer user_data){
   strcpy(label,"Page");
   if(get_label(mw_data, label,"Get the name of the tab","Please input tab's name"))    
     return (create_tab (mw_data, copy_tab, notebook, label));
+  else
+    return NULL;
 }
 
 void
@@ -2362,7 +2377,7 @@ void
 on_quit_activate                       (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-  gtk_main_quit ();
+  mainwindow_quit();
 }
 
 
@@ -3199,7 +3214,7 @@ on_MWindow_destroy                     (GtkWidget       *widget,
 
   g_info("There are now : %d windows\n",g_slist_length(g_main_window_list));
   if(g_slist_length(g_main_window_list) == 0)
-    gtk_main_quit ();
+    mainwindow_quit();
 }
 
 gboolean    
@@ -3809,7 +3824,7 @@ char * get_selection(char ** loaded_module_name, int nb_module,
   }
 
   id = gtk_dialog_run(GTK_DIALOG(dialogue));
-  GtkTreeModel **store_model = (GtkTreeModel**)&store;  /* for strict aliasing */
+  GtkTreeModel **store_model = (GtkTreeModel**)&store;
   switch(id){
     case GTK_RESPONSE_ACCEPT:
     case GTK_RESPONSE_OK:
This page took 0.024741 seconds and 4 git commands to generate.