Merged trunk r4110 to build-system

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/build-system@4111 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Lex Trotman 2009-08-18 23:45:32 +00:00
commit 95b90f2c4a
16 changed files with 883 additions and 718 deletions

View File

@ -167,6 +167,35 @@ Configurable Build Menu Changes
* src/project.h, src/project.c: * src/project.h, src/project.c:
Changed to load/store the new configuration info. Changed to load/store the new configuration info.
2009-08-18 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/callbacks.c:
Fix 'Open Selected File' for unsaved new documents.
* src/keybindings.c, src/keybindings.h, src/prefs.c:
Fix updating main menu accelerators after changing keybindings
(thanks to Lex Trotman).
* src/callbacks.c:
Fix using 'Insert date' keybinding when a custom date string has
not been set.
* src/pluginprivate.h, src/pluginutils.c, src/plugins.c:
Merge Plugin and GeanyPluginPrivate structs.
2009-08-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/keybindings.c:
Fix non-working Home and End keys on numpads.
2009-08-17 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* doc/geany.txt, doc/geany.html, NEWS:
Add 'Scope autocompletion' section.
Add 'Tools menu items' section to explain configuration files
submenu, reload configuration item.
Minor updates/fixes.
2009-08-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2009-08-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/document.c: * src/document.c:

4
NEWS
View File

