aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Fabio Bas2010-11-20 14:34:35 +0000
committerGravatar Fabio Bas2010-11-20 14:34:35 +0000
commit5958a3b64b07290401bfa990060182d5efd41850 (patch)
treee8982f423dcd8c649259d5e218baf4ca0bbf5829 /src/modules
parentFixed restore script dialog (diff)
downloadKVIrc-5958a3b64b07290401bfa990060182d5efd41850.tar.gz
KVIrc-5958a3b64b07290401bfa990060182d5efd41850.tar.bz2
KVIrc-5958a3b64b07290401bfa990060182d5efd41850.zip
added $window.isDocked and window.savePropertiesAsDefault
removed hardcoded partAllChannels(), unhighlightAllWindows() and window "system popup" creation routines binded windows "system popup"request with the OnWindowPopupRequest event implemented all previous hardcoded functions in kvs in the (previously unused) "windowpopup" popup implements #1021; you'll need to restore default scripts or add the popup manually The first who opens a bug ticket because he missed to restore the scripts will win a puppy git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5150 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/window/libkviwindow.cpp60
1 files changed, 58 insertions, 2 deletions
diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp
index b9bcafc8c..1729c22ac 100644
--- a/src/modules/window/libkviwindow.cpp
+++ b/src/modules/window/libkviwindow.cpp
@@ -176,7 +176,7 @@ static bool window_kvs_cmd_close(KviKvsModuleCommandCall * c)
no operation is performed. If the specified window
does not exist a warning is printed unless the -q switch is used.
@seealso:
- [cmd]window.undock[/cmd]
+ [cmd]window.undock[/cmd], [fnc]$window.isDocked[/fnc]
*/
static bool window_kvs_cmd_dock(KviKvsModuleCommandCall * c)
@@ -205,7 +205,7 @@ static bool window_kvs_cmd_dock(KviKvsModuleCommandCall * c)
no operation is performed. If the specified window
does not exist a warning is printed unless the -q switch is used.
@seealso:
- [cmd]window.dock[/cmd]
+ [cmd]window.dock[/cmd], [fnc]$window.isDocked[/fnc]
*/
static bool window_kvs_cmd_undock(KviKvsModuleCommandCall * c)
@@ -480,6 +480,35 @@ static bool window_kvs_fnc_activityTemperature(KviKvsModuleFunctionCall * c)
}
/*
+ @doc: window.isDocked
+ @type:
+ function
+ @title:
+ $window.isDocked
+ @short:
+ Checks if a window is currently docked
+ @syntax:
+ $window.isDocked
+ $window.isDocked(<window_id>)
+ @description:
+ Returns 1 if the window specified by <window_id> is currently docked and 0 otherwise.
+ The form with no parameters works on the current window. If the specified window
+ doesn't exist then 0 is returned.
+ @seealso:
+ [cmd]window.dock[/cmd], [cmd]window.undock[/cmd]
+*/
+
+static bool window_kvs_fnc_isDocked(KviKvsModuleFunctionCall * c)
+{
+ GET_KVS_FNC_WINDOW_ID
+ if(pWnd)
+ {
+ c->returnValue()->setBoolean(pWnd->mdiParent() ? true : false);
+ }
+ return true;
+}
+
+/*
@doc: window.isMinimized
@type:
function
@@ -1428,6 +1457,31 @@ static bool window_kvs_cmd_setBackground(KviKvsModuleCommandCall * c)
[fnc]$asciiToHex[/fnc], [fnc]$features[/fnc]
*/
+/*
+ @doc: window.savePropertiesAsDefault
+ @type:
+ command
+ @title:
+ window.savePropertiesAsDefault
+ @short:
+ Saves the window properties as default
+ @syntax:
+ window.savePropertiesAsDefault [window_id]
+ @description:
+ Saves the window properties of the specified window as default for every window
+ of the same type (eg: all queries, all channels, ..).
+ If window_id is missing then the current window properties are used.
+*/
+
+static bool window_kvs_cmd_savePropertiesAsDefault(KviKvsModuleCommandCall * c)
+{
+ GET_KVS_WINDOW_ID
+ if(pWnd)
+ {
+ pWnd->savePropertiesAsDefault();
+ }
+ return true;
+}
#ifdef COMPILE_CRYPT_SUPPORT
static bool initializeCryptEngine(KviCryptEngine * eng,KviStr &szEncryptKey,KviStr &szDecryptKey,QString &szError)
@@ -1554,6 +1608,7 @@ static bool window_module_init(KviModule *m)
KVSM_REGISTER_FUNCTION(m,"console",window_kvs_fnc_console);
KVSM_REGISTER_FUNCTION(m,"hasUserFocus",window_kvs_fnc_hasUserFocus);
KVSM_REGISTER_FUNCTION(m,"hasOutput",window_kvs_fnc_hasOutput);
+ KVSM_REGISTER_FUNCTION(m,"isDocked",window_kvs_fnc_isDocked);
KVSM_REGISTER_FUNCTION(m,"isMinimized",window_kvs_fnc_isMinimized);
KVSM_REGISTER_FUNCTION(m,"isMaximized",window_kvs_fnc_isMaximized);
KVSM_REGISTER_FUNCTION(m,"caption",window_kvs_fnc_caption);
@@ -1581,6 +1636,7 @@ static bool window_module_init(KviModule *m)
KVSM_REGISTER_SIMPLE_COMMAND(m,"setCryptEngine",window_kvs_cmd_setCryptEngine);
KVSM_REGISTER_SIMPLE_COMMAND(m,"setInputText",window_kvs_cmd_setInputText);
KVSM_REGISTER_SIMPLE_COMMAND(m,"insertInInputText",window_kvs_cmd_insertInInputText);
+ KVSM_REGISTER_SIMPLE_COMMAND(m,"savePropertiesAsDefault",window_kvs_cmd_savePropertiesAsDefault);
// saveOutput (view()->saveBuffer())
/*