Add /tray timer <seconds>

closes #787
This commit is contained in:
James Booth
2016-05-15 01:41:34 +01:00
parent d00615beba
commit c6a6e3a51c
7 changed files with 75 additions and 7 deletions

View File

@@ -192,13 +192,22 @@ tray_shutdown(void)
g_string_free(icon_msg_filename, TRUE);
}
void
tray_set_timer(int interval)
{
g_source_remove(timer);
_tray_change_icon(NULL);
timer = g_timeout_add(interval * 1000, _tray_change_icon, NULL);
}
void
tray_enable(void)
{
prof_tray = gtk_status_icon_new_from_file(icon_filename->str);
shutting_down = FALSE;
_tray_change_icon(NULL);
timer = g_timeout_add(5000, _tray_change_icon, NULL);
int interval = prefs_get_tray_timer() * 1000;
timer = g_timeout_add(interval, _tray_change_icon, NULL);
}
void