如何添加自定义的preference到洋泾浜? [英] How do I add custom preference into Pidgin?

查看:174
本文介绍了如何添加自定义的preference到洋泾浜?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要添加preference到洋泾浜为我的自定义菜单项,如图<一个href=\"http://stackoverflow.com/questions/23379170/how-do-i-add-item-to-pidgin-menu/23379171#23379171\">How我添加物品到洋泾浜菜单。我怎样才能做到这一点?

I need to add preference into Pidgin to serve my custom menu item as shown in How do I add item to Pidgin menu. How can I achieve this?

推荐答案

您需要找到函数 pidgin_blist_init 洋泾浜/ gtkblist.c 并添加以下行:

You need to find function pidgin_blist_init in pidgin/gtkblist.c and add the following line:

purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_groups", FALSE);

purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", FALSE);

有同样功能的加入 INT 字符串 string_list 路径路径列表类型。现在,我们需要把我们的自定义菜单项自定义函数关联。这是在 pidgin_blist_show 完成。只需添加行

There are also functions to add int, string, none, string_list, path and path_list types. Now, we need to associate our custom menu item with custom function. This is done in pidgin_blist_show. Just add the line

purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_groups",
                              _prefs_change_redo_list_groups, NULL);

purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
                              _prefs_change_redo_list, NULL);

最后,添加 _ prefs_change_redo_list_groups 函数只是在之后_ prefs_change_redo_list

static void _prefs_change_redo_list_groups(const char *name, PurplePrefType type,
                                           gconstpointer val, gpointer data)
{
    purple_blist_set_groups_visible(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_groups"));
    _prefs_change_redo_list(name, type, val, data);
}

purple_blist_set_groups_visible 也将公布一次我开发它,我答应;)

The purple_blist_set_groups_visible will also be published once I develop it, I promise ;)

这篇关于如何添加自定义的preference到洋泾浜?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