示例#1
0
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);
	}
}
示例#2
0
/*!
  \brief loads runtime status details from XML, creates the slider and inserts
  it into the hash table
  \param node is the current XML node
  \param hash is the hashtable to stick the resulting RTS structure into
  \param table_num is the table number on this tab
  \param tab_id is the Tab identification enumeration
  */
G_MODULE_EXPORT void load_rts(xmlNode *node, GHashTable *hash, gint table_num, TabIdent tab_id)
{
	gchar *slider_name = NULL;
	gchar *source = NULL;
	gint row = 0;
	gint table = 0;
	Rt_Slider *slider = NULL;
	xmlNode *cur_node = NULL;

	if (!node->children)
	{
		printf(_("ERROR, load_rts, xml node is empty!!\n"));
		return;
	}
	cur_node = node->children;
	while (cur_node->next)
	{
		if (cur_node->type == XML_ELEMENT_NODE)
		{
			if (g_strcasecmp((gchar *)cur_node->name,"slider_name") == 0)
				generic_xml_gchar_import(cur_node,&slider_name);
			if (g_strcasecmp((gchar *)cur_node->name,"source") == 0)
				generic_xml_gchar_import(cur_node,&source);
			if (g_strcasecmp((gchar *)cur_node->name,"row") == 0)
				generic_xml_gint_import(cur_node,&row);
			if (g_strcasecmp((gchar *)cur_node->name,"table") == 0)
				generic_xml_gint_import(cur_node,&table);
		}
		cur_node = cur_node->next;
	}
	if ((slider_name) && (source))
		slider = add_slider(slider_name,table,table_num,row,source,tab_id);
	if (slider)
	{
		if (g_hash_table_lookup(hash,slider_name) == NULL)
			g_hash_table_insert(hash,g_strdup(slider_name),(gpointer)slider);
	}
	g_free(slider_name);
	g_free(source);
}