diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2004-01-19 23:16:07 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2004-01-19 23:16:07 +0000 |
commit | c20a3fdfa4f71bd750d1b58ab0673e376ec52c6c (patch) | |
tree | 3ec858ccd1eb14faaaf66ee2121a08f9f3dd5fec | |
parent | f97a5555cafb82e773b9bed6f96f5e2147702c88 (diff) | |
download | weechat-c20a3fdfa4f71bd750d1b58ab0673e376ec52c6c.zip |
Added look_infobar_timestamp config option
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/common/weechat.c | 3 | ||||
-rw-r--r-- | src/common/weechat.h | 1 | ||||
-rw-r--r-- | src/common/weeconfig.c | 5 | ||||
-rw-r--r-- | src/common/weeconfig.h | 1 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 7 | ||||
-rw-r--r-- | weechat/ChangeLog | 3 | ||||
-rw-r--r-- | weechat/src/common/weechat.c | 3 | ||||
-rw-r--r-- | weechat/src/common/weechat.h | 1 | ||||
-rw-r--r-- | weechat/src/common/weeconfig.c | 5 | ||||
-rw-r--r-- | weechat/src/common/weeconfig.h | 1 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-display.c | 7 |
12 files changed, 20 insertions, 20 deletions
@@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2004-01-18 +ChangeLog - 2004-01-20 Version 0.0.5 (under dev!): + * info bar timestamp is added to config ("look_infobar_timestamp") * added info bar (optional, "look_infobar" to enable it, "on" by default) * fixed crash with /oper command * for default config file, nick is now based on un*x username (thanks to Witukind) diff --git a/src/common/weechat.c b/src/common/weechat.c index a64d3022d..5682fa22e 100644 --- a/src/common/weechat.c +++ b/src/common/weechat.c @@ -58,7 +58,6 @@ #include "../plugins/plugins.h" -char *var_LANG; /* LANG environment variable */ int quit_weechat; /* = 1 if quit request from user... why ? :'( */ char *weechat_home; /* WeeChat home dir. (example: /home/toto/.weechat) */ FILE *log_file; /* WeeChat log file (~/.weechat/weechat.log) */ @@ -429,8 +428,6 @@ wee_shutdown () int main (int argc, char *argv[]) { - var_LANG = getenv ("LANG"); /* get LANG environment variable */ - #ifdef ENABLE_NLS setlocale (LC_ALL, ""); /* initialize gettext */ bindtextdomain (PACKAGE, LOCALEDIR); diff --git a/src/common/weechat.h b/src/common/weechat.h index 58a3b72d9..8fcf09efe 100644 --- a/src/common/weechat.h +++ b/src/common/weechat.h @@ -97,7 +97,6 @@ /* global variables and functions */ -extern char *var_LANG; extern int quit_weechat; extern char *weechat_home; diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c index 4d91862b6..e2e129983 100644 --- a/src/common/weeconfig.c +++ b/src/common/weeconfig.c @@ -74,6 +74,7 @@ int cfg_look_nickmode_empty; char *cfg_look_no_nickname; char *cfg_look_completor; int cfg_look_infobar; +char *cfg_look_infobar_timestamp; t_config_option weechat_options_look[] = { { "look_set_title", N_("set title for terminal window (curses GUI) with name & version"), @@ -142,6 +143,10 @@ t_config_option weechat_options_look[] = N_("enable info bar"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, NULL, NULL, &cfg_look_infobar, NULL, NULL }, + { "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 }, { NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL } }; diff --git a/src/common/weeconfig.h b/src/common/weeconfig.h index 3078355ae..bd1897be2 100644 --- a/src/common/weeconfig.h +++ b/src/common/weeconfig.h @@ -89,6 +89,7 @@ extern int cfg_look_nickmode_empty; extern char *cfg_look_no_nickname; extern char *cfg_look_completor; extern int cfg_look_infobar; +extern char *cfg_look_infobar_timestamp; extern int cfg_col_title; extern int cfg_col_title_bg; diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index 3aa441472..b5090c529 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -926,7 +926,7 @@ gui_draw_window_infobar (t_gui_window *window) { time_t time_seconds; struct tm *local_time; - char text[256]; + char text[1024 + 1]; /* TODO: manage splitted windows! */ if (window != gui_current_window) @@ -943,10 +943,7 @@ gui_draw_window_infobar (t_gui_window *window) time_seconds = time (NULL); local_time = localtime (&time_seconds); - if (strncmp (var_LANG, "fr", 2) == 0) - strftime (text, 255, "%A %d %B %G - %H:%M", local_time); - else - strftime (text, 255, "%B, %A %d %G - %H:%M", local_time); + strftime (text, 1024, cfg_look_infobar_timestamp, local_time); wprintw (window->win_infobar, "%s", text); wrefresh (window->win_infobar); diff --git a/weechat/ChangeLog b/weechat/ChangeLog index ef7fdf504..2115deb3a 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2004-01-18 +ChangeLog - 2004-01-20 Version 0.0.5 (under dev!): + * info bar timestamp is added to config ("look_infobar_timestamp") * added info bar (optional, "look_infobar" to enable it, "on" by default) * fixed crash with /oper command * for default config file, nick is now based on un*x username (thanks to Witukind) diff --git a/weechat/src/common/weechat.c b/weechat/src/common/weechat.c index a64d3022d..5682fa22e 100644 --- a/weechat/src/common/weechat.c +++ b/weechat/src/common/weechat.c @@ -58,7 +58,6 @@ #include "../plugins/plugins.h" -char *var_LANG; /* LANG environment variable */ int quit_weechat; /* = 1 if quit request from user... why ? :'( */ char *weechat_home; /* WeeChat home dir. (example: /home/toto/.weechat) */ FILE *log_file; /* WeeChat log file (~/.weechat/weechat.log) */ @@ -429,8 +428,6 @@ wee_shutdown () int main (int argc, char *argv[]) { - var_LANG = getenv ("LANG"); /* get LANG environment variable */ - #ifdef ENABLE_NLS setlocale (LC_ALL, ""); /* initialize gettext */ bindtextdomain (PACKAGE, LOCALEDIR); diff --git a/weechat/src/common/weechat.h b/weechat/src/common/weechat.h index 58a3b72d9..8fcf09efe 100644 --- a/weechat/src/common/weechat.h +++ b/weechat/src/common/weechat.h @@ -97,7 +97,6 @@ /* global variables and functions */ -extern char *var_LANG; extern int quit_weechat; extern char *weechat_home; diff --git a/weechat/src/common/weeconfig.c b/weechat/src/common/weeconfig.c index 4d91862b6..e2e129983 100644 --- a/weechat/src/common/weeconfig.c +++ b/weechat/src/common/weeconfig.c @@ -74,6 +74,7 @@ int cfg_look_nickmode_empty; char *cfg_look_no_nickname; char *cfg_look_completor; int cfg_look_infobar; +char *cfg_look_infobar_timestamp; t_config_option weechat_options_look[] = { { "look_set_title", N_("set title for terminal window (curses GUI) with name & version"), @@ -142,6 +143,10 @@ t_config_option weechat_options_look[] = N_("enable info bar"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, NULL, NULL, &cfg_look_infobar, NULL, NULL }, + { "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 }, { NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL } }; diff --git a/weechat/src/common/weeconfig.h b/weechat/src/common/weeconfig.h index 3078355ae..bd1897be2 100644 --- a/weechat/src/common/weeconfig.h +++ b/weechat/src/common/weeconfig.h @@ -89,6 +89,7 @@ extern int cfg_look_nickmode_empty; extern char *cfg_look_no_nickname; extern char *cfg_look_completor; extern int cfg_look_infobar; +extern char *cfg_look_infobar_timestamp; extern int cfg_col_title; extern int cfg_col_title_bg; diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index 3aa441472..b5090c529 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -926,7 +926,7 @@ gui_draw_window_infobar (t_gui_window *window) { time_t time_seconds; struct tm *local_time; - char text[256]; + char text[1024 + 1]; /* TODO: manage splitted windows! */ if (window != gui_current_window) @@ -943,10 +943,7 @@ gui_draw_window_infobar (t_gui_window *window) time_seconds = time (NULL); local_time = localtime (&time_seconds); - if (strncmp (var_LANG, "fr", 2) == 0) - strftime (text, 255, "%A %d %B %G - %H:%M", local_time); - else - strftime (text, 255, "%B, %A %d %G - %H:%M", local_time); + strftime (text, 1024, cfg_look_infobar_timestamp, local_time); wprintw (window->win_infobar, "%s", text); wrefresh (window->win_infobar); |