SF.net SVN: geany:[4509] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Tue Dec 29 18:35:30 UTC 2009
Revision: 4509
http://geany.svn.sourceforge.net/geany/?rev=4509&view=rev
Author: eht16
Date: 2009-12-29 18:35:30 +0000 (Tue, 29 Dec 2009)
Log Message:
-----------
Fix sensitivity of the Edit->Plugin Preferences menu item if plugins are loaded which do not provide a configuration dialog.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/callbacks.c
trunk/src/plugins.c
trunk/src/plugins.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-12-29 18:23:54 UTC (rev 4508)
+++ trunk/ChangeLog 2009-12-29 18:35:30 UTC (rev 4509)
@@ -4,6 +4,9 @@
plugins/geanyfunctions.h:
Add editor_get_eol_char_name(), editor_get_eol_char_len() and
editor_get_eol_char() to the plugin API.
+ * src/callbacks.c, src/plugins.c, src/plugins.h:
+ Fix sensitivity of the Edit->Plugin Preferences menu item
+ if plugins are loaded which do not provide a configuration dialog.
2009-12-26 Frank Lanitz <frank at frank.uvena.de>
Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c 2009-12-29 18:23:54 UTC (rev 4508)
+++ trunk/src/callbacks.c 2009-12-29 18:35:30 UTC (rev 4509)
@@ -293,7 +293,7 @@
#ifndef HAVE_PLUGINS
gtk_widget_hide(item);
#else
- gtk_widget_set_sensitive(item, active_plugin_list != NULL);
+ gtk_widget_set_sensitive(item, plugins_have_preferences());
#endif
}
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2009-12-29 18:23:54 UTC (rev 4508)
+++ trunk/src/plugins.c 2009-12-29 18:35:30 UTC (rev 4509)
@@ -970,6 +970,25 @@
}
+/* Check whether there are any plugins loaded which provide a configure symbol */
+gboolean plugins_have_preferences(void)
+{
+ GList *item;
+
+ if (active_plugin_list == NULL)
+ return FALSE;
+
+ foreach_list(item, active_plugin_list)
+ {
+ Plugin *plugin = item->data;
+ if (plugin->configure != NULL || plugin->configure_single != NULL)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
/* Plugin Manager */
enum
Modified: trunk/src/plugins.h
===================================================================
--- trunk/src/plugins.h 2009-12-29 18:23:54 UTC (rev 4508)
+++ trunk/src/plugins.h 2009-12-29 18:35:30 UTC (rev 4509)
@@ -37,6 +37,8 @@
void plugins_load_active(void);
+gboolean plugins_have_preferences(void);
+
#endif
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list