Revision: 1997 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1997&view=re... Author: frlan Date: 2011-03-19 13:52:35 +0000 (Sat, 19 Mar 2011)
Log Message: ----------- Tableconvert: Make plugin function available via tools menu
Modified Paths: -------------- trunk/geany-plugins/tableconvert/ChangeLog trunk/geany-plugins/tableconvert/src/tableconvert.c
Modified: trunk/geany-plugins/tableconvert/ChangeLog =================================================================== --- trunk/geany-plugins/tableconvert/ChangeLog 2011-03-17 21:49:25 UTC (rev 1996) +++ trunk/geany-plugins/tableconvert/ChangeLog 2011-03-19 13:52:35 UTC (rev 1997) @@ -1,3 +1,8 @@ +2011-03-19 Frank Lanitz frlan@frank.uvena.de + + * Make plugin function available via tools menu. + + 2011-03-17 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* Fix an minor issue with shadowing variables.
Modified: trunk/geany-plugins/tableconvert/src/tableconvert.c =================================================================== --- trunk/geany-plugins/tableconvert/src/tableconvert.c 2011-03-17 21:49:25 UTC (rev 1996) +++ trunk/geany-plugins/tableconvert/src/tableconvert.c 2011-03-19 13:52:35 UTC (rev 1997) @@ -38,6 +38,8 @@ };
+static GtkWidget *main_menu_item = NULL; + void convert_to_table(gboolean header) { GeanyDocument *doc = NULL; @@ -194,11 +196,22 @@ void plugin_init(GeanyData *data) { init_keybindings(); + main_locale_init(LOCALEDIR, GETTEXT_PACKAGE); + + /* Build up menu entry */ + main_menu_item = gtk_menu_item_new_with_mnemonic(_("_Convert to table")); + gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), main_menu_item); + ui_widget_set_tooltip_text(main_menu_item, + _("Converts current marked list to a table.")); + g_signal_connect(G_OBJECT(main_menu_item), "activate", G_CALLBACK(convert_to_table), TRUE); + gtk_widget_show_all(main_menu_item); + ui_add_document_sensitive(main_menu_item); + }
void plugin_cleanup(void) { - /* We don't need to do anything here at the moment */ + gtk_widget_destroy(main_menu_item); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.