本文整理汇总了C++中purple_prefs_get_bool函数的典型用法代码示例。如果您正苦于以下问题:C++ purple_prefs_get_bool函数的具体用法?C++ purple_prefs_get_bool怎么用?C++ purple_prefs_get_bool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了purple_prefs_get_bool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blist_create_cb
static void blist_create_cb(PurpleBuddyList *purple_blist, void *data) {
purple_debug_info(WINPREFS_PLUGIN_ID, "buddy list created\n");
blist = PIDGIN_BLIST(purple_blist)->window;
if(purple_prefs_get_bool(PREF_DBLIST_DOCKABLE)) {
blist_set_dockable(TRUE);
if(purple_prefs_get_bool(PREF_DBLIST_DOCKED)) {
blist_ab->undocked_height = purple_prefs_get_int(PREF_DBLIST_HEIGHT);
if(!(gdk_window_get_state(gtk_widget_get_window(blist))
& GDK_WINDOW_STATE_WITHDRAWN)) {
gtk_appbar_dock(blist_ab,
purple_prefs_get_int(PREF_DBLIST_SIDE));
if(purple_prefs_get_int(PREF_BLIST_ON_TOP)
== BLIST_TOP_DOCKED)
blist_set_ontop(TRUE);
} else {
g_idle_add(listen_for_blist_visible_cb, NULL);
}
}
}
if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS)
blist_set_ontop(TRUE);
}
示例2: init_plugin
static void
init_plugin(PurplePlugin *plugin)
{
purple_prefs_add_none("/plugins/gtk");
purple_prefs_add_none("/plugins/gtk/win32");
purple_prefs_add_none("/plugins/gtk/win32/winprefs");
purple_prefs_add_bool(PREF_DBLIST_DOCKABLE, FALSE);
purple_prefs_add_bool(PREF_DBLIST_DOCKED, FALSE);
purple_prefs_add_int(PREF_DBLIST_HEIGHT, 0);
purple_prefs_add_int(PREF_DBLIST_SIDE, 0);
/* Convert old preferences */
if(purple_prefs_exists(PREF_DBLIST_ON_TOP)) {
gint blist_top = BLIST_TOP_NEVER;
if(purple_prefs_get_bool(PREF_BLIST_ON_TOP))
blist_top = BLIST_TOP_ALWAYS;
else if(purple_prefs_get_bool(PREF_DBLIST_ON_TOP))
blist_top = BLIST_TOP_DOCKED;
purple_prefs_remove(PREF_BLIST_ON_TOP);
purple_prefs_remove(PREF_DBLIST_ON_TOP);
purple_prefs_add_int(PREF_BLIST_ON_TOP, blist_top);
} else
purple_prefs_add_int(PREF_BLIST_ON_TOP, BLIST_TOP_NEVER);
purple_prefs_remove(PREF_CHAT_BLINK);
}
示例3: notify_new_message_cb
static void
notify_new_message_cb (PurpleAccount *account,
const gchar *sender,
const gchar *message,
int flags,
gpointer data)
{
PurpleConversation *conv;
if (!purple_prefs_get_bool ("/plugins/gtk/libnotify/newmsg"))
return;
conv = purple_find_conversation_with_account (PURPLE_CONV_TYPE_IM, sender, account);
#ifndef DEBUG /* in debug mode, always show notifications */
if (conv && purple_conversation_has_focus (conv)) {
purple_debug_info (PLUGIN_ID, "Conversation has focus 0x%lx\n", (unsigned long)conv);
return;
}
#endif
if (conv && purple_prefs_get_bool ("/plugins/gtk/libnotify/newconvonly")) {
purple_debug_info (PLUGIN_ID, "Conversation is not new 0x%lx\n", (unsigned long)conv);
return;
}
if (!should_notify_unavailable (account))
return;
notify_msg_sent (account, conv, sender, message);
}
示例4: notify_buddy_signoff_cb
static void
notify_buddy_signoff_cb (PurpleBuddy *buddy,
gpointer data)
{
gchar *tr_name, *title;
gboolean blocked;
g_return_if_fail (buddy);
if (!purple_prefs_get_bool ("/plugins/gtk/libnotify/signoff"))
return;
if (g_list_find (just_signed_on_accounts, buddy->account))
return;
blocked = purple_prefs_get_bool ("/plugins/gtk/libnotify/blocked");
if (!purple_privacy_check (buddy->account, buddy->name) && blocked)
return;
if (!should_notify_unavailable (purple_buddy_get_account (buddy)))
return;
tr_name = truncate_escape_string (best_name (buddy), 25);
title = g_strdup_printf (_("%s signed off"), tr_name);
notify (title, NULL, buddy, NULL);
g_free (tr_name);
g_free (title);
}
示例5: set_conv_window_trans
static void set_conv_window_trans(PidginWindow *oldwin, PidginWindow *newwin) {
GtkWidget *win = newwin->window;
/* check prefs to see if we want trans */
if (purple_prefs_get_bool(OPT_WINTRANS_IM_ENABLED)) {
set_wintrans(win, purple_prefs_get_int(OPT_WINTRANS_IM_ALPHA),
TRUE, purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP));
if (purple_prefs_get_bool(OPT_WINTRANS_IM_SLIDER)) {
add_slider(win);
}
}
/* If we're moving from one window to another,
* add the focus listeners to the new window if not already there */
if (oldwin != NULL && oldwin != newwin) {
if (pidgin_conv_window_get_gtkconv_count(newwin) == 0) {
g_signal_connect(G_OBJECT(win), "focus_in_event",
G_CALLBACK(focus_conv_win_cb), win);
g_signal_connect(G_OBJECT(win), "focus_out_event",
G_CALLBACK(focus_conv_win_cb), win);
}
/* If we've moved the last conversation, cleanup the window */
if (pidgin_conv_window_get_gtkconv_count(oldwin) == 1)
cleanup_conv_window(oldwin);
}
}
示例6: purple_prefs_init
void
purple_prefs_init(void)
{
void *handle = purple_prefs_get_handle();
prefs_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
purple_prefs_connect_callback(handle, "/", prefs_save_cb, NULL);
purple_prefs_add_none("/purple");
purple_prefs_add_none("/plugins");
purple_prefs_add_none("/plugins/core");
purple_prefs_add_none("/plugins/lopl");
purple_prefs_add_none("/plugins/prpl");
/* Away */
purple_prefs_add_none("/purple/away");
purple_prefs_add_string("/purple/away/idle_reporting", "system");
purple_prefs_add_bool("/purple/away/away_when_idle", TRUE);
purple_prefs_add_int("/purple/away/mins_before_away", 5);
/* Away -> Auto-Reply */
if (!purple_prefs_exists("/purple/away/auto_response/enabled") ||
!purple_prefs_exists("/purple/away/auto_response/idle_only"))
{
purple_prefs_add_string("/purple/away/auto_reply", "awayidle");
}
else
{
if (!purple_prefs_get_bool("/purple/away/auto_response/enabled"))
{
purple_prefs_add_string("/purple/away/auto_reply", "never");
}
else
{
if (purple_prefs_get_bool("/purple/away/auto_response/idle_only"))
{
purple_prefs_add_string("/purple/away/auto_reply", "awayidle");
}
else
{
purple_prefs_add_string("/purple/away/auto_reply", "away");
}
}
}
/* Buddies */
purple_prefs_add_none("/purple/buddies");
/* Contact Priority Settings */
purple_prefs_add_none("/purple/contact");
purple_prefs_add_bool("/purple/contact/last_match", FALSE);
purple_prefs_remove("/purple/contact/offline_score");
purple_prefs_remove("/purple/contact/away_score");
purple_prefs_remove("/purple/contact/idle_score");
purple_prefs_load();
purple_prefs_update_old();
}
示例7: set_blist_trans
static void set_blist_trans(GtkWidget *w, const char *pref) {
gboolean enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
purple_prefs_set_bool(pref, enabled);
if (blist) {
set_wintrans(blist, purple_prefs_get_int(OPT_WINTRANS_BL_ALPHA),
purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED),
purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP));
}
}
示例8: purplerc_make_fonts_vbox
static GtkWidget *
purplerc_make_fonts_vbox(void)
{
GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
GtkSizeGroup *labelsg = NULL;
gsize i;
vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER);
hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
check = pidgin_prefs_checkbox(_("GTK+ Interface Font"),
"/plugins/gtk/purplerc/set/gtk-font-name",
hbox);
gtk_size_group_add_widget(labelsg, check);
widget = pidgin_pixbuf_button_from_stock("", GTK_STOCK_SELECT_FONT,
PIDGIN_BUTTON_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0);
gtk_widget_set_sensitive(widget,
purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-font-name"));
g_signal_connect(G_OBJECT(check), "toggled",
G_CALLBACK(pidgin_toggle_sensitive), widget);
g_signal_connect(G_OBJECT(widget), "clicked",
G_CALLBACK(purplerc_set_font), GINT_TO_POINTER(-1));
for (i = 0; i < G_N_ELEMENTS(font_prefs); i++) {
hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
check = pidgin_prefs_checkbox(_(font_names[i]),
font_prefs_set[i], hbox);
gtk_size_group_add_widget(labelsg, check);
font_widgets[i] = pidgin_pixbuf_button_from_stock("",
GTK_STOCK_SELECT_FONT, PIDGIN_BUTTON_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(hbox), font_widgets[i], FALSE,
FALSE, 0);
gtk_widget_set_sensitive(font_widgets[i],
purple_prefs_get_bool(font_prefs_set[i]));
g_signal_connect(G_OBJECT(check), "toggled",
G_CALLBACK(pidgin_toggle_sensitive),
font_widgets[i]);
g_signal_connect(G_OBJECT(font_widgets[i]), "clicked",
G_CALLBACK(purplerc_set_font),
GINT_TO_POINTER(i));
}
g_object_unref(labelsg);
return vbox;
}
示例9: conv_menu_cb
static void
conv_menu_cb(PurpleConversation *conv, GList **list)
{
PurpleConversationType type = purple_conversation_get_type(conv);
gboolean enabled = ((type == PURPLE_CONV_TYPE_IM && purple_prefs_get_bool(PREF_IMS)) ||
(type == PURPLE_CONV_TYPE_CHAT && purple_prefs_get_bool(PREF_CHATS)));
PurpleMenuAction *action = purple_menu_action_new(_("Jump to markerline"),
enabled ? PURPLE_CALLBACK(jump_to_markerline) : NULL, NULL, NULL);
*list = g_list_append(*list, action);
}
示例10: change_alpha
static void change_alpha(GtkWidget *w, gpointer data) {
int alpha = gtk_range_get_value(GTK_RANGE(w));
purple_prefs_set_int(OPT_WINTRANS_IM_ALPHA, alpha);
/* If we're in no-transparency on focus mode,
* don't take effect immediately */
if (!purple_prefs_get_bool(OPT_WINTRANS_IM_ONFOCUS))
set_wintrans(GTK_WIDGET(data), alpha, TRUE,
purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP));
}
示例11: attach_signals
static int
attach_signals(PurpleConversation *conv)
{
PidginConversation *gtkconv = NULL;
PidginWindow *gtkwin = NULL;
GSList *imhtml_ids = NULL, *entry_ids = NULL;
guint id;
gtkconv = PIDGIN_CONVERSATION(conv);
if (!gtkconv) {
purple_debug_misc("notify", "Failed to find gtkconv\n");
return 0;
}
gtkwin = gtkconv->win;
if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_focus")) {
/* TODO should really find a way to make this work no matter
* where the focus is inside the conv window, without having
* to bind to focus-in-event on the g(d|t)kwindow */
/* try setting the signal on the focus-in-event for
* gtkwin->notebook->container? */
id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event",
G_CALLBACK(unnotify_cb), conv);
entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id));
id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "focus-in-event",
G_CALLBACK(unnotify_cb), conv);
imhtml_ids = g_slist_append(imhtml_ids, GUINT_TO_POINTER(id));
}
if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")) {
/* TODO similarly should really find a way to allow for
* clicking in other places of the window */
id = g_signal_connect(G_OBJECT(gtkconv->entry), "button-press-event",
G_CALLBACK(unnotify_cb), conv);
entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id));
id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "button-press-event",
G_CALLBACK(unnotify_cb), conv);
imhtml_ids = g_slist_append(imhtml_ids, GUINT_TO_POINTER(id));
}
if (purple_prefs_get_bool("/plugins/gtk/X11/notify/notify_type")) {
id = g_signal_connect(G_OBJECT(gtkconv->entry), "key-press-event",
G_CALLBACK(unnotify_cb), conv);
entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id));
}
purple_conversation_set_data(conv, "notify-imhtml-signals", imhtml_ids);
purple_conversation_set_data(conv, "notify-entry-signals", entry_ids);
return 0;
}
示例12: history_prefs_check
static void
history_prefs_check(PurplePlugin *plugin)
{
if (!purple_prefs_get_bool("/purple/logging/log_ims") &&
!purple_prefs_get_bool("/purple/logging/log_chats"))
{
purple_notify_warning(plugin, NULL, _("History Plugin Requires Logging"),
_("Logging can be enabled from Tools -> Preferences -> Logging.\n\n"
"Enabling logs for instant messages and/or chats will activate "
"history for the same conversation type(s)."), NULL);
}
}
示例13: history_prefs_check
static void
history_prefs_check(PurplePlugin *plugin)
{
if (!purple_prefs_get_bool("/purple/logging/log_ims") &&
!purple_prefs_get_bool("/purple/logging/log_chats"))
{
PurpleRequestFields *fields = purple_request_fields_new();
PurpleRequestFieldGroup *group;
PurpleRequestField *field;
struct {
const char *pref;
const char *label;
} prefs[] = {
{"/purple/logging/log_ims", N_("Log IMs")},
{"/purple/logging/log_chats", N_("Log chats")},
{NULL, NULL}
};
int iter;
GList *list = purple_log_logger_get_options();
const char *system = purple_prefs_get_string("/purple/logging/format");
group = purple_request_field_group_new(_("Logging"));
field = purple_request_field_list_new("/purple/logging/format", _("Log format"));
while (list) {
const char *label = _(list->data);
list = g_list_delete_link(list, list);
purple_request_field_list_add_icon(field, label, NULL, list->data);
if (system && strcmp(system, list->data) == 0)
purple_request_field_list_add_selected(field, label);
list = g_list_delete_link(list, list);
}
purple_request_field_group_add_field(group, field);
for (iter = 0; prefs[iter].pref; iter++) {
field = purple_request_field_bool_new(prefs[iter].pref, _(prefs[iter].label),
purple_prefs_get_bool(prefs[iter].pref));
purple_request_field_group_add_field(group, field);
}
purple_request_fields_add_group(fields, group);
purple_request_fields(plugin, NULL, _("History Plugin Requires Logging"),
_("Logging can be enabled from Tools -> Preferences -> Logging.\n\n"
"Enabling logs for instant messages and/or chats will activate "
"history for the same conversation type(s)."),
fields,
_("OK"), G_CALLBACK(finch_request_save_in_prefs),
_("Cancel"), NULL,
NULL, NULL, NULL, plugin);
}
}
示例14: purple_prefs_get_bool
void BuddyList::UpdateCachedPreference(const char *name)
{
if (!strcmp(name, CONF_PREFIX "/blist/show_empty_groups"))
show_empty_groups = purple_prefs_get_bool(name);
else if (!strcmp(name, CONF_PREFIX "/blist/show_offline_buddies"))
show_offline_buddies = purple_prefs_get_bool(name);
else if (!strcmp(name, CONF_PREFIX "/blist/colorization_mode")) {
const char *value = purple_prefs_get_string(name);
if (!strcmp(value, "status"))
colorization_mode = COLOR_BY_STATUS;
else
colorization_mode = COLOR_NONE;
}
}
示例15: load_pref_window
static void
load_pref_window(const char * profile)
{
gint i;
finch_sound_set_active_profile(profile);
gnt_combo_box_set_selected(GNT_COMBO_BOX(pref_dialog->method), (gchar *)purple_prefs_get_string(make_pref("/method")));
gnt_entry_set_text(GNT_ENTRY(pref_dialog->command), purple_prefs_get_path(make_pref("/command")));
gnt_check_box_set_checked(GNT_CHECK_BOX(pref_dialog->conv_focus), purple_prefs_get_bool(make_pref("/conv_focus")));
gnt_combo_box_set_selected(GNT_COMBO_BOX(pref_dialog->while_status), GINT_TO_POINTER(purple_prefs_get_int("/purple" "/sound/while_status")));
gnt_slider_set_value(GNT_SLIDER(pref_dialog->volume), CLAMP(purple_prefs_get_int(make_pref("/volume")), 0, 100));
for (i = 0; i < PURPLE_NUM_SOUNDS; i++) {
FinchSoundEvent * event = &sounds[i];
gchar *boolpref;
gchar *filepref, *basename = NULL;
const char * profile = finch_sound_get_active_profile();
filepref = g_strdup_printf(FINCH_PREFS_ROOT "/sound/profiles/%s/file/%s", profile, event->pref);
g_free(event->file);
event->file = g_strdup(purple_prefs_get_path(filepref));
g_free(filepref);
if (event->label == NULL) {
continue;
}
boolpref = g_strdup_printf(FINCH_PREFS_ROOT "/sound/profiles/%s/enabled/%s", profile, event->pref);
gnt_tree_change_text(GNT_TREE(pref_dialog->events), GINT_TO_POINTER(i), 0, event->label);
gnt_tree_change_text(GNT_TREE(pref_dialog->events), GINT_TO_POINTER(i), 1,
event->file[0] ? (basename = g_path_get_basename(event->file)) : _("(default)"));
g_free(basename);
gnt_tree_set_choice(GNT_TREE(pref_dialog->events), GINT_TO_POINTER(i), purple_prefs_get_bool(boolpref));
g_free(boolpref);
}
gnt_tree_set_selected(GNT_TREE(pref_dialog->profiles), (gchar *)finch_sound_get_active_profile());
gnt_widget_draw(pref_dialog->window);
}