Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Tue, 14 Oct 2014 21:47:33 UTC Commit: 03faa182ceca4d02bfe564e9ed6c8e4e1841da88 https://github.com/geany/geany-plugins/commit/03faa182ceca4d02bfe564e9ed6c8e...
Log Message: ----------- geanyctags: use plugin_set_key_group() instead of deprecated PLUGIN_KEY_GROUP()
Modified Paths: -------------- geanyctags/src/geanyctags.c
Modified: geanyctags/src/geanyctags.c 15 lines changed, 8 insertions(+), 7 deletions(-) =================================================================== @@ -72,8 +72,6 @@ enum };
-PLUGIN_KEY_GROUP(geanyctags, KB_COUNT); -
void plugin_init(G_GNUC_UNUSED GeanyData * data); void plugin_cleanup(void); @@ -586,21 +584,24 @@ static void on_find_tag(GtkMenuItem *menuitem, gpointer user_data) gtk_widget_hide(s_ft_dialog.widget); }
-static void kb_callback(guint key_id) +static gboolean kb_callback(guint key_id) { switch (key_id) { case KB_FIND_TAG: on_find_tag(NULL, NULL); - break; + return TRUE; case KB_GENERATE_TAGS: on_generate_tags(NULL, NULL); - break; + return TRUE; } + return FALSE; }
void plugin_init(G_GNUC_UNUSED GeanyData * data) { + GeanyKeyGroup *key_group = plugin_set_key_group(geany_plugin, "GeanyCtags", KB_COUNT, kb_callback); + s_context_sep_item = gtk_separator_menu_item_new(); gtk_widget_show(s_context_sep_item); gtk_menu_shell_prepend(GTK_MENU_SHELL(geany->main_widgets->editor_menu), s_context_sep_item); @@ -623,14 +624,14 @@ void plugin_init(G_GNUC_UNUSED GeanyData * data) gtk_widget_show(s_gt_item); gtk_container_add(GTK_CONTAINER(geany->main_widgets->project_menu), s_gt_item); g_signal_connect((gpointer) s_gt_item, "activate", G_CALLBACK(on_generate_tags), NULL); - keybindings_set_item(plugin_key_group, KB_GENERATE_TAGS, kb_callback, + keybindings_set_item(key_group, KB_GENERATE_TAGS, NULL, 0, 0, "generate_tags", _("Generate tags"), s_gt_item);
s_ft_item = gtk_menu_item_new_with_mnemonic(_("Find tag")); gtk_widget_show(s_ft_item); gtk_container_add(GTK_CONTAINER(geany->main_widgets->project_menu), s_ft_item); g_signal_connect((gpointer) s_ft_item, "activate", G_CALLBACK(on_find_tag), NULL); - keybindings_set_item(plugin_key_group, KB_FIND_TAG, kb_callback, + keybindings_set_item(key_group, KB_FIND_TAG, NULL, 0, 0, "find_tag", _("Find tag"), s_ft_item);
set_widgets_sensitive(FALSE);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).