mirror of
https://github.com/weechat/weechat.git
synced 2026-07-02 11:45:41 +02:00
Added hotlist option for buffer in plugins API, improved buffer refreshs
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
./src/gui/gui-main.h
|
||||
./src/gui/gui-nicklist.c
|
||||
./src/gui/gui-nicklist.h
|
||||
./src/gui/gui-status.c
|
||||
./src/gui/gui-status.h
|
||||
./src/gui/gui-window.c
|
||||
./src/gui/gui-window.h
|
||||
@@ -100,6 +101,7 @@
|
||||
./src/plugins/irc/irc-display.h
|
||||
./src/plugins/irc/irc.h
|
||||
./src/plugins/irc/irc-input.c
|
||||
./src/plugins/irc/irc-input.h
|
||||
./src/plugins/irc/irc-log.c
|
||||
./src/plugins/irc/irc-mode.c
|
||||
./src/plugins/irc/irc-mode.h
|
||||
|
||||
@@ -68,6 +68,7 @@ SET(WEECHAT_SOURCES
|
||||
./src/gui/gui-main.h
|
||||
./src/gui/gui-nicklist.c
|
||||
./src/gui/gui-nicklist.h
|
||||
./src/gui/gui-status.c
|
||||
./src/gui/gui-status.h
|
||||
./src/gui/gui-window.c
|
||||
./src/gui/gui-window.h
|
||||
@@ -101,6 +102,7 @@ SET(WEECHAT_SOURCES
|
||||
./src/plugins/irc/irc-display.h
|
||||
./src/plugins/irc/irc.h
|
||||
./src/plugins/irc/irc-input.c
|
||||
./src/plugins/irc/irc-input.h
|
||||
./src/plugins/irc/irc-log.c
|
||||
./src/plugins/irc/irc-mode.c
|
||||
./src/plugins/irc/irc-mode.h
|
||||
|
||||
+20
-19
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2008-01-02 12:39+0100\n"
|
||||
"POT-Creation-Date: 2008-01-06 12:35+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -195,14 +195,18 @@ msgstr ""
|
||||
msgid "Plugins loaded:"
|
||||
msgstr ""
|
||||
|
||||
msgid " commands hooked:"
|
||||
#, c-format
|
||||
msgid " written by \"%s\", license: %s"
|
||||
msgstr ""
|
||||
|
||||
msgid " timers hooked:"
|
||||
msgid " commands hooked:"
|
||||
msgstr ""
|
||||
|
||||
msgid " timers hooked:"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid " %d %s (%d calls remaining)"
|
||||
msgid " %d %s (%d calls remaining)"
|
||||
msgstr ""
|
||||
|
||||
msgid "second"
|
||||
@@ -216,44 +220,44 @@ msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#, c-format
|
||||
msgid " %d %s (no call limit)"
|
||||
msgid " %d %s (no call limit)"
|
||||
msgstr ""
|
||||
|
||||
msgid " fd hooked:"
|
||||
msgid " fd hooked:"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid " %d (flags: %d)"
|
||||
msgid " %d (flags: %d)"
|
||||
msgstr ""
|
||||
|
||||
msgid " prints hooked:"
|
||||
msgid " prints hooked:"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid " buffer: %s / %s, message: \"%s\""
|
||||
msgid " buffer: %s / %s, message: \"%s\""
|
||||
msgstr ""
|
||||
|
||||
msgid "(none)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid " message: \"%s\""
|
||||
msgid " message: \"%s\""
|
||||
msgstr ""
|
||||
|
||||
msgid " signals hooked:"
|
||||
msgid " signals hooked:"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid " signal: %s"
|
||||
msgid " signal: %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "(all)"
|
||||
msgstr ""
|
||||
|
||||
msgid " configuration options hooked:"
|
||||
msgid " configuration options hooked:"
|
||||
msgstr ""
|
||||
|
||||
msgid " completion hooked:"
|
||||
msgid " completions hooked:"
|
||||
msgstr ""
|
||||
|
||||
msgid "No plugin found."
|
||||
@@ -2709,14 +2713,11 @@ msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s cannot find nick for sending message\n"
|
||||
msgid "%s%s: you are not connected to server"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s you are not connected to server\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "This buffer is not a channel!\n"
|
||||
msgid "%s: this buffer is not a channel!"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
|
||||
@@ -142,8 +142,8 @@ command_buffer (void *data, struct t_gui_buffer *buffer,
|
||||
return WEECHAT_RC_ERROR;
|
||||
}
|
||||
gui_buffer_close (buffer, 1);
|
||||
gui_status_draw (gui_current_window->buffer, 1);
|
||||
gui_input_draw (gui_current_window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
buffer->input_refresh_needed = 1;
|
||||
}
|
||||
else if (string_strcasecmp (argv[1], "notify") == 0)
|
||||
{
|
||||
@@ -897,7 +897,7 @@ command_plugin_list (char *name, int full)
|
||||
{
|
||||
/* second line of plugin info */
|
||||
gui_chat_printf (NULL,
|
||||
_(" written by \"%s\", license: s%"),
|
||||
_(" written by \"%s\", license: %s"),
|
||||
ptr_plugin->author,
|
||||
ptr_plugin->license);
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ void
|
||||
config_change_hotlist ()
|
||||
{
|
||||
gui_hotlist_resort ();
|
||||
gui_status_draw (gui_current_window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -39,6 +39,7 @@ lib_weechat_gui_common_a_SOURCES = gui-action.c \
|
||||
gui-keyboard.c \
|
||||
gui-keyboard.h \
|
||||
gui-main.h \
|
||||
gui-status.c \
|
||||
gui-status.h \
|
||||
gui-window.c \
|
||||
gui-window.h \
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "../gui-input.h"
|
||||
#include "../gui-history.h"
|
||||
#include "../gui-nicklist.h"
|
||||
#include "../gui-status.h"
|
||||
#include "../gui-window.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
@@ -161,23 +162,44 @@ gui_main_loop ()
|
||||
/* execute hook timers */
|
||||
hook_timer_exec ();
|
||||
|
||||
/* refresh needed ? */
|
||||
if (gui_refresh_screen_needed)
|
||||
/* refresh window if needed */
|
||||
if (gui_window_refresh_needed)
|
||||
gui_window_refresh_screen (0);
|
||||
|
||||
/* refresh status bar if needed */
|
||||
if (gui_status_refresh_needed)
|
||||
{
|
||||
gui_status_draw (1);
|
||||
gui_status_refresh_needed = 0;
|
||||
}
|
||||
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer;
|
||||
ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
/* refresh title if needed */
|
||||
if (ptr_buffer->title_refresh_needed)
|
||||
{
|
||||
gui_chat_draw_title (ptr_buffer, 1);
|
||||
ptr_buffer->title_refresh_needed = 0;
|
||||
}
|
||||
/* refresh chat if needed */
|
||||
if (ptr_buffer->chat_refresh_needed)
|
||||
{
|
||||
gui_chat_draw (ptr_buffer, 0);
|
||||
ptr_buffer->chat_refresh_needed = 0;
|
||||
}
|
||||
/* refresh nicklist if needed */
|
||||
if (ptr_buffer->nicklist_refresh_needed)
|
||||
{
|
||||
gui_nicklist_draw (ptr_buffer, 0);
|
||||
ptr_buffer->nicklist_refresh_needed = 0;
|
||||
}
|
||||
/* refresh input if needed */
|
||||
if (ptr_buffer->input_refresh_needed)
|
||||
{
|
||||
gui_input_draw (ptr_buffer, 1);
|
||||
ptr_buffer->input_refresh_needed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* wait for keyboard or network activity */
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
|
||||
|
||||
/*
|
||||
* gui_status_draw: draw status window for a buffer
|
||||
* gui_status_draw: draw status window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_status_draw (struct t_gui_buffer *buffer, int erase)
|
||||
gui_status_draw (int erase)
|
||||
{
|
||||
struct t_gui_window *ptr_win;
|
||||
struct t_gui_hotlist *ptr_hotlist;
|
||||
@@ -52,9 +52,6 @@ gui_status_draw (struct t_gui_buffer *buffer, int erase)
|
||||
int x;
|
||||
int display_name, names_count;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) buffer;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
@@ -139,7 +136,7 @@ gui_status_draw (struct t_gui_buffer *buffer, int erase)
|
||||
GUI_COLOR_STATUS_DATA_OTHER);
|
||||
display_name = ((CONFIG_INTEGER(config_look_hotlist_names_level) & 1) != 0);
|
||||
break;
|
||||
case GUI_HOTLIST_MSG:
|
||||
case GUI_HOTLIST_MESSAGE:
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
GUI_COLOR_STATUS_DATA_MSG);
|
||||
display_name = ((CONFIG_INTEGER(config_look_hotlist_names_level) & 2) != 0);
|
||||
|
||||
@@ -46,9 +46,6 @@
|
||||
#include "gui-curses.h"
|
||||
|
||||
|
||||
int gui_refresh_screen_needed = 0;
|
||||
|
||||
|
||||
/*
|
||||
* gui_window_get_width: get screen width (terminal width in chars for Curses)
|
||||
*/
|
||||
@@ -444,7 +441,7 @@ gui_window_redraw_buffer (struct t_gui_buffer *buffer)
|
||||
gui_chat_draw (buffer, 1);
|
||||
if (GUI_CURSES(ptr_win)->win_nick)
|
||||
gui_nicklist_draw (buffer, 1);
|
||||
gui_status_draw (buffer, 1);
|
||||
gui_status_draw (1);
|
||||
if (CONFIG_BOOLEAN(config_look_infobar))
|
||||
gui_infobar_draw (buffer, 1);
|
||||
gui_input_draw (buffer, 1);
|
||||
@@ -576,7 +573,7 @@ gui_window_page_up (struct t_gui_window *window)
|
||||
window->start_line = NULL;
|
||||
window->start_line_pos = 0;
|
||||
}
|
||||
gui_status_draw (window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -618,7 +615,7 @@ gui_window_page_down (struct t_gui_window *window)
|
||||
window->start_line_pos = 0;
|
||||
gui_hotlist_remove_buffer (window->buffer);
|
||||
}
|
||||
gui_status_draw (window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,7 +643,7 @@ gui_window_scroll_up (struct t_gui_window *window)
|
||||
window->start_line = NULL;
|
||||
window->start_line_pos = 0;
|
||||
}
|
||||
gui_status_draw (window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -689,7 +686,7 @@ gui_window_scroll_down (struct t_gui_window *window)
|
||||
window->start_line_pos = 0;
|
||||
gui_hotlist_remove_buffer (window->buffer);
|
||||
}
|
||||
gui_status_draw (window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -713,7 +710,7 @@ gui_window_scroll_top (struct t_gui_window *window)
|
||||
window->start_line = NULL;
|
||||
window->start_line_pos = 0;
|
||||
}
|
||||
gui_status_draw (window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -738,7 +735,7 @@ gui_window_scroll_bottom (struct t_gui_window *window)
|
||||
window->start_line_pos = 0;
|
||||
gui_hotlist_remove_buffer (window->buffer);
|
||||
}
|
||||
gui_status_draw (window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1308,7 +1305,7 @@ gui_window_refresh_screen (int force)
|
||||
{
|
||||
int new_height, new_width;
|
||||
|
||||
if (force || (gui_refresh_screen_needed == 1))
|
||||
if (force || (gui_window_refresh_needed == 1))
|
||||
{
|
||||
endwin ();
|
||||
refresh ();
|
||||
@@ -1324,8 +1321,8 @@ gui_window_refresh_screen (int force)
|
||||
}
|
||||
}
|
||||
|
||||
if (!force && (gui_refresh_screen_needed > 0))
|
||||
gui_refresh_screen_needed--;
|
||||
if (!force && (gui_window_refresh_needed > 0))
|
||||
gui_window_refresh_needed--;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1335,7 +1332,7 @@ gui_window_refresh_screen (int force)
|
||||
void
|
||||
gui_window_refresh_screen_sigwinch ()
|
||||
{
|
||||
gui_refresh_screen_needed = 1;
|
||||
gui_window_refresh_needed = 1;
|
||||
//gui_window_refresh_screen (0);
|
||||
signal (SIGWINCH, &gui_window_refresh_screen_sigwinch);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ struct t_gui_curses_objects
|
||||
};
|
||||
|
||||
extern struct t_gui_color gui_weechat_colors[];
|
||||
extern int gui_refresh_screen_needed;
|
||||
|
||||
/* color functions */
|
||||
extern int gui_color_get_pair (int num_color);
|
||||
|
||||
@@ -33,13 +33,12 @@
|
||||
|
||||
|
||||
/*
|
||||
* gui_status_draw: draw status window for a buffer
|
||||
* gui_status_draw: draw status window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_status_draw (struct t_gui_buffer *buffer, int erase)
|
||||
gui_status_draw (int erase)
|
||||
{
|
||||
/* TODO: write this function for Gtk */
|
||||
(void) buffer;
|
||||
(void) erase;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ gui_window_page_up (struct t_gui_window *window)
|
||||
(-1) * (window->win_chat_height - 1) :
|
||||
(-1) * ((window->win_chat_height - 1) * 2));
|
||||
gui_chat_draw (window->buffer, 0);
|
||||
gui_status_draw (window->buffer, 0);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ gui_window_page_down (struct t_gui_window *window)
|
||||
}
|
||||
|
||||
gui_chat_draw (window->buffer, 0);
|
||||
gui_status_draw (window->buffer, 0);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ gui_window_scroll_up (struct t_gui_window *window)
|
||||
(-1) * ( (window->win_chat_height - 1) +
|
||||
CONFIG_INTEGER(config_look_scroll_amount)));
|
||||
gui_chat_draw (window->buffer, 0);
|
||||
gui_status_draw (window->buffer, 0);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ gui_window_scroll_down (struct t_gui_window *window)
|
||||
}
|
||||
|
||||
gui_chat_draw (window->buffer, 0);
|
||||
gui_status_draw (window->buffer, 0);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ gui_window_scroll_top (struct t_gui_window *window)
|
||||
window->start_line = window->buffer->lines;
|
||||
window->start_line_pos = 0;
|
||||
gui_chat_draw (window->buffer, 0);
|
||||
gui_status_draw (window->buffer, 0);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ gui_window_scroll_bottom (struct t_gui_window *window)
|
||||
window->start_line = NULL;
|
||||
window->start_line_pos = 0;
|
||||
gui_chat_draw (window->buffer, 0);
|
||||
gui_status_draw (window->buffer, 0);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -684,8 +684,8 @@ gui_action_up (char *args)
|
||||
((t_irc_dcc *)(window->dcc_first))->prev_dcc;
|
||||
window->dcc_selected =
|
||||
((t_irc_dcc *)(window->dcc_selected))->prev_dcc;
|
||||
gui_chat_draw (gui_current_window->buffer, 1);
|
||||
gui_input_draw (gui_current_window->buffer, 1);
|
||||
gui_current_window->buffer->chat_refresh_needed = 1;
|
||||
gui_current_window->buffer->input_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -824,8 +824,8 @@ gui_action_down (char *args)
|
||||
else
|
||||
window->dcc_selected =
|
||||
irc_dcc_list->next_dcc;
|
||||
gui_chat_draw (gui_current_window->buffer, 1);
|
||||
gui_input_draw (gui_current_window->buffer, 1);
|
||||
gui_current_window->buffer->chat_refresh_needed = 1;
|
||||
gui_current_window->buffer->input_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1329,8 +1329,8 @@ gui_action_scroll_previous_highlight (char *args)
|
||||
window->start_line_pos = 0;
|
||||
window->first_line_displayed =
|
||||
(window->start_line == gui_current_window->buffer->lines);
|
||||
gui_chat_draw (gui_current_window->buffer, 1);
|
||||
gui_status_draw (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->chat_refresh_needed = 1;
|
||||
gui_current_window->buffer->input_refresh_needed = 1;
|
||||
return;
|
||||
}
|
||||
ptr_line = ptr_line->prev_line;
|
||||
@@ -1366,8 +1366,8 @@ gui_action_scroll_next_highlight (char *args)
|
||||
window->start_line_pos = 0;
|
||||
window->first_line_displayed =
|
||||
(window->start_line == gui_current_window->buffer->lines);
|
||||
gui_chat_draw (gui_current_window->buffer, 1);
|
||||
gui_status_draw (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->chat_refresh_needed = 1;
|
||||
gui_current_window->buffer->input_refresh_needed = 1;
|
||||
return;
|
||||
}
|
||||
ptr_line = ptr_line->next_line;
|
||||
@@ -1399,8 +1399,8 @@ gui_action_scroll_unread (char *args)
|
||||
gui_current_window->start_line_pos = 0;
|
||||
gui_current_window->first_line_displayed =
|
||||
(gui_current_window->start_line == gui_current_window->buffer->lines);
|
||||
gui_chat_draw (gui_current_window->buffer, 1);
|
||||
gui_status_draw (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->chat_refresh_needed = 1;
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+26
-11
File diff suppressed because it is too large
Load Diff
@@ -66,6 +66,7 @@ struct t_gui_buffer
|
||||
|
||||
/* buffer title */
|
||||
char *title; /* buffer title */
|
||||
int title_refresh_needed; /* refresh for title is needed ? */
|
||||
|
||||
/* chat content */
|
||||
struct t_gui_line *lines; /* lines of chat window */
|
||||
@@ -97,6 +98,7 @@ struct t_gui_buffer
|
||||
int input_buffer_length; /* number of chars in buffer */
|
||||
int input_buffer_pos; /* position into buffer */
|
||||
int input_buffer_1st_display; /* first char displayed on screen */
|
||||
int input_refresh_needed; /* refresh for input is needed ? */
|
||||
|
||||
/* completion */
|
||||
struct t_gui_completion *completion; /* completion */
|
||||
|
||||
+3
-3
@@ -404,8 +404,8 @@ gui_chat_line_free (struct t_gui_line *line)
|
||||
{
|
||||
ptr_win->start_line = ptr_win->start_line->next_line;
|
||||
ptr_win->start_line_pos = 0;
|
||||
gui_chat_draw (ptr_win->buffer, 0);
|
||||
gui_status_draw (ptr_win->buffer, 0);
|
||||
ptr_win->buffer->chat_refresh_needed = 1;
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
if (line->str_time)
|
||||
@@ -566,7 +566,7 @@ gui_chat_printf_date (struct t_gui_buffer *buffer, time_t date,
|
||||
|| (gui_buffer_is_scrolled (buffer))))
|
||||
{
|
||||
gui_hotlist_add (buffer, 0, NULL, 1);
|
||||
gui_status_draw (buffer, 0);
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "../core/wee-util.h"
|
||||
#include "gui-hotlist.h"
|
||||
#include "gui-buffer.h"
|
||||
#include "gui-status.h"
|
||||
#include "gui-window.h"
|
||||
|
||||
|
||||
@@ -190,7 +191,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer, int priority,
|
||||
{
|
||||
struct t_gui_hotlist *new_hotlist, *ptr_hotlist;
|
||||
|
||||
if (!buffer)
|
||||
if (!buffer || !gui_add_hotlist)
|
||||
return;
|
||||
|
||||
/* do not highlight current buffer */
|
||||
@@ -198,6 +199,11 @@ gui_hotlist_add (struct t_gui_buffer *buffer, int priority,
|
||||
&& (!allow_current_buffer) && (!gui_buffer_is_scrolled (buffer)))
|
||||
return;
|
||||
|
||||
if (priority < GUI_HOTLIST_MIN)
|
||||
priority = GUI_HOTLIST_MIN;
|
||||
else if (priority > GUI_HOTLIST_MAX)
|
||||
priority = GUI_HOTLIST_MAX;
|
||||
|
||||
if ((ptr_hotlist = gui_hotlist_search (gui_hotlist, buffer)))
|
||||
{
|
||||
/* return if priority is greater or equal than the one to add */
|
||||
@@ -226,6 +232,8 @@ gui_hotlist_add (struct t_gui_buffer *buffer, int priority,
|
||||
new_hotlist->prev_hotlist = NULL;
|
||||
|
||||
gui_hotlist_add_hotlist (&gui_hotlist, &last_gui_hotlist, new_hotlist);
|
||||
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -21,10 +21,13 @@
|
||||
#define __WEECHAT_GUI_HOTLIST_H 1
|
||||
|
||||
#define GUI_HOTLIST_LOW 0
|
||||
#define GUI_HOTLIST_MSG 1
|
||||
#define GUI_HOTLIST_MESSAGE 1
|
||||
#define GUI_HOTLIST_PRIVATE 2
|
||||
#define GUI_HOTLIST_HIGHLIGHT 3
|
||||
|
||||
#define GUI_HOTLIST_MIN 0
|
||||
#define GUI_HOTLIST_MAX 3
|
||||
|
||||
struct t_gui_hotlist
|
||||
{
|
||||
int priority; /* 0=crappy msg (join/part), 1=msg, */
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "gui-nicklist.h"
|
||||
#include "gui-buffer.h"
|
||||
#include "gui-color.h"
|
||||
#include "gui-status.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -196,6 +197,7 @@ gui_nicklist_add_group (struct t_gui_buffer *buffer,
|
||||
{
|
||||
buffer->nicklist_refresh_needed = 1;
|
||||
buffer->nicklist_visible_count++;
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
|
||||
return new_group;
|
||||
@@ -337,6 +339,7 @@ gui_nicklist_add_nick (struct t_gui_buffer *buffer,
|
||||
{
|
||||
buffer->nicklist_refresh_needed = 1;
|
||||
buffer->nicklist_visible_count++;
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
|
||||
return new_nick;
|
||||
@@ -372,6 +375,7 @@ gui_nicklist_remove_nick (struct t_gui_buffer *buffer,
|
||||
buffer->nicklist_refresh_needed = 1;
|
||||
if (buffer->nicklist_visible_count > 0)
|
||||
buffer->nicklist_visible_count--;
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
|
||||
free (nick);
|
||||
@@ -427,6 +431,7 @@ gui_nicklist_remove_group (struct t_gui_buffer *buffer,
|
||||
if (buffer->nicklist_display_groups
|
||||
&& (buffer->nicklist_visible_count > 0))
|
||||
buffer->nicklist_visible_count--;
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
|
||||
free (group);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* gui-status.c: status functions, used by all GUI */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
int gui_status_refresh_needed = 0; /* refresh needed for status bar ? */
|
||||
@@ -20,10 +20,10 @@
|
||||
#ifndef __WEECHAT_GUI_STATUS_H
|
||||
#define __WEECHAT_GUI_STATUS_H 1
|
||||
|
||||
struct t_gui_buffer;
|
||||
extern int gui_status_refresh_needed;
|
||||
|
||||
/* statusbar functions (GUI dependent) */
|
||||
|
||||
extern void gui_status_draw (struct t_gui_buffer *buffer, int erase);
|
||||
extern void gui_status_draw (int erase);
|
||||
|
||||
#endif /* gui-status.h */
|
||||
|
||||
+14
-13
@@ -47,6 +47,7 @@
|
||||
int gui_init_ok = 0; /* = 1 if GUI is initialized*/
|
||||
int gui_ok = 0; /* = 1 if GUI is ok */
|
||||
/* (0 when size too small) */
|
||||
int gui_window_refresh_needed = 0; /* = 1 if refresh needed */
|
||||
|
||||
struct t_gui_window *gui_windows = NULL; /* first window */
|
||||
struct t_gui_window *last_gui_window = NULL; /* last window */
|
||||
@@ -617,8 +618,8 @@ gui_window_scroll (struct t_gui_window *window, char *scroll)
|
||||
window->start_line_pos = 0;
|
||||
window->first_line_displayed =
|
||||
(window->start_line == window->buffer->lines);
|
||||
gui_chat_draw (window->buffer, 1);
|
||||
gui_status_draw (window->buffer, 0);
|
||||
window->buffer->chat_refresh_needed = 1;
|
||||
gui_status_refresh_needed = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -656,8 +657,8 @@ gui_window_search_text (struct t_gui_window *window)
|
||||
window->start_line_pos = 0;
|
||||
window->first_line_displayed =
|
||||
(window->start_line == window->buffer->lines);
|
||||
gui_chat_draw (window->buffer, 1);
|
||||
gui_status_draw (window->buffer, 1);
|
||||
window->buffer->chat_refresh_needed = 1;
|
||||
gui_status_refresh_needed = 1;
|
||||
return 1;
|
||||
}
|
||||
ptr_line = ptr_line->prev_line;
|
||||
@@ -681,8 +682,8 @@ gui_window_search_text (struct t_gui_window *window)
|
||||
window->start_line_pos = 0;
|
||||
window->first_line_displayed =
|
||||
(window->start_line == window->buffer->lines);
|
||||
gui_chat_draw (window->buffer, 1);
|
||||
gui_status_draw (window->buffer, 1);
|
||||
window->buffer->chat_refresh_needed = 1;
|
||||
gui_status_refresh_needed = 1;
|
||||
return 1;
|
||||
}
|
||||
ptr_line = ptr_line->next_line;
|
||||
@@ -711,8 +712,8 @@ gui_window_search_start (struct t_gui_window *window)
|
||||
window->buffer->text_search_input =
|
||||
strdup (window->buffer->input_buffer);
|
||||
gui_input_delete_line (window->buffer);
|
||||
gui_status_draw (window->buffer, 1);
|
||||
gui_input_draw (window->buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
window->buffer->input_refresh_needed = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -731,8 +732,8 @@ gui_window_search_restart (struct t_gui_window *window)
|
||||
window->buffer->text_search_found = 1;
|
||||
else
|
||||
{
|
||||
gui_chat_draw (window->buffer, 1);
|
||||
gui_status_draw (window->buffer, 1);
|
||||
window->buffer->chat_refresh_needed = 1;
|
||||
gui_status_refresh_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -756,9 +757,9 @@ gui_window_search_stop (struct t_gui_window *window)
|
||||
window->start_line = NULL;
|
||||
window->start_line_pos = 0;
|
||||
gui_hotlist_remove_buffer (window->buffer);
|
||||
gui_chat_draw (window->buffer, 0);
|
||||
gui_status_draw (window->buffer, 1);
|
||||
gui_input_draw (window->buffer, 1);
|
||||
window->buffer->chat_refresh_needed = 1;
|
||||
gui_status_refresh_needed = 1;
|
||||
window->buffer->input_refresh_needed = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
extern int gui_init_ok;
|
||||
extern int gui_ok;
|
||||
extern int gui_window_refresh_needed;
|
||||
|
||||
/* window structures */
|
||||
|
||||
|
||||
@@ -707,7 +707,7 @@ alias_completion_cb (void *data, char *completion, struct t_gui_buffer *buffer,
|
||||
for (ptr_alias = alias_list; ptr_alias;
|
||||
ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
weechat_list_add (list, ptr_alias->name, "sort");
|
||||
weechat_list_add (list, ptr_alias->name, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
@@ -469,7 +469,7 @@ irc_channel_add_nick_speaking (struct t_irc_channel *channel, char *nick)
|
||||
if (!channel->nicks_speaking)
|
||||
channel->nicks_speaking = weechat_list_new ();
|
||||
|
||||
weechat_list_add (channel->nicks_speaking, nick, "end");
|
||||
weechat_list_add (channel->nicks_speaking, nick, WEECHAT_LIST_POS_END);
|
||||
|
||||
size = weechat_list_size (channel->nicks_speaking);
|
||||
if (size > IRC_CHANNEL_NICKS_SPEAKING_LIMIT)
|
||||
|
||||
@@ -156,7 +156,7 @@ irc_command_ame (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
//gui_add_hotlist = 0;
|
||||
weechat_buffer_set (NULL, "hotlist", "-");
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
@@ -171,7 +171,7 @@ irc_command_ame (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
}
|
||||
}
|
||||
//gui_add_hotlist = 1;
|
||||
weechat_buffer_set (NULL, "hotlist", "+");
|
||||
}
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ irc_command_amsg (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
//gui_add_hotlist = 0;
|
||||
weechat_buffer_set (NULL, "hotlist", "-");
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ irc_command_amsg (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
}
|
||||
}
|
||||
//gui_add_hotlist = 1;
|
||||
weechat_buffer_set (NULL, "hotlist", "+");
|
||||
}
|
||||
else
|
||||
return WEECHAT_RC_ERROR;
|
||||
@@ -387,7 +387,7 @@ irc_command_away (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
(void) data;
|
||||
(void) argv;
|
||||
|
||||
//gui_add_hotlist = 0;
|
||||
weechat_buffer_set (NULL, "hotlist", "-");
|
||||
if ((argc > 2) && (weechat_strcasecmp (argv[1], "-all") == 0))
|
||||
{
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
@@ -400,8 +400,8 @@ irc_command_away (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
else
|
||||
irc_command_away_server (ptr_server, argv_eol[1]);
|
||||
|
||||
//gui_status_draw (window->buffer, 1);
|
||||
//gui_add_hotlist = 1;
|
||||
weechat_buffer_set (NULL, "hotlist", "+");
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+36
-42
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -52,9 +52,16 @@ struct t_weelist;
|
||||
#define WEECHAT_RC_WITH_HIGHLIGHT 4 /* ok and ask for highlight */
|
||||
/* (for message handler only) */
|
||||
|
||||
#define WEELIST_POS_SORT "sort"
|
||||
#define WEELIST_POS_BEGINNING "beginning"
|
||||
#define WEELIST_POS_END "end"
|
||||
/* list management (order of elements) */
|
||||
#define WEECHAT_LIST_POS_SORT "sort"
|
||||
#define WEECHAT_LIST_POS_BEGINNING "beginning"
|
||||
#define WEECHAT_LIST_POS_END "end"
|
||||
|
||||
/* buffer hotlist */
|
||||
#define WEECHAT_HOTLIST_LOW "0"
|
||||
#define WEECHAT_HOTLIST_MESSAGE "1"
|
||||
#define WEECHAT_HOTLIST_PRIVATE "2"
|
||||
#define WEECHAT_HOTLIST_HIGHLIGHT "3"
|
||||
|
||||
struct t_weechat_plugin
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user