global traces works, interaction with mainwindow seems ok
[lttv.git] / ltt / branches / poly / lttv / modules / gui / lttvwindow / lttvwindow / init_module.c
index 505cc86da3416398df06be904fe51c5c1d53b70d..604af308cbd1a2402c484dce2fc7cd4c936d0fa5 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #include <gtk/gtk.h>
+#include <glib.h>
 
 #include <lttv/lttv.h>
 #include <lttv/attribute.h>
@@ -37,6 +38,7 @@
 #include <lttv/stats.h>
 #include <lttvwindow/menu.h>
 #include <lttvwindow/toolbar.h>
+#include <lttvwindow/lttvwindowtraces.h>
 
 #include "interface.h"
 #include "support.h"
 #include <ltt/trace.h>
 
 
-GQuark LTTV_TRACES;
+LttvTraceInfo LTTV_TRACES,
+       LTTV_COMPUTATION,
+       LTTV_REQUESTS_QUEUE,
+       LTTV_REQUESTS_CURRENT,
+       LTTV_NOTIFY_QUEUE,
+       LTTV_NOTIFY_CURRENT;
 
 /** Array containing instanced objects. */
 GSList * g_main_window_list = NULL ;
@@ -63,12 +70,16 @@ static char *a_trace;
 void lttv_trace_option(void *hook_data)
 { 
   LttTrace *trace;
-  gchar *path;
-
-  trace = ltt_trace_open(a_trace);
-  if(trace == NULL) g_critical("cannot open trace %s", a_trace);
-  g_init_trace = lttv_trace_new(trace);
-
+  gchar *abs_path;
+
+  get_absolute_pathname(a_trace, abs_path);
+  g_init_trace = lttvwindowtraces_get_trace_by_name(abs_path);
+  if(g_init_trace == NULL) {
+    trace = ltt_trace_open(abs_path);
+    if(trace == NULL) g_critical("cannot open trace %s", abs_path);
+    g_init_trace = lttv_trace_new(trace);
+    lttvwindowtraces_add_trace(g_init_trace);
+  }
 }
 
 /*****************************************************************************
@@ -110,7 +121,12 @@ static void init() {
   // Global attributes only used for interaction with main() here.
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
   
-  LTTV_TRACES = g_quark_from_string("traces/");
+  LTTV_TRACES = g_quark_from_string("traces");
+  LTTV_COMPUTATION = g_quark_from_string("computation");
+  LTTV_REQUESTS_QUEUE = g_quark_from_string("requests_queue");
+  LTTV_REQUESTS_CURRENT = g_quark_from_string("requests_current");
+  LTTV_NOTIFY_QUEUE = g_quark_from_string("notify_queue");
+  LTTV_NOTIFY_CURRENT = g_quark_from_string("notify_current");
   
   g_debug("GUI init()");
 
This page took 0.023743 seconds and 4 git commands to generate.