From 9278198964829cbea5b2f0bc41a800ffc7086d30 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 10 Aug 2004 18:02:38 +0000 Subject: [PATCH] Added key for clearing hotlist (Alt-R) --- ChangeLog | 5 ++++- src/common/hotlist.c | 12 ++++++++++++ src/common/hotlist.h | 1 + src/gui/curses/gui-input.c | 9 +++++++++ weechat/ChangeLog | 5 ++++- weechat/src/common/hotlist.c | 12 ++++++++++++ weechat/src/common/hotlist.h | 1 + weechat/src/gui/curses/gui-input.c | 9 +++++++++ 8 files changed, 52 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cba0da20b..21716f676 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,12 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2004-08-08 +ChangeLog - 2004-08-10 +Version 0.0.8 (under dev!): + * added key for clearing hotlist (Alt-R) + Version 0.0.7 (2004-08-08): * new "col_status_delimiters" config option * /buffer command added, buffers ordered by number, auto-jump to active diff --git a/src/common/hotlist.c b/src/common/hotlist.c index 8b0a33ca3..e8be5659c 100644 --- a/src/common/hotlist.c +++ b/src/common/hotlist.c @@ -159,6 +159,18 @@ hotlist_free (t_weechat_hotlist *ptr_hotlist) hotlist = new_hotlist; } +/* + * hotlist_free_all: free all hotlists + */ + +void +hotlist_free_all () +{ + /* remove all hotlists */ + while (hotlist) + hotlist_free (hotlist); +} + /* * hotlist_remove_buffer: remove a buffer from hotlist */ diff --git a/src/common/hotlist.h b/src/common/hotlist.h index 2824c09ad..9458fcf39 100644 --- a/src/common/hotlist.h +++ b/src/common/hotlist.h @@ -39,6 +39,7 @@ extern t_gui_buffer *hotlist_initial_buffer; extern void hotlist_add (int, t_gui_buffer *); extern void hotlist_free (t_weechat_hotlist *); +extern void hotlist_free_all (); extern void hotlist_remove_buffer (t_gui_buffer *); #endif /* hotlist.h */ diff --git a/src/gui/curses/gui-input.c b/src/gui/curses/gui-input.c index 6ca895220..723b2601a 100644 --- a/src/gui/curses/gui-input.c +++ b/src/gui/curses/gui-input.c @@ -362,6 +362,15 @@ gui_read_keyb () } } break; + /* Alt-R */ + case 'r': + case 'R': + if (hotlist) + { + hotlist_free_all (); + gui_redraw_buffer (gui_current_window->buffer); + } + break; } } break; diff --git a/weechat/ChangeLog b/weechat/ChangeLog index cba0da20b..21716f676 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,9 +1,12 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2004-08-08 +ChangeLog - 2004-08-10 +Version 0.0.8 (under dev!): + * added key for clearing hotlist (Alt-R) + Version 0.0.7 (2004-08-08): * new "col_status_delimiters" config option * /buffer command added, buffers ordered by number, auto-jump to active diff --git a/weechat/src/common/hotlist.c b/weechat/src/common/hotlist.c index 8b0a33ca3..e8be5659c 100644 --- a/weechat/src/common/hotlist.c +++ b/weechat/src/common/hotlist.c @@ -159,6 +159,18 @@ hotlist_free (t_weechat_hotlist *ptr_hotlist) hotlist = new_hotlist; } +/* + * hotlist_free_all: free all hotlists + */ + +void +hotlist_free_all () +{ + /* remove all hotlists */ + while (hotlist) + hotlist_free (hotlist); +} + /* * hotlist_remove_buffer: remove a buffer from hotlist */ diff --git a/weechat/src/common/hotlist.h b/weechat/src/common/hotlist.h index 2824c09ad..9458fcf39 100644 --- a/weechat/src/common/hotlist.h +++ b/weechat/src/common/hotlist.h @@ -39,6 +39,7 @@ extern t_gui_buffer *hotlist_initial_buffer; extern void hotlist_add (int, t_gui_buffer *); extern void hotlist_free (t_weechat_hotlist *); +extern void hotlist_free_all (); extern void hotlist_remove_buffer (t_gui_buffer *); #endif /* hotlist.h */ diff --git a/weechat/src/gui/curses/gui-input.c b/weechat/src/gui/curses/gui-input.c index 6ca895220..723b2601a 100644 --- a/weechat/src/gui/curses/gui-input.c +++ b/weechat/src/gui/curses/gui-input.c @@ -362,6 +362,15 @@ gui_read_keyb () } } break; + /* Alt-R */ + case 'r': + case 'R': + if (hotlist) + { + hotlist_free_all (); + gui_redraw_buffer (gui_current_window->buffer); + } + break; } } break;