diff options
| author | 2010-02-18 23:50:49 +0000 | |
|---|---|---|
| committer | 2010-02-18 23:50:49 +0000 | |
| commit | a76a9d344ab9676add0cbe0013e2ad7d63e3b82e (patch) | |
| tree | ef4866720a178b3b6c814d956da5849ca8e61780 /data | |
| parent | improved hungarian notation; (diff) | |
| download | KVIrc-a76a9d344ab9676add0cbe0013e2ad7d63e3b82e.tar.gz KVIrc-a76a9d344ab9676add0cbe0013e2ad7d63e3b82e.tar.bz2 KVIrc-a76a9d344ab9676add0cbe0013e2ad7d63e3b82e.zip | |
fixed /names command; removed useless files
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3986 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'data')
| -rw-r--r-- | data/defscript/aliases.kvs | 2 | ||||
| -rw-r--r-- | data/defscript/installer.kvs | 169 | ||||
| -rw-r--r-- | data/defscript/theme-install.kvs | 30 |
3 files changed, 1 insertions, 200 deletions
diff --git a/data/defscript/aliases.kvs b/data/defscript/aliases.kvs index 94b74f9a2..aa7d9f4f6 100644 --- a/data/defscript/aliases.kvs +++ b/data/defscript/aliases.kvs @@ -220,7 +220,7 @@ alias(names) { echo $tr("Usage:") "/names <channel>" } else { - raw names $active + raw names $chan.name($active) } } else { raw names $0- diff --git a/data/defscript/installer.kvs b/data/defscript/installer.kvs deleted file mode 100644 index f974b7eda..000000000 --- a/data/defscript/installer.kvs +++ /dev/null @@ -1,169 +0,0 @@ -/* - A helper class for installing and parsing files, - and generating an uninstallation alias on the fly. - - Example : - include "utils/installer.kvs" - %installer = $new(installer,0,myinstaller) - %installer->$copyFiles(pics,*.png,$file.localdir(pics)) - %installer->$includeFiles(src,*.kvs) - %installer->generateUninstallAlias("foo::uninstall") - delete %installer - Here, "foo::uninstall" must be called in you uninstall - callback script. - - Warnings: - 1) Declaration of aliases, popups, etc, in source files - (.kvs) must be in a similar format - as when you export them directly from kvirc. - Example: - alias(myalias) - defpopup(mypopup) - 2) If you use a "defpopup -m" to add an item to an - existing popup,this item won't be registered - automatically for uninstallation by this installer script. - You should typically identify the item you added using - the "id" parameter. See this example where the id is - "myaddon::myitem": - defpopup -m (channeltextview) - { - item(MyItem)(myaddon::myitem) - { - ... - } - } - Then, you add this line to you uninstall callback - script: - delpopupitem channeltextview myaddon::myitem -*/ -class(installer,object) -{ - constructor() - { - } - - copyFiles($0 = source dir,$1 = file regexp,$2 = target dir) - { - if(!$file.exists($0))return - if($isempty($0)) - { - echo $tr("[Installer] The first argument to \%installer->\$copyfiles must be a source directory") - halt - } - - if($isempty($1)) - { - echo $tr("[Installer] The second argument to \%installer->\$copyfiles must be a file name or file regexp") - halt - } - - if($isempty($2)) - { - echo $tr("[Installer] The third argument to \%installer->\$copyfiles must be a destination directory") - halt - } - - if($file.exists($0)) - { - %files = $file.ls($file.fixpath($0),f,$1) - if($length(%files)) - { - @$mkdir($2) - foreach(%file,%files) - { - $this->%lFiles <+ $str.replace($file.fixpath("$2/%file"),"\\\\","\\") - file.copy -o $file.fixpath($0/%file) $file.fixpath($2/%file) - } - } - } - } - - // Recursive creation of directory - mkdir($0 = directory) - { - if($isempty($0) || $file.exists($0)) return - foreach -a (%subdir,$str.split("/",$file.fixpath($0))) - { - %p <+ %subdir - %path = $str.join("/",%p) - if(!$file.exists(%path)) - file.mkdir -q %path - } - if(!$file.exists($0)) - { - echo $tr("[Installer] Failed to create directory") \"$0\" - return - } - } - - // Parse source files and get what will need to be uninstalled - includeFiles($0 = dir, $1 = file regexp) - { - if($isempty($0)) - { - echo $tr("[Installer] The first argument to \%installer->\$includefiles must be a source directory") - halt - } - - @$mkdir($0) - - if($1 == "") - %szRe = "*.kvs" - else - %szRe = $1 - - %files = $file.ls($file.fixpath($0),f,$1) - if($length(%files)) - { - foreach(%file,%files) - { - $this->%lSources <+ $str.replace($file.fixpath("$0/%file"),"\\\\","\\") - include $file.fixpath("$0/%file") - } - } - } - - - generateUninstallAlias($0 = alias name) - { - %c = "alias($0)$lf" - %c .= "{$lf" - if($isset($this->%lFiles)) - { - foreach(%file,$this->%lFiles) - { - %file =~ s/"^$file.localdir()/(.*)$"/"\$file.localdir(\\1)"/ - %c .= " file.remove -q \"%file\"$lf"; - } - } - if($isset($this->%lSources)) - { - foreach(%file,$this->%lSources){ - foreach(%line,$file.readlines(%file)) - if(!$str.isempty(%line)){ - if($str.match("event(*)",%line,e)) - %c .= " event -q ("$str.token(1,"()",%line)"){}$lf" - else if($str.match("alias(*)",%line,e)) - %aliases<+$str.token(1,"()",%line) - else if($str.match("defpopup(*)",%line,e)) - %c .= " defpopup("$str.token(1,"()",%line)"){}$lf" - else if($str.match("toolbar.create * *",%line,e)) - %c .= " toolbar.destroy -q "$str.word(1,%line)"$lf" - else if($str.match("action.create* (*)",%line,e)) - %c .= " action.destroy -q "$str.replace($str.token(1,"(,)",%line),,\")"$lf" - else if($str.match("class(*)*",%line,e)) - %c .= " objects.killclass -q "$str.token(1,"(,)",%line)"$lf" - } - } - if($isset(%aliases)) - foreach(%alias,%aliases) - %c .= " alias -q (%alias){}$lf" - %c .= " alias -q ($0){}$lf" - } - %c .= "}" - eval %c - } -} - - - diff --git a/data/defscript/theme-install.kvs b/data/defscript/theme-install.kvs deleted file mode 100644 index 606ec43c0..000000000 --- a/data/defscript/theme-install.kvs +++ /dev/null @@ -1,30 +0,0 @@ -addon.register("Theme: @THEMENAME@","@THEMEVERSION@",$tr("@THEMENAME@"),$tr("@THEMEDESCRIPTION@"),"3.2.0.99") -{ - # This is our uninstall callback: it will be called by KVIrc when addon.uninstall is invoked - - # This is an automatically generated alias that will erase the installed files - @ALIASNAME@_uninstallfiles - file.rmdir $file.localdir("themes/@SUBDIR@") - alias(@ALIASNAME@_uninstallfiles) {} - # Done -} - -# Ok, addon.register succeeded. We can go on with the installation. - -# Get the path that this script was launched from -%mypath = $file.extractPath($0) - -# get the installer helper class (this is pretty standard and included in the distro) -parse %mypath/utils/installer.kvs - -# The installer will copy our files and generate automatically -# an uninstallation alias for them -%installer = $new(installer,0,myinstaller) - -# copy files in each subdirectory -# the pics - -%installer->$copyFiles("%mypath/files/","*",$file.localdir("themes/@SUBDIR@")) -%installer->$generateUninstallAlias("@ALIASNAME@_uninstallfiles") -# finally kill the installer helper -delete %installer |
