From a01ecb276ff43962d0380cda67db12a91aeab39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 16 Aug 2016 21:22:28 +0200 Subject: [PATCH] core: add optional argument "lowest", "highest" or level mask in command /input hotlist_clear --- ChangeLog.adoc | 1 + doc/de/autogen/user/weechat_commands.adoc | 106 +++++++++++----------- doc/en/autogen/user/weechat_commands.adoc | 2 +- doc/fr/autogen/user/weechat_commands.adoc | 2 +- doc/it/autogen/user/weechat_commands.adoc | 2 +- doc/ja/autogen/user/weechat_commands.adoc | 106 +++++++++++----------- doc/pl/autogen/user/weechat_commands.adoc | 106 +++++++++++----------- po/cs.po | 7 +- po/de.po | 8 +- po/es.po | 7 +- po/fr.po | 15 ++- po/hu.po | 7 +- po/it.po | 7 +- po/ja.po | 8 +- po/pl.po | 8 +- po/pt.po | 8 +- po/pt_BR.po | 7 +- po/ru.po | 7 +- po/tr.po | 7 +- po/weechat.pot | 7 +- src/core/wee-command.c | 38 ++++---- src/core/wee-config.c | 2 +- src/core/wee-upgrade.c | 4 +- src/gui/gui-hotlist.c | 34 ++++++- src/gui/gui-hotlist.h | 4 +- src/gui/gui-input.c | 61 ++++++++++++- src/gui/gui-input.h | 3 +- 27 files changed, 357 insertions(+), 217 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index c6ba0063f..e1e01b641 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] New features:: + * core: add optional argument "lowest", "highest" or level mask in command /input hotlist_clear * core: add option "cycle" in command /buffer * relay: add option relay.network.allow_empty_password (issue #735) * trigger: add support for one-time triggers (issue #399, issue #509) diff --git a/doc/de/autogen/user/weechat_commands.adoc b/doc/de/autogen/user/weechat_commands.adoc index a647a2849..ad33c70fa 100644 --- a/doc/de/autogen/user/weechat_commands.adoc +++ b/doc/de/autogen/user/weechat_commands.adoc @@ -418,60 +418,60 @@ value: Anzahl der gewünschten Einträgen im Befehlsverlauf anzeigen ---- /input [] -Auflistung der möglichen Aktionen: - return: simuliert die "enter" Taste - complete_next: vervollständigt Wort mit nächster Komplettierung - complete_previous: vervollständigt Word mit vorheriger Komplettierung - search_text_here: Textsuche ab aktueller Position - search_text: Textsuche im Buffer - search_switch_case: schaltet Groß-/Kleinschreibung ein und aus - search_switch_regex: Wechsel des Suchmodus: einfache Textsuche/reguläre Ausdrücke - search_switch_where: wechselt Suche in Nachricht/Präfix - search_previous: sucht vorheriger Zeile - search_next: sucht nächste Zeile - search_stop_here: beendet Suche ab aktueller Position - search_stop: suche beenden - delete_previous_char: entfernt vorheriges Zeichen - delete_next_char: entfernt nächstes Zeichen - delete_previous_word: entfernt vorheriges Wort - delete_next_word: entfernt nächstes Wort - delete_beginning_of_line: entfernt alle Zeichen ab Zeilenanfang bis zum Cursor - delete_end_of_line: entfernt alle Zeichen ab Cursor bis zum Ende der Zeile - delete_line: löscht die komplette Eingabezeile - clipboard_paste: fügt Zeichenkette aus der Zwischenablage ein - transpose_chars: Zeichen austauschen - undo: letzten Befehl in der Eingabezeile rückgängig machen - redo: letzten Befehl in der Eingabezeile wiederherstellen - move_beginning_of_line: springt an den Anfang der Eingabezeile - move_end_of_line: springt ans Ende der Eingabezeile - move_previous_char: setzt den Cursor eine Position nach links - move_next_char: setzt den Cursor eine Position nach rechts - move_previous_word: springt zum Anfang des vorherigen Wortes, in der Eingabezeile - move_next_word: springt zum Anfang des nächsten Wortes, in der Eingabezeile - history_previous: ruft vorherigen Befehl oder Nachricht aus dem Befehlsspeicher auf (im Such-Modus: rückwärts suchen) - history_next: ruft nächsten Befehl oder Nachricht aus dem Befehlsspeicher auf (im Such-Modus: vorwärts suchen) - history_global_previous: ruft vorherigen Befehl/Nachricht aus dem globalen Befehlsspeicher auf (für alle Buffer) - history_global_next: ruft nächsten Befehl/Nachricht aus dem globalen Befehlsspeicher auf (für alle Buffer) - jump_smart: wechselt zum nächsten Buffer mit Aktivität (nach Priorität: highlight, Nachricht, …) - jump_last_buffer_displayed: wechselt zum jeweils zuletzt angezeigten Buffer - jump_previously_visited_buffer: springt zum letzten besuchten Buffer - jump_next_visited_buffer: springt zum nächsten besuchten Buffer - hotlist_clear: löscht Hotliste (Aktivitätsanzeige für die Buffer) - grab_key: fängt eine Taste (optionales Argument: Verzögerung um eine Taste einzufangen. Standard sind 500 Millisekunden) - grab_key_command: zeigt den Tastencode (inklusive des eingebundenen Befehls) einer Tastenkombination an und fügt ihn in die Befehlszeile ein (optionales Argument: Verzögerung um eine Taste einzufangen. Standard sind 500 Millisekunden) - grab_mouse: fängt den Code einer Maus Aktivität - grab_mouse_area: fängt den Code einer Maus Aktivität mit entsprechendem Bereich - set_unread: setzt für alle Buffer die Markierung der ungelesen Nachrichten - set_unread_current_buffer: setzt nur für den aktuellen Buffer eine Markierung der ungelesen Nachrichten - switch_active_buffer: springt zum nächsten zusammengefügten Buffer - switch_active_buffer_previous: springt zum vorherigen zusammengefügten Buffer - zoom_merged_buffer: zoomt in zusammengefügte Buffer - insert: fügt einen Text in die Eingabezeile ein (Escapesequenzen sind möglich, siehe /help print) - send: schickt Text an einen Buffer - paste_start: Einfügen wird gestartet (bracketed paste mode) - paste_stop: Einfügen wird beendet (bracketed paste mode) +list of actions: + return: simulate key "enter" + complete_next: complete word with next completion + complete_previous: complete word with previous completion + search_text_here: search text in buffer at current position + search_text: search text in buffer + search_switch_case: switch exact case for search + search_switch_regex: switch search type: string/regular expression + search_switch_where: switch search in messages/prefixes + search_previous: search previous line + search_next: search next line + search_stop_here: stop search at current position + search_stop: stop search + delete_previous_char: delete previous char + delete_next_char: delete next char + delete_previous_word: delete previous word + delete_next_word: delete next word + delete_beginning_of_line: delete from beginning of line until cursor + delete_end_of_line: delete from cursor until end of line + delete_line: delete entire line + clipboard_paste: paste from clipboard + transpose_chars: transpose two chars + undo: undo last command line action + redo: redo last command line action + move_beginning_of_line: move cursor to beginning of line + move_end_of_line: move cursor to end of line + move_previous_char: move cursor to previous char + move_next_char: move cursor to next char + move_previous_word: move cursor to previous word + move_next_word: move cursor to next word + history_previous: recall previous command in current buffer history + history_next: recall next command in current buffer history + history_global_previous: recall previous command in global history + history_global_next: recall next command in global history + jump_smart: jump to next buffer with activity + jump_last_buffer_displayed: jump to last buffer displayed (before last jump to a buffer) + jump_previously_visited_buffer: jump to previously visited buffer + jump_next_visited_buffer: jump to next visited buffer + hotlist_clear: clear hotlist (optional argument: "lowest" to clear only lowest level in hotlist, "highest" to clear only highest level in hotlist, or level mask: integer which is a combination of 1=join/part, 2=message, 4=private, 8=highlight) + grab_key: grab a key (optional argument: delay for end of grab, default is 500 milliseconds) + grab_key_command: grab a key with its associated command (optional argument: delay for end of grab, default is 500 milliseconds) + grab_mouse: grab mouse event code + grab_mouse_area: grab mouse event code with area + set_unread: set unread marker for all buffers + set_unread_current_buffer: set unread marker for current buffer + switch_active_buffer: switch to next merged buffer + switch_active_buffer_previous: switch to previous merged buffer + zoom_merged_buffer: zoom on merged buffer + insert: insert text in command line (escaped chars are allowed, see /help print) + send: send text to the buffer + paste_start: start paste (bracketed paste mode) + paste_stop: stop paste (bracketed paste mode) -Dieser Befehl wird sinnvollerweise mittels Tastenbelegungen oder Erweiterungen genutzt. +This command is used by key bindings or plugins. ---- [[command_weechat_key]] diff --git a/doc/en/autogen/user/weechat_commands.adoc b/doc/en/autogen/user/weechat_commands.adoc index b41c90038..65f626662 100644 --- a/doc/en/autogen/user/weechat_commands.adoc +++ b/doc/en/autogen/user/weechat_commands.adoc @@ -456,7 +456,7 @@ list of actions: jump_last_buffer_displayed: jump to last buffer displayed (before last jump to a buffer) jump_previously_visited_buffer: jump to previously visited buffer jump_next_visited_buffer: jump to next visited buffer - hotlist_clear: clear hotlist + hotlist_clear: clear hotlist (optional argument: "lowest" to clear only lowest level in hotlist, "highest" to clear only highest level in hotlist, or level mask: integer which is a combination of 1=join/part, 2=message, 4=private, 8=highlight) grab_key: grab a key (optional argument: delay for end of grab, default is 500 milliseconds) grab_key_command: grab a key with its associated command (optional argument: delay for end of grab, default is 500 milliseconds) grab_mouse: grab mouse event code diff --git a/doc/fr/autogen/user/weechat_commands.adoc b/doc/fr/autogen/user/weechat_commands.adoc index 42f0aaf5f..719adc925 100644 --- a/doc/fr/autogen/user/weechat_commands.adoc +++ b/doc/fr/autogen/user/weechat_commands.adoc @@ -456,7 +456,7 @@ liste des actions : jump_last_buffer_displayed : sauter au dernier tampon affiché (avant le dernier saut vers un tampon) jump_previously_visited_buffer : sauter au tampon visité précédemment jump_next_visited_buffer : sauter au tampon visité après - hotlist_clear : effacer la hotlist + hotlist_clear : effacer la hotlist (paramètre facultatif : "lowest" pour effacer seulement le plus petit niveau dans la hotlist, "highest" pour effacer seulement le niveau le plus haut dans la hotlist, ou un masque de niveaux : entier qui est une combinaison de 1=join/part, 2=message, 4=privé, 8=highlight) grab_key : capturer une touche (paramètre facultatif : délai pour la fin de la capture, par défaut 500 millisecondes) grab_key_command : capturer une touche avec sa commande associée (paramètre facultatif : délai pour la fin de la capture, par défaut 500 millisecondes) grab_mouse : capturer un évènement de la souris diff --git a/doc/it/autogen/user/weechat_commands.adoc b/doc/it/autogen/user/weechat_commands.adoc index 7132f4805..8c3396bce 100644 --- a/doc/it/autogen/user/weechat_commands.adoc +++ b/doc/it/autogen/user/weechat_commands.adoc @@ -456,7 +456,7 @@ list of actions: jump_last_buffer_displayed: jump to last buffer displayed (before last jump to a buffer) jump_previously_visited_buffer: jump to previously visited buffer jump_next_visited_buffer: jump to next visited buffer - hotlist_clear: clear hotlist + hotlist_clear: clear hotlist (optional argument: "lowest" to clear only lowest level in hotlist, "highest" to clear only highest level in hotlist, or level mask: integer which is a combination of 1=join/part, 2=message, 4=private, 8=highlight) grab_key: grab a key (optional argument: delay for end of grab, default is 500 milliseconds) grab_key_command: grab a key with its associated command (optional argument: delay for end of grab, default is 500 milliseconds) grab_mouse: grab mouse event code diff --git a/doc/ja/autogen/user/weechat_commands.adoc b/doc/ja/autogen/user/weechat_commands.adoc index ae50810fe..3d8e1c072 100644 --- a/doc/ja/autogen/user/weechat_commands.adoc +++ b/doc/ja/autogen/user/weechat_commands.adoc @@ -418,60 +418,60 @@ value: 表示する履歴エントリの数 ---- /input [] -アクションリスト: - return: "enter" キーをシミュレート - complete_next: 次の補完候補で単語を補完 - complete_previous: 一つ前の補完候補で単語を補完 - search_text_here: 現在の位置でテキストを検索 - search_text: バッファ内のテキストを検索 - search_switch_case: 完全一致検索に変更 - search_switch_regex: 検索タイプの切り替え: 文字列/正規表現 - search_switch_where: 検索範囲の切り替え: メッセージ/プレフィックス - search_previous: 一つ前の行を検索 - search_next: 次の行を検索 - search_stop_here: 現在の位置で検索を終了 - search_stop: 検索を終了 - delete_previous_char: 一つ前の文字を削除 - delete_next_char: 次の文字を削除 - delete_previous_word: 一つ前の単語を削除 - delete_next_word: 次の単語を削除 - delete_beginning_of_line: 行の最初からカーソル位置までを削除 - delete_end_of_line: カーソルから行の最後までを削除 - delete_line: 行を削除 - clipboard_paste: クリップボードからペースト - transpose_chars: 2 つの文字を入れ替え - undo: 最新のコマンドラインアクションまで元に戻す - redo: 最新のコマンドラインアクションまでやり直す - move_beginning_of_line: カーソルを行頭に移動 - move_end_of_line: カーソルを行末まで移動 - move_previous_char: カーソルを一つ前の文字に移動 - move_next_char: カーソルを次の文字に移動 - move_previous_word: カーソルを一つ前の単語に移動 - move_next_word: カーソルを次の単語に移動 - history_previous: 現在のバッファ履歴のひとつ前のコマンドを再呼び出し - history_next: 現在のバッファ履歴の次のコマンドを再呼び出し - history_global_previous: グローバル履歴の一つ前のコマンドを再呼び出し - history_global_next: グローバル履歴の次のコマンドを再呼び出し - jump_smart: 次のアクティブバッファに飛ぶ - jump_last_buffer_displayed: 表示されている最後のバッファに移動 (最新のバッファ移動の一つ前に表示されていたバッファ) - jump_previously_visited_buffer: 一つ前に訪れたバッファに移動 - jump_next_visited_buffer: 次に訪れたバッファに移動 - hotlist_clear: ホットリストを消去 - grab_key: キーを横取り (任意引数: 最後の横取りからの遅延時間、デフォルトは 500 ミリ秒) - grab_key_command: あるコマンドに関連してキーを横取り (任意引数: 最後の横取りからの遅延時間、デフォルトは 500 ミリ秒) - grab_mouse: grab マウスイベントコードを横取り - grab_mouse_area: 範囲指定のマウスイベントコードを横取り - set_unread: 全てのバッファに対して未読マーカーを設定 - set_unread_current_buffer: 現在のバッファに対して未読マーカーを設定 - switch_active_buffer: 次のマージされたバッファに移動 - switch_active_buffer_previous: 一つ前のマージされたバッファに移動 - zoom_merged_buffer: マージされたバッファにズーム - insert: コマンドラインにテキストを挿入 (エスケープ文字も可、/help print を参照) - send: バッファにテキストを送信 - paste_start: ペーストの開始 (括弧付きペーストモード) - paste_stop: ペーストの終了 (括弧付きペーストモード) +list of actions: + return: simulate key "enter" + complete_next: complete word with next completion + complete_previous: complete word with previous completion + search_text_here: search text in buffer at current position + search_text: search text in buffer + search_switch_case: switch exact case for search + search_switch_regex: switch search type: string/regular expression + search_switch_where: switch search in messages/prefixes + search_previous: search previous line + search_next: search next line + search_stop_here: stop search at current position + search_stop: stop search + delete_previous_char: delete previous char + delete_next_char: delete next char + delete_previous_word: delete previous word + delete_next_word: delete next word + delete_beginning_of_line: delete from beginning of line until cursor + delete_end_of_line: delete from cursor until end of line + delete_line: delete entire line + clipboard_paste: paste from clipboard + transpose_chars: transpose two chars + undo: undo last command line action + redo: redo last command line action + move_beginning_of_line: move cursor to beginning of line + move_end_of_line: move cursor to end of line + move_previous_char: move cursor to previous char + move_next_char: move cursor to next char + move_previous_word: move cursor to previous word + move_next_word: move cursor to next word + history_previous: recall previous command in current buffer history + history_next: recall next command in current buffer history + history_global_previous: recall previous command in global history + history_global_next: recall next command in global history + jump_smart: jump to next buffer with activity + jump_last_buffer_displayed: jump to last buffer displayed (before last jump to a buffer) + jump_previously_visited_buffer: jump to previously visited buffer + jump_next_visited_buffer: jump to next visited buffer + hotlist_clear: clear hotlist (optional argument: "lowest" to clear only lowest level in hotlist, "highest" to clear only highest level in hotlist, or level mask: integer which is a combination of 1=join/part, 2=message, 4=private, 8=highlight) + grab_key: grab a key (optional argument: delay for end of grab, default is 500 milliseconds) + grab_key_command: grab a key with its associated command (optional argument: delay for end of grab, default is 500 milliseconds) + grab_mouse: grab mouse event code + grab_mouse_area: grab mouse event code with area + set_unread: set unread marker for all buffers + set_unread_current_buffer: set unread marker for current buffer + switch_active_buffer: switch to next merged buffer + switch_active_buffer_previous: switch to previous merged buffer + zoom_merged_buffer: zoom on merged buffer + insert: insert text in command line (escaped chars are allowed, see /help print) + send: send text to the buffer + paste_start: start paste (bracketed paste mode) + paste_stop: stop paste (bracketed paste mode) -これらのコマンドはキーバインドかプラグインで利用できます。 +This command is used by key bindings or plugins. ---- [[command_weechat_key]] diff --git a/doc/pl/autogen/user/weechat_commands.adoc b/doc/pl/autogen/user/weechat_commands.adoc index 01dc336db..d90064424 100644 --- a/doc/pl/autogen/user/weechat_commands.adoc +++ b/doc/pl/autogen/user/weechat_commands.adoc @@ -418,60 +418,60 @@ Wartość: ilość elementów historii do pokazania ---- /input [] -lista akcji: - return: symuluje klawisz "enter" - complete_next: dopełnia słowo następnym dopełnieniem - complete_previous: dopełnia słowo poprzednim dopełnieniem - search_text_here: szuka testu w obecnej pozycji w buforze - search_text: szuka tekstu w buforze - search_switch_case: przełącza na dokładne dopasowanie przy szukaniu - search_switch_regex: przełącza typy wyszukiwania ciąg/wyrażenie regularne - search_switch_where: zmienia miejsce przeszukiwania na wiadomości/przedrostki - search_previous: szuka poprzednich linii - search_next: szuka następnych linii - search_stop_here: zatrzymuje wyszukiwanie na obecnej pozycji - search_stop: zatrzymuje wyszukiwanie - delete_previous_char: usuwa poprzedni znak - delete_next_char: usuwa następny znak - delete_previous_word: usuwa poprzednie słowo - delete_next_word: usuwa następne słowo - delete_beginning_of_line: usuwa od początku linii do kursora - delete_end_of_line: usuwa od kursora do końca linii - delete_line: usuwa cała linię - clipboard_paste: wkleja ze schowka - transpose_chars: zamienia dwa znaki - undo: cofa ostatnia akcję w linii poleceń - redo: ponownie wykonuje cofniętą akcję w linii poleceń - move_beginning_of_line: przesuwa kursor na początek linii - move_end_of_line: przesuwa kursor na koniec linii - move_previous_char: przesuwa kursor do poprzedniego znaku - move_next_char: przesuwa kursor do następnego znaku - move_previous_word: przesuwa kursor do poprzedniego słowa - move_next_word: przesuwa kursor do następnego słowa - history_previous: przywołuje poprzednia komendę z historii obecnego bufora - history_next: przywołuje następną komendę z historii obecnego bufora - history_global_previous: przywołuje poprzednią komendę z globalnej historii - history_global_next: przywołuje następną komendę z globalnej historii - jump_smart: przechodzi do następnego bufora z aktywnością - jump_last_buffer_displayed: przechodzi do ostatnio wyświetlanego bufora (przed ostatnim przeskoczeniem do bufora) - jump_previously_visited_buffer: przeskakuje do poprzedniego bufora - jump_next_visited_buffer: przeskakuje to następnego bufora - hotlist_clear: czyści hotlistę - grab_key: przechwytuje klawisz (opcjonalny argument: opóźnienie końca przechwycenia, domyślnie jest to 500 milisekund) - grab_key_command: przechwytuje klawisz z przypisaną komendą(opcjonalny argument: opóźnienie końca przechwycenia, domyślnie jest to 500 milisekund) - grab_mouse: przechwytuje kod zdarzenia myszy - grab_mouse_area: przechwytuje kod zdarzenia myszy z obszarem - set_unread: ustawia znacznik nie przeczytania dla wszystkich buforów - set_unread_current_buffer: ustawia znacznik nie przeczytania dla obecnego bufora - switch_active_buffer: przełącza do następnego połączonego buforu - switch_active_buffer_previous: przełącza do poprzedniego połączonego buforu - zoom_merged_buffer: zoom na połączony bufor - insert: wkleja tekst do linii poleceń (dozwolone są wyescapowane znaki, zobacz /help print) - send: wysyła tekst do bufora - paste_start: zaczyna wklejanie (tryb z rozpoznawaniem wklejanego tekstu) - paste_stop: kończy wklejanie (tryb z rozpoznawaniem wklejanego tekstu) +list of actions: + return: simulate key "enter" + complete_next: complete word with next completion + complete_previous: complete word with previous completion + search_text_here: search text in buffer at current position + search_text: search text in buffer + search_switch_case: switch exact case for search + search_switch_regex: switch search type: string/regular expression + search_switch_where: switch search in messages/prefixes + search_previous: search previous line + search_next: search next line + search_stop_here: stop search at current position + search_stop: stop search + delete_previous_char: delete previous char + delete_next_char: delete next char + delete_previous_word: delete previous word + delete_next_word: delete next word + delete_beginning_of_line: delete from beginning of line until cursor + delete_end_of_line: delete from cursor until end of line + delete_line: delete entire line + clipboard_paste: paste from clipboard + transpose_chars: transpose two chars + undo: undo last command line action + redo: redo last command line action + move_beginning_of_line: move cursor to beginning of line + move_end_of_line: move cursor to end of line + move_previous_char: move cursor to previous char + move_next_char: move cursor to next char + move_previous_word: move cursor to previous word + move_next_word: move cursor to next word + history_previous: recall previous command in current buffer history + history_next: recall next command in current buffer history + history_global_previous: recall previous command in global history + history_global_next: recall next command in global history + jump_smart: jump to next buffer with activity + jump_last_buffer_displayed: jump to last buffer displayed (before last jump to a buffer) + jump_previously_visited_buffer: jump to previously visited buffer + jump_next_visited_buffer: jump to next visited buffer + hotlist_clear: clear hotlist (optional argument: "lowest" to clear only lowest level in hotlist, "highest" to clear only highest level in hotlist, or level mask: integer which is a combination of 1=join/part, 2=message, 4=private, 8=highlight) + grab_key: grab a key (optional argument: delay for end of grab, default is 500 milliseconds) + grab_key_command: grab a key with its associated command (optional argument: delay for end of grab, default is 500 milliseconds) + grab_mouse: grab mouse event code + grab_mouse_area: grab mouse event code with area + set_unread: set unread marker for all buffers + set_unread_current_buffer: set unread marker for current buffer + switch_active_buffer: switch to next merged buffer + switch_active_buffer_previous: switch to previous merged buffer + zoom_merged_buffer: zoom on merged buffer + insert: insert text in command line (escaped chars are allowed, see /help print) + send: send text to the buffer + paste_start: start paste (bracketed paste mode) + paste_stop: stop paste (bracketed paste mode) -Ta komenda jest używana do przypisywania klawiszy lub przez wtyczki. +This command is used by key bindings or plugins. ---- [[command_weechat_key]] diff --git a/po/cs.po b/po/cs.po index 3596605a5..3f2f59d60 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:42+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -1734,7 +1734,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/de.po b/po/de.po index a4219fef6..c26c8b7a7 100644 --- a/po/de.po +++ b/po/de.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-08-14 14:14+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German <>\n" @@ -1901,6 +1901,7 @@ msgstr "Funktionen für die Befehlszeile" msgid " []" msgstr " []" +#, fuzzy msgid "" "list of actions:\n" " return: simulate key \"enter\"\n" @@ -1941,7 +1942,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/es.po b/po/es.po index 787fac4da..76b59d08f 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:42+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -1766,7 +1766,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/fr.po b/po/fr.po index 6a8cb198c..5a9e09097 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" -"PO-Revision-Date: 2016-08-14 10:12+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" +"PO-Revision-Date: 2016-08-16 21:20+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -1910,7 +1910,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " @@ -1975,7 +1978,11 @@ msgstr "" "dernier saut vers un tampon)\n" " jump_previously_visited_buffer : sauter au tampon visité précédemment\n" " jump_next_visited_buffer : sauter au tampon visité après\n" -" hotlist_clear : effacer la hotlist\n" +" hotlist_clear : effacer la hotlist (paramètre facultatif : \"lowest\" pour " +"effacer seulement le plus petit niveau dans la hotlist, \"highest\" pour " +"effacer seulement le niveau le plus haut dans la hotlist, ou un masque de " +"niveaux : entier qui est une combinaison de 1=join/part, 2=message, 4=privé, " +"8=highlight)\n" " grab_key : capturer une touche (paramètre facultatif : délai pour la fin " "de la capture, par défaut 500 millisecondes)\n" " grab_key_command : capturer une touche avec sa commande associée " diff --git a/po/hu.po b/po/hu.po index 2697ee802..f9c3b123e 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:43+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -1594,7 +1594,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/it.po b/po/it.po index 290bdfcec..c232de7b4 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:43+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -1808,7 +1808,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/ja.po b/po/ja.po index 3bc7e8ecd..5c9683d2f 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-08-07 16:37+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese []" msgstr " []" +#, fuzzy msgid "" "list of actions:\n" " return: simulate key \"enter\"\n" @@ -1855,7 +1856,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/pl.po b/po/pl.po index 03bf2add8..3eb87efca 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:43+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -1860,6 +1860,7 @@ msgstr "funkcje linii komend" msgid " []" msgstr " []" +#, fuzzy msgid "" "list of actions:\n" " return: simulate key \"enter\"\n" @@ -1900,7 +1901,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/pt.po b/po/pt.po index e5add0441..79f9ac23d 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:43+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -1855,6 +1855,7 @@ msgstr "funções da linha de comandos" msgid " []" msgstr " []" +#, fuzzy msgid "" "list of actions:\n" " return: simulate key \"enter\"\n" @@ -1895,7 +1896,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/pt_BR.po b/po/pt_BR.po index 3218061f7..65aa16289 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:43+0200\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -1819,7 +1819,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/ru.po b/po/ru.po index d30c6c86d..17c3839d2 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:43+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -1616,7 +1616,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/tr.po b/po/tr.po index f04495d10..0fbb97ab9 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2016-05-18 07:43+0200\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -1446,7 +1446,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/po/weechat.pot b/po/weechat.pot index b75f7372c..d23cfd8da 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2016-08-14 10:08+0200\n" +"POT-Creation-Date: 2016-08-16 21:17+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -1447,7 +1447,10 @@ msgid "" "jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" -" hotlist_clear: clear hotlist\n" +" hotlist_clear: clear hotlist (optional argument: \"lowest\" to clear only " +"lowest level in hotlist, \"highest\" to clear only highest level in hotlist, " +"or level mask: integer which is a combination of 1=join/part, 2=message, " +"4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, default is " "500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " diff --git a/src/core/wee-command.c b/src/core/wee-command.c index f217ca4b0..504f13298 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -3047,7 +3047,7 @@ COMMAND_CALLBACK(input) else if (string_strcasecmp (argv[1], "jump_next_visited_buffer") == 0) gui_input_jump_next_visited_buffer (buffer); else if (string_strcasecmp (argv[1], "hotlist_clear") == 0) - gui_input_hotlist_clear (buffer); + gui_input_hotlist_clear (buffer, (argc > 2) ? argv[2] : NULL); else if (string_strcasecmp (argv[1], "grab_key") == 0) gui_input_grab_key (buffer, 0, (argc > 2) ? argv[2] : NULL); else if (string_strcasecmp (argv[1], "grab_key_command") == 0) @@ -7412,7 +7412,10 @@ command_init () "last jump to a buffer)\n" " jump_previously_visited_buffer: jump to previously visited buffer\n" " jump_next_visited_buffer: jump to next visited buffer\n" - " hotlist_clear: clear hotlist\n" + " hotlist_clear: clear hotlist (optional argument: \"lowest\" to " + "clear only lowest level in hotlist, \"highest\" to clear only " + "highest level in hotlist, or level mask: integer which is a " + "combination of 1=join/part, 2=message, 4=private, 8=highlight)\n" " grab_key: grab a key (optional argument: delay for end of grab, " "default is 500 milliseconds)\n" " grab_key_command: grab a key with its associated command (optional " @@ -7431,20 +7434,23 @@ command_init () " paste_stop: stop paste (bracketed paste mode)\n" "\n" "This command is used by key bindings or plugins."), - "return|complete_next|complete_previous|search_text_here|search_text|" - "search_switch_case|search_switch_regex|search_switch_where|" - "search_previous|search_next|search_stop_here|search_stop|" - "delete_previous_char|delete_next_char|delete_previous_word|" - "delete_next_word|delete_beginning_of_line|delete_end_of_line|" - "delete_line|clipboard_paste|transpose_chars|undo|redo|" - "move_beginning_of_line|move_end_of_line|move_previous_char|" - "move_next_char|move_previous_word|move_next_word|history_previous|" - "history_next|history_global_previous|history_global_next|jump_smart|" - "jump_last_buffer_displayed|jump_previously_visited_buffer|" - "jump_next_visited_buffer|hotlist_clear|grab_key|grab_key_command|" - "grab_mouse|grab_mouse_area|set_unread|set_unread_current_buffer|" - "switch_active_buffer|switch_active_buffer_previous|" - "zoom_merged_buffer|insert|send|paste_start|paste_stop", + "return || complete_next || complete_previous || search_text_here || " + "search_text || search_switch_case || search_switch_regex || " + "search_switch_where || search_previous || search_next || " + "search_stop_here || search_stop || delete_previous_char || " + "delete_next_char || delete_previous_word || delete_next_word || " + "delete_beginning_of_line || delete_end_of_line || delete_line || " + "clipboard_paste || transpose_chars || undo || redo || " + "move_beginning_of_line || move_end_of_line || move_previous_char || " + "move_next_char || move_previous_word || move_next_word || " + "history_previous || history_next || history_global_previous || " + "history_global_next || jump_smart || jump_last_buffer_displayed || " + "jump_previously_visited_buffer || jump_next_visited_buffer || " + "hotlist_clear 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|lowest|highest || " + "grab_key || grab_key_command || grab_mouse || grab_mouse_area || " + "set_unread || set_unread_current_buffer || switch_active_buffer || " + "switch_active_buffer_previous || zoom_merged_buffer || insert || " + "send || paste_start || paste_stop", &command_input, NULL, NULL); hook_command ( NULL, "key", diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 4d86cda97..c1e50202b 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -2813,7 +2813,7 @@ config_weechat_init_options () N_("level for displaying names in hotlist (combination " "of: 1=join/part, 2=message, 4=private, 8=highlight, " "for example: 12=private+highlight)"), - NULL, 1, 15, "12", NULL, 0, + NULL, 1, GUI_HOTLIST_MASK_MAX, "12", NULL, 0, NULL, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL, NULL, NULL); diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index 00776a63a..b0bff36c8 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -723,7 +723,7 @@ upgrade_weechat_read_hotlist (struct t_infolist *infolist) if (!hotlist_reset) { - gui_hotlist_clear (); + gui_hotlist_clear (GUI_HOTLIST_MASK_MAX); hotlist_reset = 1; } plugin_name = infolist_string (infolist, "plugin_name"); @@ -846,7 +846,7 @@ upgrade_weechat_load () upgrade_file_close (upgrade_file); if (!hotlist_reset) - gui_hotlist_clear (); + gui_hotlist_clear (GUI_HOTLIST_MASK_MAX); gui_color_buffer_assign (); gui_color_buffer_display (); diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c index e5ef86668..205c0bbe9 100644 --- a/src/gui/gui-hotlist.c +++ b/src/gui/gui-hotlist.c @@ -470,13 +470,41 @@ gui_hotlist_resort () /* * Clears hotlist. + * + * Argument "level_mask" is a combination of: + * 1 = join/part + * 2 = message + * 4 = private + * 8 = highlight + * + * So for example : + * 1 = clear only join/part + * 12 = clear only private and highlight + * 15 = clear whole hotlist */ void -gui_hotlist_clear () +gui_hotlist_clear (int level_mask) { - gui_hotlist_free_all (&gui_hotlist, &last_gui_hotlist); - gui_hotlist_changed_signal (); + struct t_gui_hotlist *ptr_hotlist, *ptr_next_hotlist; + int hotlist_changed; + + hotlist_changed = 0; + + ptr_hotlist = gui_hotlist; + while (ptr_hotlist) + { + ptr_next_hotlist = ptr_hotlist->next_hotlist; + if (level_mask & (1 << ptr_hotlist->priority)) + { + gui_hotlist_free (&gui_hotlist, &last_gui_hotlist, ptr_hotlist); + hotlist_changed = 1; + } + ptr_hotlist = ptr_next_hotlist; + } + + if (hotlist_changed) + gui_hotlist_changed_signal (); } /* diff --git a/src/gui/gui-hotlist.h b/src/gui/gui-hotlist.h index d3f9f58e4..dab59ace2 100644 --- a/src/gui/gui-hotlist.h +++ b/src/gui/gui-hotlist.h @@ -34,6 +34,8 @@ enum t_gui_hotlist_priority #define GUI_HOTLIST_MIN 0 #define GUI_HOTLIST_MAX (GUI_HOTLIST_NUM_PRIORITIES - 1) +#define GUI_HOTLIST_MASK_MAX ((1 << GUI_HOTLIST_NUM_PRIORITIES) - 1) + struct t_gui_hotlist { enum t_gui_hotlist_priority priority; /* 0=crappy msg (join/part), */ @@ -58,7 +60,7 @@ extern struct t_gui_hotlist *gui_hotlist_add (struct t_gui_buffer *buffer, enum t_gui_hotlist_priority priority, struct timeval *creation_time); extern void gui_hotlist_resort (); -extern void gui_hotlist_clear (); +extern void gui_hotlist_clear (int level_mask); extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer, int force_remove_buffer); extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (const void *pointer, diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c index 9d543acb2..2f373b373 100644 --- a/src/gui/gui-input.c +++ b/src/gui/gui-input.c @@ -1540,10 +1540,65 @@ gui_input_jump_next_visited_buffer (struct t_gui_buffer *buffer) */ void -gui_input_hotlist_clear (struct t_gui_buffer *buffer) +gui_input_hotlist_clear (struct t_gui_buffer *buffer, + const char *str_level_mask) { - gui_hotlist_clear (); - gui_hotlist_initial_buffer = buffer; + long level_mask; + char *error; + struct t_gui_hotlist *ptr_hotlist; + int priority; + + if (str_level_mask) + { + if (strcmp (str_level_mask, "lowest") == 0) + { + /* clear only lowest priority currently in hotlist */ + priority = GUI_HOTLIST_MAX + 1; + for (ptr_hotlist = gui_hotlist; ptr_hotlist; + ptr_hotlist = ptr_hotlist->next_hotlist) + { + if ((int)ptr_hotlist->priority < priority) + priority = ptr_hotlist->priority; + } + if (priority <= GUI_HOTLIST_MAX) + { + gui_hotlist_clear (1 << priority); + gui_hotlist_initial_buffer = buffer; + } + } + else if (strcmp (str_level_mask, "highest") == 0) + { + /* clear only highest priority currently in hotlist */ + priority = GUI_HOTLIST_MIN - 1; + for (ptr_hotlist = gui_hotlist; ptr_hotlist; + ptr_hotlist = ptr_hotlist->next_hotlist) + { + if ((int)ptr_hotlist->priority > priority) + priority = ptr_hotlist->priority; + } + if (priority >= GUI_HOTLIST_MIN) + { + gui_hotlist_clear (1 << priority); + gui_hotlist_initial_buffer = buffer; + } + } + else + { + /* clear hotlist using a mask of levels */ + error = NULL; + level_mask = strtol (str_level_mask, &error, 10); + if (error && !error[0] && (level_mask > 0)) + { + gui_hotlist_clear ((int)level_mask); + gui_hotlist_initial_buffer = buffer; + } + } + } + else + { + gui_hotlist_clear (GUI_HOTLIST_MASK_MAX); + gui_hotlist_initial_buffer = buffer; + } } /* diff --git a/src/gui/gui-input.h b/src/gui/gui-input.h index b36c2d1bb..415056e28 100644 --- a/src/gui/gui-input.h +++ b/src/gui/gui-input.h @@ -75,7 +75,8 @@ extern void gui_input_jump_smart (struct t_gui_buffer *buffer); extern void gui_input_jump_last_buffer_displayed (struct t_gui_buffer *buffer); extern void gui_input_jump_previously_visited_buffer (struct t_gui_buffer *buffer); extern void gui_input_jump_next_visited_buffer (struct t_gui_buffer *buffer); -extern void gui_input_hotlist_clear (struct t_gui_buffer *buffer); +extern void gui_input_hotlist_clear (struct t_gui_buffer *buffer, + const char *level_mask); extern void gui_input_grab_key (struct t_gui_buffer *buffer, int command, const char *delay); extern void gui_input_grab_mouse (struct t_gui_buffer *buffer, int area);