Revision: 982 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=982&view=rev Author: frlan Date: 2009-10-11 20:01:49 +0000 (Sun, 11 Oct 2009)
Log Message: ----------- GeanyLaTeX: Add a function to insert \ref{} and \pageref{} together when inserting a reference
Modified Paths: -------------- trunk/geanylatex/ChangeLog trunk/geanylatex/src/geanylatex.c
Modified: trunk/geanylatex/ChangeLog =================================================================== --- trunk/geanylatex/ChangeLog 2009-10-11 20:00:45 UTC (rev 981) +++ trunk/geanylatex/ChangeLog 2009-10-11 20:01:49 UTC (rev 982) @@ -1,3 +1,9 @@ +2009-10-10 Frank Lanitz <frank@frank(dot)uvena(dot)de> + + * Add a function to insert \ref{} and \pageref{} together when + inserting a reference. + + 2009-09-13 Frank Lanitz <frank@frank(dot)uvena(dot)de>
* Adding custom templates to wizard.
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2009-10-11 20:00:45 UTC (rev 981) +++ trunk/geanylatex/src/geanylatex.c 2009-10-11 20:01:49 UTC (rev 982) @@ -422,6 +422,7 @@ GtkWidget *table = NULL; GtkWidget *radio1 = NULL; GtkWidget *radio2 = NULL; + GtkWidget *radio3 = NULL; GtkTreeModel *model = NULL; GeanyDocument *doc = NULL; GSList *file_list = NULL; @@ -477,6 +478,11 @@ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio2), FALSE); gtk_container_add(GTK_CONTAINER(vbox), radio2);
+ radio3 = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(radio1), _("_Add both")); + gtk_button_set_focus_on_click(GTK_BUTTON(radio3), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio3), FALSE); + gtk_container_add(GTK_CONTAINER(vbox), radio3); + gtk_widget_show_all(vbox);
@@ -487,14 +493,19 @@ ref_string = g_strdup(gtk_combo_box_get_active_text( GTK_COMBO_BOX(textbox_ref)));
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio2)) == FALSE) + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio1)) == TRUE) { ref_string = g_strconcat("\ref{", ref_string, "}", NULL); } - else + else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio2))== TRUE) { ref_string = g_strconcat("\pageref{", ref_string, "}", NULL); } + else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio3))== TRUE) + { + ref_string = g_strconcat("\ref{", ref_string, "}, ", _("page"), + " \pageref{", ref_string, "}", NULL); + }
if (ref_string != NULL) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org