• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ purple_prefs_get_bool函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中purple_prefs_get_bool函数的典型用法代码示例。如果您正苦于以下问题:C++ purple_prefs_get_bool函数的具体用法?C++ purple_prefs_get_bool怎么用?C++ purple_prefs_get_bool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了purple_prefs_get_bool函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);

}
开发者ID:N8Fear,项目名称:purple-facebook,代码行数:26,代码来源:winprefs.c


示例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);
}
开发者ID:Draghtnod,项目名称:pidgin,代码行数:25,代码来源:winprefs.c


示例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);
}
开发者ID:KurtPreston,项目名称:pidgin-libnotify,代码行数:31,代码来源:pidgin-libnotify.c


示例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);
}
开发者ID:KurtPreston,项目名称:pidgin-libnotify,代码行数:31,代码来源:pidgin-libnotify.c


示例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);
	}
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:28,代码来源:win2ktrans.c


示例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();
}
开发者ID:psunkari,项目名称:spicebird,代码行数:59,代码来源:prefs.c


示例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));
	}
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:9,代码来源:win2ktrans.c


示例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;
}
开发者ID:Draghtnod,项目名称:pidgin,代码行数:56,代码来源:pidginrc.c


示例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);
}
开发者ID:gotomypc,项目名称:pidgin_whiteboard,代码行数:10,代码来源:markerline.c


示例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));
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:10,代码来源:win2ktrans.c


示例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;
}
开发者ID:mclarkelauer,项目名称:HoneyIM,代码行数:54,代码来源:notify.c


示例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);
	}
}
开发者ID:ArmoredPidgin,项目名称:pidgin-hardened,代码行数:12,代码来源:history.c


示例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);
	}
}
开发者ID:Draghtnod,项目名称:pidgin,代码行数:52,代码来源:gnthistory.c


示例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;
  }
}
开发者ID:transacid,项目名称:CenterIM5,代码行数:14,代码来源:BuddyList.cpp


示例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);
}
开发者ID:Herrie82,项目名称:pidgin-2.10.12,代码行数:49,代码来源:gntsound.c


示例16: im_recv_im

static void
im_recv_im(PurpleAccount *account, char *who, char *what,
	    PurpleConversation * conv, PurpleMessageFlags flags)
{
  int wasPlaying = 0;

  if(system("dbus-send --print-reply --dest=net.kevinmehall.Pithos /net/kevinmehall/Pithos net.kevinmehall.Pithos.IsPlaying")){
    wasPlaying = 1;
    system("dbus-send --print-reply --dest=net.kevinmehall.Pithos /net/kevinmehall/Pithos net.kevinmehall.Pithos.PlayPause");
  }

  char *stripped;
  const char *alias = get_best_name(account, who);
  silent_joins = NULL;

  GString *buffer= g_string_new("");

/*  msg_utf8=purple_utf8_try_convert(what) */

  stripped = (char *)purple_markup_strip_html(/*msg_utf8?msg_utf8:*/what);
    
  if(purple_prefs_get_bool("/plugins/gtk/festival/speaker/replace_url"))
    stripped = unlinkify_text(stripped);

  if (strlen(stripped) <= purple_prefs_get_int("/plugins/gtk/festival/speaker/maxlength")) {

    if(purple_prefs_get_bool("/plugins/gtk/festival/speaker/prepend_who") &&
       strcmp(alias, prev_alias))
      g_string_printf(buffer,"%s %s %s", alias, _("says"), stripped);
    else
      g_string_printf(buffer,"%s", stripped);

    strcpy(prev_alias, alias);
    speak(buffer);
  } else {
    g_string_printf(buffer, "message overflow");
    speak(buffer);
  }

  g_free(stripped);
/*  if (msg_utf8) g_free(msg_utf8); */
  g_string_free(buffer,TRUE);

  if(wasPlaying==1 && !system("dbus-send --print-reply --dest=net.kevinmehall.Pithos /net/kevinmehall/Pithos net.kevinmehall.Pithos.IsPlaying")){
    sleep(5);
    system("dbus-send --print-reply --dest=net.kevinmehall.Pithos /net/kevinmehall/Pithos net.kevinmehall.Pithos.PlayPause");
  }
}
开发者ID:gerrywastaken,项目名称:pidgin-festival,代码行数:48,代码来源:festival.c


示例17: commande

