summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-10-12 18:22:11 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-10-12 18:22:11 +0200
commit0e68117b37f2ac79c8cf0777f367b367609825ac (patch)
tree4b279e39d951691cd2599ae688e252203d72ff31
parent6e695ebe65f1dd6304b0a2b8b25c5b285d60a251 (diff)
downloadweechat-0e68117b37f2ac79c8cf0777f367b367609825ac.zip
Add new option weechat.look.hotlist_unique_numbers (task #10691)
-rw-r--r--ChangeLog1
-rw-r--r--doc/de/autogen/user/weechat_options.txt5
-rw-r--r--doc/en/autogen/user/weechat_options.txt5
-rw-r--r--doc/fr/autogen/user/weechat_options.txt7
-rw-r--r--doc/it/autogen/user/weechat_options.txt5
-rw-r--r--po/cs.po10
-rw-r--r--po/de.po10
-rw-r--r--po/es.po10
-rw-r--r--po/fr.po14
-rw-r--r--po/hu.po7
-rw-r--r--po/it.po10
-rw-r--r--po/pl.po10
-rw-r--r--po/ru.po10
-rw-r--r--po/weechat.pot7
-rw-r--r--src/core/wee-config.c7
-rw-r--r--src/core/wee-config.h1
-rw-r--r--src/gui/gui-bar-item.c76
17 files changed, 157 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c12a0c1a..4d9b648a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@ v0.3.4-dev, 2010-10-12
Version 0.3.4 (under dev!)
--------------------------
+* core: add new option weechat.look.hotlist_unique_numbers (task #10691)
* core: add property "no_highlight_nicks" in buffers to disable highlight
for some nicks in buffer
* core: add new options weechat.look.input_share and
diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt
index 81144ec9e..2f612dfd3 100644
--- a/doc/de/autogen/user/weechat_options.txt
+++ b/doc/de/autogen/user/weechat_options.txt
@@ -423,6 +423,11 @@
** Typ: integer
** Werte: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (Standardwert: `group_time_asc`)
+* *weechat.look.hotlist_unique_numbers*
+** Beschreibung: `keep only unique numbers in hotlist (this applies only on hotlist items where name is NOT displayed after number)`
+** Typ: boolesch
+** Werte: on, off (Standardwert: `on`)
+
* *weechat.look.input_share*
** Beschreibung: `share commands, text, or both in input for all buffers (there is still local history for each buffer)`
** Typ: integer
diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt
index 0f2e58cb5..477bd2839 100644
--- a/doc/en/autogen/user/weechat_options.txt
+++ b/doc/en/autogen/user/weechat_options.txt
@@ -423,6 +423,11 @@
** type: integer
** values: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (default value: `group_time_asc`)
+* *weechat.look.hotlist_unique_numbers*
+** description: `keep only unique numbers in hotlist (this applies only on hotlist items where name is NOT displayed after number)`
+** type: boolean
+** values: on, off (default value: `on`)
+
* *weechat.look.input_share*
** description: `share commands, text, or both in input for all buffers (there is still local history for each buffer)`
** type: integer
diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt
index a407bc822..d92f2096a 100644
--- a/doc/fr/autogen/user/weechat_options.txt
+++ b/doc/fr/autogen/user/weechat_options.txt
@@ -414,7 +414,7 @@
** valeurs: on, off (valeur par défaut: `off`)
* *weechat.look.hotlist_short_names*
-** description: `si défini, utilie des noms courts pour afficher les noms de tampons dans la hotlist (commence après le premier '.' dans le nom)`
+** description: `si défini, utilise des noms courts pour afficher les noms de tampons dans la hotlist (commence après le premier '.' dans le nom)`
** type: booléen
** valeurs: on, off (valeur par défaut: `on`)
@@ -423,6 +423,11 @@
** type: entier
** valeurs: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (valeur par défaut: `group_time_asc`)
+* *weechat.look.hotlist_unique_numbers*
+** description: `garde seulement des numéros uniques dans la hotlist (cela s'applique seulement aux éléments de la hotlist où le nom n'est PAS affiché après le numéro)`
+** type: booléen
+** valeurs: on, off (valeur par défaut: `on`)
+
* *weechat.look.input_share*
** description: `partage les commandes, le texte, ou les deux dans la zone de saisie pour tous les tampons (il y a toujours un historique local sur chaque tampon)`
** type: entier
diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt
index f25e6738a..ac7037eae 100644
--- a/doc/it/autogen/user/weechat_options.txt
+++ b/doc/it/autogen/user/weechat_options.txt
@@ -423,6 +423,11 @@
** tipo: intero
** valori: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (valore predefinito: `group_time_asc`)
+* *weechat.look.hotlist_unique_numbers*
+** descrizione: `keep only unique numbers in hotlist (this applies only on hotlist items where name is NOT displayed after number)`
+** tipo: bool
+** valori: on, off (valore predefinito: `on`)
+
* *weechat.look.input_share*
** descrizione: `share commands, text, or both in input for all buffers (there is still local history for each buffer)`
** tipo: intero
diff --git a/po/cs.po b/po/cs.po
index e9de02c47..4812327e3 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-10-12 08:24+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1810,6 +1810,14 @@ msgstr ""
"[skupina_číslo_vzestupně], group_number_desc [skupina_číslo_sestupně], "
"number_asc [číslo_vzestupně], number_desc [číslo_sestupně] ) "
+#, fuzzy
+msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+"maximální počet jmen v hotlistu (0 = žádné jméno není zobrazeno, pouze čísla "
+"bufferů)"
+
msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
diff --git a/po/de.po b/po/de.po
index 80c3205ee..1f2d539fa 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-10-12 08:24+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-10-11 16:32+0200\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1888,6 +1888,14 @@ msgstr ""
#, fuzzy
msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+"Maximale Anzahl an Namen in der Hotlist (0 = keine Namen, nur die Anzahl der "
+"Buffer)"
+
+#, fuzzy
+msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
msgstr ""
diff --git a/po/es.po b/po/es.po
index 07c68f3dc..3bb089b55 100644
--- a/po/es.po
+++ b/po/es.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-10-12 08:24+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1828,6 +1828,14 @@ msgstr ""
"group_time_desc, group_number_asc, group_number_desc, number_asc, "
"number_desc)"
+#, fuzzy
+msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+"número máximo de nombres en la lista de actividad (0 = no se muestra "
+"ninguno, sólo los números de buffer)"
+
msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
diff --git a/po/fr.po b/po/fr.po
index 4694c7248..e7b1d1fa6 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-10-12 08:24+0200\n"
-"PO-Revision-Date: 2010-10-12 08:25+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+0200\n"
+"PO-Revision-Date: 2010-10-12 12:58+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -1835,7 +1835,7 @@ msgid ""
"if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)"
msgstr ""
-"si défini, utilie des noms courts pour afficher les noms de tampons dans la "
+"si défini, utilise des noms courts pour afficher les noms de tampons dans la "
"hotlist (commence après le premier '.' dans le nom)"
msgid ""
@@ -1847,6 +1847,14 @@ msgstr ""
"number_desc)"
msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+"garde seulement des numéros uniques dans la hotlist (cela s'applique "
+"seulement aux éléments de la hotlist où le nom n'est PAS affiché après le "
+"numéro)"
+
+msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
msgstr ""
diff --git a/po/hu.po b/po/hu.po
index e032ed45f..d521ed6da 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-10-12 08:24+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1595,6 +1595,11 @@ msgid ""
msgstr ""
msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+
+msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
msgstr ""
diff --git a/po/it.po b/po/it.po
index 95680448b..228918059 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-10-12 08:24+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-10-10 19:30+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1836,6 +1836,14 @@ msgstr ""
"group_time_desc, group_number_asc, group_number_desc, number_asc, "
"number_desc)"
+#, fuzzy
+msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+"numero massimo di nomi nella hotlist (0 = nessun nome visualizzato, solo "
+"numeri dei buffer)"
+
msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
diff --git a/po/pl.po b/po/pl.po
index d48e3cad6..e97347bef 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-10-12 08:24+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1835,6 +1835,14 @@ msgstr ""
"typ sortowania hotlisty (group_time_asc (domyślny), group_time_desc, "
"group_number_asc, group_number_desc, number_asc, number_desc)"
+#, fuzzy
+msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+"maksymalna ilość nazw w hotliście (0 = żadna nazwa nie zostanie wyświetlona, "
+"tylko numery buforów)"
+
msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
diff --git a/po/ru.po b/po/ru.po
index 4ba511582..172f76451 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-10-12 08:24+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1609,6 +1609,14 @@ msgstr ""
"тип сортировки хотлиста (group_time_asc (по-умолчанию), group_time_desc, "
"group_number_asc, group_number_desc, number_asc, number_desc)"
+#, fuzzy
+msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+"максимальное количество имён в хотлисте (0 = имена не показываются, только "
+"номера буферов)"
+
msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
diff --git a/po/weechat.pot b/po/weechat.pot
index 543065d4b..01da54531 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: 2010-10-12 08:24+0200\n"
+"POT-Creation-Date: 2010-10-12 12:58+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"
@@ -1377,6 +1377,11 @@ msgid ""
msgstr ""
msgid ""
+"keep only unique numbers in hotlist (this applies only on hotlist items "
+"where name is NOT displayed after number)"
+msgstr ""
+
+msgid ""
"share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)"
msgstr ""
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 720f926a3..0aaf3a629 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -90,6 +90,7 @@ struct t_config_option *config_look_hotlist_names_level;
struct t_config_option *config_look_hotlist_names_merged_buffers;
struct t_config_option *config_look_hotlist_short_names;
struct t_config_option *config_look_hotlist_sort;
+struct t_config_option *config_look_hotlist_unique_numbers;
struct t_config_option *config_look_input_share;
struct t_config_option *config_look_input_share_overwrite;
struct t_config_option *config_look_input_undo_max;
@@ -1372,6 +1373,12 @@ config_weechat_init_options ()
"group_time_asc|group_time_desc|group_number_asc|"
"group_number_desc|number_asc|number_desc",
0, 0, "group_time_asc", NULL, 0, NULL, NULL, &config_change_hotlist, NULL, NULL, NULL);
+ config_look_hotlist_unique_numbers = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_unique_numbers", "boolean",
+ N_("keep only unique numbers in hotlist (this applies only on hotlist "
+ "items where name is NOT displayed after number)"),
+ NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
config_look_input_share = config_file_new_option (
weechat_config_file, ptr_section,
"input_share", "integer",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 70b872648..99046f5a0 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -119,6 +119,7 @@ extern struct t_config_option *config_look_hotlist_names_level;
extern struct t_config_option *config_look_hotlist_names_merged_buffers;
extern struct t_config_option *config_look_hotlist_short_names;
extern struct t_config_option *config_look_hotlist_sort;
+extern struct t_config_option *config_look_hotlist_unique_numbers;
extern struct t_config_option *config_look_input_share;
extern struct t_config_option *config_look_input_share_overwrite;
extern struct t_config_option *config_look_input_undo_max;
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index e861d520d..1d1f00c1f 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -979,9 +979,9 @@ char *
gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
struct t_gui_window *window)
{
- char buf[1024], format[32];
+ char buf[1024], format[32], *buffer_without_name_displayed;
struct t_gui_hotlist *ptr_hotlist;
- int names_count, display_name;
+ int numbers_count, names_count, display_name;
/* make C compiler happy */
(void) data;
@@ -995,6 +995,15 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
strcat (buf, _("Act: "));
+ buffer_without_name_displayed = NULL;
+ if (CONFIG_BOOLEAN(config_look_hotlist_unique_numbers) && last_gui_buffer)
+ {
+ buffer_without_name_displayed = malloc (last_gui_buffer->number);
+ if (buffer_without_name_displayed)
+ memset (buffer_without_name_displayed, 0, last_gui_buffer->number);
+ }
+
+ numbers_count = 0;
names_count = 0;
for (ptr_hotlist = gui_hotlist; ptr_hotlist;
ptr_hotlist = ptr_hotlist->next_hotlist)
@@ -1022,37 +1031,52 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
break;
}
- sprintf (buf + strlen (buf), "%d", ptr_hotlist->buffer->number);
+ display_name = ((CONFIG_BOOLEAN(config_look_hotlist_names_merged_buffers)
+ && (gui_buffer_count_merged_buffers (ptr_hotlist->buffer->number) > 1))
+ || (display_name
+ && (CONFIG_INTEGER(config_look_hotlist_names_count) != 0)
+ && (names_count < CONFIG_INTEGER(config_look_hotlist_names_count))));
- if ((CONFIG_BOOLEAN(config_look_hotlist_names_merged_buffers)
- && (gui_buffer_count_merged_buffers (ptr_hotlist->buffer->number) > 1))
- || (display_name
- && (CONFIG_INTEGER(config_look_hotlist_names_count) != 0)
- && (names_count < CONFIG_INTEGER(config_look_hotlist_names_count))))
+ if (display_name || !buffer_without_name_displayed
+ || (buffer_without_name_displayed[ptr_hotlist->buffer->number - 1] == 0))
{
- names_count++;
+ if (numbers_count > 0)
+ strcat (buf, ",");
- strcat (buf, GUI_COLOR_CUSTOM_BAR_DELIM);
- strcat (buf, ":");
- strcat (buf, GUI_COLOR_CUSTOM_BAR_FG);
- if (CONFIG_INTEGER(config_look_hotlist_names_length) == 0)
- snprintf (format, sizeof (format) - 1, "%%s");
+ numbers_count++;
+ sprintf (buf + strlen (buf), "%d", ptr_hotlist->buffer->number);
+
+ if (display_name)
+ {
+ names_count++;
+
+ strcat (buf, GUI_COLOR_CUSTOM_BAR_DELIM);
+ strcat (buf, ":");
+ strcat (buf, GUI_COLOR_CUSTOM_BAR_FG);
+ if (CONFIG_INTEGER(config_look_hotlist_names_length) == 0)
+ snprintf (format, sizeof (format) - 1, "%%s");
+ else
+ snprintf (format, sizeof (format) - 1,
+ "%%.%ds",
+ CONFIG_INTEGER(config_look_hotlist_names_length));
+ sprintf (buf + strlen (buf), format,
+ (CONFIG_BOOLEAN(config_look_hotlist_short_names)) ?
+ ptr_hotlist->buffer->short_name : ptr_hotlist->buffer->name);
+ }
else
- snprintf (format, sizeof (format) - 1,
- "%%.%ds",
- CONFIG_INTEGER(config_look_hotlist_names_length));
- sprintf (buf + strlen (buf), format,
- (CONFIG_BOOLEAN(config_look_hotlist_short_names)) ?
- ptr_hotlist->buffer->short_name : ptr_hotlist->buffer->name);
+ {
+ if (buffer_without_name_displayed)
+ buffer_without_name_displayed[ptr_hotlist->buffer->number - 1] = 1;
+ }
+
+ if (strlen (buf) > sizeof (buf) - 32)
+ break;
}
-
- if (ptr_hotlist->next_hotlist)
- strcat (buf, ",");
-
- if (strlen (buf) > sizeof (buf) - 32)
- break;
}
+ if (buffer_without_name_displayed)
+ free (buffer_without_name_displayed);
+
return strdup (buf);
}