From: Yannick Brosseau Date: Fri, 24 May 2013 19:30:51 +0000 (-0400) Subject: Disable open new window and new tabs are now created emtpy X-Git-Tag: v1.5-beta1~8 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e40cdd19296a4fbacf0738fb3671f6d0503d9e99;p=lttv.git Disable open new window and new tabs are now created emtpy Signed-off-by: Yannick Brosseau --- diff --git a/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index b5f416b2..9b70ee3f 100644 --- a/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -1680,22 +1680,7 @@ void add_trace(GtkWidget * widget, gpointer user_data) ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin"); tab = ptab->tab; } -#if 0 -//TODO fdeslauriers 2012-07-06: Remove this popup when we support multiple traces - traceset = lttvwindow_get_traceset(tab); - if(traceset != NULL && lttv_traceset_number(traceset) > 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; - } -#endif + /* Create a new traceset*/ traceset = tab->traceset_info->traceset; if(traceset == NULL) { @@ -2283,7 +2268,7 @@ LttvPluginTab *create_new_tab(GtkWidget* widget, gpointer user_data) gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))); Tab *copy_tab; - if(!page) { + if(!page || TRUE ) { copy_tab = NULL; } else { LttvPluginTab *ptab; @@ -3105,7 +3090,19 @@ void on_button_new_clicked (GtkButton *button, gpointer user_data) { +#ifdef BABEL_CLEANUP create_new_window((GtkWidget*)button, user_data, TRUE); +#else + GtkWidget *dialogue = + gtk_message_dialog_new( + GTK_WINDOW(gtk_widget_get_toplevel(button)), + GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "Opening multiple windows is disabled."); + gtk_dialog_run(GTK_DIALOG(dialogue)); + gtk_widget_destroy(dialogue); +#endif } void diff --git a/lttv/modules/gui/lttvwindow/lttvwindow/interface.c b/lttv/modules/gui/lttvwindow/lttvwindow/interface.c index 9e55661f..56013356 100644 --- a/lttv/modules/gui/lttvwindow/lttvwindow/interface.c +++ b/lttv/modules/gui/lttvwindow/lttvwindow/interface.c @@ -182,15 +182,17 @@ create_MWindow (void) // gtk_container_add (GTK_CONTAINER (FileMenuNewTitle_menu), EmptyTraceset); // CloneTraceset = gtk_menu_item_new_with_mnemonic ("Clone trace set"); +#ifdef BABEL_CLEANUP CloneTraceset = gtk_menu_item_new_with_mnemonic ("New window"); gtk_widget_show (CloneTraceset); gtk_container_add (GTK_CONTAINER (FileMenuNewTitle_menu), CloneTraceset); + FileMenuNewSep = gtk_menu_item_new (); gtk_widget_show (FileMenuNewSep); gtk_container_add (GTK_CONTAINER (FileMenuNewTitle_menu), FileMenuNewSep); gtk_widget_set_sensitive (FileMenuNewSep, FALSE); - +#endif Tab = gtk_menu_item_new_with_mnemonic ("Tab"); gtk_widget_show (Tab); gtk_container_add (GTK_CONTAINER (FileMenuNewTitle_menu), Tab); @@ -410,6 +412,7 @@ create_MWindow (void) gtk_box_pack_start (GTK_BOX (MVbox), MToolbar1, FALSE, FALSE, 0); gtk_toolbar_set_style (GTK_TOOLBAR (MToolbar1), GTK_TOOLBAR_ICONS); +#ifdef BABEL_CLEANUP tmp_toolbar_icon = create_pixmap (MWindow, "filenew.png"); tlbEmptyTraceset = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1), GTK_TOOLBAR_CHILD_BUTTON, @@ -421,7 +424,7 @@ create_MWindow (void) gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE); gtk_widget_show (tlbEmptyTraceset); gtk_container_set_border_width (GTK_CONTAINER (tlbEmptyTraceset), 1); - +#endif tmp_toolbar_icon = create_pixmap (MWindow, "filenew.png"); tlbTab = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1), GTK_TOOLBAR_CHILD_BUTTON, @@ -657,9 +660,11 @@ create_MWindow (void) // g_signal_connect ((gpointer) EmptyTraceset, "activate", // G_CALLBACK (on_empty_traceset_activate), // NULL); +#ifdef BABEL_CLEANUP g_signal_connect ((gpointer) CloneTraceset, "activate", G_CALLBACK (on_clone_traceset_activate), NULL); +#endif g_signal_connect ((gpointer) Tab, "activate", G_CALLBACK (on_tab_activate), NULL); @@ -775,9 +780,11 @@ create_MWindow (void) g_signal_connect ((gpointer) About, "activate", G_CALLBACK (on_about_activate), NULL); +#ifdef BABEL_CLEANUP g_signal_connect ((gpointer) tlbEmptyTraceset, "clicked", G_CALLBACK (on_button_new_clicked), NULL); +#endif g_signal_connect ((gpointer) tlbTab, "clicked", G_CALLBACK (on_button_new_tab_clicked), NULL); @@ -849,8 +856,10 @@ create_MWindow (void) GLADE_HOOKUP_OBJECT (MWindow, FileMenuNewTitle, "FileMenuNewTitle"); GLADE_HOOKUP_OBJECT (MWindow, FileMenuNewTitle_menu, "FileMenuNewTitle_menu"); // GLADE_HOOKUP_OBJECT (MWindow, EmptyTraceset, "EmptyTraceset"); +#ifdef BABEL_CLEANUP GLADE_HOOKUP_OBJECT (MWindow, CloneTraceset, "CloneTraceset"); GLADE_HOOKUP_OBJECT (MWindow, FileMenuNewSep, "FileMenuNewSep"); +#endif GLADE_HOOKUP_OBJECT (MWindow, Tab, "Tab"); // GLADE_HOOKUP_OBJECT (MWindow, OpenTraceset, "OpenTraceset"); GLADE_HOOKUP_OBJECT (MWindow, Close, "Close"); @@ -905,7 +914,9 @@ create_MWindow (void) GLADE_HOOKUP_OBJECT (MWindow, HelpmenuSeparator, "HelpmenuSeparator"); GLADE_HOOKUP_OBJECT (MWindow, About, "About"); GLADE_HOOKUP_OBJECT (MWindow, MToolbar1, "MToolbar1"); +#ifdef BABEL_CLEANUP GLADE_HOOKUP_OBJECT (MWindow, tlbEmptyTraceset, "tlbEmptyTraceset"); +#endif BABEL_CLEANUP GLADE_HOOKUP_OBJECT (MWindow, tlbTab, "tlbTab"); // GLADE_HOOKUP_OBJECT (MWindow, tlbOpenTraceset, "tlbOpenTraceset"); GLADE_HOOKUP_OBJECT (MWindow, tlbAddTrace, "tlbAddTrace");