Пример #1
0
static void sig_statusbar_activity_hilight(WINDOW_REC *window, gpointer oldlevel)
{
    GList *tmp;
    int inspos;

    g_return_if_fail(window != NULL);

    if (settings_get_bool("actlist_moves"))
    {
	/* Move the window to the first in the activity list */
	if (g_list_find(activity_list, window) != NULL)
	    activity_list = g_list_remove(activity_list, window);
	if (window->new_data != 0)
	    activity_list = g_list_prepend(activity_list, window);
	statusbar_item_redraw(activity_item);
	return;
    }

    if (g_list_find(activity_list, window) != NULL)
    {
	/* already in activity list */
	if (window->new_data == 0)
	{
	    /* remove from activity list */
	    activity_list = g_list_remove(activity_list, window);
	    statusbar_item_redraw(activity_item);
	}
	else if (window->new_data != GPOINTER_TO_INT(oldlevel) ||
		 window->last_color != 0)
	{
		/* different level as last time (or maybe different
		   hilight color?), just redraw it. */
		statusbar_item_redraw(activity_item);
	}
        return;
    }

    if (window->new_data == 0)
	    return;

    /* add window to activity list .. */
    inspos = 0;
    for (tmp = activity_list; tmp != NULL; tmp = tmp->next, inspos++)
    {
        WINDOW_REC *rec = tmp->data;

	if (window->refnum < rec->refnum)
	{
	    activity_list = g_list_insert(activity_list, window, inspos);
	    break;
	}
    }
    if (tmp == NULL)
	activity_list = g_list_append(activity_list, window);

    statusbar_item_redraw(activity_item);
}
Пример #2
0
static void sig_statusbar_channel_redraw_window_item(WI_ITEM_REC *item)
{
	WINDOW_REC *window;

        window = window_item_window(item);
	if (window->active == item && is_window_visible(window))
		statusbar_item_redraw(channel_item);
}
Пример #3
0
static void sig_statusbar_activity_window_destroyed(WINDOW_REC *window)
{
	g_return_if_fail(window != NULL);

	if (g_list_find(activity_list, window) != NULL)
		activity_list = g_list_remove(activity_list, window);
	statusbar_item_redraw(activity_item);
}
Пример #4
0
static int statusbar_lag_timeout(void)
{
	/* refresh statusbar every 10 seconds */
	if (time(NULL)-lag_last_draw < LAG_REFRESH_TIME)
		return 1;

	statusbar_item_redraw(lag_item);
	return 1;
}
Пример #5
0
static void sig_sidebars_redraw(void)
{
	GSList *tmp;

	for (tmp = mainwindows; tmp != NULL; tmp = tmp->next) {
		MAIN_WINDOW_REC *rec = tmp->data;

		if (rec->statusbar_channel_item != NULL)
                        statusbar_item_redraw(rec->statusbar_channel_item);
	}
}
Пример #6
0
static void statusbar_update_item(void)
{
	GSList *items;

	items = g_hash_table_lookup(sbar_signal_items,
				    GINT_TO_POINTER(signal_get_emitted_id()));
	while (items != NULL) {
		SBAR_ITEM_REC *item = items->data;

		statusbar_item_redraw(item);
		items = items->next;
	}
}
Пример #7
0
/* check if we need to redraw clock.. */
static int statusbar_clock_timeout(void)
{
	struct tm *tm;
	time_t t;
	int min;

	tm = localtime(&clock_last);
	min = tm->tm_min;

	t = time(NULL);
	tm = localtime(&t);

	if (tm->tm_min != min) {
		/* minute changed, redraw! */
		statusbar_item_redraw(clock_item);
	}
	return 1;
}
Пример #8
0
static void statusbar_update_window(WINDOW_REC *window)
{
        WINDOW_REC *item_window;
	GSList *items;

	items = g_hash_table_lookup(sbar_signal_items,
				    GINT_TO_POINTER(signal_get_emitted_id()));
	while (items != NULL) {
		SBAR_ITEM_REC *item = items->data;

		item_window = item->bar->parent_window != NULL ?
			item->bar->parent_window->active : active_win;

		if (item_window == window)
			statusbar_item_redraw(item);

		items = items->next;
	}
}
Пример #9
0
static void statusbar_update_server(SERVER_REC *server)
{
        SERVER_REC *item_server;
	GSList *items;

	items = g_hash_table_lookup(sbar_signal_items,
				    GINT_TO_POINTER(signal_get_emitted_id()));
	while (items != NULL) {
		SBAR_ITEM_REC *item = items->data;

		item_server = item->bar->parent_window != NULL ?
			item->bar->parent_window->active->active_server :
			active_win->active_server;

		if (item_server == server)
			statusbar_item_redraw(item);

		items = items->next;
	}
}
Пример #10
0
static void sig_statusbar_topic_redraw(void)
{
	if (topic_item != NULL) statusbar_item_redraw(topic_item);
}
Пример #11
0
static void sig_statusbar_lag_redraw(void)
{
	statusbar_item_redraw(lag_item);
}
Пример #12
0
static void sig_statusbar_channel_redraw_window(WINDOW_REC *window)
{
	if (is_window_visible(window))
		statusbar_item_redraw(channel_item);
}
Пример #13
0
static void sig_statusbar_channel_redraw(void)
{
	statusbar_item_redraw(channel_item);
}
Пример #14
0
static void sig_statusbar_nick_redraw(void)
{
	statusbar_item_redraw(nick_item);
}
Пример #15
0
static int statusbar_mail_timeout(void)
{
	statusbar_item_redraw(mail_item);
	return 1;
}
Пример #16
0
static void sig_statusbar_activity_updated(void)
{
	statusbar_item_redraw(activity_item);
}