SF.net SVN: geany-plugins:[203] trunk/geanysendmail

frlan at users.sourceforge.net frlan at xxxxx
Tue Oct 14 17:55:22 UTC 2008


Revision: 203
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=203&view=rev
Author:   frlan
Date:     2008-10-14 17:55:21 +0000 (Tue, 14 Oct 2008)

Log Message:
-----------
Applied a patch by Nick to make use of Geany Plugin API r100 and the add_document_sensitive() function from plugin API.

Modified Paths:
--------------
    trunk/geanysendmail/ChangeLog
    trunk/geanysendmail/src/geanysendmail.c

Modified: trunk/geanysendmail/ChangeLog
===================================================================
--- trunk/geanysendmail/ChangeLog	2008-10-13 16:26:58 UTC (rev 202)
+++ trunk/geanysendmail/ChangeLog	2008-10-14 17:55:21 UTC (rev 203)
@@ -1,3 +1,9 @@
+2008-10-14  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
+
+ * Applied a patch by Nick to make use of Geany Plugin API r100 and the
+   add_document_sensitive() function from plugin API.
+
+
 2008-10-13  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
 
  * Applied a patch by Nick to make use of Geany Plugin API r99 and the

Modified: trunk/geanysendmail/src/geanysendmail.c
===================================================================
--- trunk/geanysendmail/src/geanysendmail.c	2008-10-13 16:26:58 UTC (rev 202)
+++ trunk/geanysendmail/src/geanysendmail.c	2008-10-14 17:55:21 UTC (rev 203)
@@ -39,11 +39,10 @@
 #endif
 
 GeanyPlugin		*geany_plugin;
-PluginFields	*plugin_fields;
 GeanyData		*geany_data;
 GeanyFunctions	*geany_functions;
 
-PLUGIN_VERSION_CHECK(99)
+PLUGIN_VERSION_CHECK(100)
 
 PLUGIN_SET_INFO(_("GeanySendMail"), _("A little plugin to send the current \
 file as attachment by user's favorite mailer"), "0.4svn", "Frank Lanitz <frank at frank.uvena.de>")
@@ -64,6 +63,7 @@
 gboolean use_address_dialog = FALSE;
 /* Needed global to remove from toolbar again */
 GtkWidget *mailbutton = NULL;
+static GtkWidget *main_menu_item = NULL;
 
 
 static void locale_init(void)
@@ -250,6 +250,7 @@
 
 	mailbutton = (GtkWidget*) gtk_tool_button_new (icon, "Mail");
 	p_plugin->add_toolbar_item(geany_plugin, GTK_TOOL_ITEM(mailbutton));
+	p_ui->add_document_sensitive(mailbutton);
 	g_signal_connect (G_OBJECT(mailbutton), "clicked", G_CALLBACK(send_as_attachment), NULL);
 	gtk_widget_show_all (mailbutton);
 }
@@ -412,8 +413,6 @@
 
 	tooltips = gtk_tooltips_new();
 
-	plugin_fields->flags = PLUGIN_IS_DOCUMENT_SENSITIVE;
-
 	if (icon_in_toolbar == TRUE)
 	{
 		show_icon();
@@ -438,13 +437,14 @@
 		0, 0, "send_file_as_attachment", kb_label, menu_mail_attachment);
 
 	gtk_widget_show_all(menu_mail);
-	plugin_fields->menu_item = menu_mail;
+	p_ui->add_document_sensitive(menu_mail);
+	main_menu_item = menu_mail;
 }
 
 
 void plugin_cleanup()
 {
-	gtk_widget_destroy(plugin_fields->menu_item);
+	gtk_widget_destroy(main_menu_item);
 	cleanup_icon();
 	g_free(mailer);
 	g_free(address);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list