@ -58,8 +58,8 @@ Geany 0.18 (August 16, 2009)
Filetypes: Filetypes:
* Add Markdown filetype (thanks to Jon Strait). * Add Markdown filetype (thanks to Jon Strait).
* Highlight D WYSIWYG backtick `strings` and r"strings" (#1895745). * Highlight D WYSIWYG backtick `strings` and r"strings" (#1895745).
* Minor improvements for filetypes: Fortran, Haxe, HTML, Lua, * Minor improvements for filetypes: Fortran, Haxe, HTML, Lua,
Matlab, Pascal, Python, Tcl Matlab, Pascal, Python, Tcl.
Tags: Tags:
* Read custom system global tags files from $prefix/share/geany/tags * Read custom system global tags files from $prefix/share/geany/tags

File diff suppressed because it is too large Load Diff

View File

@ -44,10 +44,10 @@ Some basic features of Geany:
* Syntax highlighting * Syntax highlighting
* Code folding * Code folding
* Symbol name autocompletion * Autocompletion of symbols/words
* Construct completion/snippets * Construct completion/snippets
* Auto-closing of XML and HTML tags * Auto-closing of XML and HTML tags
* Call tips * Calltips
* Many supported filetypes including C, Java, PHP, HTML, Python, Perl, * Many supported filetypes including C, Java, PHP, HTML, Python, Perl,
Pascal, and others Pascal, and others
* Symbol lists * Symbol lists
@ -865,6 +865,24 @@ word on completion* preference is set (in `Editor Completions tab in
preferences dialog`_) then any characters after the cursor that match preferences dialog`_) then any characters after the cursor that match
a symbol or word are deleted. a symbol or word are deleted.
Scope autocompletion
````````````````````
E.g.::
struct
{
int i;
char c;
} foo;
When you type ``foo.`` it will show an autocompletion list with 'i' and
'c' symbols.
It only works for languages that set parent scope names for e.g. struct
members. Currently this means C-like languages. The C tag parser only
parses global scopes, so this won't work for structs or objects declared
in local scope.
User-definable snippets User-definable snippets
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
@ -1588,10 +1606,6 @@ Show documents list
change between documents (see `Switching between documents`_) and change between documents (see `Switching between documents`_) and
to perform some common operations such as saving, closing and reloading. to perform some common operations such as saving, closing and reloading.
Show full path name in documents list
Show the full directory path of the files you are editing in the
*Documents* list.
Fonts Fonts
````` `````
@ -2887,7 +2901,8 @@ Send Selection to Terminal Sends the current sele
line (if there is no selection) to the line (if there is no selection) to the
embedded Terminal (VTE). embedded Terminal (VTE).
Reflow lines/paragraph Reformat selected lines or current paragraph, Reflow lines/block Reformat selected lines or current
(indented) text block,
breaking lines at the long line marker. breaking lines at the long line marker.
@ -2923,6 +2938,11 @@ Find Document Usage Finds all occurrences
document and displays them in the messages document and displays them in the messages
window. window.
Mark All Highlight all matches of the current
word/selection in the current document
with a colored box. If there's nothing to
find, highlighted matches will be cleared.
**Go to** **Go to**
Navigate forward a location Switches to the next location in the navigation Navigate forward a location Switches to the next location in the navigation
@ -3093,6 +3113,27 @@ Configuration files
=================== ===================
Tools menu items
----------------
There's a *Configuration files* submenu in the *Tools* menu that
contains items for some of the available user configuration files.
Clicking on one opens it in the editor for you to update. Geany will
reload the file after you have saved it.
.. note::
Other configuration files are not shown here and you will need to open
them manually and usually restart Geany to see any changes.
There's also a *Reload Configuration* item which can be used if you
updated a configuration file outside of the current instance. This
item is also necessary to update syntax highlighting colors.
.. note::
Syntax highlighting colors aren't updated after saving
filetypes.common as this can take a short while depending on which
documents are open.
Global configuration file Global configuration file
------------------------- -------------------------

View File

@ -1,3 +1,10 @@
2009-08-19 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* pt.po: Rename Portuguese translation file so it can work as a fall
back for all Portuguese based languages.
* sl.po: Update of Slovenian translation. Thanks to Joze Klepec.
2009-08-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2009-08-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* de.po: * de.po:

View File

@ -1,2 +1,2 @@
# set of available languages (in alphabetic order) # set of available languages (in alphabetic order)
be bg ca cs de el en_GB es fi fr hu it ja ko lb nl pl pt_BR pt_PT ro ru sl sv tr uk vi zh_CN zh_TW be bg ca cs de el en_GB es fi fr hu it ja ko lb nl pl pt pt_BR ro ru sl sv tr uk vi zh_CN zh_TW

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Geany 0.18\n" "Project-Id-Version: Geany 0.18\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-08-16 18:09+0200\n" "POT-Creation-Date: 2009-08-16 18:14+0200\n"
"PO-Revision-Date: 2009-08-12 00:29+0000\n" "PO-Revision-Date: 2009-08-12 00:29+0000\n"
"Last-Translator: DarkVenger\n" "Last-Translator: DarkVenger\n"
"Language-Team: Portuguese <pt@li.org>\n" "Language-Team: Portuguese <pt@li.org>\n"

View File

@ -6,9 +6,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: geany 0.18\n" "Project-Id-Version: geany 0.19\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-08-16 18:09+0200\n" "POT-Creation-Date: 2009-08-16 18:14+0200\n"
"PO-Revision-Date: 2009-08-11 23:24+0100\n" "PO-Revision-Date: 2009-08-11 23:24+0100\n"
"Last-Translator: Jože Klepec <joze.klepec@siol.net>\n" "Last-Translator: Jože Klepec <joze.klepec@siol.net>\n"
"Language-Team: Slovenian <geany-i18n@uvena.de>\n" "Language-Team: Slovenian <geany-i18n@uvena.de>\n"
@ -3226,8 +3226,9 @@ msgid "Print Geany's installation prefix"
msgstr "Izpiši Geanyjevo namestitveno predpono" msgstr "Izpiši Geanyjevo namestitveno predpono"
#: ../src/main.c:141 #: ../src/main.c:141
#, fuzzy
msgid "Don't load the previous session's files" msgid "Don't load the previous session's files"
msgstr "Ne naloži datotek prejšnje seje" msgstr "ne naloži datotek prejšnje seje"
#: ../src/main.c:143 #: ../src/main.c:143
msgid "Don't load terminal support" msgid "Don't load terminal support"

View File

@ -1466,11 +1466,18 @@ on_insert_date_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
{ {
GeanyDocument *doc = document_get_current(); GeanyDocument *doc = document_get_current();
gchar *format; gchar *format = NULL;
gchar *time_str; gchar *time_str;
g_return_if_fail(doc != NULL); g_return_if_fail(doc != NULL);
/* set default value */
if (utils_str_equal("", ui_prefs.custom_date_format))
{
g_free(ui_prefs.custom_date_format);
ui_prefs.custom_date_format = g_strdup("%d.%m.%Y");
}
if (utils_str_equal(_("dd.mm.yyyy"), (gchar*) user_data)) if (utils_str_equal(_("dd.mm.yyyy"), (gchar*) user_data))
format = "%d.%m.%Y"; format = "%d.%m.%Y";
else if (utils_str_equal(_("mm.dd.yyyy"), (gchar*) user_data)) else if (utils_str_equal(_("mm.dd.yyyy"), (gchar*) user_data))
@ -1487,13 +1494,6 @@ on_insert_date_activate (GtkMenuItem *menuitem,
format = ui_prefs.custom_date_format; format = ui_prefs.custom_date_format;
else else
{ {
/* set default value */
if (utils_str_equal("", ui_prefs.custom_date_format))
{
g_free(ui_prefs.custom_date_format);
ui_prefs.custom_date_format = g_strdup("%d.%m.%Y");
}
dialogs_show_input(_("Custom Date Format"), dialogs_show_input(_("Custom Date Format"),
_("Enter here a custom date and time format. You can use any conversion specifiers which can be used with the ANSI C strftime function."), _("Enter here a custom date and time format. You can use any conversion specifiers which can be used with the ANSI C strftime function."),
ui_prefs.custom_date_format, FALSE, &on_custom_date_input_response); ui_prefs.custom_date_format, FALSE, &on_custom_date_input_response);
@ -1866,7 +1866,7 @@ on_menu_open_selected_file1_activate (GtkMenuItem *menuitem,
if (sel != NULL) if (sel != NULL)
{ {
gchar *locale_filename, *filename; gchar *locale_filename, *filename = NULL;
if (g_path_is_absolute(sel)) if (g_path_is_absolute(sel))
filename = g_strdup(sel); filename = g_strdup(sel);
@ -1874,7 +1874,10 @@ on_menu_open_selected_file1_activate (GtkMenuItem *menuitem,
{ /* relative filename, add the path of the current file */ { /* relative filename, add the path of the current file */
gchar *path; gchar *path;
path = g_path_get_dirname(doc->file_name); path = utils_get_current_file_dir_utf8();
if (!path)
path = g_get_current_dir();
filename = g_build_path(G_DIR_SEPARATOR_S, path, sel, NULL); filename = g_build_path(G_DIR_SEPARATOR_S, path, sel, NULL);
if (! g_file_test(filename, G_FILE_TEST_EXISTS) && if (! g_file_test(filename, G_FILE_TEST_EXISTS) &&

View File

@ -4567,7 +4567,7 @@ static void setup_sci_keys(ScintillaObject *sci)
sci_clear_cmdkey(sci, '\\' | (SCMOD_CTRL << 16)); /* Next word part */ sci_clear_cmdkey(sci, '\\' | (SCMOD_CTRL << 16)); /* Next word part */
sci_clear_cmdkey(sci, SCK_UP | (SCMOD_CTRL << 16)); /* scroll line up */ sci_clear_cmdkey(sci, SCK_UP | (SCMOD_CTRL << 16)); /* scroll line up */
sci_clear_cmdkey(sci, SCK_DOWN | (SCMOD_CTRL << 16)); /* scroll line down */ sci_clear_cmdkey(sci, SCK_DOWN | (SCMOD_CTRL << 16)); /* scroll line down */
sci_clear_cmdkey(sci, SCK_HOME); /* line start */ sci_clear_cmdkey(sci, SCK_HOME); /* line start */
sci_clear_cmdkey(sci, SCK_END); /* line end */ sci_clear_cmdkey(sci, SCK_END); /* line end */
sci_clear_cmdkey(sci, SCK_END | (SCMOD_ALT << 16)); /* visual line end */ sci_clear_cmdkey(sci, SCK_END | (SCMOD_ALT << 16)); /* visual line end */

View File

@ -107,12 +107,10 @@ static void cb_func_switch_tablastused(guint key_id);
static void cb_func_move_tab(guint key_id); static void cb_func_move_tab(guint key_id);
static void add_popup_menu_accels(void); static void add_popup_menu_accels(void);
static void apply_kb_accel(GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer user_data);
/* This is used to set default keybindings on startup but at this point we don't want to /* This is used to set default keybindings on startup.
* assign the keybinding to the menu_item (apply_kb_accel) otherwise it can't be overridden * Menu accels are set in apply_kb_accel(). */
* by user keybindings anymore */
/** Simple convenience function to fill a GeanyKeyBinding struct item. /** Simple convenience function to fill a GeanyKeyBinding struct item.
* @param group Group. * @param group Group.
* @param key_id Keybinding index for the group. * @param key_id Keybinding index for the group.
@ -566,16 +564,6 @@ void keybindings_init(void)
} }
static void apply_kb_accel(GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer user_data)
{
if (kb->key != 0 && kb->menu_item)
{
gtk_widget_add_accelerator(kb->menu_item, "activate", kb_accel_group,
kb->key, kb->mods, GTK_ACCEL_VISIBLE);
}
}
typedef void (*KBItemCallback) (GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer user_data); typedef void (*KBItemCallback) (GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer user_data);
static void keybindings_foreach(KBItemCallback cb, gpointer user_data) static void keybindings_foreach(KBItemCallback cb, gpointer user_data)
@ -630,36 +618,42 @@ static void load_user_kb(void)
} }
static void apply_kb_accel(GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer user_data)
{
if (kb->key != 0 && kb->menu_item)
{
gtk_widget_add_accelerator(kb->menu_item, "activate", kb_accel_group,
kb->key, kb->mods, GTK_ACCEL_VISIBLE);
}
}
void keybindings_load_keyfile(void) void keybindings_load_keyfile(void)
{ {
load_user_kb(); load_user_kb();
add_popup_menu_accels(); add_popup_menu_accels();
/* set menu accels now, after user keybindings have been read and processed /* set menu accels now, after user keybindings have been read */
* if we would set it before, user keybindings could not override menu item's default
* keybindings */
keybindings_foreach(apply_kb_accel, NULL); keybindings_foreach(apply_kb_accel, NULL);
} }
static void add_menu_accel(GeanyKeyGroup *group, guint kb_id, static void add_menu_accel(GeanyKeyGroup *group, guint kb_id, GtkWidget *menuitem)
GtkAccelGroup *accel_group, GtkWidget *menuitem)
{ {
GeanyKeyBinding *kb = &group->keys[kb_id]; GeanyKeyBinding *kb = &group->keys[kb_id];
if (kb->key != 0) if (kb->key != 0)
gtk_widget_add_accelerator(menuitem, "activate", accel_group, gtk_widget_add_accelerator(menuitem, "activate", kb_accel_group,
kb->key, kb->mods, GTK_ACCEL_VISIBLE); kb->key, kb->mods, GTK_ACCEL_VISIBLE);
} }
#define GEANY_ADD_POPUP_ACCEL(kb_id, wid) \ #define GEANY_ADD_POPUP_ACCEL(kb_id, wid) \
add_menu_accel(group, kb_id, accel_group, ui_lookup_widget(main_widgets.editor_menu, G_STRINGIFY(wid))) add_menu_accel(group, kb_id, ui_lookup_widget(main_widgets.editor_menu, G_STRINGIFY(wid)))
/* set the menu item accelerator shortcuts (just for visibility, they are handled anyway) */ /* set the menu item accelerator shortcuts (just for visibility, they are handled anyway) */
static void add_popup_menu_accels(void) static void add_popup_menu_accels(void)
{ {
GtkAccelGroup *accel_group = gtk_accel_group_new();
GeanyKeyGroup *group; GeanyKeyGroup *group;
group = g_ptr_array_index(keybinding_groups, GEANY_KEY_GROUP_EDITOR); group = g_ptr_array_index(keybinding_groups, GEANY_KEY_GROUP_EDITOR);
@ -696,8 +690,6 @@ static void add_popup_menu_accels(void)
GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_SENDTOVTE, send_selection_to_vte2); GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_SENDTOVTE, send_selection_to_vte2);
/* the build menu items are set if the build menus are created */ /* the build menu items are set if the build menus are created */
gtk_window_add_accel_group(GTK_WINDOW(main_widgets.window), accel_group);
} }
@ -1075,6 +1067,37 @@ static gboolean check_vte(GdkModifierType state, guint keyval)
#endif #endif
/* Map the keypad keys to their equivalent functions (taken from ScintillaGTK.cxx) */
static guint key_kp_translate(guint key_in)
{
switch (key_in)
{
case GDK_KP_Down:
return GDK_Down;
case GDK_KP_Up:
return GDK_Up;
case GDK_KP_Left:
return GDK_Left;
case GDK_KP_Right:
return GDK_Right;
case GDK_KP_Home:
return GDK_Home;
case GDK_KP_End:
return GDK_End;
case GDK_KP_Page_Up:
return GDK_Page_Up;
case GDK_KP_Page_Down:
return GDK_Page_Down;
case GDK_KP_Delete:
return GDK_Delete;
case GDK_KP_Insert:
return GDK_Insert;
default:
return key_in;
}
}
/* central keypress event handler, almost all keypress events go to this function */ /* central keypress event handler, almost all keypress events go to this function */
static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer user_data) static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer user_data)
{ {
@ -1098,6 +1121,9 @@ static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer
if (keyval >= GDK_A && keyval <= GDK_Z) if (keyval >= GDK_A && keyval <= GDK_Z)
keyval += GDK_a - GDK_A; keyval += GDK_a - GDK_A;
if (keyval >= GDK_KP_Space && keyval < GDK_KP_Equal)
keyval = key_kp_translate(keyval);
/*geany_debug("%d (%d) %d (%d)", keyval, ev->keyval, state, ev->state);*/ /*geany_debug("%d (%d) %d (%d)", keyval, ev->keyval, state, ev->state);*/
/* special cases */ /* special cases */
@ -2228,3 +2254,20 @@ static void cb_func_insert_action(guint key_id)
} }
} }
/* update key combination */
void keybindings_update_combo(GeanyKeyBinding *kb, guint key, GdkModifierType mods)
{
GtkWidget *widget = kb->menu_item;
if (widget && kb->key)
gtk_widget_remove_accelerator(widget, kb_accel_group, kb->key, kb->mods);
kb->key = key;
kb->mods = mods;
if (widget && kb->key)
gtk_widget_add_accelerator(widget, "activate", kb_accel_group,
kb->key, kb->mods, GTK_ACCEL_VISIBLE);
}

View File

@ -322,6 +322,8 @@ void keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
GeanyKeyCallback callback, guint key, GdkModifierType mod, GeanyKeyCallback callback, guint key, GdkModifierType mod,
gchar *name, gchar *label, GtkWidget *menu_item); gchar *name, gchar *label, GtkWidget *menu_item);
void keybindings_update_combo(GeanyKeyBinding *kb, guint key, GdkModifierType mods);
void keybindings_send_command(guint group_id, guint key_id); void keybindings_send_command(guint group_id, guint key_id);
GeanyKeyBinding *keybindings_lookup_item(guint group_id, guint key_id); GeanyKeyBinding *keybindings_lookup_item(guint group_id, guint key_id);

View File

@ -26,7 +26,9 @@
#ifndef PLUGINPRIVATE_H #ifndef PLUGINPRIVATE_H
#define PLUGINPRIVATE_H #define PLUGINPRIVATE_H
#include "ui_utils.h" #include "ui_utils.h" /* GeanyAutoSeparator */
#include "keybindings.h" /* GeanyKeyGroup */
typedef struct SignalConnection typedef struct SignalConnection
{ {
@ -35,11 +37,24 @@ typedef struct SignalConnection
} }
SignalConnection; SignalConnection;
typedef struct GeanyPluginPrivate typedef struct GeanyPluginPrivate
{ {
GModule *module;
gchar *filename; /* plugin filename (/path/libname.so) */
PluginInfo info; /* plugin name, description, etc */
GeanyPlugin public; /* fields the plugin can read */
void (*init) (GeanyData *data); /* Called when the plugin is enabled */
GtkWidget* (*configure) (GtkDialog *dialog); /* plugin configure dialog, optional */
void (*help) (void); /* Called when the plugin should show some help, optional */
void (*cleanup) (void); /* Called when the plugin is disabled or when Geany exits */
/* extra stuff */
PluginFields fields;
GeanyKeyGroup *key_group;
GeanyAutoSeparator toolbar_separator; GeanyAutoSeparator toolbar_separator;
gboolean resident; GArray *signal_ids; /* SignalConnection's to disconnect when unloading */
GArray *signal_ids; /* SignalConnection's to disconnect when unloading */
} }
GeanyPluginPrivate; GeanyPluginPrivate;

View File

@ -62,24 +62,7 @@
#include "pluginutils.h" #include "pluginutils.h"
#include "pluginprivate.h" #include "pluginprivate.h"
typedef GeanyPluginPrivate Plugin; /* shorter alias */
typedef struct Plugin
{
GModule *module;
gchar *filename; /* plugin filename (/path/libname.so) */
PluginInfo info; /* plugin name, description, etc */
PluginFields fields;
GeanyPlugin public; /* fields the plugin can read */
GeanyPluginPrivate priv; /* GeanyPlugin type private data, same as (*public.priv) */
GeanyKeyGroup *key_group;
void (*init) (GeanyData *data); /* Called when the plugin is enabled */
GtkWidget* (*configure) (GtkDialog *dialog); /* plugin configure dialog, optional */
void (*help) (void); /* Called when the plugin should show some help, optional */
void (*cleanup) (void); /* Called when the plugin is disabled or when Geany exits */
}
Plugin;
static gboolean want_plugins = FALSE; static gboolean want_plugins = FALSE;
@ -534,9 +517,6 @@ plugin_init(Plugin *plugin)
g_return_if_fail(plugin->init); g_return_if_fail(plugin->init);
plugin->init(&geany_data); plugin->init(&geany_data);
if (p_geany_plugin && (*p_geany_plugin)->priv->resident)
g_module_make_resident(plugin->module);
/* store some function pointers for later use */ /* store some function pointers for later use */
g_module_symbol(plugin->module, "plugin_configure", (void *) &plugin->configure); g_module_symbol(plugin->module, "plugin_configure", (void *) &plugin->configure);
g_module_symbol(plugin->module, "plugin_help", (void *) &plugin->help); g_module_symbol(plugin->module, "plugin_help", (void *) &plugin->help);
@ -667,7 +647,7 @@ plugin_new(const gchar *fname, gboolean init_plugin, gboolean add_to_list)
plugin->filename = g_strdup(fname); plugin->filename = g_strdup(fname);
plugin->module = module; plugin->module = module;
plugin->public.info = &plugin->info; plugin->public.info = &plugin->info;
plugin->public.priv = &plugin->priv; plugin->public.priv = plugin;
if (init_plugin) if (init_plugin)
plugin_init(plugin); plugin_init(plugin);
@ -681,7 +661,7 @@ plugin_new(const gchar *fname, gboolean init_plugin, gboolean add_to_list)
static void remove_callbacks(Plugin *plugin) static void remove_callbacks(Plugin *plugin)
{ {
GArray *signal_ids = plugin->priv.signal_ids; GArray *signal_ids = plugin->signal_ids;
SignalConnection *sc; SignalConnection *sc;
if (signal_ids == NULL) if (signal_ids == NULL)
@ -714,7 +694,7 @@ plugin_cleanup(Plugin *plugin)
if (plugin->key_group) if (plugin->key_group)
g_ptr_array_remove_fast(keybinding_groups, plugin->key_group); g_ptr_array_remove_fast(keybinding_groups, plugin->key_group);
widget = plugin->priv.toolbar_separator.widget; widget = plugin->toolbar_separator.widget;
if (widget) if (widget)
gtk_widget_destroy(widget); gtk_widget_destroy(widget);

View File

@ -88,7 +88,7 @@ void plugin_module_make_resident(GeanyPlugin *plugin)
{ {
g_return_if_fail(plugin); g_return_if_fail(plugin);
plugin->priv->resident = TRUE; g_module_make_resident(plugin->priv->module);
} }

View File

@ -1265,8 +1265,7 @@ static void kb_cell_edited_cb(GtkCellRendererText *cellrenderertext, gchar *path
/* set the values here, because of the above check, setting it in /* set the values here, because of the above check, setting it in
* gtk_accelerator_parse would return a wrong key combination if it is duplicate */ * gtk_accelerator_parse would return a wrong key combination if it is duplicate */
kb->key = lkey; keybindings_update_combo(kb, lkey, lmods);
kb->mods = lmods;
gtk_tree_store_set(store, &iter, KB_TREE_SHORTCUT, new_text, -1); gtk_tree_store_set(store, &iter, KB_TREE_SHORTCUT, new_text, -1);
@ -1311,8 +1310,7 @@ static void kb_dialog_response_cb(GtkWidget *dialog, gint response, G_GNUC_UNUSE
/* set the values here, because of the above check, setting it in /* set the values here, because of the above check, setting it in
* gtk_accelerator_parse would return a wrong key combination if it is duplicate */ * gtk_accelerator_parse would return a wrong key combination if it is duplicate */
kb->key = lkey; keybindings_update_combo(kb, lkey, lmods);
kb->mods = lmods;
gtk_tree_store_set(store, &g_iter, gtk_tree_store_set(store, &g_iter,
KB_TREE_SHORTCUT, gtk_label_get_text(GTK_LABEL(dialog_label)), -1); KB_TREE_SHORTCUT, gtk_label_get_text(GTK_LABEL(dialog_label)), -1);
@ -1395,8 +1393,7 @@ static gboolean kb_find_duplicate(GeanyKeyBinding *search_kb,
_("The combination '%s' is already used for \"%s\"."), _("The combination '%s' is already used for \"%s\"."),
action, kb->label)) action, kb->label))
{ {
kb->key = 0; keybindings_update_combo(kb, 0, 0);
kb->mods = 0;
kb_clear_tree_shortcut(g, i); kb_clear_tree_shortcut(g, i);
continue; continue;
} }