Add warning popup when trying to open multiple traces
authorFrancis Deslauriers <francis.deslauriers@polymtl.ca>
Wed, 4 Jul 2012 21:21:20 +0000 (17:21 -0400)
committerYannick Brosseau <yannick.brosseau@gmail.com>
Fri, 6 Jul 2012 21:34:21 +0000 (17:34 -0400)
Signed-off-by: Francis Deslauriers <francis.deslauriers@polymtl.ca>
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c

index ae56ee67354108613cf5b8793c3b61414f48a2c6..ec7724043f2f55767be62dee5cd271599d382169 100644 (file)
@@ -1613,7 +1613,7 @@ static void lttvwindow_add_trace(Tab *tab, LttvTrace *trace_v)
 void add_trace(GtkWidget * widget, gpointer user_data)
 {
   
-  LttvTraceset * traceset;
+  LttvTraceset * traceset = NULL;
   const char * path;
   char abs_path[PATH_MAX];
   gint id;
@@ -1632,6 +1632,20 @@ void add_trace(GtkWidget * widget, gpointer user_data)
     ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
     tab = ptab->tab;
   }
+  traceset = lttvwindow_get_traceset(tab);
+  if(traceset != NULL && traceset->traces->len > 0){
+         GtkWidget *dialogue = 
+           gtk_message_dialog_new(
+             GTK_WINDOW(gtk_widget_get_toplevel(widget)),
+             GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+             GTK_MESSAGE_ERROR,
+             GTK_BUTTONS_OK,
+             "Loading multiple traces is not supported at the moment.");
+         gtk_dialog_run(GTK_DIALOG(dialogue));
+         gtk_widget_destroy(dialogue);
+         return;
+       }
+  
   /* Create a new traceset*/
   traceset = lttv_traceset_new();
   /* File open dialog management */
This page took 0.025335 seconds and 4 git commands to generate.