summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--po/cs.po8
-rw-r--r--po/de.po8
-rw-r--r--po/es.po8
-rw-r--r--po/fr.po20
-rw-r--r--po/hu.po8
-rw-r--r--po/ru.po8
-rw-r--r--po/weechat.pot8
-rw-r--r--src/core/wee-command.c24
-rw-r--r--src/gui/curses/gui-curses-bar.c24
-rw-r--r--src/gui/curses/gui-curses-chat.c22
-rw-r--r--src/gui/gui-action.c2
-rw-r--r--src/gui/gui-bar-item.c2
-rw-r--r--src/gui/gui-bar.c157
-rw-r--r--src/gui/gui-bar.h2
-rw-r--r--src/gui/gui-buffer.c13
-rw-r--r--src/gui/gui-buffer.h1
-rw-r--r--src/gui/gui-chat.c2
-rw-r--r--src/gui/gui-window.c10
18 files changed, 244 insertions, 83 deletions
diff --git a/po/cs.po b/po/cs.po
index 933bae431..c327f55b9 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-04-03 15:11+0200\n"
+"POT-Creation-Date: 2008-04-03 18:09+0200\n"
"PO-Revision-Date: 2007-09-06 12:44+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -558,7 +558,8 @@ msgstr "řídit buffery"
msgid ""
"[add barname type position size separator item1,item2,...] | [del barname] | "
-"[set barname name|type|position|size|separator|items value] | [list]"
+"[set barname name|number|position|size|separator|items value] | [list] | "
+"[listitems]"
msgstr ""
msgid ""
@@ -572,7 +573,8 @@ msgid ""
"item1,...: items for this bar\n"
" del: delete a bar\n"
" set: set a value for a bar property\n"
-" list: list all bars"
+" list: list all bars\n"
+"listitems: list all bar items"
msgstr ""
msgid "manage buffers"
diff --git a/po/de.po b/po/de.po
index a13df574f..bf0c14aa7 100644
--- a/po/de.po
+++ b/po/de.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-04-03 15:11+0200\n"
+"POT-Creation-Date: 2008-04-03 18:09+0200\n"
"PO-Revision-Date: 2007-09-06 12:44+0200\n"
"Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -566,7 +566,8 @@ msgstr "Puffer verwalten"
msgid ""
"[add barname type position size separator item1,item2,...] | [del barname] | "
-"[set barname name|type|position|size|separator|items value] | [list]"
+"[set barname name|number|position|size|separator|items value] | [list] | "
+"[listitems]"
msgstr ""
msgid ""
@@ -580,7 +581,8 @@ msgid ""
"item1,...: items for this bar\n"
" del: delete a bar\n"
" set: set a value for a bar property\n"
-" list: list all bars"
+" list: list all bars\n"
+"listitems: list all bar items"
msgstr ""
msgid "manage buffers"
diff --git a/po/es.po b/po/es.po
index 268d36a6c..4da06879a 100644
--- a/po/es.po
+++ b/po/es.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-04-03 15:11+0200\n"
+"POT-Creation-Date: 2008-04-03 18:09+0200\n"
"PO-Revision-Date: 2007-09-19 12:09+0200\n"
"Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -562,7 +562,8 @@ msgstr "gestionar los búfers"
msgid ""
"[add barname type position size separator item1,item2,...] | [del barname] | "
-"[set barname name|type|position|size|separator|items value] | [list]"
+"[set barname name|number|position|size|separator|items value] | [list] | "
+"[listitems]"
msgstr ""
msgid ""
@@ -576,7 +577,8 @@ msgid ""
"item1,...: items for this bar\n"
" del: delete a bar\n"
" set: set a value for a bar property\n"
-" list: list all bars"
+" list: list all bars\n"
+"listitems: list all bar items"
msgstr ""
msgid "manage buffers"
diff --git a/po/fr.po b/po/fr.po
index 949443d85..8856420b8 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-04-03 15:11+0200\n"
-"PO-Revision-Date: 2008-04-03 15:11+0200\n"
+"POT-Creation-Date: 2008-04-03 18:09+0200\n"
+"PO-Revision-Date: 2008-04-03 18:09+0200\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -130,7 +130,7 @@ msgid "No bar defined"
msgstr "Pas de barre définie"
msgid "List of bar items:"
-msgstr "Liste des objets de barres:"
+msgstr "Liste des objets de barre:"
#, c-format
msgid " %s (plugin: %s)"
@@ -514,11 +514,9 @@ msgstr "gestion des barres"
msgid ""
"[add barname type position size separator item1,item2,...] | [del barname] | "
-"[set barname name|type|position|size|separator|items value] | [list]"
-msgstr ""
-"[add nombarre type position taille separateur objet1,objet2,...] | [del "
-"nombarre] | [set nombarre name|type|position|size|separator|items valeur] | "
-"[list]"
+"[set barname name|number|position|size|separator|items value] | [list] | "
+"[listitems]"
+msgstr "[add nombarre type position taille separateur objet1,objet2,...] | [del nombarre] | [set nombarre name|position|size|separator|items valeur] | [list] | [listitems]"
msgid ""
" add: add a new bar\n"
@@ -531,7 +529,8 @@ msgid ""
"item1,...: items for this bar\n"
" del: delete a bar\n"
" set: set a value for a bar property\n"
-" list: list all bars"
+" list: list all bars\n"
+"listitems: list all bar items"
msgstr ""
" add: ajoute une nouvelle barre\n"
" nombarre: nom de la barre (doit être unique)\n"
@@ -544,7 +543,8 @@ msgstr ""
"objet1,...: objets pour cette barre\n"
" del: supprime une barre\n"
" set: changer la valeur d'une propriété de la barre\n"
-" list: liste toutes les barres"
+" list: liste toutes les barres\n"
+" listitems: liste tous les objets de barre"
msgid "manage buffers"
msgstr "gestion des tampons"
diff --git a/po/hu.po b/po/hu.po
index 5b822e823..b73124f67 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-04-03 15:11+0200\n"
+"POT-Creation-Date: 2008-04-03 18:09+0200\n"
"PO-Revision-Date: 2007-10-10 18:07+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -564,7 +564,8 @@ msgstr "pufferek kezelése"
msgid ""
"[add barname type position size separator item1,item2,...] | [del barname] | "
-"[set barname name|type|position|size|separator|items value] | [list]"
+"[set barname name|number|position|size|separator|items value] | [list] | "
+"[listitems]"
msgstr ""
msgid ""
@@ -578,7 +579,8 @@ msgid ""
"item1,...: items for this bar\n"
" del: delete a bar\n"
" set: set a value for a bar property\n"
-" list: list all bars"
+" list: list all bars\n"
+"listitems: list all bar items"
msgstr ""
msgid "manage buffers"
diff --git a/po/ru.po b/po/ru.po
index 788065e23..e03610c56 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-04-03 15:11+0200\n"
+"POT-Creation-Date: 2008-04-03 18:09+0200\n"
"PO-Revision-Date: 2007-09-06 12:44+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -560,7 +560,8 @@ msgstr "управление буферами"
msgid ""
"[add barname type position size separator item1,item2,...] | [del barname] | "
-"[set barname name|type|position|size|separator|items value] | [list]"
+"[set barname name|number|position|size|separator|items value] | [list] | "
+"[listitems]"
msgstr ""
msgid ""
@@ -574,7 +575,8 @@ msgid ""
"item1,...: items for this bar\n"
" del: delete a bar\n"
" set: set a value for a bar property\n"
-" list: list all bars"
+" list: list all bars\n"
+"listitems: list all bar items"
msgstr ""
msgid "manage buffers"
diff --git a/po/weechat.pot b/po/weechat.pot
index 4d32cc7aa..1d8734fb6 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-04-03 15:11+0200\n"
+"POT-Creation-Date: 2008-04-03 18:09+0200\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"
@@ -491,7 +491,8 @@ msgstr ""
msgid ""
"[add barname type position size separator item1,item2,...] | [del barname] | "
-"[set barname name|type|position|size|separator|items value] | [list]"
+"[set barname name|number|position|size|separator|items value] | [list] | "
+"[listitems]"
msgstr ""
msgid ""
@@ -505,7 +506,8 @@ msgid ""
"item1,...: items for this bar\n"
" del: delete a bar\n"
" set: set a value for a bar property\n"
-" list: list all bars"
+" list: list all bars\n"
+"listitems: list all bar items"
msgstr ""
msgid "manage buffers"
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 12727f1f6..575ed8d71 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -73,12 +73,11 @@ command_bar (void *data, struct t_gui_buffer *buffer,
/* make C compiler happy */
(void) data;
(void) buffer;
- (void) argv_eol;
+ /* list of bars */
if ((argc == 1)
|| ((argc == 2) && (string_strcasecmp (argv[1], "list") == 0)))
{
- /* list of bars */
if (gui_bars)
{
gui_chat_printf (NULL, "");
@@ -107,8 +106,14 @@ command_bar (void *data, struct t_gui_buffer *buffer,
}
else
gui_chat_printf (NULL, _("No bar defined"));
-
- /* list of bar items */
+
+ return WEECHAT_RC_OK;
+ }
+
+ /* list of bar items */
+ if ((argc == 1)
+ || ((argc == 2) && (string_strcasecmp (argv[1], "listitems") == 0)))
+ {
if (gui_bar_items)
{
gui_chat_printf (NULL, "");
@@ -2299,8 +2304,8 @@ command_init ()
hook_command (NULL, "bar",
N_("manage bars"),
N_("[add barname type position size separator item1,item2,...] "
- "| [del barname] | [set barname name|type|position|size|"
- "separator|items value] | [list]"),
+ "| [del barname] | [set barname name|number|position|"
+ "size|separator|items value] | [list] | [listitems]"),
N_(" add: add a new bar\n"
" barname: name of bar (must be unique)\n"
" type: \"root\" (outside windows), \"window_active\" "
@@ -2313,9 +2318,10 @@ command_init ()
"item1,...: items for this bar\n"
" del: delete a bar\n"
" set: set a value for a bar property\n"
- " list: list all bars"),
- "add|del|set|list %r name|type|position|size|separator|"
- "items",
+ " list: list all bars\n"
+ "listitems: list all bar items"),
+ "add|del|set|list|listitems %r name|number|position|size|"
+ "separator|items",
&command_bar, NULL);
hook_command (NULL, "buffer",
N_("manage buffers"),
diff --git a/src/gui/curses/gui-curses-bar.c b/src/gui/curses/gui-curses-bar.c
index 7feb60bd9..1ea49bc5e 100644
--- a/src/gui/curses/gui-curses-bar.c
+++ b/src/gui/curses/gui-curses-bar.c
@@ -510,9 +510,9 @@ gui_bar_window_add_missing_bars (struct t_gui_window *window)
int
gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
- char *string, int max_chars)
+ char *string, int max_chars_on_screen)
{
- int weechat_color, num_displayed, size_on_screen;
+ int weechat_color, chars_displayed, size_on_screen;
char str_color[3], utf_char[16], *next_char, *output;
if (!string || !string[0])
@@ -524,7 +524,7 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
else
gui_window_set_weechat_color (bar_window->win_bar, GUI_COLOR_STATUS);
- num_displayed = 0;
+ chars_displayed = 0;
while (string && string[0])
{
@@ -552,31 +552,29 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
if (gui_window_utf_char_valid (utf_char))
{
+ size_on_screen = utf8_char_size_screen (utf_char);
+ if (chars_displayed + size_on_screen > max_chars_on_screen)
+ return chars_displayed;
+ chars_displayed += size_on_screen;
output = string_iconv_from_internal (NULL, utf_char);
wprintw (bar_window->win_bar, "%s",
(output) ? output : utf_char);
- size_on_screen = utf8_char_size_screen ((output) ?
- output : utf_char);
- num_displayed += size_on_screen;
- max_chars -= size_on_screen;
if (output)
free (output);
}
else
{
+ if (chars_displayed + 1 > max_chars_on_screen)
+ return chars_displayed;
+ chars_displayed++;
wprintw (bar_window->win_bar, ".");
- num_displayed++;
- max_chars--;
}
string = next_char;
-
- if (max_chars <= 0)
- break;
}
}
- return num_displayed;
+ return chars_displayed;
}
/*
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index 2b1ff6d27..b17b9bcdc 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -520,7 +520,7 @@ void
gui_chat_display_word_raw (struct t_gui_window *window, char *string,
int max_chars_on_screen, int display)
{
- char *next_char, *output, utf_char[16], chars_displayed, size_screen;
+ char *next_char, *output, utf_char[16], chars_displayed, size_on_screen;
if (display)
wmove (GUI_CURSES(window)->win_chat,
@@ -541,15 +541,15 @@ gui_chat_display_word_raw (struct t_gui_window *window, char *string,
{
memcpy (utf_char, string, next_char - string);
utf_char[next_char - string] = '\0';
- if (max_chars_on_screen > 0)
- {
- size_screen = utf8_strlen_screen (utf_char);
- if (chars_displayed + size_screen > max_chars_on_screen)
- return;
- chars_displayed += size_screen;
- }
if (gui_window_utf_char_valid (utf_char))
{
+ if (max_chars_on_screen > 0)
+ {
+ size_on_screen = utf8_strlen_screen (utf_char);
+ if (chars_displayed + size_on_screen > max_chars_on_screen)
+ return;
+ chars_displayed += size_on_screen;
+ }
output = string_iconv_from_internal (NULL, utf_char);
wprintw (GUI_CURSES(window)->win_chat,
"%s", (output) ? output : utf_char);
@@ -558,6 +558,12 @@ gui_chat_display_word_raw (struct t_gui_window *window, char *string,
}
else
{
+ if (max_chars_on_screen > 0)
+ {
+ if (chars_displayed + 1 > max_chars_on_screen)
+ return;
+ chars_displayed++;
+ }
wprintw (GUI_CURSES(window)->win_chat, ".");
}
}
diff --git a/src/gui/gui-action.c b/src/gui/gui-action.c
index ebe07fd0b..906564c86 100644
--- a/src/gui/gui-action.c
+++ b/src/gui/gui-action.c
@@ -1370,7 +1370,7 @@ 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_chat_get_first_line_displayed (gui_current_window->buffer));
- gui_current_window->buffer->chat_refresh_needed = 1;
+ gui_current_window->buffer->chat_refresh_needed = 2;
gui_status_refresh_needed = 1;
}
}
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index 5de3a1a4d..94448b2f4 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -350,7 +350,7 @@ gui_bar_item_default_buffer_filter (void *data, struct t_gui_bar_item *item,
return NULL;
snprintf (buf, sizeof (buf),
- "%s[%sF%s%s%s]",
+ "%s[%sF%s%s%s] ",
GUI_COLOR(GUI_COLOR_STATUS_DELIMITERS),
GUI_COLOR(GUI_COLOR_STATUS),
(window->buffer->lines_hidden) ? "," : "",
diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c
index e11797556..602ef8f4d 100644
--- a/src/gui/gui-bar.c
+++ b/src/gui/gui-bar.c
@@ -132,6 +132,25 @@ gui_bar_search (char *name)
}
/*
+ * gui_bar_search_by_number: search a bar by number
+ */
+
+struct t_gui_bar *
+gui_bar_search_by_number (int number)
+{
+ struct t_gui_bar *ptr_bar;
+
+ for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
+ {
+ if (ptr_bar->number == number)
+ return ptr_bar;
+ }
+
+ /* bar not found */
+ return NULL;
+}
+
+/*
* gui_bar_new: create a new bar
*/
@@ -220,6 +239,27 @@ gui_bar_new (struct t_weechat_plugin *plugin, char *name, char *type,
}
/*
+ * gui_bar_refresh: ask for bar refresh on screen (for all windows where bar is)
+ */
+
+void
+gui_bar_refresh (struct t_gui_bar *bar)
+{
+ struct t_gui_window *ptr_win;
+
+ if (bar->type == GUI_BAR_TYPE_ROOT)
+ gui_window_refresh_needed = 1;
+ else
+ {
+ for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
+ {
+ if (gui_bar_window_search_bar (ptr_win, bar))
+ ptr_win->refresh_needed = 1;
+ }
+ }
+}
+
+/*
* gui_bar_set_name: set name for a bar
*/
@@ -235,21 +275,111 @@ gui_bar_set_name (struct t_gui_bar *bar, char *name)
}
/*
- * gui_bar_set_type: set type for a bar
+ * gui_bar_set_number: set number for a bar
*/
void
-gui_bar_set_type (struct t_gui_bar *bar, char *type)
+gui_bar_set_number (struct t_gui_bar *bar, int number)
{
- int type_value;
+ struct t_gui_bar *ptr_bar;
+ struct t_gui_window *ptr_win;
+ int i;
+
+ if (number < 1)
+ number = 1;
- (void) bar;
+ /* bar number is already ok? */
+ if (number == bar->number)
+ return;
- if (type && type[0])
+ /* remove bar from list */
+ if (bar == gui_bars)
+ {
+ gui_bars = bar->next_bar;
+ gui_bars->prev_bar = NULL;
+ }
+ if (bar == last_gui_bar)
{
- type_value = gui_bar_get_type (type);
- if (type_value >= 0)
+ last_gui_bar = bar->prev_bar;
+ last_gui_bar->next_bar = NULL;
+ }
+ if (bar->prev_bar)
+ (bar->prev_bar)->next_bar = bar->next_bar;
+ if (bar->next_bar)
+ (bar->next_bar)->prev_bar = bar->prev_bar;
+
+ if (number == 1)
+ {
+ gui_bars->prev_bar = bar;
+ bar->prev_bar = NULL;
+ bar->next_bar = gui_bars;
+ gui_bars = bar;
+ }
+ else
+ {
+ /* assign new number to all bars */
+ i = 1;
+ for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
+ {
+ ptr_bar->number = i++;
+ }
+
+ ptr_bar = gui_bar_search_by_number (number);
+ if (ptr_bar)
{
+ /* add bar before ptr_bar */
+ bar->prev_bar = ptr_bar->prev_bar;
+ bar->next_bar = ptr_bar;
+ if (ptr_bar->prev_bar)
+ (ptr_bar->prev_bar)->next_bar = bar;
+ ptr_bar->prev_bar = bar;
+ }
+ else
+ {
+ /* add to end of list */
+ bar->prev_bar = last_gui_bar;
+ bar->next_bar = NULL;
+ last_gui_bar->next_bar = bar;
+ last_gui_bar = bar;
+ }
+ }
+
+ /* assign new number to all bars */
+ i = 1;
+ for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
+ {
+ ptr_bar->number = i++;
+ gui_bar_free_bar_windows (ptr_bar);
+ }
+
+ for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
+ {
+ for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
+ {
+ if (ptr_bar->type != GUI_BAR_TYPE_ROOT)
+ gui_bar_window_new (ptr_bar, ptr_win);
+ }
+ }
+
+ gui_window_refresh_needed = 1;
+}
+
+/*
+ * gui_bar_set_position: set position for a bar
+ */
+
+void
+gui_bar_set_position (struct t_gui_bar *bar, char *position)
+{
+ int position_value;
+
+ if (position && position[0])
+ {
+ position_value = gui_bar_get_position (position);
+ if ((position_value >= 0) && ((int)bar->position != position_value))
+ {
+ bar->position = position_value;
+ gui_bar_refresh (bar);
}
}
}
@@ -270,6 +400,8 @@ gui_bar_set_size (struct t_gui_bar *bar, int size)
bar->size = size;
bar->current_size = (size == 0) ? 1 : size;
+
+ gui_bar_refresh (bar);
}
}
@@ -316,13 +448,16 @@ gui_bar_set (struct t_gui_bar *bar, char *property, char *value)
{
gui_bar_set_name (bar, value);
}
- else if (string_strcasecmp (property, "type") == 0)
+ if (string_strcasecmp (property, "number") == 0)
{
- gui_bar_set_type (bar, value);
+ error = NULL;
+ number = strtol (value, &error, 10);
+ if (error && !error[0])
+ gui_bar_set_number (bar, number);
}
else if (string_strcasecmp (property, "position") == 0)
{
-
+ gui_bar_set_position (bar, value);
}
else if (string_strcasecmp (property, "size") == 0)
{
@@ -334,10 +469,12 @@ gui_bar_set (struct t_gui_bar *bar, char *property, char *value)
else if (string_strcasecmp (property, "separator") == 0)
{
bar->separator = (string_strcasecmp (value, "1") == 0) ? 1 : 0;
+ gui_bar_refresh (bar);
}
else if (string_strcasecmp (property, "items") == 0)
{
gui_bar_set_items (bar, value);
+ gui_bar_draw (bar);
}
}
diff --git a/src/gui/gui-bar.h b/src/gui/gui-bar.h
index f5d487e53..100b5f23f 100644
--- a/src/gui/gui-bar.h
+++ b/src/gui/gui-bar.h
@@ -91,6 +91,8 @@ extern void gui_bar_print_log ();
/* functions (GUI dependent) */
+extern struct t_gui_bar_window *gui_bar_window_search_bar (struct t_gui_window *window,
+ struct t_gui_bar *bar);
extern int gui_bar_window_get_size (struct t_gui_bar *bar,
struct t_gui_window *window,
enum t_gui_bar_position position);
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 8bd38dc04..7f266db8c 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -115,7 +115,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin, char *category, char *name,
new_buffer->lines_count = 0;
new_buffer->lines_hidden = 0;
new_buffer->prefix_max_length = 0;
- new_buffer->chat_refresh_needed = 1;
+ new_buffer->chat_refresh_needed = 2;
/* nicklist */
new_buffer->nicklist = 0;
@@ -317,7 +317,7 @@ gui_buffer_set_type (struct t_gui_buffer *buffer, enum t_gui_buffer_type type)
break;
}
buffer->type = type;
- buffer->chat_refresh_needed = 1;
+ buffer->chat_refresh_needed = 2;
}
/*
@@ -662,7 +662,7 @@ gui_buffer_clear (struct t_gui_buffer *buffer)
}
}
- buffer->chat_refresh_needed = 1;
+ buffer->chat_refresh_needed = 2;
gui_status_refresh_needed = 1;
}
@@ -859,13 +859,13 @@ gui_buffer_move_to_number (struct t_gui_buffer *buffer, int number)
if (gui_buffers == last_gui_buffer)
return;
+ if (number < 1)
+ number = 1;
+
/* buffer number is already ok ? */
if (number == buffer->number)
return;
- if (number < 1)
- number = 1;
-
snprintf (buf2_str, sizeof (buf2_str) - 1, "%d", buffer->number);
/* remove buffer from list */
@@ -923,7 +923,6 @@ gui_buffer_move_to_number (struct t_gui_buffer *buffer, int number)
last_gui_buffer->next_buffer = buffer;
last_gui_buffer = buffer;
}
-
}
/* assign new number to all buffers */
diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h
index 5c17cb8cd..89a63a107 100644
--- a/src/gui/gui-buffer.h
+++ b/src/gui/gui-buffer.h
@@ -86,6 +86,7 @@ struct t_gui_buffer
int lines_hidden; /* 1 if at least one line is hidden */
int prefix_max_length; /* length for prefix align */
int chat_refresh_needed; /* refresh for chat is needed ? */
+ /* (1=refresh, 2=erase+refresh) */
/* nicklist */
int nicklist; /* = 1 if nicklist is enabled */
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c
index 18c982bfa..c3b8e0340 100644
--- a/src/gui/gui-chat.c
+++ b/src/gui/gui-chat.c
@@ -579,7 +579,7 @@ gui_chat_line_free (struct t_gui_buffer *buffer, struct t_gui_line *line)
{
ptr_win->start_line = ptr_win->start_line->next_line;
ptr_win->start_line_pos = 0;
- ptr_win->buffer->chat_refresh_needed = 1;
+ ptr_win->buffer->chat_refresh_needed = 2;
gui_status_refresh_needed = 1;
}
}
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index b7c49e946..3a9dd99a5 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -637,7 +637,7 @@ gui_window_scroll (struct t_gui_window *window, char *scroll)
window->start_line_pos = 0;
window->first_line_displayed =
(window->start_line == gui_chat_get_first_line_displayed (window->buffer));
- window->buffer->chat_refresh_needed = 1;
+ window->buffer->chat_refresh_needed = 2;
gui_status_refresh_needed = 1;
return;
}
@@ -680,7 +680,7 @@ gui_window_search_text (struct t_gui_window *window)
window->start_line_pos = 0;
window->first_line_displayed =
(window->start_line == gui_chat_get_first_line_displayed (window->buffer));
- window->buffer->chat_refresh_needed = 1;
+ window->buffer->chat_refresh_needed = 2;
gui_status_refresh_needed = 1;
return 1;
}
@@ -709,7 +709,7 @@ gui_window_search_text (struct t_gui_window *window)
window->start_line_pos = 0;
window->first_line_displayed =
(window->start_line == window->buffer->lines);
- window->buffer->chat_refresh_needed = 1;
+ window->buffer->chat_refresh_needed = 2;
gui_status_refresh_needed = 1;
return 1;
}
@@ -759,7 +759,7 @@ gui_window_search_restart (struct t_gui_window *window)
window->buffer->text_search_found = 1;
else
{
- window->buffer->chat_refresh_needed = 1;
+ window->buffer->chat_refresh_needed = 2;
gui_status_refresh_needed = 1;
}
}
@@ -784,7 +784,7 @@ gui_window_search_stop (struct t_gui_window *window)
window->start_line = NULL;
window->start_line_pos = 0;
gui_hotlist_remove_buffer (window->buffer);
- window->buffer->chat_refresh_needed = 1;
+ window->buffer->chat_refresh_needed = 2;
gui_status_refresh_needed = 1;
window->buffer->input_refresh_needed = 1;
}