PurpleCmdRet commande(PurpleConversation *conv, const gchar *cmd, gchar **args, gchar **error, void *data) {
	int argc,pid;
	char *joueur;
	char *jeu;
	joueur=g_strdup_printf("host%d", (int) (999.0*rand()/(RAND_MAX+1.0)));
	for(argc=0;args[argc];argc++);
	if(argc==0) {
		if(error)
			*error=g_strdup("Il faut spécifier un jeu, les jeux possibles sont(respectez la casse):\n-TicTacToe\n-Reversi\n-Chess");
		return PURPLE_CMD_RET_FAILED;
	}
	jeu=args[0];
	pid=fork();
	if(pid==0) {
		char **parms=malloc(4*sizeof(char *));
		char *sys_parm;
		if(purple_prefs_get_bool("/plugins/gtk/ggzpurple/guest"))
		 {
			parms[0]=joueur;
			parms[1]=jeu;
			sys_parm=g_strdup_printf("%s -u %s -g %s -s %s", GGZWRAPPER, parms[0], parms[1], purple_prefs_get_string("/plugins/gtk/ggzpurple/server"));
		 }
		else
		 {
			parms[0]=(char*)purple_prefs_get_string("/plugins/gtk/ggzpurple/login");
			parms[1]=jeu;
			sys_parm=g_strdup_printf("%s -u %s -g %s -p %s -s %s", GGZWRAPPER, parms[0], parms[1], purple_prefs_get_string("/plugins/gtk/ggzpurple/password"), purple_prefs_get_string("/plugins/gtk/ggzpurple/server"));
		 }
		parms[0]="sh";
		parms[1]="-c";
		parms[2]=sys_parm;
		parms[3]=NULL;
		printf("LAUNCH: %s,%s %s %s\n", "/bin/sh", parms[0], parms[1], parms[2]);
		execv("/bin/sh", parms);
		exit(0);
	} else if(pid>0) {
		if(purple_prefs_get_bool("/plugins/gtk/ggzpurple/guest")) purple_conv_im_send(PURPLE_CONV_IM(conv), g_strdup_printf("%s%s %s %s", HEADER, jeu,joueur, FOOTER));
		else purple_conv_im_send(PURPLE_CONV_IM(conv), g_strdup_printf("%s%s %s %s", HEADER, jeu,purple_prefs_get_string("/plugins/gtk/ggzpurple/login"), FOOTER));

		LastGamePID = pid;

		return PURPLE_CMD_RET_OK;
	} else {
		if(error)
		*error=strdup("Probleme de fork()");
		return PURPLE_CMD_RET_FAILED;
	}
}
开发者ID:ralight,项目名称:ggz,代码行数:48,代码来源:simple.c


示例18: conv_updated_cb

static void
conv_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type) {
	PidginConversation *pconv = PIDGIN_CONVERSATION(conv);
	PidginWindow *win = pidgin_conv_get_window(pconv);

	if (type == PURPLE_CONV_UPDATE_UNSEEN && !pidgin_conv_is_hidden(pconv)
			&& pconv->unseen_state == PIDGIN_UNSEEN_NONE
			&& pidgin_conv_window_get_gtkconv_count(win) == 1) {
		GtkWidget *window = win->window;
		gboolean has_focus;

		g_object_get(G_OBJECT(window), "has-toplevel-focus", &has_focus, NULL);

		if (!has_focus || !purple_prefs_get_bool(OPT_WINTRANS_IM_ONFOCUS))
			set_conv_window_trans(NULL, win);

		if (g_signal_handler_find(G_OBJECT(window), G_SIGNAL_MATCH_FUNC,
				0, 0, NULL, G_CALLBACK(focus_conv_win_cb), NULL) == 0) {
			g_signal_connect(G_OBJECT(window), "focus_in_event",
				G_CALLBACK(focus_conv_win_cb), window);
			g_signal_connect(G_OBJECT(window), "focus_out_event",
				G_CALLBACK(focus_conv_win_cb), window);
		}
	}
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:25,代码来源:win2ktrans.c


示例19: plugin_load

/**************************************************************************************************
    Load plugin
**************************************************************************************************/
static gboolean
plugin_load(PurplePlugin *plugin)
{
    PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist();
	GList *convs = purple_get_conversations();

    if (purple_prefs_get_bool("/plugins/core/hidemenu/default_state")) {
        hmb_is_menu_visible = FALSE;
    } else {
        hmb_is_menu_visible = TRUE;
    }

    // set callback for 'blist created' signal
    purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", plugin, 
                          PURPLE_CALLBACK(hmb_blist_created_cb), NULL);
    // set callback for 'conversation displayed' signal
	purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", plugin,
	                      PURPLE_CALLBACK(hmb_conversation_displayed_cb), NULL);

	// hide blist menubar
    hmb_toggle_menubar(gtkblist, NULL);

    // hide conversations menubar
	while (convs) {
		PurpleConversation *conv = (PurpleConversation *)convs->data;
		if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) {
			hmb_toggle_menubar(NULL, PIDGIN_CONVERSATION(conv));
		}
		convs = convs->next;
	}

	return TRUE;
}
开发者ID:dreadatour,项目名称:pidgin-hide-menu,代码行数:36,代码来源:hidemenu.c


示例20: otrg_prefs_global_load

void
otrg_prefs_global_load(gboolean *enabledp, gboolean *automaticp,
	gboolean *onlyprivatep, gboolean *avoidloggingp)
{
	if (purple_prefs_exists("/OTR/enabled")) {
		*enabledp = purple_prefs_get_bool("/OTR/enabled");
		*automaticp = purple_prefs_get_bool("/OTR/automatic");
		*onlyprivatep = purple_prefs_get_bool("/OTR/onlyprivate");
		*avoidloggingp = purple_prefs_get_bool("/OTR/avoidloggingotr");
	} else {
		*enabledp = TRUE;
		*automaticp = TRUE;
		*onlyprivatep = FALSE;
		*avoidloggingp = TRUE;
	}
}
开发者ID:N8Fear,项目名称:pidgin-otr,代码行数:16,代码来源:common.c



注:本文中的purple_prefs_get_bool函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ purple_prefs_get_int函数代码示例发布时间:2022-05-30
下一篇:
C++ purple_input_remove函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap