diff options
| author | 2011-02-23 06:06:22 +0000 | |
|---|---|---|
| committer | 2011-02-23 06:06:22 +0000 | |
| commit | 987c3fcc5fd3b9217436ac5ca5a0317d76363805 (patch) | |
| tree | 5800f6a60e8e1811871335e81c77c2baad67023b /src/modules/window/libkviwindow.cpp | |
| parent | updated version to fit recent changes (diff) | |
| download | KVIrc-987c3fcc5fd3b9217436ac5ca5a0317d76363805.tar.gz KVIrc-987c3fcc5fd3b9217436ac5ca5a0317d76363805.tar.bz2 KVIrc-987c3fcc5fd3b9217436ac5ca5a0317d76363805.zip | |
Code improvements in window class
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5506 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/window/libkviwindow.cpp')
| -rw-r--r-- | src/modules/window/libkviwindow.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp index 35bb2ba47..4470d6980 100644 --- a/src/modules/window/libkviwindow.cpp +++ b/src/modules/window/libkviwindow.cpp @@ -1143,16 +1143,21 @@ static bool window_kvs_fnc_open(KviKvsModuleFunctionCall * c) QString szFlags; QString szCaption; kvs_uint_t uCtx; - kvs_int_t iIcon; + QString szIcon; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) KVSM_PARAMETER("caption",KVS_PT_STRING,KVS_PF_OPTIONAL,szCaption) KVSM_PARAMETER("irc_context",KVS_PT_UINT,KVS_PF_OPTIONAL,uCtx) - KVSM_PARAMETER("icon",KVS_PT_INT,KVS_PF_OPTIONAL,iIcon) + KVSM_PARAMETER("icon",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) KVSM_PARAMETERS_END(c) - iIcon = iIcon % KviIconManager::IconCount; + QPixmap *pPix=g_pIconManager->getImage(szIcon); + if(!pPix){ + c->warning(__tr2qs("The specified Icon does not exists: switching to 'none'")); + szIcon.prepend("$icon("); + szIcon.append(")"); + } int iFlags = 0; if(szFlags.contains('i')) iFlags |= UserWindow::HasInput; @@ -1170,7 +1175,7 @@ static bool window_kvs_fnc_open(KviKvsModuleFunctionCall * c) UserWindow * pWnd = new UserWindow( c->window()->frame(), szCaption.toUtf8().data(), - iIcon, + szIcon, pConsole, iFlags); |
