SF.net SVN: geany:[3626] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Fri Mar 13 10:02:29 UTC 2009
Revision: 3626
http://geany.svn.sourceforge.net/geany/?rev=3626&view=rev
Author: eht16
Date: 2009-03-13 10:02:29 +0000 (Fri, 13 Mar 2009)
Log Message:
-----------
Add an option to set an additional plugin lookup path.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.html
trunk/doc/geany.txt
trunk/geany.glade
trunk/src/interface.c
trunk/src/main.c
trunk/src/plugindata.h
trunk/src/plugins.c
trunk/src/prefs.c
trunk/src/prefs.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/ChangeLog 2009-03-13 10:02:29 UTC (rev 3626)
@@ -1,3 +1,11 @@
+2009-03-13 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * doc/geany.txt, doc/geany.html, geany.glade, src/interface.c,
+ src/main.c, src/plugindata.h, src/plugins.c, src/prefs.c,
+ src/prefs.h:
+ Add an option to set an additional plugin lookup path.
+
+
2009-03-10 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* data/filetype_extensions.conf, data/filetypes.actionscript,
Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/doc/geany.html 2009-03-13 10:02:29 UTC (rev 3626)
@@ -1666,6 +1666,13 @@
Leave it blank to use the current working directory.</dd>
<dt>Project files</dt>
<dd>Path to start in when opening project files.</dd>
+<dt>Extra plugin path</dt>
+<dd>Geany looks by default in the global installation path and in the
+configuration directory. The path entered here will be searched additionally
+for plugins. Usually you do not need to set an additional path to search for
+plugins. It might be useful when Geany is installed on a multi-user machine
+and additional plugins should be available in a custom location for all users.
+Leave blank to not set an additional lookup path.</dd>
</dl>
</div>
</div>
@@ -4705,7 +4712,7 @@
<div class="footer">
<hr class="footer" />
<a class="reference external" href="geany.txt">View document source</a>.
-Generated on: 2009-02-25 23:11 UTC.
+Generated on: 2009-03-13 09:51 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/doc/geany.txt 2009-03-13 10:02:29 UTC (rev 3626)
@@ -1383,6 +1383,13 @@
Project files
Path to start in when opening project files.
+Extra plugin path
+ Geany looks by default in the global installation path and in the
+ configuration directory. The path entered here will be searched additionally
+ for plugins. Usually you do not need to set an additional path to search for
+ plugins. It might be useful when Geany is installed on a multi-user machine
+ and additional plugins should be available in a custom location for all users.
+ Leave blank to not set an additional lookup path.
General Miscellaneous tab in preferences dialog
Modified: trunk/geany.glade
===================================================================
--- trunk/geany.glade 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/geany.glade 2009-03-13 10:02:29 UTC (rev 3626)
@@ -2992,7 +2992,7 @@
<child>
<widget class="GtkTable" id="table11">
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">3</property>
@@ -3155,6 +3155,85 @@
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkLabel" id="label235">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Extra plugin path:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="extra_plugin_path_entry">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Geany looks by default in the global installation path and in the configuration directory. The path entered here will be searched additionally for plugins. Leave blank to disable.</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char">•</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="extra_plugin_path_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkImage" id="image2852">
+ <property name="visible">True</property>
+ <property name="stock">gtk-open</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
Modified: trunk/src/interface.c
===================================================================
--- trunk/src/interface.c 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/src/interface.c 2009-03-13 10:02:29 UTC (rev 3626)
@@ -2280,6 +2280,10 @@
GtkWidget *project_file_path_entry;
GtkWidget *project_file_path_button;
GtkWidget *image1775;
+ GtkWidget *label235;
+ GtkWidget *extra_plugin_path_entry;
+ GtkWidget *extra_plugin_path_button;
+ GtkWidget *image2852;
GtkWidget *label190;
GtkWidget *label233;
GtkWidget *vbox41;
@@ -2706,7 +2710,7 @@
gtk_container_add (GTK_CONTAINER (frame25), alignment28);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment28), 0, 0, 12, 0);
- table11 = gtk_table_new (2, 3, FALSE);
+ table11 = gtk_table_new (3, 3, FALSE);
gtk_widget_show (table11);
gtk_container_add (GTK_CONTAINER (alignment28), table11);
gtk_table_set_row_spacings (GTK_TABLE (table11), 3);
@@ -2762,6 +2766,31 @@
gtk_widget_show (image1775);
gtk_container_add (GTK_CONTAINER (project_file_path_button), image1775);
+ label235 = gtk_label_new (_("Extra plugin path:"));
+ gtk_widget_show (label235);
+ gtk_table_attach (GTK_TABLE (table11), label235, 0, 1, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label235), 0, 0.5);
+
+ extra_plugin_path_entry = gtk_entry_new ();
+ gtk_widget_show (extra_plugin_path_entry);
+ gtk_table_attach (GTK_TABLE (table11), extra_plugin_path_entry, 1, 2, 2, 3,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_tooltips_set_tip (tooltips, extra_plugin_path_entry, _("Geany looks by default in the global installation path and in the configuration directory. The path entered here will be searched additionally for plugins. Leave blank to disable."), NULL);
+ gtk_entry_set_invisible_char (GTK_ENTRY (extra_plugin_path_entry), 8226);
+
+ extra_plugin_path_button = gtk_button_new ();
+ gtk_widget_show (extra_plugin_path_button);
+ gtk_table_attach (GTK_TABLE (table11), extra_plugin_path_button, 2, 3, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ image2852 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
+ gtk_widget_show (image2852);
+ gtk_container_add (GTK_CONTAINER (extra_plugin_path_button), image2852);
+
label190 = gtk_label_new (_("<b>Paths</b>"));
gtk_widget_show (label190);
gtk_frame_set_label_widget (GTK_FRAME (frame25), label190);
@@ -4542,6 +4571,10 @@
GLADE_HOOKUP_OBJECT (prefs_dialog, project_file_path_entry, "project_file_path_entry");
GLADE_HOOKUP_OBJECT (prefs_dialog, project_file_path_button, "project_file_path_button");
GLADE_HOOKUP_OBJECT (prefs_dialog, image1775, "image1775");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, label235, "label235");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, extra_plugin_path_entry, "extra_plugin_path_entry");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, extra_plugin_path_button, "extra_plugin_path_button");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, image2852, "image2852");
GLADE_HOOKUP_OBJECT (prefs_dialog, label190, "label190");
GLADE_HOOKUP_OBJECT (prefs_dialog, label233, "label233");
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox41, "vbox41");
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/src/main.c 2009-03-13 10:02:29 UTC (rev 3626)
@@ -1116,6 +1116,7 @@
g_free(app->datadir);
g_free(app->docdir);
g_free(prefs.default_open_path);
+ g_free(prefs.custom_plugin_path);
g_free(ui_prefs.custom_date_format);
g_free(interface_prefs.editor_font);
g_free(interface_prefs.tagbar_font);
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/src/plugindata.h 2009-03-13 10:02:29 UTC (rev 3626)
@@ -45,7 +45,7 @@
enum {
/** The Application Programming Interface (API) version, incremented
* whenever any plugin data types are modified or appended to. */
- GEANY_API_VERSION = 134,
+ GEANY_API_VERSION = 135,
/** The Application Binary Interface (ABI) version, incremented whenever
* existing fields in the plugin data types have to be changed or reordered. */
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/src/plugins.c 2009-03-13 10:02:29 UTC (rev 3626)
@@ -816,16 +816,21 @@
gchar *path;
path = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "plugins", NULL);
- /* first load plugins in ~/.config/geany/plugins/, then in $prefix/lib/geany */
+ /* first load plugins in ~/.config/geany/plugins/ */
load_plugins_from_path(path);
g_free(path);
+
+ /* load plugins from a custom path */
+ if (NZV(prefs.custom_plugin_path))
+ load_plugins_from_path(prefs.custom_plugin_path);
+
+ /* finally load plugins from $prefix/lib/geany */
#ifdef G_OS_WIN32
path = get_plugin_path();
#else
path = g_strconcat(GEANY_LIBDIR, G_DIR_SEPARATOR_S "geany", NULL);
#endif
load_plugins_from_path(path);
-
g_free(path);
}
@@ -945,6 +950,8 @@
stash_group_add_toggle_button(group, &prefs.load_plugins,
"load_plugins", TRUE, "check_plugins");
+ stash_group_add_entry(group, &prefs.custom_plugin_path,
+ "custom_plugin_path", "", "extra_plugin_path_entry");
g_signal_connect(geany_object, "save-settings", G_CALLBACK(on_save_settings), NULL);
stash_group_add_string_vector(group, &active_plugins_pref, "active_plugins", NULL);
Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/src/prefs.c 2009-03-13 10:02:29 UTC (rev 3626)
@@ -86,6 +86,7 @@
guint key, GdkModifierType mods, const gchar *action);
static void on_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data);
static void on_show_notebook_tabs_toggled(GtkToggleButton *togglebutton, gpointer user_data);
+static void on_enable_plugins_toggled(GtkToggleButton *togglebutton, gpointer user_data);
static void on_use_folding_toggled(GtkToggleButton *togglebutton, gpointer user_data);
static void on_open_encoding_toggled(GtkToggleButton *togglebutton, gpointer user_data);
static void on_prefs_print_radio_button_toggled(GtkToggleButton *togglebutton, gpointer user_data);
@@ -539,6 +540,7 @@
#ifndef HAVE_PLUGINS
gtk_widget_set_sensitive(ui_lookup_widget(ui_widgets.prefs_dialog, "check_plugins"), FALSE);
#endif
+ on_enable_plugins_toggled(GTK_TOGGLE_BUTTON( ui_lookup_widget(ui_widgets.prefs_dialog, "check_plugins")), NULL);
#ifdef HAVE_VTE
/* make VTE switch visible only when VTE is compiled in, it is hidden by default */
@@ -1356,6 +1358,15 @@
}
+static void on_enable_plugins_toggled(GtkToggleButton *togglebutton, gpointer user_data)
+{
+ gboolean sens = gtk_toggle_button_get_active(togglebutton);
+
+ gtk_widget_set_sensitive(ui_lookup_widget(ui_widgets.prefs_dialog, "extra_plugin_path_entry"), sens);
+ gtk_widget_set_sensitive(ui_lookup_widget(ui_widgets.prefs_dialog, "extra_plugin_path_button"), sens);
+}
+
+
static void on_open_encoding_toggled(GtkToggleButton *togglebutton, gpointer user_data)
{
gboolean sens = gtk_toggle_button_get_active(togglebutton);
@@ -1459,6 +1470,7 @@
/* add the clear icon to GtkEntry widgets in the dialog */
ui_entry_add_clear_icon(ui_lookup_widget(ui_widgets.prefs_dialog, "startup_path_entry"));
ui_entry_add_clear_icon(ui_lookup_widget(ui_widgets.prefs_dialog, "project_file_path_entry"));
+ ui_entry_add_clear_icon(ui_lookup_widget(ui_widgets.prefs_dialog, "extra_plugin_path_entry"));
ui_entry_add_clear_icon(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_toggle_mark"));
ui_entry_add_clear_icon(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_com_make"));
ui_entry_add_clear_icon(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_com_term"));
@@ -1482,6 +1494,8 @@
ui_setup_open_button_callback(ui_lookup_widget(ui_widgets.prefs_dialog, "startup_path_button"), NULL,
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(ui_lookup_widget(ui_widgets.prefs_dialog, "startup_path_entry")));
+ ui_setup_open_button_callback(ui_lookup_widget(ui_widgets.prefs_dialog, "extra_plugin_path_button"), NULL,
+ GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(ui_lookup_widget(ui_widgets.prefs_dialog, "extra_plugin_path_entry")));
g_signal_connect(ui_widgets.prefs_dialog, "response",
G_CALLBACK(on_prefs_button_clicked), NULL);
@@ -1518,6 +1532,8 @@
g_signal_connect(ui_lookup_widget(ui_widgets.prefs_dialog, "check_print_pageheader"),
"toggled", G_CALLBACK(on_prefs_print_page_header_toggled), NULL);
+ g_signal_connect(ui_lookup_widget(ui_widgets.prefs_dialog, "check_plugins"),
+ "toggled", G_CALLBACK(on_enable_plugins_toggled), NULL);
g_signal_connect(ui_lookup_widget(ui_widgets.prefs_dialog, "check_toolbar_show"),
"toggled", G_CALLBACK(on_toolbar_show_toggled), NULL);
g_signal_connect(ui_lookup_widget(ui_widgets.prefs_dialog, "check_show_notebook_tabs"),
Modified: trunk/src/prefs.h
===================================================================
--- trunk/src/prefs.h 2009-03-13 09:59:58 UTC (rev 3625)
+++ trunk/src/prefs.h 2009-03-13 10:02:29 UTC (rev 3626)
@@ -36,6 +36,7 @@
gboolean switch_to_status;
gboolean auto_focus;
gchar *default_open_path;
+ gchar *custom_plugin_path;
}
GeanyPrefs;
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