From: Francis Deslauriers Date: Wed, 4 Jul 2012 21:21:20 +0000 (-0400) Subject: Add warning popup when trying to open multiple traces X-Git-Tag: v1.5-beta1~64 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=deb3d2f82d104fb338a5c96d0cbe628903cbab96;p=lttv.git Add warning popup when trying to open multiple traces Signed-off-by: Francis Deslauriers Signed-off-by: Yannick Brosseau --- diff --git a/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index ae56ee67..ec772404 100644 --- a/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -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 */