From e2baf2ccce1dbff7fb16693848149c017675f9e5 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 10 Aug 2010 15:24:11 +0000 Subject: Fixed OnUserModeChange event name Added OnWindowTitleRequest event (implements #804) Expanded window.setWindowTitle so that it can change the title of any type of window git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4846 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/window/libkviwindow.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/modules/window/libkviwindow.cpp') diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp index a921373ad..dd44c389c 100644 --- a/src/modules/window/libkviwindow.cpp +++ b/src/modules/window/libkviwindow.cpp @@ -1166,9 +1166,7 @@ static bool window_kvs_fnc_open(KviKvsModuleFunctionCall * c) @description: Sets the caption of the user window specified by to .[br] If is an empty string then the current window is assumed.[br] - The window must be of type userwnd and must have been created by [fnc]$window.open[/fnc]: - it is not possible to change the caption of other window types.[br] - If the window does not exists or is not of the expected type then a warning is printed unless the -q switch is used.[br] + If the window does not exists then a warning is printed unless the -q switch is used.[br] @seealso: */ @@ -1194,7 +1192,13 @@ static bool window_kvs_cmd_setWindowTitle(KviKvsModuleCommandCall * c) { ((KviUserWindow *)pWnd)->setWindowTitleStrings(szPlain); } else { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs("The specified window is not of type \"userwnd\"")); + //store the window title (needed for functions that search windows by their captions) + ((KviWindow *)pWnd)->setFixedCaption(szPlain); + + if(((KviWindow *)pWnd)->mdiParent()) + ((KviWindow *)pWnd)->mdiParent()->setWindowTitle(szPlain); + else + ((KviWindow *)pWnd)->setWindowTitle(szPlain); } return true; } -- cgit v1.3.1-10-gc9f91