diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/curses/gui-curses-main.c | 7 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk-main.c | 9 | ||||
-rw-r--r-- | src/gui/gui-chat.c | 17 | ||||
-rw-r--r-- | src/gui/gui-chat.h | 1 |
4 files changed, 32 insertions, 2 deletions
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index e408161d2..53af9a02e 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -54,9 +54,12 @@ void gui_main_pre_init (int *argc, char **argv[]) { - /* nothing for Curses interface */ + /* make C compiler happy */ (void) argc; (void) argv; + + /* build empty prefixes (before reading config) */ + gui_chat_prefix_build_empty (); } /* @@ -76,6 +79,8 @@ gui_main_init () raw (); gui_color_init (); + + /* build prefixes according to config */ gui_chat_prefix_build (); gui_infobar = NULL; diff --git a/src/gui/gtk/gui-gtk-main.c b/src/gui/gtk/gui-gtk-main.c index 4a316fcc8..51a7beb31 100644 --- a/src/gui/gtk/gui-gtk-main.c +++ b/src/gui/gtk/gui-gtk-main.c @@ -33,6 +33,7 @@ #include "../../core/wee-config.h" #include "../../core/wee-utf8.h" #include "../../plugins/plugin.h" +#include "../gui-chat.h" #include "../gui-main.h" #include "../gui-buffer.h" #include "../gui-history.h" @@ -62,6 +63,9 @@ GtkWidget *gui_gtk_label1; void gui_main_pre_init (int *argc, char **argv[]) { + /* build empty prefixes (before reading config) */ + gui_chat_prefix_build_empty (); + /* Initialise Gtk */ gtk_init (argc, argv); } @@ -82,11 +86,14 @@ gui_main_init () gui_ok = 1; + /* build prefixes according to config */ + gui_chat_prefix_build (); + /* init clipboard buffer */ gui_input_clipboard = NULL; /* create Gtk widgets */ - + gdk_color_parse ("white", &color_fg); gdk_color_parse ("black", &color_bg); diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index cf0c5e69b..9325e12d4 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -49,7 +49,24 @@ int gui_chat_time_length = 0; /* length of time for each line (in chars) */ /* + * gui_chat_prefix_build_empty: build empty prefixes + * (called before reading WeeChat config file) + */ + +void +gui_chat_prefix_build_empty () +{ + gui_chat_prefix[GUI_CHAT_PREFIX_INFO] = gui_chat_prefix_empty; + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR] = gui_chat_prefix_empty; + gui_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = gui_chat_prefix_empty; + gui_chat_prefix[GUI_CHAT_PREFIX_ACTION] = gui_chat_prefix_empty; + gui_chat_prefix[GUI_CHAT_PREFIX_JOIN] = gui_chat_prefix_empty; + gui_chat_prefix[GUI_CHAT_PREFIX_QUIT] = gui_chat_prefix_empty; +} + +/* * gui_chat_prefix_build: build prefix with colors + * (called after reading WeeChat config file) */ void diff --git a/src/gui/gui-chat.h b/src/gui/gui-chat.h index 3da67508f..3dd6fc9f1 100644 --- a/src/gui/gui-chat.h +++ b/src/gui/gui-chat.h @@ -45,6 +45,7 @@ extern int gui_chat_time_length; /* chat functions */ +extern void gui_chat_prefix_build_empty (); extern void gui_chat_prefix_build (); extern int gui_chat_strlen_screen (char *string); extern int gui_chat_string_real_pos (char *string, int pos); |