summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/curses/gui-input.c')
-rw-r--r--src/gui/curses/gui-input.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/gui/curses/gui-input.c b/src/gui/curses/gui-input.c
index 53baeb2d4..26a881428 100644
--- a/src/gui/curses/gui-input.c
+++ b/src/gui/curses/gui-input.c
@@ -69,6 +69,10 @@ gui_read_keyb ()
case KEY_F(7):
gui_switch_to_next_window ();
break;
+ /* remove last infobar message */
+ case KEY_F(10):
+ gui_infobar_remove ();
+ break;
/* cursor up */
case KEY_UP:
if (gui_current_window->ptr_history)
@@ -353,22 +357,38 @@ gui_main_loop ()
fd_set read_fd;
static struct timeval timeout;
t_irc_server *ptr_server;
- int old_min;
+ int old_min, old_sec;
time_t new_time;
struct tm *local_time;
quit_weechat = 0;
- old_min = 0;
+ old_min = -1;
+ old_sec = -1;
while (!quit_weechat)
{
new_time = time (NULL);
local_time = localtime (&new_time);
+
+ /* minute has changed ? => redraw infobar */
if (local_time->tm_min != old_min)
{
old_min = local_time->tm_min;
gui_redraw_window_infobar (gui_current_window);
}
+ /* second has changed ? => count down time for infobar, if needed */
+ if (local_time->tm_sec != old_sec)
+ {
+ old_sec = local_time->tm_sec;
+ /* TODO: manage splitted windows! */
+ if (gui_infobar && gui_infobar->remaining_time > 0)
+ {
+ gui_infobar->remaining_time--;
+ if (gui_infobar->remaining_time == 0)
+ gui_infobar_remove ();
+ }
+ }
+
timeout.tv_sec = 0;
timeout.tv_usec = 10000;
FD_ZERO (&read_fd);