Esempio n. 1
0
static gboolean
plugin_load(PurplePlugin *plugin)
{
	pidgin_conv_placement_add_fnc("number", _("By conversation count"),
							   &conv_placement_by_number);
	purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement");
	return TRUE;
}
Esempio n. 2
0
/**
 * The plugin's load function
 *
 * @param[in] plugin     Pointer to the plugin
 * @return               Whether to continue loading
**/
static gboolean plugin_load(PurplePlugin *plugin)
{
	PidginBuddyList *
	    gtkblist;	  /*< For determining if blist was initialized */
	void *conv_handle;     /*< The conversations handle                 */
	void *gtkblist_handle; /*< The Pidgin Buddy List handle             */
	void *gtkconv_handle;  /*< The Pidgin conversations handle          */

	/* XXX: There should be an interface to list available Buddy List
	 * windows. */
	gtkblist = pidgin_blist_get_default_gtk_blist();
	conv_handle = purple_conversations_get_handle();
	gtkblist_handle = pidgin_blist_get_handle();
	gtkconv_handle = pidgin_conversations_get_handle();

	/* Add the conversation placement option provided by this plugin. */
	pidgin_conv_placement_add_fnc(PLUGIN_TOKEN, _(PWM_STR_CP_BLIST),
				      &conv_placement_by_blist);
	purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT
				      "/conversations/placement");

	/* Rebuild the layout when the preference changes. */
	purple_prefs_connect_callback(plugin, PREF_SIDE, pref_convs_side_cb,
				      NULL);

	/* Toggle the instruction panel as conversations come and go. */
	purple_signal_connect(conv_handle, "conversation-created", plugin,
			      PURPLE_CALLBACK(conversation_created_cb), NULL);
	purple_signal_connect(conv_handle, "deleting-conversation", plugin,
			      PURPLE_CALLBACK(deleting_conversation_cb), NULL);
	purple_signal_connect(gtkconv_handle, "conversation-dragging", plugin,
			      PURPLE_CALLBACK(conversation_dragging_cb), NULL);
	purple_signal_connect(gtkconv_handle, "conversation-hiding", plugin,
			      PURPLE_CALLBACK(conversation_hiding_cb), NULL);
	purple_signal_connect(gtkconv_handle, "conversation-switched", plugin,
			      PURPLE_CALLBACK(conversation_switched_cb), NULL);

	/* Hijack Buddy Lists as they are created. */
	purple_signal_connect(gtkblist_handle, "gtkblist-created", plugin,
			      PURPLE_CALLBACK(gtkblist_created_cb), NULL);

	/* If a default Buddy List is already available, use it immediately. */
	if (gtkblist != NULL && gtkblist->window != NULL)
		pwm_merge_conversation(gtkblist);

	return TRUE;
}