Ejemplo n.º 1
0
static void
update_launcher()
{
	guint count = 0;
	GList *convs = NULL;
	g_return_if_fail(launcher != NULL);
	if (launcher_count == LAUNCHER_COUNT_DISABLE)
		return;

	if (launcher_count == LAUNCHER_COUNT_MESSAGES) {
		for (convs = purple_conversations_get_all(); convs != NULL; convs = convs->next) {
			PurpleConversation *conv = convs->data;
			count += GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv),
					"unity-message-count"));
		}
	} else {
		count = n_sources;
	}

	if (launcher != NULL) {
		if (count > 0)
			unity_launcher_entry_set_count_visible(launcher, TRUE);
		else
			unity_launcher_entry_set_count_visible(launcher, FALSE);
		unity_launcher_entry_set_count(launcher, count);
	}
}
Ejemplo n.º 2
0
static void
progress_ui_handler_update_unity_launcher_entry (NemoProgressUIHandler *self,
                                                 NemoProgressInfo *info,
                                                 UnityLauncherEntry *entry)
{
	g_return_if_fail (self);
	g_return_if_fail (entry);

	if (self->priv->active_infos > 0) {
		unity_launcher_entry_set_progress_visible (entry, TRUE);
		progress_ui_handler_show_unity_quicklist (self, entry, TRUE);
		progress_ui_handler_unity_progress_changed (NULL, self);

		if (self->priv->active_infos > 1) {
			unity_launcher_entry_set_count (entry, self->priv->active_infos);
			unity_launcher_entry_set_count_visible (entry, TRUE);
		} else {
			unity_launcher_entry_set_count_visible (entry, FALSE);
		}
	} else {
		unity_launcher_entry_set_progress_visible (entry, FALSE);
		unity_launcher_entry_set_progress (entry, 0.0);
		unity_launcher_entry_set_count_visible (entry, FALSE);
		progress_ui_handler_show_unity_quicklist (self, entry, FALSE);
		GCancellable *pc = nemo_progress_info_get_cancellable (info);

		if (!g_cancellable_is_cancelled (pc)) {
			unity_launcher_entry_set_urgent (entry, TRUE);

			g_timeout_add_seconds (2, (GSourceFunc)
				               progress_ui_handler_disable_unity_urgency,
					       entry);
		}
	}
}
Ejemplo n.º 3
0
void UnityTaskbarManager::setCount(int count) {
	if (_launcher == NULL)
		return;

	unity_launcher_entry_set_count(_launcher, count);

	unity_launcher_entry_set_count_visible(_launcher, (count == 0) ? FALSE : TRUE);
}
Ejemplo n.º 4
0
void ResizerUnity::updateNumber(int number)
{
    if(number<0){
        unity_launcher_entry_set_count_visible(unity, false);
    }else{
        unity_launcher_entry_set_count(unity, number);
        unity_launcher_entry_set_count_visible(unity, true);
    }
}
Ejemplo n.º 5
0
Archivo: mmenu.c Proyecto: Ansa89/uTox
// Removes a source from the MessagingMenu
gboolean remove_source()
{
    messaging_menu_app_remove_source(mmapp, (gchar*)f_id_data);
    unread_friends--;
    unity_launcher_entry_set_count(launcher, unread_friends);
    if(unread_friends == 0) {
        unity_launcher_entry_set_count_visible(launcher, FALSE);
    }
    return FALSE;
}
Ejemplo n.º 6
0
Archivo: mmenu.c Proyecto: 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;
}