From ede76f7b4440ecc983ad414012b14819bc975d30 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 4 Oct 2003 08:53:10 +0000 Subject: [PATCH] Added "look_set_title" option in config file --- BUGS | 6 +++--- ChangeLog | 9 +++++---- TODO | 28 +++++++++++++--------------- src/config.c | 7 ++++++- src/config.h | 1 + src/gui/curses/gui-display.c | 4 ++-- weechat/BUGS | 6 +++--- weechat/ChangeLog | 9 +++++---- weechat/TODO | 28 +++++++++++++--------------- weechat/src/config.c | 7 ++++++- weechat/src/config.h | 1 + weechat/src/gui/curses/gui-display.c | 4 ++-- 12 files changed, 60 insertions(+), 50 deletions(-) diff --git a/BUGS b/BUGS index 2f1952d8b..25256d226 100644 --- a/BUGS +++ b/BUGS @@ -1,15 +1,15 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -WeeChat known bugs, 2003-10-03 +WeeChat known bugs, 2003-10-04 - too much nicks in the channel (> height of window) => display bug - some IRC commands are marked as 'unknown' when received (IRC protocol is under dev!) -- config is not saved (to ~/.weechat/weechatrc) - intercept Ctrl-C (do not quit immediately if Ctrl-C pressed!) - program is stopped when bad option in config file (it should not, only display warning) -- too much opened channel => display bug +- too much opened channels => display bug - when kicked, channel is not prefixed by '(' and sufixed by ')' - when function key (non used by WeeChat) is pressed, prompt is deleted +- when quitting WeeChat term title is not restored (if look_set_title is ON) diff --git a/ChangeLog b/ChangeLog index 05b2d7429..852f9689c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,15 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2003-10-03 +ChangeLog - 2003-10-04 Version 0.0.2 (under dev!): - * alias for commands (new commands /alias and /unalias, new section in config file) - * config is now saved automatically when quitting WeeChat - * added new WeeChat commands: server, connect, disconnect, save + * new commands for alias: /alias, /unalias (new section in config file) + * config is now saved automatically when quitting WeeChat, /save command added + * new commands for servers: /server, /connect, /disconnect * added autoconnect flag for each server in config file + * added "look_set_title" option in config file * term window title is modified with WeeChat name and version * fixed nicklist display bug * fixed crash when sending command which can only be received diff --git a/TODO b/TODO index f1c211b19..38d1e257a 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,7 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -TODO - 2003-10-03 +TODO - 2003-10-04 Legend: # done @@ -14,7 +14,6 @@ v0.0.2: ------ * IRC protocol: - - implement RFC 2812 + "/mode" command: change the user/channels modes - "/rehash" command: tell the server to reload its config file - "/restart" command: tell the server to restart itself @@ -22,36 +21,25 @@ v0.0.2: * WeeChat commands: # "/connect" and "/disconnect" commands (for multiservers use) # "/server" command to add, remove or list servers - - "/reload" command: reload the WeeChat's config file # "/save" command: save configuration to disk - + "/set" command: allow the user to set the WeeChat variables - under WeeChat without editing the config file (colours, time - format, etc) # "/alias" and "/unalias" commands - - "/highlight" command: highlight a given word when it appears on - channels/privates * Interface: - display current channel modes (example : #weechat(+nt)) - * TCP/IP communication: - - connect to server with child process (background) - * Configuration: # write config file - + add alias definition + # add alias definition - add an option for each server in order to run commands on join (example: /msg nickserv identify password) - channel list for auto-join (for each server) - - do not stop program if problem with options in config file - - load config file after GUI (so init values by default (colors, ...) before - loading config) Future versions: --------------- * IRC protocol: + - implement RFC 2812 - "/dcc" command (for chat and sending/receiving files) - complete "/list" command: add regexp search, display only channels that match regexp @@ -71,6 +59,12 @@ Future versions: and show us the output on the current window. An option to exec like -o could send the output to the server, on the current channel/private + - "/reload" command: reload the WeeChat's config file + - "/highlight" command: highlight a given word when it appears on + channels/privates + + "/set" command: allow the user to set the WeeChat variables + under WeeChat without editing the config file (colours, time + format, etc) * Interface: - interpret special chars in messages (color & bold for example) @@ -87,6 +81,7 @@ Future versions: ? Qt GUI * TCP/IP communication: + - connect to server with child process (background) - SSL support - IPv6 protocol implementation @@ -94,6 +89,9 @@ Future versions: - add key bindings to config file - add missing options for config file - wrong alias is not created and not saved when quitting WeeChat + - do not stop program if problem with options in config file + - load config file after GUI (so init values by default (colors, ...) before + loading config) * Plugins: - add Perl plugin diff --git a/src/config.c b/src/config.c index a570488bd..0d34efea0 100644 --- a/src/config.c +++ b/src/config.c @@ -51,6 +51,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] = /* config, look & feel section */ +int cfg_look_set_title; int cfg_look_startup_logo; int cfg_look_startup_version; char *cfg_look_weechat_slogan; @@ -69,7 +70,11 @@ char *cfg_look_no_nickname; char *cfg_look_completor; t_config_option weechat_options_look[] = -{ { "look_startup_logo", N_("display " WEECHAT_NAME " logo at startup"), +{ { "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"), + OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, + NULL, NULL, &cfg_look_set_title, NULL, NULL }, + { "look_startup_logo", N_("display " WEECHAT_NAME " logo at startup"), N_("display " WEECHAT_NAME " logo at startup"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, NULL, NULL, &cfg_look_startup_logo, NULL, NULL }, diff --git a/src/config.h b/src/config.h index 36eeb1616..692698797 100644 --- a/src/config.h +++ b/src/config.h @@ -75,6 +75,7 @@ struct t_config_option int (*handler_change)(int *, char **); }; +extern int cfg_look_set_title; extern int cfg_look_startup_logo; extern int cfg_look_startup_version; extern char *cfg_look_weechat_slogan; diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index 26c2100f9..ac146ccce 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -1545,9 +1545,9 @@ gui_init () signal (SIGWINCH, gui_resize_term_handler); - #ifdef __LINUX__ + #ifdef __linux__ /* set title for term window, not for console */ - if (strcmp (getenv ("TERM"), "linux") != 0) + if (cfg_look_set_title && (strcmp (getenv ("TERM"), "linux") != 0)) printf ("\e]2;" WEECHAT_NAME " " WEECHAT_VERSION "\a\e]1;" WEECHAT_NAME " " WEECHAT_VERSION "\a"); #endif diff --git a/weechat/BUGS b/weechat/BUGS index 2f1952d8b..25256d226 100644 --- a/weechat/BUGS +++ b/weechat/BUGS @@ -1,15 +1,15 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -WeeChat known bugs, 2003-10-03 +WeeChat known bugs, 2003-10-04 - too much nicks in the channel (> height of window) => display bug - some IRC commands are marked as 'unknown' when received (IRC protocol is under dev!) -- config is not saved (to ~/.weechat/weechatrc) - intercept Ctrl-C (do not quit immediately if Ctrl-C pressed!) - program is stopped when bad option in config file (it should not, only display warning) -- too much opened channel => display bug +- too much opened channels => display bug - when kicked, channel is not prefixed by '(' and sufixed by ')' - when function key (non used by WeeChat) is pressed, prompt is deleted +- when quitting WeeChat term title is not restored (if look_set_title is ON) diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 05b2d7429..852f9689c 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,14 +1,15 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2003-10-03 +ChangeLog - 2003-10-04 Version 0.0.2 (under dev!): - * alias for commands (new commands /alias and /unalias, new section in config file) - * config is now saved automatically when quitting WeeChat - * added new WeeChat commands: server, connect, disconnect, save + * new commands for alias: /alias, /unalias (new section in config file) + * config is now saved automatically when quitting WeeChat, /save command added + * new commands for servers: /server, /connect, /disconnect * added autoconnect flag for each server in config file + * added "look_set_title" option in config file * term window title is modified with WeeChat name and version * fixed nicklist display bug * fixed crash when sending command which can only be received diff --git a/weechat/TODO b/weechat/TODO index f1c211b19..38d1e257a 100644 --- a/weechat/TODO +++ b/weechat/TODO @@ -1,7 +1,7 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -TODO - 2003-10-03 +TODO - 2003-10-04 Legend: # done @@ -14,7 +14,6 @@ v0.0.2: ------ * IRC protocol: - - implement RFC 2812 + "/mode" command: change the user/channels modes - "/rehash" command: tell the server to reload its config file - "/restart" command: tell the server to restart itself @@ -22,36 +21,25 @@ v0.0.2: * WeeChat commands: # "/connect" and "/disconnect" commands (for multiservers use) # "/server" command to add, remove or list servers - - "/reload" command: reload the WeeChat's config file # "/save" command: save configuration to disk - + "/set" command: allow the user to set the WeeChat variables - under WeeChat without editing the config file (colours, time - format, etc) # "/alias" and "/unalias" commands - - "/highlight" command: highlight a given word when it appears on - channels/privates * Interface: - display current channel modes (example : #weechat(+nt)) - * TCP/IP communication: - - connect to server with child process (background) - * Configuration: # write config file - + add alias definition + # add alias definition - add an option for each server in order to run commands on join (example: /msg nickserv identify password) - channel list for auto-join (for each server) - - do not stop program if problem with options in config file - - load config file after GUI (so init values by default (colors, ...) before - loading config) Future versions: --------------- * IRC protocol: + - implement RFC 2812 - "/dcc" command (for chat and sending/receiving files) - complete "/list" command: add regexp search, display only channels that match regexp @@ -71,6 +59,12 @@ Future versions: and show us the output on the current window. An option to exec like -o could send the output to the server, on the current channel/private + - "/reload" command: reload the WeeChat's config file + - "/highlight" command: highlight a given word when it appears on + channels/privates + + "/set" command: allow the user to set the WeeChat variables + under WeeChat without editing the config file (colours, time + format, etc) * Interface: - interpret special chars in messages (color & bold for example) @@ -87,6 +81,7 @@ Future versions: ? Qt GUI * TCP/IP communication: + - connect to server with child process (background) - SSL support - IPv6 protocol implementation @@ -94,6 +89,9 @@ Future versions: - add key bindings to config file - add missing options for config file - wrong alias is not created and not saved when quitting WeeChat + - do not stop program if problem with options in config file + - load config file after GUI (so init values by default (colors, ...) before + loading config) * Plugins: - add Perl plugin diff --git a/weechat/src/config.c b/weechat/src/config.c index a570488bd..0d34efea0 100644 --- a/weechat/src/config.c +++ b/weechat/src/config.c @@ -51,6 +51,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] = /* config, look & feel section */ +int cfg_look_set_title; int cfg_look_startup_logo; int cfg_look_startup_version; char *cfg_look_weechat_slogan; @@ -69,7 +70,11 @@ char *cfg_look_no_nickname; char *cfg_look_completor; t_config_option weechat_options_look[] = -{ { "look_startup_logo", N_("display " WEECHAT_NAME " logo at startup"), +{ { "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"), + OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, + NULL, NULL, &cfg_look_set_title, NULL, NULL }, + { "look_startup_logo", N_("display " WEECHAT_NAME " logo at startup"), N_("display " WEECHAT_NAME " logo at startup"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, NULL, NULL, &cfg_look_startup_logo, NULL, NULL }, diff --git a/weechat/src/config.h b/weechat/src/config.h index 36eeb1616..692698797 100644 --- a/weechat/src/config.h +++ b/weechat/src/config.h @@ -75,6 +75,7 @@ struct t_config_option int (*handler_change)(int *, char **); }; +extern int cfg_look_set_title; extern int cfg_look_startup_logo; extern int cfg_look_startup_version; extern char *cfg_look_weechat_slogan; diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index 26c2100f9..ac146ccce 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -1545,9 +1545,9 @@ gui_init () signal (SIGWINCH, gui_resize_term_handler); - #ifdef __LINUX__ + #ifdef __linux__ /* set title for term window, not for console */ - if (strcmp (getenv ("TERM"), "linux") != 0) + if (cfg_look_set_title && (strcmp (getenv ("TERM"), "linux") != 0)) printf ("\e]2;" WEECHAT_NAME " " WEECHAT_VERSION "\a\e]1;" WEECHAT_NAME " " WEECHAT_VERSION "\a"); #endif