Revision: 2339 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2339&view=re... Author: frlan Date: 2011-11-14 19:50:37 +0000 (Mon, 14 Nov 2011) Log Message: ----------- GeanyLaTeX: Fix an issue on inserting format submenu
Modified Paths: -------------- trunk/geany-plugins/geanylatex/src/geanylatex.c
Modified: trunk/geany-plugins/geanylatex/src/geanylatex.c =================================================================== --- trunk/geany-plugins/geanylatex/src/geanylatex.c 2011-11-14 19:50:12 UTC (rev 2338) +++ trunk/geany-plugins/geanylatex/src/geanylatex.c 2011-11-14 19:50:37 UTC (rev 2339) @@ -363,7 +363,7 @@ static void check_for_menu(gint ft_id) { - /* We don't check whether the menu has been added here, as this + /* We don't check whether the menu has been added here, as this * will is checked by add_menu_to_menubar() anyway */ if (ft_id == GEANY_FILETYPES_LATEX) { @@ -2092,46 +2092,46 @@ menu_latex = gtk_menu_item_new_with_mnemonic(_("_LaTeX")); gtk_menu_shell_insert( menubar, menu_latex, g_list_length(menubar->children)-1); - + menu_latex_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex), menu_latex_menu); - + /* Filling up menubar menus */ /* LaTeX menu */ menu_latex_wizard = ui_image_menu_item_new(GTK_STOCK_NEW, _("LaTeX-_Wizard")); gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_wizard); ui_widget_set_tooltip_text(menu_latex_wizard, _("Starts a Wizard to easily create LaTeX-documents")); - + g_signal_connect(menu_latex_wizard, "activate", G_CALLBACK(glatex_wizard_activated), NULL); - + menu_latex_menu_special_char = gtk_menu_item_new_with_mnemonic(_("I_nsert Special Character")); ui_widget_set_tooltip_text(menu_latex_menu_special_char, _("Helps to use some not very common letters and signs")); gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_menu_special_char); - + menu_latex_menu_special_char_submenu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex_menu_special_char), menu_latex_menu_special_char_submenu); glatex_sub_menu_init(menu_latex_menu_special_char_submenu, glatex_char_array, glatex_cat_names, char_insert_activated); - + menu_latex_ref = gtk_menu_item_new_with_mnemonic(_("Insert _Reference")); ui_widget_set_tooltip_text(menu_latex_ref, _("Inserting references to the document")); gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_ref); g_signal_connect(menu_latex_ref, "activate", G_CALLBACK(glatex_insert_ref_activated), NULL); - + menu_latex_label = gtk_menu_item_new_with_mnemonic(_("Insert _Label")); ui_widget_set_tooltip_text(menu_latex_label, _("Helps at inserting labels to a document")); gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_label); g_signal_connect(menu_latex_label, "activate", G_CALLBACK(glatex_insert_label_activated), NULL); - + menu_latex_insert_environment = gtk_menu_item_new_with_mnemonic( _("Insert _Environment")); ui_widget_set_tooltip_text(menu_latex_insert_environment, @@ -2139,7 +2139,7 @@ gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_insert_environment); g_signal_connect(menu_latex_insert_environment, "activate", G_CALLBACK(glatex_insert_environment_dialog), NULL); - + menu_latex_insert_usepackage = gtk_menu_item_new_with_mnemonic( _("Insert P_ackage")); ui_widget_set_tooltip_text(menu_latex_insert_usepackage, @@ -2147,14 +2147,14 @@ gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_insert_usepackage); g_signal_connect(menu_latex_insert_usepackage, "activate", G_CALLBACK(glatex_insert_usepackage_dialog), NULL); - + menu_latex_format_insert = gtk_menu_item_new_with_mnemonic(_("_Format")); - gtk_container_add(GTK_CONTAINER(menu_bibtex_menu), menu_latex_format_insert); - + gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_format_insert); + menu_latex_format_insert_submenu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex_format_insert), menu_latex_format_insert_submenu); - + for (i = 0; i < LATEX_STYLES_END; i++) { tmp = NULL; @@ -2163,15 +2163,15 @@ g_signal_connect(tmp, "activate", G_CALLBACK(glatex_insert_latex_format), GINT_TO_POINTER(i)); } - + /* Add font size menu */ menu_latex_fontsize = gtk_menu_item_new_with_mnemonic(_("F_ont size")); gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_fontsize); - + menu_latex_fontsize_submenu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex_fontsize), menu_latex_fontsize_submenu); - + for (i = 0; i < LATEX_FONTSIZE_END; i++) { tmp = NULL; @@ -2180,7 +2180,7 @@ g_signal_connect(tmp, "activate", G_CALLBACK(glatex_insert_latex_fontsize), GINT_TO_POINTER(i)); } - + /* Add menuitem for LaTeX replacement functions*/ menu_latex_replacement = gtk_menu_item_new_with_mnemonic( _("_Special Character Replacement")); @@ -2188,7 +2188,7 @@ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex_replacement), menu_latex_replacement_submenu); gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_replacement); - + /* Add menuitem for bulk replacment */ menu_latex_replace_selection = gtk_menu_item_new_with_mnemonic( _("Bulk _Replace Special Characters")); @@ -2198,7 +2198,7 @@ menu_latex_replace_selection); g_signal_connect(menu_latex_replace_selection, "activate", G_CALLBACK(glatex_replace_special_character), NULL); - + /* Add menu entry for toggling input replacment */ menu_latex_replace_toggle = gtk_check_menu_item_new_with_mnemonic( _("Toggle _Special Character Replacement")); @@ -2206,10 +2206,10 @@ toggle_active); gtk_container_add(GTK_CONTAINER(menu_latex_replacement_submenu), menu_latex_replace_toggle); - + g_signal_connect(menu_latex_replace_toggle, "activate", G_CALLBACK(glatex_toggle_status), NULL); - + /* Add menu entry for inserting a command */ menu_latex_insert_command = gtk_menu_item_new_with_mnemonic( _("Insert _Command")); @@ -2230,10 +2230,10 @@ ui_add_document_sensitive(menu_latex_insert_command); ui_add_document_sensitive(menu_latex_fontsize); ui_add_document_sensitive(menu_latex_replacement); - - + + gtk_widget_show_all(menu_latex); - } /* only execute if menuitem "LaTeX" has not already been inserted + } /* only execute if menuitem "LaTeX" has not already been inserted into menubar before */
/* BibTeX menu */ @@ -2242,10 +2242,10 @@ menu_bibtex = gtk_menu_item_new_with_mnemonic(_("_BibTeX")); gtk_menu_shell_insert( menubar, menu_bibtex, g_list_length(menubar->children)-1); - + menu_bibtex_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_bibtex), menu_bibtex_menu); - + menu_latex_insert_bibtex_cite = gtk_menu_item_new_with_mnemonic(_("Insert B_ibTeX reference")); ui_widget_set_tooltip_text(menu_latex_insert_bibtex_cite, @@ -2253,14 +2253,14 @@ gtk_container_add(GTK_CONTAINER(menu_bibtex_menu), menu_latex_insert_bibtex_cite); g_signal_connect(menu_latex_insert_bibtex_cite, "activate", G_CALLBACK(on_insert_bibtex_dialog_activate), NULL); - + menu_latex_bibtex = gtk_menu_item_new_with_mnemonic(_("_BibTeX entries")); gtk_container_add(GTK_CONTAINER(menu_bibtex_menu), menu_latex_bibtex); - + menu_latex_bibtex_submenu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex_bibtex), menu_latex_bibtex_submenu); - + for (i = 0; i < GLATEX_BIBTEX_N_TYPES; i++) { tmp = NULL; @@ -2269,10 +2269,10 @@ g_signal_connect(tmp, "activate", G_CALLBACK(glatex_insert_bibtex_entry), GINT_TO_POINTER(i)); } - + /* Switch document sensitivness */ ui_add_document_sensitive(menu_latex_bibtex); - + gtk_widget_show_all(menu_bibtex); } /* Only insert BibTeX menu if not already done. */ }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org