Example #1
0
static gboolean
fx_account_tooltip(HybridAccount *account, HybridTooltipData *tip_data)
{
    fetion_account *ac;

    ac = hybrid_account_get_protocol_data(account);

    if (ac->mobileno && *ac->mobileno) {
        hybrid_tooltip_data_add_title(tip_data, ac->mobileno);

    } else {
        hybrid_tooltip_data_add_title(tip_data, ac->sid);
    }

    hybrid_tooltip_data_add_pair(tip_data, _("Name"), ac->nickname);
    hybrid_tooltip_data_add_pair(tip_data, _("Status"),
                                 hybrid_get_presence_name(account->state));

    if (ac->mobileno && *ac->mobileno) {
        hybrid_tooltip_data_add_pair(tip_data, _("Fetion Number"), ac->sid);
    } else {
        hybrid_tooltip_data_add_pair(tip_data, _("Mobile Number"),
                                     ac->mobileno);
    }
    hybrid_tooltip_data_add_pair(tip_data, _("Mood"), ac->mood_phrase);

    return TRUE;
}
Example #2
0
void
hybrid_head_bind_to_account(HybridAccount *account)
{
	GtkTreeModel *model;
	GtkTreePath *path;
	GdkPixbuf *pixbuf;
	GdkPixbuf *status_icon;
	gchar *text;

	model = gtk_cell_view_get_model(GTK_CELL_VIEW(hybrid_head->cellview));

	if (!account) {
		pixbuf = hybrid_create_default_icon(32);
		text = g_strdup(_("No account was enabled."));
		status_icon = NULL;

	} else {
		pixbuf = hybrid_create_round_pixbuf(account->icon_data,
							account->icon_data_len, 32);
		text = g_strdup_printf(_("<b>%s</b> [%s]\n<small>%s</small>"), 
							account->nickname,
							hybrid_get_presence_name(account->state),
							account->status_text ? account->status_text : "");
		status_icon = hybrid_create_presence_pixbuf(account->state, 16);
	}


	gtk_list_store_set(GTK_LIST_STORE(model), &hybrid_head->iter,
					HYBRID_HEAD_PIXBUF_COLUMN, pixbuf,
					HYBRID_HEAD_NAME_COLUMN, text,
					HYBRID_HEAD_STATUS_ICON_COLUMN, status_icon,
					-1);

	path = gtk_tree_path_new_from_string("0");
	gtk_cell_view_set_displayed_row(GTK_CELL_VIEW(hybrid_head->cellview), path);
	gtk_tree_path_free(path);
	
	g_object_unref(pixbuf);
	if (status_icon) {
		g_object_unref(status_icon);
	}
	g_free(text);
}
Example #3
0
static gboolean
fx_buddy_tooltip(HybridAccount *account, HybridBuddy *buddy, HybridTooltipData *tip_data)
{
    fetion_account *ac;
    fetion_buddy *bd;

    ac = hybrid_account_get_protocol_data(account);

    if (!(bd = fetion_buddy_find_by_userid(ac, buddy->id))) {
        return FALSE;
    }

    if (bd->mobileno && *bd->mobileno) {
        hybrid_tooltip_data_add_title(tip_data, bd->mobileno);

    } else {
        hybrid_tooltip_data_add_title(tip_data, bd->sid);
    }

    hybrid_tooltip_data_add_pair(tip_data, _("Name"), bd->nickname);

    if (bd->localname && *bd->localname) {
        hybrid_tooltip_data_add_pair(tip_data, _("Alias"), bd->localname);
    }
    hybrid_tooltip_data_add_pair(tip_data, _("Status"),
                                 hybrid_get_presence_name(buddy->state));

    if (bd->mobileno && *bd->mobileno) {
        hybrid_tooltip_data_add_pair(tip_data, _("Fetion Number"), bd->sid);
    } else {
        hybrid_tooltip_data_add_pair(tip_data, _("Mobile Number"),
                                     bd->mobileno);
    }

    if (bd->mood_phrase && *bd->mood_phrase) {
        hybrid_tooltip_data_add_pair(tip_data, _("Mood"), bd->mood_phrase);
    }

    return TRUE;
}