1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 16:53:14 +02:00

core: display a message when mouse state is changed with command /mouse

This commit is contained in:
Sebastien Helleu
2011-10-29 11:27:58 +02:00
parent ce8ae83e17
commit 8eefea424b
11 changed files with 101 additions and 11 deletions
+14
View File
@@ -3121,6 +3121,7 @@ COMMAND_CALLBACK(mouse)
if (string_strcasecmp (argv[1], "enable") == 0)
{
gui_mouse_enable ();
gui_chat_printf (NULL, _("Mouse enabled"));
if (argc > 2)
command_mouse_timer (argv[2]);
return WEECHAT_RC_OK;
@@ -3130,6 +3131,7 @@ COMMAND_CALLBACK(mouse)
if (string_strcasecmp (argv[1], "disable") == 0)
{
gui_mouse_disable ();
gui_chat_printf (NULL, _("Mouse disabled"));
if (argc > 2)
command_mouse_timer (argv[2]);
return WEECHAT_RC_OK;
@@ -3139,14 +3141,26 @@ COMMAND_CALLBACK(mouse)
if (string_strcasecmp (argv[1], "toggle") == 0)
{
if (gui_mouse_enabled)
{
gui_mouse_disable ();
gui_chat_printf (NULL, _("Mouse disabled"));
}
else
{
gui_mouse_enable ();
gui_chat_printf (NULL, _("Mouse enabled"));
}
if (argc > 2)
command_mouse_timer (argv[2]);
return WEECHAT_RC_OK;
}
gui_chat_printf (NULL,
_("%sError: unknown option for \"%s\" "
"command"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
"mouse");
return WEECHAT_RC_OK;
}