summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--po/cs.po4
-rw-r--r--po/de.po4
-rw-r--r--po/es.po4
-rw-r--r--po/fr.po12
-rw-r--r--po/hu.po4
-rw-r--r--po/it.po4
-rw-r--r--po/pl.po4
-rw-r--r--po/pt_BR.po4
-rw-r--r--po/ru.po4
-rw-r--r--po/weechat.pot4
-rw-r--r--src/core/wee-config.c2
-rw-r--r--src/gui/curses/gui-curses-color.c147
12 files changed, 87 insertions, 110 deletions
diff --git a/po/cs.po b/po/cs.po
index 4a43bc3f0..2422dce92 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-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-11-06 11:55+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1766,7 +1766,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, fuzzy, c-format
diff --git a/po/de.po b/po/de.po
index 09e85f0d9..0056d7543 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.3-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-12-07 23:21+0100\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1825,7 +1825,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, fuzzy, c-format
diff --git a/po/es.po b/po/es.po
index 4161cdea0..25627dcea 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-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-11-06 11:56+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1779,7 +1779,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, fuzzy, c-format
diff --git a/po/fr.po b/po/fr.po
index 7dd59334a..e03a88d48 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-12-20 12:52+0100\n"
-"PO-Revision-Date: 2010-12-20 12:15+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
+"PO-Revision-Date: 2010-12-21 09:22+0100\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -1795,12 +1795,8 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
-msgstr ""
-"couleur personnalisée dans la palette, le format est: \"alias;fg,bg;r/g/b\" "
-"où alias est le nom de la couleur, fg,bg est \"texte,fond\" (par exemple: "
-"\"200,-1\"), r/g/b est la redéfinition de la couleur (le terminal doit le "
-"supporter) (tout est optionnel dans ce format)"
+"in this format and order is not important)"
+msgstr "couleur personnalisée dans la palette, le format est: \"alias;fg,bg;r/g/b\" où alias est le nom de la couleur, fg,bg est \"texte,fond\" (par exemple: \"200,-1\"), r/g/b est la redéfinition de la couleur (le terminal doit le supporter) (tout est optionnel dans ce format et l'ordre n'est pas important)"
#, c-format
msgid "%sError: palette option must be numeric"
diff --git a/po/hu.po b/po/hu.po
index 7d1d4941d..c78f6f4c1 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-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-11-05 17:17+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1589,7 +1589,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, fuzzy, c-format
diff --git a/po/it.po b/po/it.po
index 04900e2f3..fa1c3413f 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-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-12-10 14:11+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1786,7 +1786,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, fuzzy, c-format
diff --git a/po/pl.po b/po/pl.po
index 101b68d2b..70aaa099f 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-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-11-06 11:56+0100\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1787,7 +1787,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, fuzzy, c-format
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 3e3f5fb15..79ebd103d 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.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-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-11-13 09:26+0100\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1420,7 +1420,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, fuzzy, c-format
diff --git a/po/ru.po b/po/ru.po
index af19617ee..73604cc63 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-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-11-05 17:17+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1598,7 +1598,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, fuzzy, c-format
diff --git a/po/weechat.pot b/po/weechat.pot
index 30b7743e8..b0abc16ad 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-12-20 12:52+0100\n"
+"POT-Creation-Date: 2010-12-21 09:22+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"
@@ -1359,7 +1359,7 @@ msgid ""
"custom color in palette, format is: \"alias;fg,bg;r/g/b\" where alias is "
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
-"in this format)"
+"in this format and order is not important)"
msgstr ""
#, c-format
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 5efd720f6..51c57fbcf 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -732,7 +732,7 @@ config_weechat_palette_create_option_cb (void *data,
"where alias is color name, fg,bg is \"foreground,background\" "
"(example: \"200,-1\"), r/g/b is redefinition of color "
"(terminal must support it) (everything is optional "
- "in this format)"),
+ "in this format and order is not important)"),
NULL, 0, 0, "", value, 0, NULL, NULL,
&config_weechat_palette_change_cb, NULL,
NULL, NULL);
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index ace7faf40..54a367b18 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -590,9 +590,9 @@ struct t_gui_color_palette *
gui_color_palette_new (int number, const char *value)
{
struct t_gui_color_palette *new_color_palette;
- char *pos_semicolon, *ptr_value, *pos, *pos2, *error1, *error2, *error3;
+ char **items, *pos, *pos2, *error1, *error2, *error3;
char *str_alias, *str_pair, *str_rgb, str_number[64];
- int fg, bg, r, g, b;
+ int num_items, i, fg, bg, r, g, b;
if (!value)
return NULL;
@@ -611,104 +611,85 @@ gui_color_palette_new (int number, const char *value)
str_pair = NULL;
str_rgb = NULL;
- pos_semicolon = strchr (value, ';');
- if (pos_semicolon)
+ items = string_split (value, ";", 0, 0, &num_items);
+ if (items)
{
- if (pos_semicolon > value)
+ for (i = 0; i < num_items; i++)
{
- str_alias = string_strndup (value, pos_semicolon - value);
- }
- ptr_value = pos_semicolon + 1;
- if (ptr_value[0])
- {
- pos_semicolon = strchr (ptr_value, ';');
- if (pos_semicolon)
+ pos = strchr (items[i], ',');
+ if (pos)
+ str_pair = items[i];
+ else
{
- if (pos_semicolon > ptr_value)
- {
- str_pair = string_strndup (ptr_value,
- pos_semicolon - ptr_value);
- }
- ptr_value = pos_semicolon + 1;
- if (ptr_value[0])
- {
- str_rgb = strdup (ptr_value);
- }
+ pos = strchr (items[i], '/');
+ if (pos)
+ str_rgb = items[i];
+ else
+ str_alias = items[i];
}
- else
- str_pair = strdup (ptr_value);
}
- }
- else if (value[0])
- {
- str_alias = strdup (value);
- }
-
- if (str_alias)
- {
- new_color_palette->alias = strdup (str_alias);
- }
- else
- {
- snprintf (str_number, sizeof (str_number), "%d", number);
- new_color_palette->alias = strdup (str_number);
- }
-
- if (str_pair)
- {
- pos = strchr (str_pair, ',');
- if (pos)
+
+ if (str_alias)
{
- pos[0] = '\0';
- error1 = NULL;
- fg = (int)strtol (str_pair, &error1, 10);
- error2 = NULL;
- bg = (int)strtol (pos + 1, &error2, 10);
- if (error1 && !error1[0] && error2 && !error2[0]
- && (fg >= -1) && (bg >= -1))
- {
- new_color_palette->foreground = fg;
- new_color_palette->background = bg;
- }
+ new_color_palette->alias = strdup (str_alias);
}
- }
-
- if (str_rgb)
- {
- pos = strchr (str_rgb, '/');
- if (pos)
+ else
+ {
+ snprintf (str_number, sizeof (str_number), "%d", number);
+ new_color_palette->alias = strdup (str_number);
+ }
+
+ if (str_pair)
{
- pos[0] = '\0';
- pos2 = strchr (pos + 1, '/');
- if (pos2)
+ pos = strchr (str_pair, ',');
+ if (pos)
{
- pos2[0] = '\0';
+ pos[0] = '\0';
error1 = NULL;
- r = (int)strtol (str_rgb, &error1, 10);
+ fg = (int)strtol (str_pair, &error1, 10);
error2 = NULL;
- g = (int)strtol (pos + 1, &error2, 10);
- error3 = NULL;
- b = (int)strtol (pos2 + 1, &error3, 10);
+ bg = (int)strtol (pos + 1, &error2, 10);
if (error1 && !error1[0] && error2 && !error2[0]
- && error3 && !error3[0]
- && (r >= 0) && (r <= 1000)
- && (g >= 0) && (g <= 1000)
- && (b >= 0) && (b <= 1000))
+ && (fg >= -1) && (bg >= -1))
+ {
+ new_color_palette->foreground = fg;
+ new_color_palette->background = bg;
+ }
+ }
+ }
+
+ if (str_rgb)
+ {
+ pos = strchr (str_rgb, '/');
+ if (pos)
+ {
+ pos[0] = '\0';
+ pos2 = strchr (pos + 1, '/');
+ if (pos2)
{
- new_color_palette->r = r;
- new_color_palette->g = g;
- new_color_palette->b = b;
+ pos2[0] = '\0';
+ error1 = NULL;
+ r = (int)strtol (str_rgb, &error1, 10);
+ error2 = NULL;
+ g = (int)strtol (pos + 1, &error2, 10);
+ error3 = NULL;
+ b = (int)strtol (pos2 + 1, &error3, 10);
+ if (error1 && !error1[0] && error2 && !error2[0]
+ && error3 && !error3[0]
+ && (r >= 0) && (r <= 1000)
+ && (g >= 0) && (g <= 1000)
+ && (b >= 0) && (b <= 1000))
+ {
+ new_color_palette->r = r;
+ new_color_palette->g = g;
+ new_color_palette->b = b;
+ }
}
}
}
+
+ string_free_split (items);
}
-
- if (str_alias)
- free (str_alias);
- if (str_pair)
- free (str_pair);
- if (str_rgb)
- free (str_rgb);
}
return new_color_palette;