1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 04:16:38 +02:00

/set command is now ok

This commit is contained in:
Sebastien Helleu
2004-01-24 20:17:01 +00:00
parent 8bcbc3dcae
commit 69cb87251e
24 changed files with 992 additions and 466 deletions
+1
View File
@@ -5,6 +5,7 @@ ChangeLog - 2004-01-24
Version 0.0.5 (under dev!):
* /set command to modify config options when WeeChat is running
* secured code to prevent buffer overflows and memory leaks
* fixed QUIT IRC command: now sent to all connected servers (not only current)
* new Perl script function to display message in info bar ("IRC::print_infobar")
+8 -6
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2004-01-18
TODO - 2004-01-24
Legend:
# done
@@ -17,9 +17,15 @@ v0.0.5:
# debug messages can be enabled via ./configure --enbale-debug option
+ Solaris version
* WeeChat commands:
# "/set" command: allow the user to set the WeeChat variables
under WeeChat without editing the config file (colors, time
format, etc)
* Interface:
+ internationalization (traduce WeeChat in many languages)
+ info bar
# info bar
# add clock
* Configuration:
+ add missing options for config file
@@ -46,9 +52,6 @@ Future versions:
nick/host connect to the given irc network
* WeeChat commands:
+ "/set" command: allow the user to set the WeeChat variables
under WeeChat without editing the config file (colours, time
format, etc)
- "/reload" command: reload the WeeChat's config file
- "/highlight" command: highlight a given word when it appears on
channels/privates
@@ -69,7 +72,6 @@ Future versions:
if WeeChat is running for long time, a lot of memory is used!)
- improve completion (for example complete command parameters when possible)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
- add clock (in status bar?)
- log chats to file
? Qt GUI
+2 -2
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.0.5-pre2, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.0.5-pre3, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.0.5-pre2])
AM_INIT_AUTOMAKE([weechat], [0.0.5-pre3])
# Checks for programs.
AC_PROG_CC
+81 -46
View File
@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.0.5-pre2\n"
"Project-Id-Version: WeeChat 0.0.5-pre3\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2004-01-24 03:16+0100\n"
"PO-Revision-Date: 2004-01-01 11:52+0100\n"
"POT-Creation-Date: 2004-01-24 20:57+0100\n"
"PO-Revision-Date: 2004-01-24 20:57+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -30,71 +30,76 @@ msgstr "%s impossible d'allouer un nouveau serveur\n"
msgid "%s error sending data to IRC server\n"
msgstr "%s erreur d'envoi de données au serveur IRC\n"
#: src/irc/irc-server.c:417
#: src/irc/irc-server.c:364 src/irc/irc-server.c:375 src/irc/irc-server.c:429
#, c-format
msgid "%s not enough memory for received IRC message\n"
msgstr "%s mémoire insuffisante pour un message IRC reçu\n"
#: src/irc/irc-server.c:436
#, c-format
msgid "%s unable to explode received buffer\n"
msgstr "%s impossible d'exploser le tampon de réception\n"
#: src/irc/irc-server.c:490
#: src/irc/irc-server.c:509
#, c-format
msgid "Command '%s' failed!\n"
msgstr "La commande '%s' a échoué !\n"
#: src/irc/irc-server.c:494
#: src/irc/irc-server.c:513
msgid "No command to execute!\n"
msgstr "Pas de commande à exécuter !\n"
#: src/irc/irc-server.c:498
#: src/irc/irc-server.c:517
#, c-format
msgid "Unknown command: cmd=%s, args=%s\n"
msgstr "Commande inconnue: cmd=%s, params=%s\n"
#: src/irc/irc-server.c:548
#: src/irc/irc-server.c:569
#, c-format
msgid "%s: connecting to %s:%d...\n"
msgstr "%s: connexion à %s:%d...\n"
#: src/irc/irc-server.c:550
#: src/irc/irc-server.c:571
#, c-format
msgid "connecting to server %s:%d...\n"
msgstr "connexion au serveur %s:%d...\n"
#: src/irc/irc-server.c:558
#: src/irc/irc-server.c:579
#, c-format
msgid "%s cannot create pipe\n"
msgstr "%s impossible de créer le pipe\n"
#: src/irc/irc-server.c:572
#: src/irc/irc-server.c:593
#, c-format
msgid "%s cannot set socket option \"SO_REUSEADDR\"\n"
msgstr "%s impossible de paramétrer l'option socket \"SO_REUSEADDR\"\n"
#: src/irc/irc-server.c:579
#: src/irc/irc-server.c:600
#, c-format
msgid "%s cannot set socket option \"SO_KEEPALIVE\"\n"
msgstr "%s impossible de paramétrer l'option socket \"SO_KEEPALIVE\"\n"
#: src/irc/irc-server.c:587
#: src/irc/irc-server.c:608
#, c-format
msgid "%s address \"%s\" not found\n"
msgstr "%s adresse \"%s\" introuvable\n"
#: src/irc/irc-server.c:610
#: src/irc/irc-server.c:631
#, c-format
msgid "%s IP address not found\n"
msgstr "%s adresse IP introuvable\n"
#: src/irc/irc-server.c:620
#: src/irc/irc-server.c:641
#, c-format
msgid "%s: server IP is: %s\n"
msgstr "%s: l'adresse IP du serveur est : %s\n"
#: src/irc/irc-server.c:626
#: src/irc/irc-server.c:647
#, c-format
msgid "%s cannot connect to irc server\n"
msgstr "%s connexion au serveur irc impossible\n"
#: src/irc/irc-server.c:676
#: src/irc/irc-server.c:697
msgid "Disconnected from server!\n"
msgstr "Déconnecté du serveur !\n"
@@ -1547,12 +1552,12 @@ msgstr "d
msgid "unloading all Perl scripts...\n"
msgstr "déchargement de tous les scripts Perl...\n"
#: src/plugins/plugins.c:87
#: src/plugins/plugins.c:89
#, c-format
msgid "auto-loading %s script: %s%s%s\n"
msgstr "chargement automatique du script %s : %s%s%s\n"
#: src/plugins/plugins.c:193
#: src/plugins/plugins.c:195
#, c-format
msgid "%s unable to add handler for \"%s\" message (not enough memory)\n"
msgstr ""
@@ -1567,7 +1572,7 @@ msgstr "[non connect
msgid "-MORE-"
msgstr "-PLUS-"
#: src/gui/gtk/gui-display.c:647
#: src/gui/gtk/gui-display.c:657
msgid "server"
msgstr "serveur"
@@ -2069,16 +2074,46 @@ msgstr "cr
msgid "%s unable to create server\n"
msgstr "%s impossible de créer le serveur\n"
#: src/common/command.c:1529
#: src/common/command.c:1490
#, c-format
msgid "%s option '%s' can not be changed while WeeChat is running\n"
msgstr "%s l'option '%s' ne peut pas être changée lorsque WeeChat tourne\n"
#: src/common/command.c:1502
#, c-format
msgid "%s incorrect value for option '%s'\n"
msgstr "%s valeur incorrecte pour l'option '%s'\n"
#: src/common/command.c:1508
#, c-format
msgid "%s config option '%s' not found\n"
msgstr "%s option de configuration '%s' non trouvée\n"
#: src/common/command.c:1558
msgid "(unknown)"
msgstr "(inconnu)"
#: src/common/command.c:1562
#: src/common/command.c:1578 src/common/command.c:1581
#, c-format
msgid "No config option found with '%s'\n"
msgstr "Aucune option de configuration trouvée avec '%s'\n"
#: src/common/command.c:1586
#, c-format
msgid "%d config option(s) found with '%s'\n"
msgstr "%d option(s) de configuration trouvées avec '%s'\n"
#: src/common/command.c:1589
#, c-format
msgid "%d config option(s) found\n"
msgstr "%d option(s) de configuration trouvées\n"
#: src/common/command.c:1609
#, c-format
msgid "%s alias or command \"%s\" not found\n"
msgstr "%s alias ou commande \"%s\" non trouvé\n"
#: src/common/command.c:1571
#: src/common/command.c:1618
#, c-format
msgid "Alias \"%s\" removed\n"
msgstr "Alias \"%s\" supprimé\n"
@@ -2209,10 +2244,10 @@ msgid " Warning:"
msgstr " Attention:"
#: src/common/weeconfig.c:81 src/common/weeconfig.c:82
msgid "set title for terminal window (curses GUI) with name & version"
msgid "set title for window (terminal for Curses GUI) with name & version"
msgstr ""
"définit le titre de la fenêtre de terminal (GUI curses) avec le nom et la "
"version"
"définit le titre de la fenêtre (terminal pour l'interface Curses) avec le "
"nom et la version"
#: src/common/weeconfig.c:85 src/common/weeconfig.c:86
msgid "display WeeChat logo at startup"
@@ -2800,57 +2835,57 @@ msgstr ""
"liste des canaux (séparés par des virgules) à rejoindre lorsque connecté au "
"serveur"
#: src/common/weeconfig.c:663
#: src/common/weeconfig.c:757
#, c-format
msgid "%s %s, line %d: new server, but previous was incomplete\n"
msgstr "%s %s, ligne %d: nouveau serveur, mais le précédent était incomplet\n"
#: src/common/weeconfig.c:672
#: src/common/weeconfig.c:766
#, c-format
msgid "%s %s, line %d: server '%s' already exists\n"
msgstr "%s %s, ligne %d: le serveur '%s' existe déjà\n"
#: src/common/weeconfig.c:684
#: src/common/weeconfig.c:778
#, c-format
msgid "%s %s, line %d: unable to create server\n"
msgstr "%s %s, ligne %d: impossible de créer le serveur\n"
#: src/common/weeconfig.c:723
#: src/common/weeconfig.c:817
#, c-format
msgid "%s unable to assign default int with string (\"%s\")\n"
msgstr "%s impossible d'assigner la valeur entière avec la chaîne (\"%s\")\n"
#: src/common/weeconfig.c:734
#: src/common/weeconfig.c:828
#, c-format
msgid "%s unable to assign default color (\"%s\")\n"
msgstr "%s impossible d'assigner la couleur par défaut (\"%s\")\n"
#: src/common/weeconfig.c:773
#: src/common/weeconfig.c:867
#, c-format
msgid "%s config file \"%s\" not found.\n"
msgstr "%s fichier de configuration \"%s\" non trouvé.\n"
#: src/common/weeconfig.c:805
#: src/common/weeconfig.c:899
#, c-format
msgid "%s %s, line %d: invalid syntax, missing \"]\"\n"
msgstr "%s %s, ligne %d: syntaxe invalide, il manque \"]\"\n"
#: src/common/weeconfig.c:822
#: src/common/weeconfig.c:916
#, c-format
msgid "%s %s, line %d: unknown section identifier (\"%s\")\n"
msgstr "%s %s, ligne %d: section inconnue (\"%s\")\n"
#: src/common/weeconfig.c:840
#: src/common/weeconfig.c:934
#, c-format
msgid "%s %s, line %d: invalid syntax, missing \"=\"\n"
msgstr "%s %s, ligne %d: syntaxe invalide, il manque \"=\"\n"
#: src/common/weeconfig.c:874
#: src/common/weeconfig.c:968
#, c-format
msgid "%s %s, line %d: invalid option \"%s\"\n"
msgstr "%s %s, ligne %d: option \"%s\" invalide\n"
#: src/common/weeconfig.c:885
#: src/common/weeconfig.c:979
#, c-format
msgid ""
"%s %s, line %d: invalid value foroption '%s'\n"
@@ -2859,7 +2894,7 @@ msgstr ""
"%s %s, ligne %d: valeur invalide pour l'option '%s'\n"
"Attendu: valeur booléenne: 'off' ou 'on'\n"
#: src/common/weeconfig.c:894
#: src/common/weeconfig.c:988
#, c-format
msgid ""
"%s %s, line %d: invalid value for option '%s'\n"
@@ -2868,7 +2903,7 @@ msgstr ""
"%s %s, ligne %d: valeur invalide pour l'option '%s'\n"
"Attendu: entier compris entre %d et %d\n"
#: src/common/weeconfig.c:905
#: src/common/weeconfig.c:999
#, c-format
msgid ""
"%s %s, line %d: invalid value for option '%s'\n"
@@ -2877,26 +2912,26 @@ msgstr ""
"%s %s, ligne %d: valeur invalide pour l'option '%s'\n"
"Attendu: une de ces chaînes: "
#: src/common/weeconfig.c:921
#: src/common/weeconfig.c:1015
#, c-format
msgid "%s %s, line %d: invalid color name for option '%s'\n"
msgstr "%s %s, ligne %d: nom de couleur invalide pour l'option '%s'\n"
#: src/common/weeconfig.c:980 src/common/weeconfig.c:1147
#: src/common/weeconfig.c:1074 src/common/weeconfig.c:1241
#, c-format
msgid "%s cannot create file \"%s\"\n"
msgstr "%s impossible de créer le fichier \"%s\"\n"
#: src/common/weeconfig.c:986
#: src/common/weeconfig.c:1080
#, c-format
msgid "%s: creating default config file...\n"
msgstr "%s: création du fichier de configuration par défaut...\n"
#: src/common/weeconfig.c:987
#: src/common/weeconfig.c:1081
msgid "creating default config file\n"
msgstr "création du fichier de configuration par défaut\n"
#: src/common/weeconfig.c:990 src/common/weeconfig.c:1156
#: src/common/weeconfig.c:1084 src/common/weeconfig.c:1250
#, c-format
msgid ""
"#\n"
@@ -2905,10 +2940,10 @@ msgstr ""
"#\n"
"# %s: fichier de configuration, créé par %s v%s le %s#\n"
#: src/common/weeconfig.c:1098
#: src/common/weeconfig.c:1192
msgid "Unable to get user's name"
msgstr "Impossible de déterminer le nom d'utilisateur"
#: src/common/weeconfig.c:1153
#: src/common/weeconfig.c:1247
msgid "saving config to disk\n"
msgstr "sauvegarde de la configuration sur disque\n"
+77 -42
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2004-01-24 03:16+0100\n"
"POT-Creation-Date: 2004-01-24 20:57+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"
@@ -30,71 +30,76 @@ msgstr ""
msgid "%s error sending data to IRC server\n"
msgstr ""
#: src/irc/irc-server.c:417
#: src/irc/irc-server.c:364 src/irc/irc-server.c:375 src/irc/irc-server.c:429
#, c-format
msgid "%s not enough memory for received IRC message\n"
msgstr ""
#: src/irc/irc-server.c:436
#, c-format
msgid "%s unable to explode received buffer\n"
msgstr ""
#: src/irc/irc-server.c:490
#: src/irc/irc-server.c:509
#, c-format
msgid "Command '%s' failed!\n"
msgstr ""
#: src/irc/irc-server.c:494
#: src/irc/irc-server.c:513
msgid "No command to execute!\n"
msgstr ""
#: src/irc/irc-server.c:498
#: src/irc/irc-server.c:517
#, c-format
msgid "Unknown command: cmd=%s, args=%s\n"
msgstr ""
#: src/irc/irc-server.c:548
#: src/irc/irc-server.c:569
#, c-format
msgid "%s: connecting to %s:%d...\n"
msgstr ""
#: src/irc/irc-server.c:550
#: src/irc/irc-server.c:571
#, c-format
msgid "connecting to server %s:%d...\n"
msgstr ""
#: src/irc/irc-server.c:558
#: src/irc/irc-server.c:579
#, c-format
msgid "%s cannot create pipe\n"
msgstr ""
#: src/irc/irc-server.c:572
#: src/irc/irc-server.c:593
#, c-format
msgid "%s cannot set socket option \"SO_REUSEADDR\"\n"
msgstr ""
#: src/irc/irc-server.c:579
#: src/irc/irc-server.c:600
#, c-format
msgid "%s cannot set socket option \"SO_KEEPALIVE\"\n"
msgstr ""
#: src/irc/irc-server.c:587
#: src/irc/irc-server.c:608
#, c-format
msgid "%s address \"%s\" not found\n"
msgstr ""
#: src/irc/irc-server.c:610
#: src/irc/irc-server.c:631
#, c-format
msgid "%s IP address not found\n"
msgstr ""
#: src/irc/irc-server.c:620
#: src/irc/irc-server.c:641
#, c-format
msgid "%s: server IP is: %s\n"
msgstr ""
#: src/irc/irc-server.c:626
#: src/irc/irc-server.c:647
#, c-format
msgid "%s cannot connect to irc server\n"
msgstr ""
#: src/irc/irc-server.c:676
#: src/irc/irc-server.c:697
msgid "Disconnected from server!\n"
msgstr ""
@@ -1445,12 +1450,12 @@ msgstr ""
msgid "unloading all Perl scripts...\n"
msgstr ""
#: src/plugins/plugins.c:87
#: src/plugins/plugins.c:89
#, c-format
msgid "auto-loading %s script: %s%s%s\n"
msgstr ""
#: src/plugins/plugins.c:193
#: src/plugins/plugins.c:195
#, c-format
msgid "%s unable to add handler for \"%s\" message (not enough memory)\n"
msgstr ""
@@ -1463,7 +1468,7 @@ msgstr ""
msgid "-MORE-"
msgstr ""
#: src/gui/gtk/gui-display.c:647
#: src/gui/gtk/gui-display.c:657
msgid "server"
msgstr ""
@@ -1935,16 +1940,46 @@ msgstr ""
msgid "%s unable to create server\n"
msgstr ""
#: src/common/command.c:1529
#: src/common/command.c:1490
#, c-format
msgid "%s option '%s' can not be changed while WeeChat is running\n"
msgstr ""
#: src/common/command.c:1502
#, c-format
msgid "%s incorrect value for option '%s'\n"
msgstr ""
#: src/common/command.c:1508
#, c-format
msgid "%s config option '%s' not found\n"
msgstr ""
#: src/common/command.c:1558
msgid "(unknown)"
msgstr ""
#: src/common/command.c:1562
#: src/common/command.c:1578 src/common/command.c:1581
#, c-format
msgid "No config option found with '%s'\n"
msgstr ""
#: src/common/command.c:1586
#, c-format
msgid "%d config option(s) found with '%s'\n"
msgstr ""
#: src/common/command.c:1589
#, c-format
msgid "%d config option(s) found\n"
msgstr ""
#: src/common/command.c:1609
#, c-format
msgid "%s alias or command \"%s\" not found\n"
msgstr ""
#: src/common/command.c:1571
#: src/common/command.c:1618
#, c-format
msgid "Alias \"%s\" removed\n"
msgstr ""
@@ -2067,7 +2102,7 @@ msgid " Warning:"
msgstr ""
#: src/common/weeconfig.c:81 src/common/weeconfig.c:82
msgid "set title for terminal window (curses GUI) with name & version"
msgid "set title for window (terminal for Curses GUI) with name & version"
msgstr ""
#: src/common/weeconfig.c:85 src/common/weeconfig.c:86
@@ -2615,107 +2650,107 @@ msgstr ""
msgid "comma separated list of channels to join when connected to server"
msgstr ""
#: src/common/weeconfig.c:663
#: src/common/weeconfig.c:757
#, c-format
msgid "%s %s, line %d: new server, but previous was incomplete\n"
msgstr ""
#: src/common/weeconfig.c:672
#: src/common/weeconfig.c:766
#, c-format
msgid "%s %s, line %d: server '%s' already exists\n"
msgstr ""
#: src/common/weeconfig.c:684
#: src/common/weeconfig.c:778
#, c-format
msgid "%s %s, line %d: unable to create server\n"
msgstr ""
#: src/common/weeconfig.c:723
#: src/common/weeconfig.c:817
#, c-format
msgid "%s unable to assign default int with string (\"%s\")\n"
msgstr ""
#: src/common/weeconfig.c:734
#: src/common/weeconfig.c:828
#, c-format
msgid "%s unable to assign default color (\"%s\")\n"
msgstr ""
#: src/common/weeconfig.c:773
#: src/common/weeconfig.c:867
#, c-format
msgid "%s config file \"%s\" not found.\n"
msgstr ""
#: src/common/weeconfig.c:805
#: src/common/weeconfig.c:899
#, c-format
msgid "%s %s, line %d: invalid syntax, missing \"]\"\n"
msgstr ""
#: src/common/weeconfig.c:822
#: src/common/weeconfig.c:916
#, c-format
msgid "%s %s, line %d: unknown section identifier (\"%s\")\n"
msgstr ""
#: src/common/weeconfig.c:840
#: src/common/weeconfig.c:934
#, c-format
msgid "%s %s, line %d: invalid syntax, missing \"=\"\n"
msgstr ""
#: src/common/weeconfig.c:874
#: src/common/weeconfig.c:968
#, c-format
msgid "%s %s, line %d: invalid option \"%s\"\n"
msgstr ""
#: src/common/weeconfig.c:885
#: src/common/weeconfig.c:979
#, c-format
msgid ""
"%s %s, line %d: invalid value foroption '%s'\n"
"Expected: boolean value: 'off' or 'on'\n"
msgstr ""
#: src/common/weeconfig.c:894
#: src/common/weeconfig.c:988
#, c-format
msgid ""
"%s %s, line %d: invalid value for option '%s'\n"
"Expected: integer between %d and %d\n"
msgstr ""
#: src/common/weeconfig.c:905
#: src/common/weeconfig.c:999
#, c-format
msgid ""
"%s %s, line %d: invalid value for option '%s'\n"
"Expected: one of these strings: "
msgstr ""
#: src/common/weeconfig.c:921
#: src/common/weeconfig.c:1015
#, c-format
msgid "%s %s, line %d: invalid color name for option '%s'\n"
msgstr ""
#: src/common/weeconfig.c:980 src/common/weeconfig.c:1147
#: src/common/weeconfig.c:1074 src/common/weeconfig.c:1241
#, c-format
msgid "%s cannot create file \"%s\"\n"
msgstr ""
#: src/common/weeconfig.c:986
#: src/common/weeconfig.c:1080
#, c-format
msgid "%s: creating default config file...\n"
msgstr ""
#: src/common/weeconfig.c:987
#: src/common/weeconfig.c:1081
msgid "creating default config file\n"
msgstr ""
#: src/common/weeconfig.c:990 src/common/weeconfig.c:1156
#: src/common/weeconfig.c:1084 src/common/weeconfig.c:1250
#, c-format
msgid ""
"#\n"
"# %s configuration file, created by %s v%s on %s#\n"
msgstr ""
#: src/common/weeconfig.c:1098
#: src/common/weeconfig.c:1192
msgid "Unable to get user's name"
msgstr ""
#: src/common/weeconfig.c:1153
#: src/common/weeconfig.c:1247
msgid "saving config to disk\n"
msgstr ""
+83 -36
View File
@@ -84,7 +84,7 @@ t_weechat_command weechat_commands[] =
0, 1, weechat_cmd_save, NULL },
{ "set", N_("set config parameters"),
N_("[option [value]]"), N_("option: name of an option\nvalue: value for option"),
0, 2, NULL, weechat_cmd_set },
0, MAX_ARGS, NULL, weechat_cmd_set },
{ "unalias", N_("remove an alias"),
N_("alias_name"), N_("alias_name: name of alias to remove"),
1, 1, NULL, weechat_cmd_unalias },
@@ -1461,6 +1461,8 @@ weechat_cmd_set (char *arguments)
char *option, *value;
int i, j, section_displayed;
char *color_name;
t_config_option *ptr_option;
int number_found;
option = NULL;
value = NULL;
@@ -1479,10 +1481,37 @@ weechat_cmd_set (char *arguments)
if (value && value[0])
{
gui_printf (NULL, "TODO: set value!\n");
ptr_option = config_option_search (option);
if (ptr_option)
{
if (ptr_option->handler_change == NULL)
{
gui_printf (NULL,
_("%s option '%s' can not be changed while WeeChat is running\n"),
WEECHAT_ERROR, option);
}
else
{
if (config_option_set_value (ptr_option, value) == 0)
{
(void) (ptr_option->handler_change());
gui_printf (NULL, "[%s]\n", config_get_section (ptr_option));
gui_printf (NULL, " %s = %s\n", option, value);
}
else
gui_printf (NULL, _("%s incorrect value for option '%s'\n"),
WEECHAT_ERROR, option);
}
}
else
{
gui_printf (NULL, _("%s config option '%s' not found\n"),
WEECHAT_ERROR, option);
}
}
else
{
number_found = 0;
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
section_displayed = 0;
@@ -1503,45 +1532,63 @@ weechat_cmd_set (char *arguments)
}
switch (weechat_options[i][j].option_type)
{
case OPTION_TYPE_BOOLEAN:
gui_printf (NULL, " %s = %s\n",
weechat_options[i][j].option_name,
(*weechat_options[i][j].ptr_int) ?
"ON" : "OFF");
break;
case OPTION_TYPE_INT:
gui_printf (NULL,
" %s = %d\n",
weechat_options[i][j].option_name,
*weechat_options[i][j].ptr_int);
break;
case OPTION_TYPE_INT_WITH_STRING:
gui_printf (NULL,
" %s = %s\n",
weechat_options[i][j].option_name,
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int]);
break;
case OPTION_TYPE_COLOR:
color_name = gui_get_color_by_value (*weechat_options[i][j].ptr_int);
gui_printf (NULL,
" %s = %s\n",
weechat_options[i][j].option_name,
(color_name) ? color_name : _("(unknown)"));
break;
case OPTION_TYPE_STRING:
gui_printf (NULL, " %s = %s\n",
weechat_options[i][j].
option_name,
(*weechat_options[i][j].
ptr_string) ?
*weechat_options[i][j].
ptr_string : "");
break;
case OPTION_TYPE_BOOLEAN:
gui_printf (NULL, " %s = %s\n",
weechat_options[i][j].option_name,
(*weechat_options[i][j].ptr_int) ?
"ON" : "OFF");
break;
case OPTION_TYPE_INT:
gui_printf (NULL,
" %s = %d\n",
weechat_options[i][j].option_name,
*weechat_options[i][j].ptr_int);
break;
case OPTION_TYPE_INT_WITH_STRING:
gui_printf (NULL,
" %s = %s\n",
weechat_options[i][j].option_name,
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int]);
break;
case OPTION_TYPE_COLOR:
color_name = gui_get_color_by_value (*weechat_options[i][j].ptr_int);
gui_printf (NULL,
" %s = %s\n",
weechat_options[i][j].option_name,
(color_name) ? color_name : _("(unknown)"));
break;
case OPTION_TYPE_STRING:
gui_printf (NULL, " %s = %s\n",
weechat_options[i][j].
option_name,
(*weechat_options[i][j].
ptr_string) ?
*weechat_options[i][j].
ptr_string : "");
break;
}
number_found++;
}
}
}
}
if (number_found == 0)
{
if (value)
gui_printf (NULL, _("No config option found with '%s'\n"),
value);
else
gui_printf (NULL, _("No config option found with '%s'\n"));
}
else
{
if (value)
gui_printf (NULL, _("%d config option(s) found with '%s'\n"),
number_found, value);
else
gui_printf (NULL, _("%d config option(s) found\n"),
number_found);
}
}
return 0;
}
+157 -63
View File
@@ -78,81 +78,81 @@ char *cfg_look_infobar_timestamp;
int cfg_look_infobar_delay_highlight;
t_config_option weechat_options_look[] =
{ { "look_set_title", N_("set title for terminal window (curses GUI) with name & version"),
N_("set title for terminal window (curses GUI) with name & version"),
{ { "look_set_title", N_("set title for window (terminal for Curses GUI) with name & version"),
N_("set title for window (terminal for Curses GUI) with name & version"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_set_title, NULL, NULL },
NULL, NULL, &cfg_look_set_title, NULL, config_change_title },
{ "look_startup_logo", N_("display WeeChat logo at startup"),
N_("display WeeChat logo at startup"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_startup_logo, NULL, NULL },
NULL, NULL, &cfg_look_startup_logo, NULL, config_change_noop },
{ "look_startup_version", N_("display WeeChat version at startup"),
N_("display WeeChat version at startup"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_startup_version, NULL, NULL },
NULL, NULL, &cfg_look_startup_version, NULL, config_change_noop },
{ "look_weechat_slogan", N_("WeeChat slogan"),
N_("WeeChat slogan (if empty, slogan is not used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"the geekest IRC client!", NULL, NULL, &cfg_look_weechat_slogan, NULL },
"the geekest IRC client!", NULL, NULL, &cfg_look_weechat_slogan, config_change_noop },
{ "look_color_nicks", N_("display nick names with different colors"),
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_color_nicks, NULL, NULL },
NULL, NULL, &cfg_look_color_nicks, NULL, config_change_noop },
{ "look_color_actions", N_("display actions with different colors"),
N_("display actions with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_color_actions, NULL, NULL },
NULL, NULL, &cfg_look_color_actions, NULL, config_change_noop },
{ "look_remove_colors_from_msgs", N_("remove colors from incoming messages"),
N_("remove colors from incoming messages"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_remove_colors_from_msgs, NULL, NULL },
NULL, NULL, &cfg_look_remove_colors_from_msgs, NULL, config_change_noop },
{ "look_nicklist", N_("display nicklist window"),
N_("display nicklist window (for channel windows)"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_nicklist, NULL, NULL },
NULL, NULL, &cfg_look_nicklist, NULL, config_change_windows },
{ "look_nicklist_position", N_("nicklist position"),
N_("nicklist position (top, left, right (default), bottom)"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"right", cfg_look_nicklist_position_values, &cfg_look_nicklist_position, NULL, NULL },
"right", cfg_look_nicklist_position_values, &cfg_look_nicklist_position, NULL, config_change_windows },
{ "look_nicklist_min_size", N_("min size for nicklist"),
N_("min size for nicklist (width or height, depending on look_nicklist_position "
"(0 = no min size))"),
OPTION_TYPE_INT, 0, 100, 0,
NULL, NULL, &cfg_look_nicklist_min_size, NULL, NULL },
NULL, NULL, &cfg_look_nicklist_min_size, NULL, config_change_windows },
{ "look_nicklist_max_size", N_("max size for nicklist"),
N_("max size for nicklist (width or height, depending on look_nicklist_position "
"(0 = no max size; if min == max and > 0, then size is fixed))"),
OPTION_TYPE_INT, 0, 100, 0,
NULL, NULL, &cfg_look_nicklist_max_size, NULL, NULL },
NULL, NULL, &cfg_look_nicklist_max_size, NULL, config_change_windows },
{ "look_no_nickname", N_("text to display instead of nick when not connected"),
N_("text to display instead of nick when not connected"),
OPTION_TYPE_STRING, 0, 0, 0,
"-cmd-", NULL, NULL, &cfg_look_no_nickname, NULL },
"-cmd-", NULL, NULL, &cfg_look_no_nickname, config_change_window_content },
{ "look_nickmode", N_("display nick mode ((half)op/voice) before each nick"),
N_("display nick mode ((half)op/voice) before each nick"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_nickmode, NULL, NULL },
NULL, NULL, &cfg_look_nickmode, NULL, config_change_windows },
{ "look_nickmode_empty", N_("display space if nick mode is not (half)op/voice"),
N_("display space if nick mode is not (half)op/voice"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_nickmode_empty, NULL, NULL },
NULL, NULL, &cfg_look_nickmode_empty, NULL, config_change_windows },
{ "look_nick_completor", N_("the string inserted after nick completion"),
N_("the string inserted after nick completion"),
OPTION_TYPE_STRING, 0, 0, 0,
":", NULL, NULL, &cfg_look_completor, NULL },
":", NULL, NULL, &cfg_look_completor, config_change_noop },
{ "look_infobar", N_("enable info bar"),
N_("enable info bar"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_infobar, NULL, NULL },
NULL, NULL, &cfg_look_infobar, NULL, config_change_windows },
{ "look_infobar_timestamp", N_("timestamp for time in infobar"),
N_("timestamp for time in infobar"),
OPTION_TYPE_STRING, 0, 0, 0,
"%B, %A %d %G - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, NULL },
"%B, %A %d %G - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, config_change_window_content },
{ "look_infobar_delay_highlight", N_("delay (in seconds) for highlight messages in infobar"),
N_("delay (in seconds) for highlight messages in infobar "
"(0 = disable highlight notifications in infobar)"),
OPTION_TYPE_INT, 0, INT_MAX, 7,
NULL, NULL, &cfg_look_infobar_delay_highlight, NULL, NULL },
NULL, NULL, &cfg_look_infobar_delay_highlight, NULL, config_change_noop },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -198,149 +198,149 @@ t_config_option weechat_options_colors[] =
{ "col_title", N_("color for title bar"),
N_("color for title bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_title, NULL, NULL },
"gray", NULL, &cfg_col_title, NULL, &config_change_color },
{ "col_title_bg", N_("background for title bar"),
N_("background for title bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
"blue", NULL, &cfg_col_title_bg, NULL, NULL },
"blue", NULL, &cfg_col_title_bg, NULL, &config_change_color },
/* chat window */
{ "col_chat", N_("color for chat text"),
N_("color for chat text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_chat, NULL, NULL },
"gray", NULL, &cfg_col_chat, NULL, &config_change_color },
{ "col_chat_time", N_("color for time"),
N_("color for time in chat window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_chat_time, NULL, NULL },
"gray", NULL, &cfg_col_chat_time, NULL, &config_change_color },
{ "col_chat_time_sep", N_("color for time separator"),
N_("color for time separator (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"brown", NULL, &cfg_col_chat_time_sep, NULL, NULL },
"brown", NULL, &cfg_col_chat_time_sep, NULL, &config_change_color },
{ "col_chat_prefix1", N_("color for 1st and 3rd char of prefix"),
N_("color for 1st and 3rd char of prefix"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightcyan", NULL, &cfg_col_chat_prefix1, NULL, NULL },
"lightcyan", NULL, &cfg_col_chat_prefix1, NULL, &config_change_color },
{ "col_chat_prefix2", N_("color for middle char of prefix"),
N_("color for middle char of prefix"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_chat_prefix2, NULL, NULL },
"white", NULL, &cfg_col_chat_prefix2, NULL, &config_change_color },
{ "col_chat_nick", N_("color for nicks in actions"),
N_("color for nicks in actions (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightcyan", NULL, &cfg_col_chat_nick, NULL, NULL },
"lightcyan", NULL, &cfg_col_chat_nick, NULL, &config_change_color },
{ "col_chat_host", N_("color for hostnames"),
N_("color for hostnames (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_chat_host, NULL, NULL },
"cyan", NULL, &cfg_col_chat_host, NULL, &config_change_color },
{ "col_chat_channel", N_("color for channel names in actions"),
N_("color for channel names in actions (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_chat_channel, NULL, NULL },
"white", NULL, &cfg_col_chat_channel, NULL, &config_change_color },
{ "col_chat_dark", N_("color for dark separators"),
N_("color for dark separators (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"green", NULL, &cfg_col_chat_dark, NULL, NULL },
"green", NULL, &cfg_col_chat_dark, NULL, &config_change_color },
{ "col_chat_highlight", N_("color for highlighted nick"),
N_("color for highlighted nick (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_chat_highlight, NULL, NULL },
"yellow", NULL, &cfg_col_chat_highlight, NULL, &config_change_color },
{ "col_chat_bg", N_("background for chat"),
N_("background for chat window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_chat_bg, NULL, NULL },
"default", NULL, &cfg_col_chat_bg, NULL, &config_change_color },
/* status window */
{ "col_status", N_("color for status bar"),
N_("color for status bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_status, NULL, NULL },
"gray", NULL, &cfg_col_status, NULL, &config_change_color },
{ "col_status_active", N_("color for active window"),
N_("color for active window (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_status_active, NULL, NULL },
"yellow", NULL, &cfg_col_status_active, NULL, &config_change_color },
{ "col_status_data_msg", N_("color for window with new messages"),
N_("color for window with new messages (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightred", NULL, &cfg_col_status_data_msg, NULL, NULL },
"lightred", NULL, &cfg_col_status_data_msg, NULL, &config_change_color },
{ "col_status_data_other", N_("color for window with new data (not messages)"),
N_("color for window with new data (not messages) (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_status_data_other, NULL, NULL },
"lightmagenta", NULL, &cfg_col_status_data_other, NULL, &config_change_color },
{ "col_status_more", N_("color for \"*MORE*\" text"),
N_("color for window with new data (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_status_more, NULL, NULL },
"white", NULL, &cfg_col_status_more, NULL, &config_change_color },
{ "col_status_bg", N_("background for status window"),
N_("background for status window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"blue", NULL, &cfg_col_status_bg, NULL, NULL },
"blue", NULL, &cfg_col_status_bg, NULL, &config_change_color },
/* infobar window */
{ "col_infobar", N_("color for info bar text"),
N_("color for info bar text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"black", NULL, &cfg_col_infobar, NULL, NULL },
"black", NULL, &cfg_col_infobar, NULL, &config_change_color },
{ "col_infobar_highlight", N_("color for info bar highlight notification"),
N_("color for info bar highlight notification"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_infobar_highlight, NULL, NULL },
"white", NULL, &cfg_col_infobar_highlight, NULL, &config_change_color },
{ "col_infobar_bg", N_("background for info bar window"),
N_("background for info bar window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_infobar_bg, NULL, NULL },
"cyan", NULL, &cfg_col_infobar_bg, NULL, &config_change_color },
/* input window */
{ "col_input", N_("color for input text"),
N_("color for input text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_input, NULL, NULL },
"gray", NULL, &cfg_col_input, NULL, &config_change_color },
{ "col_input_channel", N_("color for input text (channel name)"),
N_("color for input text (channel name)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_input_channel, NULL, NULL },
"white", NULL, &cfg_col_input_channel, NULL, &config_change_color },
{ "col_input_nick", N_("color for input text (nick name)"),
N_("color for input text (nick name)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_input_nick, NULL, NULL },
"lightgreen", NULL, &cfg_col_input_nick, NULL, &config_change_color },
{ "col_input_bg", N_("background for input window"),
N_("background for input window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_input_bg, NULL, NULL },
"default", NULL, &cfg_col_input_bg, NULL, &config_change_color },
/* nick window */
{ "col_nick", N_("color for nicknames"),
N_("color for nicknames"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_nick, NULL, NULL },
"gray", NULL, &cfg_col_nick, NULL, &config_change_color },
{ "col_nick_op", N_("color for operator symbol"),
N_("color for operator symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_nick_op, NULL, NULL },
"lightgreen", NULL, &cfg_col_nick_op, NULL, &config_change_color },
{ "col_nick_halfop", N_("color for half-operator symbol"),
N_("color for half-operator symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_nick_halfop, NULL, NULL },
"lightmagenta", NULL, &cfg_col_nick_halfop, NULL, &config_change_color },
{ "col_nick_voice", N_("color for voice symbol"),
N_("color for voice symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_nick_voice, NULL, NULL },
"yellow", NULL, &cfg_col_nick_voice, NULL, &config_change_color },
{ "col_nick_sep", N_("color for nick separator"),
N_("color for nick separator"),
OPTION_TYPE_COLOR, 0, 0, 0,
"blue", NULL, &cfg_col_nick_sep, NULL, NULL },
"blue", NULL, &cfg_col_nick_sep, NULL, &config_change_color },
{ "col_nick_self", N_("color for local nick"),
N_("color for local nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_nick_self, NULL, NULL },
"white", NULL, &cfg_col_nick_self, NULL, &config_change_color },
{ "col_nick_private", N_("color for other nick in private window"),
N_("color for other nick in private window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_nick_private, NULL, NULL },
"gray", NULL, &cfg_col_nick_private, NULL, &config_change_color },
{ "col_nick_bg", N_("background for nicknames"),
N_("background for nicknames"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_nick_bg, NULL, NULL },
"default", NULL, &cfg_col_nick_bg, NULL, &config_change_color },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -568,6 +568,83 @@ get_pos_array_values (char **array, char *string)
return -1;
}
/*
* config_get_section: get section name from option pointer
*/
char *
config_get_section (t_config_option *ptr_option)
{
int i, j;
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
/* if option found, return pointer to section name */
if (ptr_option == &weechat_options[i][j])
return config_sections[i].section_name;
}
}
}
/* option not found */
return NULL;
}
/*
* config_change_noop: called when an option is changed by /set command
* and that no special action is needed after that
*/
void
config_change_noop ()
{
/* do nothing */
}
/*
* config_change_title: called when title is changed
*/
void
config_change_title ()
{
gui_set_window_title ();
}
/*
* config_change_windows: called when windows change (for example nicklist)
*/
void
config_change_windows ()
{
gui_switch_to_window (gui_current_window);
gui_redraw_window (gui_current_window);
}
/*
* config_change_window_content: called when content of a window changes
*/
void
config_change_window_content ()
{
gui_redraw_window (gui_current_window);
}
/*
* config_change_color: called when a color is changed by /set command
*/
void
config_change_color()
{
gui_init_colors ();
}
/*
* config_option_set_value: set new value for an option
* return: 0 if success
@@ -615,14 +692,12 @@ config_option_set_value (t_config_option *option, char *value)
}
/*
* config_set_value: set new value for an option (found by name)
* return: 0 if success
* -1 if bad value for option
* -2 if option is not found
* config_option_search: look for an option and return pointer to this option
* if option is not found, NULL is returned
*/
int
config_set_value (char *option_name, char *value)
t_config_option *
config_option_search (char *option_name)
{
int i, j;
@@ -632,14 +707,33 @@ config_set_value (char *option_name, char *value)
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
/* if option found, assign value and exit */
/* if option found, return pointer */
if (strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
return config_option_set_value (&weechat_options[i][j], value);
return &weechat_options[i][j];
}
}
}
/* option not found */
return -2;
return NULL;
}
/*
* config_set_value: set new value for an option (found by name)
* return: 0 if success
* -1 if bad value for option
* -2 if option is not found
*/
int
config_set_value (char *option_name, char *value)
{
t_config_option *ptr_option;
ptr_option = config_option_search (option_name);
if (ptr_option)
return config_option_set_value (ptr_option, value);
else
return -2;
}
/*
+10 -1
View File
@@ -70,7 +70,7 @@ struct t_config_option
char **array_values;
int *ptr_int;
char **ptr_string;
int (*handler_change)(int *, char **);
void (*handler_change)();
};
extern int cfg_look_set_title;
@@ -155,6 +155,15 @@ extern char *cfg_proxy_password;
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
extern char *config_get_section ();
extern void config_change_noop ();
extern void config_change_title ();
extern void config_change_windows ();
extern void config_change_window_content ();
extern void config_change_color ();
extern int config_option_set_value (t_config_option *, char *);
extern t_config_option *config_option_search (char *);
extern int config_set_value (char *, char *);
extern int config_read ();
extern int config_create_default ();
extern int config_write ();
+62 -33
View File
@@ -182,7 +182,7 @@ gui_calculate_pos_size (t_gui_window *window)
/* init chat & nicklist settings */
/* TODO: calculate values from function parameters */
if (WIN_IS_CHANNEL(window))
if (cfg_look_nicklist && WIN_IS_CHANNEL(window))
{
max_length = nick_get_max_length (CHANNEL(window));
@@ -1147,13 +1147,16 @@ gui_switch_to_window (t_gui_window *window)
window->win_status = ptr_win->win_status;
window->win_infobar = ptr_win->win_infobar;
window->win_input = ptr_win->win_input;
ptr_win->win_title = NULL;
ptr_win->win_chat = NULL;
ptr_win->win_nick = NULL;
ptr_win->win_status = NULL;
ptr_win->win_infobar = NULL;
ptr_win->win_input = NULL;
ptr_win->is_displayed = 0;
if (ptr_win != window)
{
ptr_win->win_title = NULL;
ptr_win->win_chat = NULL;
ptr_win->win_nick = NULL;
ptr_win->win_status = NULL;
ptr_win->win_infobar = NULL;
ptr_win->win_input = NULL;
ptr_win->is_displayed = 0;
}
break;
}
}
@@ -1169,46 +1172,52 @@ gui_switch_to_window (t_gui_window *window)
window->win_chat_width,
window->win_chat_y,
window->win_chat_x);
if (CHANNEL(window))
if (cfg_look_nicklist && CHANNEL(window))
window->win_nick = newwin (window->win_nick_height,
window->win_nick_width,
window->win_nick_y,
window->win_nick_x);
else
window->win_nick = NULL;
if (cfg_look_infobar)
{
window->win_infobar = newwin (1, COLS, LINES - 2, 0);
window->win_status = newwin (1, COLS, LINES - 3, 0);
}
else
window->win_status = newwin (1, COLS, LINES - 2, 0);
window->win_input = newwin (1, COLS, LINES - 1, 0);
}
else
{
/* create chat & nick windows */
/* remove some windows */
if (window->win_nick)
{
delwin (window->win_nick);
window->win_nick = NULL;
}
if (window->win_status)
{
delwin (window->win_status);
window->win_status = NULL;
}
if (window->win_infobar)
{
delwin (window->win_infobar);
window->win_infobar = NULL;
}
/* create windows */
if (WIN_IS_CHANNEL(window))
{
/* (re)create nicklist window */
if (window->win_nick)
delwin (window->win_nick);
delwin (window->win_chat);
window->win_chat = newwin (window->win_chat_height,
window->win_chat_width,
window->win_chat_y,
window->win_chat_x);
window->win_nick = newwin (window->win_nick_height,
window->win_nick_width,
window->win_nick_y,
window->win_nick_x);
if (cfg_look_nicklist)
window->win_nick = newwin (window->win_nick_height,
window->win_nick_width,
window->win_nick_y,
window->win_nick_x);
else
window->win_nick = NULL;
}
if (!(WIN_IS_CHANNEL(window)))
{
/* remove nick list window */
if (window->win_nick)
delwin (window->win_nick);
window->win_nick = NULL;
delwin (window->win_chat);
window->win_chat = newwin (window->win_chat_height,
window->win_chat_width,
@@ -1217,6 +1226,15 @@ gui_switch_to_window (t_gui_window *window)
}
}
/* create status/infobar windows */
if (cfg_look_infobar)
{
window->win_infobar = newwin (1, COLS, LINES - 2, 0);
window->win_status = newwin (1, COLS, LINES - 3, 0);
}
else
window->win_status = newwin (1, COLS, LINES - 2, 0);
/* change current window to the new window */
gui_current_window = window;
@@ -1476,6 +1494,20 @@ gui_init_colors ()
}
}
/*
* gui_set_window_title: set terminal title
*/
void
gui_set_window_title ()
{
#ifdef __linux__
/* set title for term window, not for console */
if (strcmp (getenv ("TERM"), "linux") != 0)
printf ("\e]2;" PACKAGE_NAME " " PACKAGE_VERSION "\a\e]1;" PACKAGE_NAME " " PACKAGE_VERSION "\a");
#endif
}
/*
* gui_init: init GUI
*/
@@ -1500,11 +1532,8 @@ gui_init ()
signal (SIGWINCH, gui_curses_resize_handler);
#ifdef __linux__
/* set title for term window, not for console */
if (cfg_look_set_title && (strcmp (getenv ("TERM"), "linux") != 0))
printf ("\e]2;" PACKAGE_NAME " " PACKAGE_VERSION "\a\e]1;" PACKAGE_NAME " " PACKAGE_VERSION "\a");
#endif
if (cfg_look_set_title)
gui_set_window_title ();
gui_ready = 1;
}
+10
View File
@@ -599,6 +599,16 @@ gui_init_colors ()
/* TODO: init colors for Gtk */
}
/*
* gui_set_window_title: set window title
*/
void
gui_set_window_title ()
{
/* TODO: set window title for Gtk */
}
/*
* gui_init: init GUI
*/
+2 -1
View File
@@ -241,7 +241,8 @@ extern void gui_move_page_up ();
extern void gui_move_page_down ();
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_pre_init (int *, char **[]);
//extern void gui_init_colors ();
extern void gui_init_colors ();
extern void gui_set_window_title ();
extern void gui_init ();
extern void gui_window_free (t_gui_window *);
extern void gui_end ();
+3 -3
View File
@@ -361,7 +361,7 @@ server_msgq_add_msg (t_irc_server *server, char *msg)
if (!message)
{
gui_printf (server->window,
_("%s not enough memory for received IRC message"),
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
return;
}
@@ -372,7 +372,7 @@ server_msgq_add_msg (t_irc_server *server, char *msg)
strlen (msg) + 1);
if (!message->data)
gui_printf (server->window,
_("%s not enough memory for received IRC message"),
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
else
{
@@ -426,7 +426,7 @@ server_msgq_add_buffer (t_irc_server * server, char *buffer)
strlen (buffer) + 1);
if (!unterminated_message)
gui_printf (server->window,
_("%s not enough memory for received IRC message"),
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
else
strcpy (unterminated_message, buffer);
+1
View File
@@ -5,6 +5,7 @@ ChangeLog - 2004-01-24
Version 0.0.5 (under dev!):
* /set command to modify config options when WeeChat is running
* secured code to prevent buffer overflows and memory leaks
* fixed QUIT IRC command: now sent to all connected servers (not only current)
* new Perl script function to display message in info bar ("IRC::print_infobar")
+8 -6
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2004-01-18
TODO - 2004-01-24
Legend:
# done
@@ -17,9 +17,15 @@ v0.0.5:
# debug messages can be enabled via ./configure --enbale-debug option
+ Solaris version
* WeeChat commands:
# "/set" command: allow the user to set the WeeChat variables
under WeeChat without editing the config file (colors, time
format, etc)
* Interface:
+ internationalization (traduce WeeChat in many languages)
+ info bar
# info bar
# add clock
* Configuration:
+ add missing options for config file
@@ -46,9 +52,6 @@ Future versions:
nick/host connect to the given irc network
* WeeChat commands:
+ "/set" command: allow the user to set the WeeChat variables
under WeeChat without editing the config file (colours, time
format, etc)
- "/reload" command: reload the WeeChat's config file
- "/highlight" command: highlight a given word when it appears on
channels/privates
@@ -69,7 +72,6 @@ Future versions:
if WeeChat is running for long time, a lot of memory is used!)
- improve completion (for example complete command parameters when possible)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
- add clock (in status bar?)
- log chats to file
? Qt GUI
+2 -2
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.0.5-pre2, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.0.5-pre3, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.0.5-pre2])
AM_INIT_AUTOMAKE([weechat], [0.0.5-pre3])
# Checks for programs.
AC_PROG_CC
+81 -46
View File
@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.0.5-pre2\n"
"Project-Id-Version: WeeChat 0.0.5-pre3\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2004-01-24 03:16+0100\n"
"PO-Revision-Date: 2004-01-01 11:52+0100\n"
"POT-Creation-Date: 2004-01-24 20:57+0100\n"
"PO-Revision-Date: 2004-01-24 20:57+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -30,71 +30,76 @@ msgstr "%s impossible d'allouer un nouveau serveur\n"
msgid "%s error sending data to IRC server\n"
msgstr "%s erreur d'envoi de données au serveur IRC\n"
#: src/irc/irc-server.c:417
#: src/irc/irc-server.c:364 src/irc/irc-server.c:375 src/irc/irc-server.c:429
#, c-format
msgid "%s not enough memory for received IRC message\n"
msgstr "%s mémoire insuffisante pour un message IRC reçu\n"
#: src/irc/irc-server.c:436
#, c-format
msgid "%s unable to explode received buffer\n"
msgstr "%s impossible d'exploser le tampon de réception\n"
#: src/irc/irc-server.c:490
#: src/irc/irc-server.c:509
#, c-format
msgid "Command '%s' failed!\n"
msgstr "La commande '%s' a échoué !\n"
#: src/irc/irc-server.c:494
#: src/irc/irc-server.c:513
msgid "No command to execute!\n"
msgstr "Pas de commande à exécuter !\n"
#: src/irc/irc-server.c:498
#: src/irc/irc-server.c:517
#, c-format
msgid "Unknown command: cmd=%s, args=%s\n"
msgstr "Commande inconnue: cmd=%s, params=%s\n"
#: src/irc/irc-server.c:548
#: src/irc/irc-server.c:569
#, c-format
msgid "%s: connecting to %s:%d...\n"
msgstr "%s: connexion à %s:%d...\n"
#: src/irc/irc-server.c:550
#: src/irc/irc-server.c:571
#, c-format
msgid "connecting to server %s:%d...\n"
msgstr "connexion au serveur %s:%d...\n"
#: src/irc/irc-server.c:558
#: src/irc/irc-server.c:579
#, c-format
msgid "%s cannot create pipe\n"
msgstr "%s impossible de créer le pipe\n"
#: src/irc/irc-server.c:572
#: src/irc/irc-server.c:593
#, c-format
msgid "%s cannot set socket option \"SO_REUSEADDR\"\n"
msgstr "%s impossible de paramétrer l'option socket \"SO_REUSEADDR\"\n"
#: src/irc/irc-server.c:579
#: src/irc/irc-server.c:600
#, c-format
msgid "%s cannot set socket option \"SO_KEEPALIVE\"\n"
msgstr "%s impossible de paramétrer l'option socket \"SO_KEEPALIVE\"\n"
#: src/irc/irc-server.c:587
#: src/irc/irc-server.c:608
#, c-format
msgid "%s address \"%s\" not found\n"
msgstr "%s adresse \"%s\" introuvable\n"
#: src/irc/irc-server.c:610
#: src/irc/irc-server.c:631
#, c-format
msgid "%s IP address not found\n"
msgstr "%s adresse IP introuvable\n"
#: src/irc/irc-server.c:620
#: src/irc/irc-server.c:641
#, c-format
msgid "%s: server IP is: %s\n"
msgstr "%s: l'adresse IP du serveur est : %s\n"
#: src/irc/irc-server.c:626
#: src/irc/irc-server.c:647
#, c-format
msgid "%s cannot connect to irc server\n"
msgstr "%s connexion au serveur irc impossible\n"
#: src/irc/irc-server.c:676
#: src/irc/irc-server.c:697
msgid "Disconnected from server!\n"
msgstr "Déconnecté du serveur !\n"
@@ -1547,12 +1552,12 @@ msgstr "d
msgid "unloading all Perl scripts...\n"
msgstr "déchargement de tous les scripts Perl...\n"
#: src/plugins/plugins.c:87
#: src/plugins/plugins.c:89
#, c-format
msgid "auto-loading %s script: %s%s%s\n"
msgstr "chargement automatique du script %s : %s%s%s\n"
#: src/plugins/plugins.c:193
#: src/plugins/plugins.c:195
#, c-format
msgid "%s unable to add handler for \"%s\" message (not enough memory)\n"
msgstr ""
@@ -1567,7 +1572,7 @@ msgstr "[non connect
msgid "-MORE-"
msgstr "-PLUS-"
#: src/gui/gtk/gui-display.c:647
#: src/gui/gtk/gui-display.c:657
msgid "server"
msgstr "serveur"
@@ -2069,16 +2074,46 @@ msgstr "cr
msgid "%s unable to create server\n"
msgstr "%s impossible de créer le serveur\n"
#: src/common/command.c:1529
#: src/common/command.c:1490
#, c-format
msgid "%s option '%s' can not be changed while WeeChat is running\n"
msgstr "%s l'option '%s' ne peut pas être changée lorsque WeeChat tourne\n"
#: src/common/command.c:1502
#, c-format
msgid "%s incorrect value for option '%s'\n"
msgstr "%s valeur incorrecte pour l'option '%s'\n"
#: src/common/command.c:1508
#, c-format
msgid "%s config option '%s' not found\n"
msgstr "%s option de configuration '%s' non trouvée\n"
#: src/common/command.c:1558
msgid "(unknown)"
msgstr "(inconnu)"
#: src/common/command.c:1562
#: src/common/command.c:1578 src/common/command.c:1581
#, c-format
msgid "No config option found with '%s'\n"
msgstr "Aucune option de configuration trouvée avec '%s'\n"
#: src/common/command.c:1586
#, c-format
msgid "%d config option(s) found with '%s'\n"
msgstr "%d option(s) de configuration trouvées avec '%s'\n"
#: src/common/command.c:1589
#, c-format
msgid "%d config option(s) found\n"
msgstr "%d option(s) de configuration trouvées\n"
#: src/common/command.c:1609
#, c-format
msgid "%s alias or command \"%s\" not found\n"
msgstr "%s alias ou commande \"%s\" non trouvé\n"
#: src/common/command.c:1571
#: src/common/command.c:1618
#, c-format
msgid "Alias \"%s\" removed\n"
msgstr "Alias \"%s\" supprimé\n"
@@ -2209,10 +2244,10 @@ msgid " Warning:"
msgstr " Attention:"
#: src/common/weeconfig.c:81 src/common/weeconfig.c:82
msgid "set title for terminal window (curses GUI) with name & version"
msgid "set title for window (terminal for Curses GUI) with name & version"
msgstr ""
"définit le titre de la fenêtre de terminal (GUI curses) avec le nom et la "
"version"
"définit le titre de la fenêtre (terminal pour l'interface Curses) avec le "
"nom et la version"
#: src/common/weeconfig.c:85 src/common/weeconfig.c:86
msgid "display WeeChat logo at startup"
@@ -2800,57 +2835,57 @@ msgstr ""
"liste des canaux (séparés par des virgules) à rejoindre lorsque connecté au "
"serveur"
#: src/common/weeconfig.c:663
#: src/common/weeconfig.c:757
#, c-format
msgid "%s %s, line %d: new server, but previous was incomplete\n"
msgstr "%s %s, ligne %d: nouveau serveur, mais le précédent était incomplet\n"
#: src/common/weeconfig.c:672
#: src/common/weeconfig.c:766
#, c-format
msgid "%s %s, line %d: server '%s' already exists\n"
msgstr "%s %s, ligne %d: le serveur '%s' existe déjà\n"
#: src/common/weeconfig.c:684
#: src/common/weeconfig.c:778
#, c-format
msgid "%s %s, line %d: unable to create server\n"
msgstr "%s %s, ligne %d: impossible de créer le serveur\n"
#: src/common/weeconfig.c:723
#: src/common/weeconfig.c:817
#, c-format
msgid "%s unable to assign default int with string (\"%s\")\n"
msgstr "%s impossible d'assigner la valeur entière avec la chaîne (\"%s\")\n"
#: src/common/weeconfig.c:734
#: src/common/weeconfig.c:828
#, c-format
msgid "%s unable to assign default color (\"%s\")\n"
msgstr "%s impossible d'assigner la couleur par défaut (\"%s\")\n"
#: src/common/weeconfig.c:773
#: src/common/weeconfig.c:867
#, c-format
msgid "%s config file \"%s\" not found.\n"
msgstr "%s fichier de configuration \"%s\" non trouvé.\n"
#: src/common/weeconfig.c:805
#: src/common/weeconfig.c:899
#, c-format
msgid "%s %s, line %d: invalid syntax, missing \"]\"\n"
msgstr "%s %s, ligne %d: syntaxe invalide, il manque \"]\"\n"
#: src/common/weeconfig.c:822
#: src/common/weeconfig.c:916
#, c-format
msgid "%s %s, line %d: unknown section identifier (\"%s\")\n"
msgstr "%s %s, ligne %d: section inconnue (\"%s\")\n"
#: src/common/weeconfig.c:840
#: src/common/weeconfig.c:934
#, c-format
msgid "%s %s, line %d: invalid syntax, missing \"=\"\n"
msgstr "%s %s, ligne %d: syntaxe invalide, il manque \"=\"\n"
#: src/common/weeconfig.c:874
#: src/common/weeconfig.c:968
#, c-format
msgid "%s %s, line %d: invalid option \"%s\"\n"
msgstr "%s %s, ligne %d: option \"%s\" invalide\n"
#: src/common/weeconfig.c:885
#: src/common/weeconfig.c:979
#, c-format
msgid ""
"%s %s, line %d: invalid value foroption '%s'\n"
@@ -2859,7 +2894,7 @@ msgstr ""
"%s %s, ligne %d: valeur invalide pour l'option '%s'\n"
"Attendu: valeur booléenne: 'off' ou 'on'\n"
#: src/common/weeconfig.c:894
#: src/common/weeconfig.c:988
#, c-format
msgid ""
"%s %s, line %d: invalid value for option '%s'\n"
@@ -2868,7 +2903,7 @@ msgstr ""
"%s %s, ligne %d: valeur invalide pour l'option '%s'\n"
"Attendu: entier compris entre %d et %d\n"
#: src/common/weeconfig.c:905
#: src/common/weeconfig.c:999
#, c-format
msgid ""
"%s %s, line %d: invalid value for option '%s'\n"
@@ -2877,26 +2912,26 @@ msgstr ""
"%s %s, ligne %d: valeur invalide pour l'option '%s'\n"
"Attendu: une de ces chaînes: "
#: src/common/weeconfig.c:921
#: src/common/weeconfig.c:1015
#, c-format
msgid "%s %s, line %d: invalid color name for option '%s'\n"
msgstr "%s %s, ligne %d: nom de couleur invalide pour l'option '%s'\n"
#: src/common/weeconfig.c:980 src/common/weeconfig.c:1147
#: src/common/weeconfig.c:1074 src/common/weeconfig.c:1241
#, c-format
msgid "%s cannot create file \"%s\"\n"
msgstr "%s impossible de créer le fichier \"%s\"\n"
#: src/common/weeconfig.c:986
#: src/common/weeconfig.c:1080
#, c-format
msgid "%s: creating default config file...\n"
msgstr "%s: création du fichier de configuration par défaut...\n"
#: src/common/weeconfig.c:987
#: src/common/weeconfig.c:1081
msgid "creating default config file\n"
msgstr "création du fichier de configuration par défaut\n"
#: src/common/weeconfig.c:990 src/common/weeconfig.c:1156
#: src/common/weeconfig.c:1084 src/common/weeconfig.c:1250
#, c-format
msgid ""
"#\n"
@@ -2905,10 +2940,10 @@ msgstr ""
"#\n"
"# %s: fichier de configuration, créé par %s v%s le %s#\n"
#: src/common/weeconfig.c:1098
#: src/common/weeconfig.c:1192
msgid "Unable to get user's name"
msgstr "Impossible de déterminer le nom d'utilisateur"
#: src/common/weeconfig.c:1153
#: src/common/weeconfig.c:1247
msgid "saving config to disk\n"
msgstr "sauvegarde de la configuration sur disque\n"
+77 -42
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2004-01-24 03:16+0100\n"
"POT-Creation-Date: 2004-01-24 20:57+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"
@@ -30,71 +30,76 @@ msgstr ""
msgid "%s error sending data to IRC server\n"
msgstr ""
#: src/irc/irc-server.c:417
#: src/irc/irc-server.c:364 src/irc/irc-server.c:375 src/irc/irc-server.c:429
#, c-format
msgid "%s not enough memory for received IRC message\n"
msgstr ""
#: src/irc/irc-server.c:436
#, c-format
msgid "%s unable to explode received buffer\n"
msgstr ""
#: src/irc/irc-server.c:490
#: src/irc/irc-server.c:509
#, c-format
msgid "Command '%s' failed!\n"
msgstr ""
#: src/irc/irc-server.c:494
#: src/irc/irc-server.c:513
msgid "No command to execute!\n"
msgstr ""
#: src/irc/irc-server.c:498
#: src/irc/irc-server.c:517
#, c-format
msgid "Unknown command: cmd=%s, args=%s\n"
msgstr ""
#: src/irc/irc-server.c:548
#: src/irc/irc-server.c:569
#, c-format
msgid "%s: connecting to %s:%d...\n"
msgstr ""
#: src/irc/irc-server.c:550
#: src/irc/irc-server.c:571
#, c-format
msgid "connecting to server %s:%d...\n"
msgstr ""
#: src/irc/irc-server.c:558
#: src/irc/irc-server.c:579
#, c-format
msgid "%s cannot create pipe\n"
msgstr ""
#: src/irc/irc-server.c:572
#: src/irc/irc-server.c:593
#, c-format
msgid "%s cannot set socket option \"SO_REUSEADDR\"\n"
msgstr ""
#: src/irc/irc-server.c:579
#: src/irc/irc-server.c:600
#, c-format
msgid "%s cannot set socket option \"SO_KEEPALIVE\"\n"
msgstr ""
#: src/irc/irc-server.c:587
#: src/irc/irc-server.c:608
#, c-format
msgid "%s address \"%s\" not found\n"
msgstr ""
#: src/irc/irc-server.c:610
#: src/irc/irc-server.c:631
#, c-format
msgid "%s IP address not found\n"
msgstr ""
#: src/irc/irc-server.c:620
#: src/irc/irc-server.c:641
#, c-format
msgid "%s: server IP is: %s\n"
msgstr ""
#: src/irc/irc-server.c:626
#: src/irc/irc-server.c:647
#, c-format
msgid "%s cannot connect to irc server\n"
msgstr ""
#: src/irc/irc-server.c:676
#: src/irc/irc-server.c:697
msgid "Disconnected from server!\n"
msgstr ""
@@ -1445,12 +1450,12 @@ msgstr ""
msgid "unloading all Perl scripts...\n"
msgstr ""
#: src/plugins/plugins.c:87
#: src/plugins/plugins.c:89
#, c-format
msgid "auto-loading %s script: %s%s%s\n"
msgstr ""
#: src/plugins/plugins.c:193
#: src/plugins/plugins.c:195
#, c-format
msgid "%s unable to add handler for \"%s\" message (not enough memory)\n"
msgstr ""
@@ -1463,7 +1468,7 @@ msgstr ""
msgid "-MORE-"
msgstr ""
#: src/gui/gtk/gui-display.c:647
#: src/gui/gtk/gui-display.c:657
msgid "server"
msgstr ""
@@ -1935,16 +1940,46 @@ msgstr ""
msgid "%s unable to create server\n"
msgstr ""
#: src/common/command.c:1529
#: src/common/command.c:1490
#, c-format
msgid "%s option '%s' can not be changed while WeeChat is running\n"
msgstr ""
#: src/common/command.c:1502
#, c-format
msgid "%s incorrect value for option '%s'\n"
msgstr ""
#: src/common/command.c:1508
#, c-format
msgid "%s config option '%s' not found\n"
msgstr ""
#: src/common/command.c:1558
msgid "(unknown)"
msgstr ""
#: src/common/command.c:1562
#: src/common/command.c:1578 src/common/command.c:1581
#, c-format
msgid "No config option found with '%s'\n"
msgstr ""
#: src/common/command.c:1586
#, c-format
msgid "%d config option(s) found with '%s'\n"
msgstr ""
#: src/common/command.c:1589
#, c-format
msgid "%d config option(s) found\n"
msgstr ""
#: src/common/command.c:1609
#, c-format
msgid "%s alias or command \"%s\" not found\n"
msgstr ""
#: src/common/command.c:1571
#: src/common/command.c:1618
#, c-format
msgid "Alias \"%s\" removed\n"
msgstr ""
@@ -2067,7 +2102,7 @@ msgid " Warning:"
msgstr ""
#: src/common/weeconfig.c:81 src/common/weeconfig.c:82
msgid "set title for terminal window (curses GUI) with name & version"
msgid "set title for window (terminal for Curses GUI) with name & version"
msgstr ""
#: src/common/weeconfig.c:85 src/common/weeconfig.c:86
@@ -2615,107 +2650,107 @@ msgstr ""
msgid "comma separated list of channels to join when connected to server"
msgstr ""
#: src/common/weeconfig.c:663
#: src/common/weeconfig.c:757
#, c-format
msgid "%s %s, line %d: new server, but previous was incomplete\n"
msgstr ""
#: src/common/weeconfig.c:672
#: src/common/weeconfig.c:766
#, c-format
msgid "%s %s, line %d: server '%s' already exists\n"
msgstr ""
#: src/common/weeconfig.c:684
#: src/common/weeconfig.c:778
#, c-format
msgid "%s %s, line %d: unable to create server\n"
msgstr ""
#: src/common/weeconfig.c:723
#: src/common/weeconfig.c:817
#, c-format
msgid "%s unable to assign default int with string (\"%s\")\n"
msgstr ""
#: src/common/weeconfig.c:734
#: src/common/weeconfig.c:828
#, c-format
msgid "%s unable to assign default color (\"%s\")\n"
msgstr ""
#: src/common/weeconfig.c:773
#: src/common/weeconfig.c:867
#, c-format
msgid "%s config file \"%s\" not found.\n"
msgstr ""
#: src/common/weeconfig.c:805
#: src/common/weeconfig.c:899
#, c-format
msgid "%s %s, line %d: invalid syntax, missing \"]\"\n"
msgstr ""
#: src/common/weeconfig.c:822
#: src/common/weeconfig.c:916
#, c-format
msgid "%s %s, line %d: unknown section identifier (\"%s\")\n"
msgstr ""
#: src/common/weeconfig.c:840
#: src/common/weeconfig.c:934
#, c-format
msgid "%s %s, line %d: invalid syntax, missing \"=\"\n"
msgstr ""
#: src/common/weeconfig.c:874
#: src/common/weeconfig.c:968
#, c-format
msgid "%s %s, line %d: invalid option \"%s\"\n"
msgstr ""
#: src/common/weeconfig.c:885
#: src/common/weeconfig.c:979
#, c-format
msgid ""
"%s %s, line %d: invalid value foroption '%s'\n"
"Expected: boolean value: 'off' or 'on'\n"
msgstr ""
#: src/common/weeconfig.c:894
#: src/common/weeconfig.c:988
#, c-format
msgid ""
"%s %s, line %d: invalid value for option '%s'\n"
"Expected: integer between %d and %d\n"
msgstr ""
#: src/common/weeconfig.c:905
#: src/common/weeconfig.c:999
#, c-format
msgid ""
"%s %s, line %d: invalid value for option '%s'\n"
"Expected: one of these strings: "
msgstr ""
#: src/common/weeconfig.c:921
#: src/common/weeconfig.c:1015
#, c-format
msgid "%s %s, line %d: invalid color name for option '%s'\n"
msgstr ""
#: src/common/weeconfig.c:980 src/common/weeconfig.c:1147
#: src/common/weeconfig.c:1074 src/common/weeconfig.c:1241
#, c-format
msgid "%s cannot create file \"%s\"\n"
msgstr ""
#: src/common/weeconfig.c:986
#: src/common/weeconfig.c:1080
#, c-format
msgid "%s: creating default config file...\n"
msgstr ""
#: src/common/weeconfig.c:987
#: src/common/weeconfig.c:1081
msgid "creating default config file\n"
msgstr ""
#: src/common/weeconfig.c:990 src/common/weeconfig.c:1156
#: src/common/weeconfig.c:1084 src/common/weeconfig.c:1250
#, c-format
msgid ""
"#\n"
"# %s configuration file, created by %s v%s on %s#\n"
msgstr ""
#: src/common/weeconfig.c:1098
#: src/common/weeconfig.c:1192
msgid "Unable to get user's name"
msgstr ""
#: src/common/weeconfig.c:1153
#: src/common/weeconfig.c:1247
msgid "saving config to disk\n"
msgstr ""
+83 -36
View File
@@ -84,7 +84,7 @@ t_weechat_command weechat_commands[] =
0, 1, weechat_cmd_save, NULL },
{ "set", N_("set config parameters"),
N_("[option [value]]"), N_("option: name of an option\nvalue: value for option"),
0, 2, NULL, weechat_cmd_set },
0, MAX_ARGS, NULL, weechat_cmd_set },
{ "unalias", N_("remove an alias"),
N_("alias_name"), N_("alias_name: name of alias to remove"),
1, 1, NULL, weechat_cmd_unalias },
@@ -1461,6 +1461,8 @@ weechat_cmd_set (char *arguments)
char *option, *value;
int i, j, section_displayed;
char *color_name;
t_config_option *ptr_option;
int number_found;
option = NULL;
value = NULL;
@@ -1479,10 +1481,37 @@ weechat_cmd_set (char *arguments)
if (value && value[0])
{
gui_printf (NULL, "TODO: set value!\n");
ptr_option = config_option_search (option);
if (ptr_option)
{
if (ptr_option->handler_change == NULL)
{
gui_printf (NULL,
_("%s option '%s' can not be changed while WeeChat is running\n"),
WEECHAT_ERROR, option);
}
else
{
if (config_option_set_value (ptr_option, value) == 0)
{
(void) (ptr_option->handler_change());
gui_printf (NULL, "[%s]\n", config_get_section (ptr_option));
gui_printf (NULL, " %s = %s\n", option, value);
}
else
gui_printf (NULL, _("%s incorrect value for option '%s'\n"),
WEECHAT_ERROR, option);
}
}
else
{
gui_printf (NULL, _("%s config option '%s' not found\n"),
WEECHAT_ERROR, option);
}
}
else
{
number_found = 0;
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
section_displayed = 0;
@@ -1503,45 +1532,63 @@ weechat_cmd_set (char *arguments)
}
switch (weechat_options[i][j].option_type)
{
case OPTION_TYPE_BOOLEAN:
gui_printf (NULL, " %s = %s\n",
weechat_options[i][j].option_name,
(*weechat_options[i][j].ptr_int) ?
"ON" : "OFF");
break;
case OPTION_TYPE_INT:
gui_printf (NULL,
" %s = %d\n",
weechat_options[i][j].option_name,
*weechat_options[i][j].ptr_int);
break;
case OPTION_TYPE_INT_WITH_STRING:
gui_printf (NULL,
" %s = %s\n",
weechat_options[i][j].option_name,
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int]);
break;
case OPTION_TYPE_COLOR:
color_name = gui_get_color_by_value (*weechat_options[i][j].ptr_int);
gui_printf (NULL,
" %s = %s\n",
weechat_options[i][j].option_name,
(color_name) ? color_name : _("(unknown)"));
break;
case OPTION_TYPE_STRING:
gui_printf (NULL, " %s = %s\n",
weechat_options[i][j].
option_name,
(*weechat_options[i][j].
ptr_string) ?
*weechat_options[i][j].
ptr_string : "");
break;
case OPTION_TYPE_BOOLEAN:
gui_printf (NULL, " %s = %s\n",
weechat_options[i][j].option_name,
(*weechat_options[i][j].ptr_int) ?
"ON" : "OFF");
break;
case OPTION_TYPE_INT:
gui_printf (NULL,
" %s = %d\n",
weechat_options[i][j].option_name,
*weechat_options[i][j].ptr_int);
break;
case OPTION_TYPE_INT_WITH_STRING:
gui_printf (NULL,
" %s = %s\n",
weechat_options[i][j].option_name,
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int]);
break;
case OPTION_TYPE_COLOR:
color_name = gui_get_color_by_value (*weechat_options[i][j].ptr_int);
gui_printf (NULL,
" %s = %s\n",
weechat_options[i][j].option_name,
(color_name) ? color_name : _("(unknown)"));
break;
case OPTION_TYPE_STRING:
gui_printf (NULL, " %s = %s\n",
weechat_options[i][j].
option_name,
(*weechat_options[i][j].
ptr_string) ?
*weechat_options[i][j].
ptr_string : "");
break;
}
number_found++;
}
}
}
}
if (number_found == 0)
{
if (value)
gui_printf (NULL, _("No config option found with '%s'\n"),
value);
else
gui_printf (NULL, _("No config option found with '%s'\n"));
}
else
{
if (value)
gui_printf (NULL, _("%d config option(s) found with '%s'\n"),
number_found, value);
else
gui_printf (NULL, _("%d config option(s) found\n"),
number_found);
}
}
return 0;
}
+157 -63
View File
@@ -78,81 +78,81 @@ char *cfg_look_infobar_timestamp;
int cfg_look_infobar_delay_highlight;
t_config_option weechat_options_look[] =
{ { "look_set_title", N_("set title for terminal window (curses GUI) with name & version"),
N_("set title for terminal window (curses GUI) with name & version"),
{ { "look_set_title", N_("set title for window (terminal for Curses GUI) with name & version"),
N_("set title for window (terminal for Curses GUI) with name & version"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_set_title, NULL, NULL },
NULL, NULL, &cfg_look_set_title, NULL, config_change_title },
{ "look_startup_logo", N_("display WeeChat logo at startup"),
N_("display WeeChat logo at startup"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_startup_logo, NULL, NULL },
NULL, NULL, &cfg_look_startup_logo, NULL, config_change_noop },
{ "look_startup_version", N_("display WeeChat version at startup"),
N_("display WeeChat version at startup"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_startup_version, NULL, NULL },
NULL, NULL, &cfg_look_startup_version, NULL, config_change_noop },
{ "look_weechat_slogan", N_("WeeChat slogan"),
N_("WeeChat slogan (if empty, slogan is not used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"the geekest IRC client!", NULL, NULL, &cfg_look_weechat_slogan, NULL },
"the geekest IRC client!", NULL, NULL, &cfg_look_weechat_slogan, config_change_noop },
{ "look_color_nicks", N_("display nick names with different colors"),
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_color_nicks, NULL, NULL },
NULL, NULL, &cfg_look_color_nicks, NULL, config_change_noop },
{ "look_color_actions", N_("display actions with different colors"),
N_("display actions with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_color_actions, NULL, NULL },
NULL, NULL, &cfg_look_color_actions, NULL, config_change_noop },
{ "look_remove_colors_from_msgs", N_("remove colors from incoming messages"),
N_("remove colors from incoming messages"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_remove_colors_from_msgs, NULL, NULL },
NULL, NULL, &cfg_look_remove_colors_from_msgs, NULL, config_change_noop },
{ "look_nicklist", N_("display nicklist window"),
N_("display nicklist window (for channel windows)"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_nicklist, NULL, NULL },
NULL, NULL, &cfg_look_nicklist, NULL, config_change_windows },
{ "look_nicklist_position", N_("nicklist position"),
N_("nicklist position (top, left, right (default), bottom)"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"right", cfg_look_nicklist_position_values, &cfg_look_nicklist_position, NULL, NULL },
"right", cfg_look_nicklist_position_values, &cfg_look_nicklist_position, NULL, config_change_windows },
{ "look_nicklist_min_size", N_("min size for nicklist"),
N_("min size for nicklist (width or height, depending on look_nicklist_position "
"(0 = no min size))"),
OPTION_TYPE_INT, 0, 100, 0,
NULL, NULL, &cfg_look_nicklist_min_size, NULL, NULL },
NULL, NULL, &cfg_look_nicklist_min_size, NULL, config_change_windows },
{ "look_nicklist_max_size", N_("max size for nicklist"),
N_("max size for nicklist (width or height, depending on look_nicklist_position "
"(0 = no max size; if min == max and > 0, then size is fixed))"),
OPTION_TYPE_INT, 0, 100, 0,
NULL, NULL, &cfg_look_nicklist_max_size, NULL, NULL },
NULL, NULL, &cfg_look_nicklist_max_size, NULL, config_change_windows },
{ "look_no_nickname", N_("text to display instead of nick when not connected"),
N_("text to display instead of nick when not connected"),
OPTION_TYPE_STRING, 0, 0, 0,
"-cmd-", NULL, NULL, &cfg_look_no_nickname, NULL },
"-cmd-", NULL, NULL, &cfg_look_no_nickname, config_change_window_content },
{ "look_nickmode", N_("display nick mode ((half)op/voice) before each nick"),
N_("display nick mode ((half)op/voice) before each nick"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_nickmode, NULL, NULL },
NULL, NULL, &cfg_look_nickmode, NULL, config_change_windows },
{ "look_nickmode_empty", N_("display space if nick mode is not (half)op/voice"),
N_("display space if nick mode is not (half)op/voice"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_nickmode_empty, NULL, NULL },
NULL, NULL, &cfg_look_nickmode_empty, NULL, config_change_windows },
{ "look_nick_completor", N_("the string inserted after nick completion"),
N_("the string inserted after nick completion"),
OPTION_TYPE_STRING, 0, 0, 0,
":", NULL, NULL, &cfg_look_completor, NULL },
":", NULL, NULL, &cfg_look_completor, config_change_noop },
{ "look_infobar", N_("enable info bar"),
N_("enable info bar"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_infobar, NULL, NULL },
NULL, NULL, &cfg_look_infobar, NULL, config_change_windows },
{ "look_infobar_timestamp", N_("timestamp for time in infobar"),
N_("timestamp for time in infobar"),
OPTION_TYPE_STRING, 0, 0, 0,
"%B, %A %d %G - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, NULL },
"%B, %A %d %G - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, config_change_window_content },
{ "look_infobar_delay_highlight", N_("delay (in seconds) for highlight messages in infobar"),
N_("delay (in seconds) for highlight messages in infobar "
"(0 = disable highlight notifications in infobar)"),
OPTION_TYPE_INT, 0, INT_MAX, 7,
NULL, NULL, &cfg_look_infobar_delay_highlight, NULL, NULL },
NULL, NULL, &cfg_look_infobar_delay_highlight, NULL, config_change_noop },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -198,149 +198,149 @@ t_config_option weechat_options_colors[] =
{ "col_title", N_("color for title bar"),
N_("color for title bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_title, NULL, NULL },
"gray", NULL, &cfg_col_title, NULL, &config_change_color },
{ "col_title_bg", N_("background for title bar"),
N_("background for title bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
"blue", NULL, &cfg_col_title_bg, NULL, NULL },
"blue", NULL, &cfg_col_title_bg, NULL, &config_change_color },
/* chat window */
{ "col_chat", N_("color for chat text"),
N_("color for chat text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_chat, NULL, NULL },
"gray", NULL, &cfg_col_chat, NULL, &config_change_color },
{ "col_chat_time", N_("color for time"),
N_("color for time in chat window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_chat_time, NULL, NULL },
"gray", NULL, &cfg_col_chat_time, NULL, &config_change_color },
{ "col_chat_time_sep", N_("color for time separator"),
N_("color for time separator (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"brown", NULL, &cfg_col_chat_time_sep, NULL, NULL },
"brown", NULL, &cfg_col_chat_time_sep, NULL, &config_change_color },
{ "col_chat_prefix1", N_("color for 1st and 3rd char of prefix"),
N_("color for 1st and 3rd char of prefix"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightcyan", NULL, &cfg_col_chat_prefix1, NULL, NULL },
"lightcyan", NULL, &cfg_col_chat_prefix1, NULL, &config_change_color },
{ "col_chat_prefix2", N_("color for middle char of prefix"),
N_("color for middle char of prefix"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_chat_prefix2, NULL, NULL },
"white", NULL, &cfg_col_chat_prefix2, NULL, &config_change_color },
{ "col_chat_nick", N_("color for nicks in actions"),
N_("color for nicks in actions (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightcyan", NULL, &cfg_col_chat_nick, NULL, NULL },
"lightcyan", NULL, &cfg_col_chat_nick, NULL, &config_change_color },
{ "col_chat_host", N_("color for hostnames"),
N_("color for hostnames (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_chat_host, NULL, NULL },
"cyan", NULL, &cfg_col_chat_host, NULL, &config_change_color },
{ "col_chat_channel", N_("color for channel names in actions"),
N_("color for channel names in actions (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_chat_channel, NULL, NULL },
"white", NULL, &cfg_col_chat_channel, NULL, &config_change_color },
{ "col_chat_dark", N_("color for dark separators"),
N_("color for dark separators (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"green", NULL, &cfg_col_chat_dark, NULL, NULL },
"green", NULL, &cfg_col_chat_dark, NULL, &config_change_color },
{ "col_chat_highlight", N_("color for highlighted nick"),
N_("color for highlighted nick (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_chat_highlight, NULL, NULL },
"yellow", NULL, &cfg_col_chat_highlight, NULL, &config_change_color },
{ "col_chat_bg", N_("background for chat"),
N_("background for chat window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_chat_bg, NULL, NULL },
"default", NULL, &cfg_col_chat_bg, NULL, &config_change_color },
/* status window */
{ "col_status", N_("color for status bar"),
N_("color for status bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_status, NULL, NULL },
"gray", NULL, &cfg_col_status, NULL, &config_change_color },
{ "col_status_active", N_("color for active window"),
N_("color for active window (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_status_active, NULL, NULL },
"yellow", NULL, &cfg_col_status_active, NULL, &config_change_color },
{ "col_status_data_msg", N_("color for window with new messages"),
N_("color for window with new messages (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightred", NULL, &cfg_col_status_data_msg, NULL, NULL },
"lightred", NULL, &cfg_col_status_data_msg, NULL, &config_change_color },
{ "col_status_data_other", N_("color for window with new data (not messages)"),
N_("color for window with new data (not messages) (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_status_data_other, NULL, NULL },
"lightmagenta", NULL, &cfg_col_status_data_other, NULL, &config_change_color },
{ "col_status_more", N_("color for \"*MORE*\" text"),
N_("color for window with new data (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_status_more, NULL, NULL },
"white", NULL, &cfg_col_status_more, NULL, &config_change_color },
{ "col_status_bg", N_("background for status window"),
N_("background for status window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"blue", NULL, &cfg_col_status_bg, NULL, NULL },
"blue", NULL, &cfg_col_status_bg, NULL, &config_change_color },
/* infobar window */
{ "col_infobar", N_("color for info bar text"),
N_("color for info bar text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"black", NULL, &cfg_col_infobar, NULL, NULL },
"black", NULL, &cfg_col_infobar, NULL, &config_change_color },
{ "col_infobar_highlight", N_("color for info bar highlight notification"),
N_("color for info bar highlight notification"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_infobar_highlight, NULL, NULL },
"white", NULL, &cfg_col_infobar_highlight, NULL, &config_change_color },
{ "col_infobar_bg", N_("background for info bar window"),
N_("background for info bar window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_infobar_bg, NULL, NULL },
"cyan", NULL, &cfg_col_infobar_bg, NULL, &config_change_color },
/* input window */
{ "col_input", N_("color for input text"),
N_("color for input text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_input, NULL, NULL },
"gray", NULL, &cfg_col_input, NULL, &config_change_color },
{ "col_input_channel", N_("color for input text (channel name)"),
N_("color for input text (channel name)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_input_channel, NULL, NULL },
"white", NULL, &cfg_col_input_channel, NULL, &config_change_color },
{ "col_input_nick", N_("color for input text (nick name)"),
N_("color for input text (nick name)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_input_nick, NULL, NULL },
"lightgreen", NULL, &cfg_col_input_nick, NULL, &config_change_color },
{ "col_input_bg", N_("background for input window"),
N_("background for input window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_input_bg, NULL, NULL },
"default", NULL, &cfg_col_input_bg, NULL, &config_change_color },
/* nick window */
{ "col_nick", N_("color for nicknames"),
N_("color for nicknames"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_nick, NULL, NULL },
"gray", NULL, &cfg_col_nick, NULL, &config_change_color },
{ "col_nick_op", N_("color for operator symbol"),
N_("color for operator symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_nick_op, NULL, NULL },
"lightgreen", NULL, &cfg_col_nick_op, NULL, &config_change_color },
{ "col_nick_halfop", N_("color for half-operator symbol"),
N_("color for half-operator symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_nick_halfop, NULL, NULL },
"lightmagenta", NULL, &cfg_col_nick_halfop, NULL, &config_change_color },
{ "col_nick_voice", N_("color for voice symbol"),
N_("color for voice symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_nick_voice, NULL, NULL },
"yellow", NULL, &cfg_col_nick_voice, NULL, &config_change_color },
{ "col_nick_sep", N_("color for nick separator"),
N_("color for nick separator"),
OPTION_TYPE_COLOR, 0, 0, 0,
"blue", NULL, &cfg_col_nick_sep, NULL, NULL },
"blue", NULL, &cfg_col_nick_sep, NULL, &config_change_color },
{ "col_nick_self", N_("color for local nick"),
N_("color for local nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_nick_self, NULL, NULL },
"white", NULL, &cfg_col_nick_self, NULL, &config_change_color },
{ "col_nick_private", N_("color for other nick in private window"),
N_("color for other nick in private window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_nick_private, NULL, NULL },
"gray", NULL, &cfg_col_nick_private, NULL, &config_change_color },
{ "col_nick_bg", N_("background for nicknames"),
N_("background for nicknames"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_nick_bg, NULL, NULL },
"default", NULL, &cfg_col_nick_bg, NULL, &config_change_color },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -568,6 +568,83 @@ get_pos_array_values (char **array, char *string)
return -1;
}
/*
* config_get_section: get section name from option pointer
*/
char *
config_get_section (t_config_option *ptr_option)
{
int i, j;
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
/* if option found, return pointer to section name */
if (ptr_option == &weechat_options[i][j])
return config_sections[i].section_name;
}
}
}
/* option not found */
return NULL;
}
/*
* config_change_noop: called when an option is changed by /set command
* and that no special action is needed after that
*/
void
config_change_noop ()
{
/* do nothing */
}
/*
* config_change_title: called when title is changed
*/
void
config_change_title ()
{
gui_set_window_title ();
}
/*
* config_change_windows: called when windows change (for example nicklist)
*/
void
config_change_windows ()
{
gui_switch_to_window (gui_current_window);
gui_redraw_window (gui_current_window);
}
/*
* config_change_window_content: called when content of a window changes
*/
void
config_change_window_content ()
{
gui_redraw_window (gui_current_window);
}
/*
* config_change_color: called when a color is changed by /set command
*/
void
config_change_color()
{
gui_init_colors ();
}
/*
* config_option_set_value: set new value for an option
* return: 0 if success
@@ -615,14 +692,12 @@ config_option_set_value (t_config_option *option, char *value)
}
/*
* config_set_value: set new value for an option (found by name)
* return: 0 if success
* -1 if bad value for option
* -2 if option is not found
* config_option_search: look for an option and return pointer to this option
* if option is not found, NULL is returned
*/
int
config_set_value (char *option_name, char *value)
t_config_option *
config_option_search (char *option_name)
{
int i, j;
@@ -632,14 +707,33 @@ config_set_value (char *option_name, char *value)
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
/* if option found, assign value and exit */
/* if option found, return pointer */
if (strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
return config_option_set_value (&weechat_options[i][j], value);
return &weechat_options[i][j];
}
}
}
/* option not found */
return -2;
return NULL;
}
/*
* config_set_value: set new value for an option (found by name)
* return: 0 if success
* -1 if bad value for option
* -2 if option is not found
*/
int
config_set_value (char *option_name, char *value)
{
t_config_option *ptr_option;
ptr_option = config_option_search (option_name);
if (ptr_option)
return config_option_set_value (ptr_option, value);
else
return -2;
}
/*
+10 -1
View File
@@ -70,7 +70,7 @@ struct t_config_option
char **array_values;
int *ptr_int;
char **ptr_string;
int (*handler_change)(int *, char **);
void (*handler_change)();
};
extern int cfg_look_set_title;
@@ -155,6 +155,15 @@ extern char *cfg_proxy_password;
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
extern char *config_get_section ();
extern void config_change_noop ();
extern void config_change_title ();
extern void config_change_windows ();
extern void config_change_window_content ();
extern void config_change_color ();
extern int config_option_set_value (t_config_option *, char *);
extern t_config_option *config_option_search (char *);
extern int config_set_value (char *, char *);
extern int config_read ();
extern int config_create_default ();
extern int config_write ();
+62 -33
View File
@@ -182,7 +182,7 @@ gui_calculate_pos_size (t_gui_window *window)
/* init chat & nicklist settings */
/* TODO: calculate values from function parameters */
if (WIN_IS_CHANNEL(window))
if (cfg_look_nicklist && WIN_IS_CHANNEL(window))
{
max_length = nick_get_max_length (CHANNEL(window));
@@ -1147,13 +1147,16 @@ gui_switch_to_window (t_gui_window *window)
window->win_status = ptr_win->win_status;
window->win_infobar = ptr_win->win_infobar;
window->win_input = ptr_win->win_input;
ptr_win->win_title = NULL;
ptr_win->win_chat = NULL;
ptr_win->win_nick = NULL;
ptr_win->win_status = NULL;
ptr_win->win_infobar = NULL;
ptr_win->win_input = NULL;
ptr_win->is_displayed = 0;
if (ptr_win != window)
{
ptr_win->win_title = NULL;
ptr_win->win_chat = NULL;
ptr_win->win_nick = NULL;
ptr_win->win_status = NULL;
ptr_win->win_infobar = NULL;
ptr_win->win_input = NULL;
ptr_win->is_displayed = 0;
}
break;
}
}
@@ -1169,46 +1172,52 @@ gui_switch_to_window (t_gui_window *window)
window->win_chat_width,
window->win_chat_y,
window->win_chat_x);
if (CHANNEL(window))
if (cfg_look_nicklist && CHANNEL(window))
window->win_nick = newwin (window->win_nick_height,
window->win_nick_width,
window->win_nick_y,
window->win_nick_x);
else
window->win_nick = NULL;
if (cfg_look_infobar)
{
window->win_infobar = newwin (1, COLS, LINES - 2, 0);
window->win_status = newwin (1, COLS, LINES - 3, 0);
}
else
window->win_status = newwin (1, COLS, LINES - 2, 0);
window->win_input = newwin (1, COLS, LINES - 1, 0);
}
else
{
/* create chat & nick windows */
/* remove some windows */
if (window->win_nick)
{
delwin (window->win_nick);
window->win_nick = NULL;
}
if (window->win_status)
{
delwin (window->win_status);
window->win_status = NULL;
}
if (window->win_infobar)
{
delwin (window->win_infobar);
window->win_infobar = NULL;
}
/* create windows */
if (WIN_IS_CHANNEL(window))
{
/* (re)create nicklist window */
if (window->win_nick)
delwin (window->win_nick);
delwin (window->win_chat);
window->win_chat = newwin (window->win_chat_height,
window->win_chat_width,
window->win_chat_y,
window->win_chat_x);
window->win_nick = newwin (window->win_nick_height,
window->win_nick_width,
window->win_nick_y,
window->win_nick_x);
if (cfg_look_nicklist)
window->win_nick = newwin (window->win_nick_height,
window->win_nick_width,
window->win_nick_y,
window->win_nick_x);
else
window->win_nick = NULL;
}
if (!(WIN_IS_CHANNEL(window)))
{
/* remove nick list window */
if (window->win_nick)
delwin (window->win_nick);
window->win_nick = NULL;
delwin (window->win_chat);
window->win_chat = newwin (window->win_chat_height,
window->win_chat_width,
@@ -1217,6 +1226,15 @@ gui_switch_to_window (t_gui_window *window)
}
}
/* create status/infobar windows */
if (cfg_look_infobar)
{
window->win_infobar = newwin (1, COLS, LINES - 2, 0);
window->win_status = newwin (1, COLS, LINES - 3, 0);
}
else
window->win_status = newwin (1, COLS, LINES - 2, 0);
/* change current window to the new window */
gui_current_window = window;
@@ -1476,6 +1494,20 @@ gui_init_colors ()
}
}
/*
* gui_set_window_title: set terminal title
*/
void
gui_set_window_title ()
{
#ifdef __linux__
/* set title for term window, not for console */
if (strcmp (getenv ("TERM"), "linux") != 0)
printf ("\e]2;" PACKAGE_NAME " " PACKAGE_VERSION "\a\e]1;" PACKAGE_NAME " " PACKAGE_VERSION "\a");
#endif
}
/*
* gui_init: init GUI
*/
@@ -1500,11 +1532,8 @@ gui_init ()
signal (SIGWINCH, gui_curses_resize_handler);
#ifdef __linux__
/* set title for term window, not for console */
if (cfg_look_set_title && (strcmp (getenv ("TERM"), "linux") != 0))
printf ("\e]2;" PACKAGE_NAME " " PACKAGE_VERSION "\a\e]1;" PACKAGE_NAME " " PACKAGE_VERSION "\a");
#endif
if (cfg_look_set_title)
gui_set_window_title ();
gui_ready = 1;
}
+10
View File
@@ -599,6 +599,16 @@ gui_init_colors ()
/* TODO: init colors for Gtk */
}
/*
* gui_set_window_title: set window title
*/
void
gui_set_window_title ()
{
/* TODO: set window title for Gtk */
}
/*
* gui_init: init GUI
*/
+2 -1
View File
@@ -241,7 +241,8 @@ extern void gui_move_page_up ();
extern void gui_move_page_down ();
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_pre_init (int *, char **[]);
//extern void gui_init_colors ();
extern void gui_init_colors ();
extern void gui_set_window_title ();
extern void gui_init ();
extern void gui_window_free (t_gui_window *);
extern void gui_end ();
+3 -3
View File
@@ -361,7 +361,7 @@ server_msgq_add_msg (t_irc_server *server, char *msg)
if (!message)
{
gui_printf (server->window,
_("%s not enough memory for received IRC message"),
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
return;
}
@@ -372,7 +372,7 @@ server_msgq_add_msg (t_irc_server *server, char *msg)
strlen (msg) + 1);
if (!message->data)
gui_printf (server->window,
_("%s not enough memory for received IRC message"),
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
else
{
@@ -426,7 +426,7 @@ server_msgq_add_buffer (t_irc_server * server, char *buffer)
strlen (buffer) + 1);
if (!unterminated_message)
gui_printf (server->window,
_("%s not enough memory for received IRC message"),
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
else
strcpy (unterminated_message, buffer);