Revision: 1652 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1652&view=re... Author: frlan Date: 2010-10-10 17:00:38 +0000 (Sun, 10 Oct 2010)
Log Message: ----------- GeanyLaTeX: Add LaTeX type of BibTeX entry direct to menu
Modified Paths: -------------- trunk/geanylatex/src/bibtex.c trunk/geanylatex/src/bibtex.h trunk/geanylatex/src/bibtexlabels.c trunk/geanylatex/src/datatypes.h trunk/geanylatex/src/geanylatex.c
Modified: trunk/geanylatex/src/bibtex.c =================================================================== --- trunk/geanylatex/src/bibtex.c 2010-10-10 17:00:17 UTC (rev 1651) +++ trunk/geanylatex/src/bibtex.c 2010-10-10 17:00:38 UTC (rev 1652) @@ -134,7 +134,7 @@ } /* Adding the doctype to entry */ output = g_string_new("@"); - g_string_append(output, glatex_label_types[doctype]); + g_string_append(output, glatex_bibtex_types[doctype].latex); g_string_append(output, "{"); g_string_append(output, eol);
Modified: trunk/geanylatex/src/bibtex.h =================================================================== --- trunk/geanylatex/src/bibtex.h 2010-10-10 17:00:17 UTC (rev 1651) +++ trunk/geanylatex/src/bibtex.h 2010-10-10 17:00:38 UTC (rev 1652) @@ -74,13 +74,10 @@ GLATEX_BIBTEX_N_ENTRIES };
-extern gchar *glatex_label_types[]; - extern const gchar *glatex_label_tooltips[]; - extern const gchar *glatex_label_entry_keywords[]; - extern const gchar *glatex_label_entry[]; +extern BibTeXType glatex_bibtex_types[];
int glatex_push_bibtex_entry(int style, GeanyDocument *doc);
Modified: trunk/geanylatex/src/bibtexlabels.c =================================================================== --- trunk/geanylatex/src/bibtexlabels.c 2010-10-10 17:00:17 UTC (rev 1651) +++ trunk/geanylatex/src/bibtexlabels.c 2010-10-10 17:00:38 UTC (rev 1652) @@ -21,22 +21,25 @@
#include "geanylatex.h" #include "bibtex.h" +#include "datatypes.h"
-gchar *glatex_label_types[] = { - N_("Article"), - N_("Book"), - N_("Booklet"), - N_("Conference"), - N_("Inbook"), - N_("Incollection"), - N_("Inproceedings"), - N_("Manual"), - N_("Mastersthesis"), - N_("Misc"), - N_("PhdThesis"), - N_("Proceedings"), - N_("Techreport"), - N_("Unpublished")}; +BibTeXType glatex_bibtex_types[] = { + { "Article", N_("Article (@Article)")}, + { "Book", N_("Book (@Book)")}, + { "Booklet", N_("Booklet (@Booklet)")}, + { "Conference", N_("Conference (@Conference)")}, + { "Inbook", N_("Inbook (@Inbook)")}, + { "Incollection", N_("Incollection (@Incollection)")}, + { "Inproceedings", N_("Inproceedings (@Inproceedings)")}, + { "Manual", N_("Manual (@Manual)")}, + { "Mastersthesis", N_("Mastersthesis (@Mastersthesis)")}, + { "Misc", N_("Misc (@Misc)")}, + { "PhdThesis", N_("PhdThesis (@PhdThesis)")}, + { "Proceedings", N_("Proceedings (@Proceedings)")}, + { "Techreport", N_("Techreport (@Techreport)")}, + { "Unpublished", N_("Unpublished (@Unpublished)")}, + { NULL, NULL} +};
const gchar *glatex_label_entry[] = {
Modified: trunk/geanylatex/src/datatypes.h =================================================================== --- trunk/geanylatex/src/datatypes.h 2010-10-10 17:00:17 UTC (rev 1651) +++ trunk/geanylatex/src/datatypes.h 2010-10-10 17:00:38 UTC (rev 1652) @@ -37,6 +37,7 @@ gboolean sorted; } CategoryName;
+ typedef struct { gchar *filepath; @@ -44,6 +45,7 @@ GString *template; } TemplateEntry;
+ typedef struct { GtkWidget *documentclass_combobox; @@ -61,4 +63,10 @@ gboolean draft_active; } LaTeXWizard;
+typedef struct +{ + gchar *latex; + gchar *label; +} BibTeXType; + #endif
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2010-10-10 17:00:17 UTC (rev 1651) +++ trunk/geanylatex/src/geanylatex.c 2010-10-10 17:00:38 UTC (rev 1652) @@ -746,7 +746,6 @@ }
- /* Called when keys were pressed */ static void glatex_kblatex_toggle(G_GNUC_UNUSED guint key_id) { @@ -2108,7 +2107,7 @@ for (i = 0; i < GLATEX_BIBTEX_N_TYPES; i++) { tmp = NULL; - tmp = gtk_menu_item_new_with_mnemonic(_(glatex_label_types[i])); + tmp = gtk_menu_item_new_with_mnemonic(_(glatex_bibtex_types[i].label)); gtk_container_add(GTK_CONTAINER(menu_latex_bibtex_submenu), tmp); g_signal_connect(tmp, "activate", G_CALLBACK(glatex_insert_bibtex_entry), GINT_TO_POINTER(i)); @@ -2287,5 +2286,4 @@ g_free(glatex_ref_chapter_string); g_free(glatex_ref_page_string); g_free(glatex_ref_all_string); - }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.