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

Refresh screen when exiting WeeChat (to display messages printed after /quit)

This commit is contained in:
Sebastien Helleu
2010-03-20 17:09:07 +01:00
parent 9d96090d7d
commit 7925b2d242
21 changed files with 184 additions and 50 deletions
+9 -7
View File
@@ -305,9 +305,12 @@ weechat_lua_unload (struct t_plugin_script *script)
char *lua_argv[1] = { NULL };
void *interpreter;
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
LUA_PLUGIN_NAME, script->name);
if ((weechat_lua_plugin->debug >= 1) || !lua_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
LUA_PLUGIN_NAME, script->name);
}
if (script->shutdown_func && script->shutdown_func[0])
{
@@ -676,11 +679,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
/* unload all scripts */
weechat_lua_unload_all ();
lua_quiet = 1;
script_end (plugin, &lua_scripts, &weechat_lua_unload_all);
lua_quiet = 0;
return WEECHAT_RC_OK;
}
+10 -8
View File
@@ -432,10 +432,13 @@ weechat_perl_unload (struct t_plugin_script *script)
int *r;
char *perl_argv[1] = { NULL };
void *interpreter;
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
PERL_PLUGIN_NAME, script->name);
if ((weechat_perl_plugin->debug >= 1) || !perl_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
PERL_PLUGIN_NAME, script->name);
}
#ifdef MULTIPLICITY
PERL_SET_CONTEXT (script->interpreter);
@@ -871,11 +874,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
/* unload all scripts */
weechat_perl_unload_all ();
perl_quiet = 1;
script_end (plugin, &perl_scripts, &weechat_perl_unload_all);
perl_quiet = 0;
#ifndef MULTIPLICITY
/* free perl intepreter */
+9 -7
View File
@@ -537,9 +537,12 @@ weechat_python_unload (struct t_plugin_script *script)
void *interpreter;
PyThreadState *old_interpreter;
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
PYTHON_PLUGIN_NAME, script->name);
if ((weechat_python_plugin->debug >= 1) || !python_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
PYTHON_PLUGIN_NAME, script->name);
}
if (script->shutdown_func && script->shutdown_func[0])
{
@@ -943,11 +946,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
/* unload all scripts */
weechat_python_unload_all ();
python_quiet = 1;
script_end (plugin, &python_scripts, &weechat_python_unload_all);
python_quiet = 0;
/* free Python interpreter */
if (python_mainThreadState != NULL)
+9 -7
View File
@@ -592,9 +592,12 @@ weechat_ruby_unload (struct t_plugin_script *script)
char *ruby_argv[1] = { NULL };
void *interpreter;
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
RUBY_PLUGIN_NAME, script->name);
if ((weechat_ruby_plugin->debug >= 1) || !ruby_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
RUBY_PLUGIN_NAME, script->name);
}
if (script->shutdown_func && script->shutdown_func[0])
{
@@ -1063,11 +1066,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
/* unload all scripts */
weechat_ruby_unload_all ();
ruby_quiet = 1;
script_end (plugin, &ruby_scripts, &weechat_ruby_unload_all);
ruby_quiet = 0;
ruby_cleanup (0);
+23 -1
View File
@@ -172,7 +172,7 @@ script_upgrade_set_buffer_callbacks (struct t_weechat_plugin *weechat_plugin,
}
/*
* script_init: initialize script
* script_init: initialize script plugin
*/
void
@@ -1238,6 +1238,28 @@ script_infolist_list_scripts (struct t_weechat_plugin *weechat_plugin,
return NULL;
}
/*
* script_end: end script plugin
*/
void
script_end (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **scripts,
void (*callback_unload_all)())
{
int scripts_loaded;
scripts_loaded = (*scripts) ? 1 : 0;
(void)(callback_unload_all) ();
if (scripts_loaded)
{
weechat_printf (NULL, _("%s: scripts unloaded"),
weechat_plugin->name);
}
}
/*
* script_print_log: print script infos in log (usually for crash dump)
*/
+3
View File
@@ -143,6 +143,9 @@ extern struct t_infolist *script_infolist_list_scripts (struct t_weechat_plugin
struct t_plugin_script *scripts,
void *pointer,
const char *arguments);
extern void script_end (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **scripts,
void (*callback_unload_all)());
extern void script_print_log (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts);
+9 -6
View File
@@ -240,9 +240,12 @@ weechat_tcl_unload (struct t_plugin_script *script)
Tcl_Interp* interp;
void *pointer;
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
TCL_PLUGIN_NAME, script->name);
if ((weechat_tcl_plugin->debug >= 1) || !tcl_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
TCL_PLUGIN_NAME, script->name);
}
if (script->shutdown_func && script->shutdown_func[0])
{
@@ -611,10 +614,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
(void) plugin;
/* unload all scripts */
weechat_tcl_unload_all ();
tcl_quiet = 1;
script_end (plugin, &tcl_scripts, &weechat_tcl_unload_all);
tcl_quiet = 0;
return WEECHAT_RC_OK;
}