void add_trace(GtkWidget * widget, gpointer user_data)
{
- LttvTraceset * traceset;
+ LttvTraceset * traceset = NULL;
const char * path;
char abs_path[PATH_MAX];
gint id;
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 */