diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-01-24 16:50:20 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-01-24 16:50:20 +0100 |
commit | ed26a0389c06250f02329fa477d2cffe7df59b5e (patch) | |
tree | ecfade4a588ba8c8dcd31d0894afabe8fbad5aad /src/gui/curses | |
parent | 25c5bc64217bce570afc36e57b0e838f54f08465 (diff) | |
download | weechat-ed26a0389c06250f02329fa477d2cffe7df59b5e.zip |
Add of "modifier" hook, migration of charset plugin to new API, SIGHUP signal catched (reload all config files), better config files reloading
Diffstat (limited to 'src/gui/curses')
-rw-r--r-- | src/gui/curses/gui-curses-color.c | 2 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-main.c | 17 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-window.c | 4 |
3 files changed, 15 insertions, 8 deletions
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index 073fcd74d..cacb8ec46 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -98,7 +98,7 @@ gui_color_get_fg_bg (char *string, char **fg, char **bg) { pos_end_fg--; } - *fg = strndup (string, pos_end_fg - string + 1); + *fg = string_strndup (string, pos_end_fg - string + 1); } else *fg = strudp ("default"); diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index 793ad9e78..e0f9e2547 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -30,6 +30,7 @@ #include <signal.h> #include "../../core/weechat.h" +#include "../../core/wee-command.h" #include "../../core/wee-config.h" #include "../../core/wee-hook.h" #include "../../core/wee-string.h" @@ -119,7 +120,7 @@ gui_main_init () } /* - * gui_main_quit: quit weechat (signal received) + * gui_main_quit: quit WeeChat */ void @@ -129,6 +130,16 @@ gui_main_quit () } /* + * gui_main_reload: reload WeeChat configuration + */ + +void +gui_main_reload () +{ + command_reload (NULL, NULL, 0, NULL, NULL); +} + +/* * gui_main_loop: main loop for WeeChat with ncurses GUI */ @@ -147,8 +158,8 @@ gui_main_loop () /* catch SIGTERM signal: quit program */ util_catch_signal (SIGTERM, &gui_main_quit); - /* cach SIGHUP signal: reload configuration */ - util_catch_signal (SIGHUP, &gui_main_quit); + /* catch SIGHUP signal: reload configuration */ + util_catch_signal (SIGHUP, &gui_main_reload); /* catch SIGWINCH signal: redraw screen */ util_catch_signal (SIGWINCH, &gui_window_refresh_screen_sigwinch); diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 3742a857f..69af89496 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -24,10 +24,7 @@ #endif #include <stdlib.h> -#include <stdarg.h> #include <string.h> -#include <signal.h> -#include <libgen.h> #include "../../core/weechat.h" #include "../../core/wee-config.h" @@ -1334,7 +1331,6 @@ gui_window_refresh_screen_sigwinch () { gui_window_refresh_needed = 1; //gui_window_refresh_screen (0); - signal (SIGWINCH, &gui_window_refresh_screen_sigwinch); } /* |