示例#1
0
QMessagingMenuSource::QMessagingMenuSource(const QString &id, const QString &label, const QString &icon, QMessagingMenuApp *menuApp) :
	QObject{menuApp},
	m_menuApp{menuApp},
	m_id{id}
{
	Q_ASSERT(m_menuApp);
	Q_UNUSED(icon);

	messaging_menu_app_append_source(m_menuApp->app(), m_id.toUtf8().data(), nullptr, label.toUtf8().data());
}
示例#2
0
文件: mmenu.c 项目: Ansa89/uTox
// Adds an entry to the MessagingMenu
gboolean add_source()
{
    messaging_menu_app_append_source(mmapp, (gchar*)f_id_data, NULL, (gchar*)f_name_data);
    messaging_menu_app_draw_attention(mmapp, (gchar*)f_id_data);
    unread_friends++;
    unity_launcher_entry_set_count(launcher, unread_friends);
    if(unread_friends == 1) {
        unity_launcher_entry_set_count_visible(launcher, TRUE);
    }
    return FALSE;
}
示例#3
0
static void
messaging_menu_add_conversation(PurpleConversation *conv, gint count)
{
	gchar *id;
	g_return_if_fail(count > 0);
	id = conversation_id(conv);

	/* GBytesIcon may be useful for messaging menu source icons using buddy
	   icon data for IMs */
	if (!messaging_menu_app_has_source(mmapp, id))
		messaging_menu_app_append_source(mmapp, id, NULL,
				purple_conversation_get_title(conv));

	if (messaging_menu_text == MESSAGING_MENU_TIME)
		messaging_menu_app_set_source_time(mmapp, id, g_get_real_time());
	else if (messaging_menu_text == MESSAGING_MENU_COUNT)
		messaging_menu_app_set_source_count(mmapp, id, count);
	messaging_menu_app_draw_attention(mmapp, id);

	g_free(id);
}