From a6d58bb6052ac8cb01805a48c4ad2f129126116f Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 24 Feb 2010 02:13:59 +0000 Subject: Added KDE3 version of kvirc git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1095341 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- data/defscript/Makefile.am | 11 + data/defscript/aliases.kvs | 706 +++++++++++++++++++ data/defscript/default.kvs | 37 + data/defscript/events.kvs | 105 +++ data/defscript/installer.kvs | 169 +++++ data/defscript/popups.kvs | 1381 ++++++++++++++++++++++++++++++++++++++ data/defscript/theme-install.kvs | 30 + data/defscript/toolbars.kvs | 43 ++ 8 files changed, 2482 insertions(+) create mode 100644 data/defscript/Makefile.am create mode 100644 data/defscript/aliases.kvs create mode 100644 data/defscript/default.kvs create mode 100644 data/defscript/events.kvs create mode 100644 data/defscript/installer.kvs create mode 100644 data/defscript/popups.kvs create mode 100644 data/defscript/theme-install.kvs create mode 100644 data/defscript/toolbars.kvs (limited to 'data/defscript') diff --git a/data/defscript/Makefile.am b/data/defscript/Makefile.am new file mode 100644 index 00000000..768c9b8f --- /dev/null +++ b/data/defscript/Makefile.am @@ -0,0 +1,11 @@ +tmpdir = $(defscriptdir) + +tmp_DATA = default.kvs \ + aliases.kvs \ + events.kvs \ + popups.kvs \ + toolbars.kvs \ + installer.kvs \ + theme-install.kvs + +EXTRA_DIST = $(tmp_DATA) diff --git a/data/defscript/aliases.kvs b/data/defscript/aliases.kvs new file mode 100644 index 00000000..5d8d7299 --- /dev/null +++ b/data/defscript/aliases.kvs @@ -0,0 +1,706 @@ +# Default aliases file + +# +# TODO: +# ignore, notify and unignore should go in the core +# +# If possible, get rid of $str.* from the default popups +# avoiding to load the module at every channel popup open action... +# (Find a core function that retrieves the number of nicknames passed ?) +# Another solution would be to increase the str.module core lock-time ? +# + +# +# Backward compatibility stuff +# +alias(avatar) +{ + # avatar target file + if(!$0) + { + echo "Missing target, no action taken" + return + } + if($1) + { + avatar.set $1 + } + avatar.notify $0 +} + +alias(clear) +{ + window.clearOutput +} + +alias(connect) +{ + objects.connect $0 $1 $2 $3 +} + +alias(disconnect) +{ + objects.disconnect $0 $1 $2 $3 +} + +alias(killclass) +{ + objects.killclass $0 +} + +alias(clearobjects) +{ + objects.clear $0 +} + +alias(nickserv) +{ + # Silent + raw -q NickServ $0- +} + +alias(chanserv) +{ + # Silent + raw -q ChanServ $0- +} + +alias(memoserv) +{ + # Silent + raw -q MemoServ $0- +} + +alias(ns) +{ + # Silent + raw -q nickserv $0- +} + +alias(cs) +{ + # Silent + raw -q chanserv $0- +} + +alias(ms) +{ + # Silent + raw -q memoserv $0- +} + +alias(gnotice) +{ + # Global notice + + #Check null notice + if(!$0){ + echo $tr("Usage"): /gnotice [-waohvq] <$tr("message")> + echo $tr("-m: send a message instead of a notice") + echo $tr("-w: send notice to all channel owners") + echo $tr("-a: send notice to all channel admins") + echo $tr("-o: send notice to all channel ops") + echo $tr("-h: send notice to all channel halfops") + echo $tr("-v: send notice to all channel voices") + echo $tr("-q: quiet mode") + halt + } + + # Detect message type + if($sw(m)) %cmd="msg" + else %cmd="notice" + + # Check for quiet message + if($sw(q)) %cmd=$str.append(%cmd," -q") + + # Check null switches + if((!$sw(w))&&(!$sw(a))&&(!$sw(o))&&(!$sw(h))&&(!$sw(v))){ + eval %cmd $chan.name($active) $0- + halt + } + + # Check switches passed + if($sw(w)) eval %cmd \~$chan.name($active) $0- + if($sw(a)) eval %cmd \!$chan.name($active) $0- + if($sw(o)) eval %cmd \@$chan.name($active) $0- + if($sw(h)) eval %cmd \%$chan.name($active) $0- + if($sw(v)) eval %cmd \+$chan.name($active) $0- +} + +alias(wallop) +{ + if(!$0){ + echo $tr("Usage"): /wallop <$tr("message")> + halt + } + + # Due to server flood, timing may be very high + echo -w=$active $tr("Sending wallop to") $chan.name($active) + timer(wallop,5000,$chan.users(,,o),$0-){ + if(%:localOps == ""){ %:localOps = $chan.users(,,o); %:curIndex = 0; } + if(%:curIndex == %:localOps[]#){ killtimer wallop; return; } + + for(%i=0;%i<1;%i++){ + if(%:localOps[%:curIndex] != $my.nick){ + if(%:curIndex == %:localOps[]#){ killtimer wallop; return; } + msg -q %:localOps[%:curIndex] $1- + %:curIndex++ + } + } + } +} + +alias(kill){ + raw -q kill $0 :$1- +} + +alias(ms) +{ + # Silent + quote ms $0- +} + +# j: This is a really common one +alias(j) +{ + #first we do a test if a chan is given as parameter + if(!$0) + { + echo $tr("Usage:") + echo " /j " + } else { + join $0- + } +} + +# s: This too +alias(s) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /s " + } else { + server $0- + } +} + +# q: Ok, I am lazy :P +alias(q) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /q " + } else { + query $0- + } +} + + +# names: maybe this should be implemented on the core? +alias(names) +{ + if(!$0) + { + if($window.type($active)!="channel") + { + echo $tr("Usage:") "/names " + } else { + raw names $active + } + } else { + raw names $0- + } +} + +# kickban +alias(kb) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /kb [" $tr("reason") "]" + halt; + } + + if(!$channel) + { + echo "[KB]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + %mask = $mask(%nick,$option(uintDefaultBanType)); + + if(!%mask)%mask = %nick; # plain ban + + %reason = $1- + #if(!%reason)%reason = "You're not welcome here!" + + # This is tricky : we send everything + # as a single raw message just because + # we do not want delays between kick and ban + # if anti-server-flood is enabled + + %raw = "kick $target %nick :%reason" + + # kick %nick %reason + + if($chan.isOp(%nick))%raw2 = "mode $target -o+b %nick %mask" + else %raw2 = "mode $target +b %mask" + + raw -q %raw2$cr$lf%raw + } + } +} + +# chanowner +alias(chanowner) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /chanowner " + halt; + } + if(!$channel) + { + echo "[CHANOWNER]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + mode $chan.name() +q %nick + } + } +} + +# chanadmin +alias(chanadmin) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /chanadmin " + halt; + } + if(!$channel) + { + echo "[CHANADMIN]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + mode $chan.name() +a %nick + } + } +} + +# dechanowner +alias(dechanowner) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /dechanowner " + halt; + } + if(!$channel) + { + echo "[DECHANOWNER]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + mode $chan.name() -q %nick + } + } +} + +# dechanadmin +alias(dechanadmin) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /dechanadmin " + halt; + } + if(!$channel) + { + echo "[DECHANADMIN]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + mode $chan.name() -a %nick + } + } +} + +# halfop +alias(halfop) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /halfop " + halt; + } + if(!$channel) + { + echo "[HALFOP]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + mode $chan.name() +h %nick + } + } +} + +# dehalfop +alias(dehalfop) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /dehalfop " + halt; + } + if(!$channel) + { + echo "[DEHALFOP]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + mode $chan.name() -h %nick + } + } +} + +# userop +alias(userop) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /userop " + halt; + } + if(!$channel) + { + echo "[USEROP]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + mode $chan.name() +u %nick + } + } +} + +# deuserop +alias(deuserop) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /deuserop " + halt; + } + if(!$channel) + { + echo "[DEUSEROP]: " $tr("This is not a channel window") + halt; + } + + foreach(%nick,$str.split(",",$0)) + { + if(%nick) + { + mode $chan.name() -u %nick + } + } +} + +# ame and amsg +alias(ame) +{ + foreach(%i,$window.list(channel))if(%i!="") me -r=%i $0- +} + +alias(amsg) +{ + foreach(%i,$window.list(channel))msg $target(%i) $0- +} + +alias(amsgall) +{ + foreach(%i,$window.list(channel),$window.list(query))msg $target(%i) $0- +} + +alias(ameall) +{ + foreach(%i,$window.list(channel),$window.list(query)){ + if(%i!="") me -r=%i $0- + } +} + +alias(awayall) +{ + foreach(%w,$window.list(console,all))away -r=%w $0-; +} + +# notify: this is a bit more complex +# We want to add an user to the notify list with a single command +# The notify lists are handled thru the registered users database +alias(notify) +{ + # This one adds a registered users database entry + # For the specified nick and uses the specified mask + # If no mask is specified , a default one is constructed + # Then the "notify" property is set for the user + + if(!$0) + { + echo $tr("Usage:") + echo " /notify [mask]" + halt + } + + # Get the mask + + %mask = $1 + + # no mask specified ? build it + + if(!%mask)%mask = $0!*@* + + # Now add the user (but do not replace old entries) + + reguser.add -f -q $0 %mask + + # Merge the notify property part with the old one (if any) + + %oldNicks = $reguser.property($0,notify) + + # It would be a good idea to check if the nikckname is already in the %oldNicks list + # but this is left as exercise for the reader. + + %oldNicks << $0 + + # And finally set the property (use -n so the notify lists will be restarted) + + reguser.setproperty -n $0 notify $0 + + # done...the notify list should be restarted now +} + +alias(ignore) +{ + # This one adds a registered users database entry + # For the specified nick and uses the specified mask + # If no mask is specified , a default one is constructed + # Then the "ignore" property is set for the user to 1 + + if(!$0) + { + echo $tr("Usage:") + echo " /ignore [-r] " + halt + } + + # Now add the user (but do not replace old entries) + + reguser.add $0 $mask($0,15); + + # And finally set the property (use -n so the notify lists will be restarted) + # Check if ignore or unignore the user + + if(!$sw(r,remove)) + { + reguser.setIgnoreEnabled $0 1 + reguser.setIgnoreFlags -p -c -n -t -i -d $0 + } else reguser.setIgnoreEnabled $0 0 +} + +# Dcc...people commonly use "dcc send" instead of "dcc.send" +alias(dcc) +{ + switch($0) + { + case(send): + { + dcc.send $1- + break + } + case(chat): + { + dcc.chat $1- + break + } + case(voice): + { + dcc.voice $1- + break + } + case(allow): + { + quote dccallow $1- + break + } + default: + { + echo "[DCC]: " $tr("Unsupported type: $0") + } + } +} + +# +# return a string with the name of the curerent usermode +# +alias(usermodename) +{ + if(!$0) + { + echo $tr("Usage:") + echo " /usermodename " + halt; + } + if(!$channel) + { + echo "[USERMODENAME]: " $tr("This is not a channel window") + halt; + } + + if($chan.isOwner($0,$channel)){ + return $tr("Channel Owner") + } elseif($chan.isAdmin($0,$channel)){ + return $tr("Channel Administrator") + } elseif($chan.isOp($0,$channel)){ + return $tr("Channel Operator") + } elseif($chan.isHalfOp($0,$channel)){ + return $tr("Half Operator") + } elseif($chan.isVoice($0,$channel)){ + return $tr("Voice") + } elseif($chan.isUserOp($0,$channel)){ + return $tr("User Operator") + } else { + return $tr("Normal User") + } +} + +alias(dccallow) +{ + quote dccallow \+$0 +} + +#shortcut for commonly called algorithm +alias(md5) +{ + return $str.digest($0-,md5) +} + +alias(sha1) +{ + return $str.digest($0-,sha1) +} + +# DNS : people like it +alias(dns) +{ + if(!$context) + { + echo "[DNS]: " $tr("You must use DNS in an IRC context") + halt + } + + if(!$server) + { + echo "[DNS]: " $tr("You must be connected to a server") + halt + } + + if(!$0) + { + echo $tr("Usage:") + echo echo " /dns " + halt + } + + if($isWellKnown($0))host -a $hostname($0) + else { + awhois($0) + { + if(!$2) + { + echo "[DNS]: " $tr("No such user: $0") + } else { + host -a $2 + } + } + } +} + +alias(ss) +{ + # Silent + quote ss $0- +} + +alias(seenserv) +{ + # Silent + msg -q SeenServ $0- +} + +alias(hs) +{ + #Silent + quote hs $0- +} + +alias(hop) +{ + // Retrieve channel + %chan=$0 + if(!%chan) %chan=$chan.name($active) + + // Retrieve channel key + %key=$chan.key($channel(%chan)) + + // Exit channel + if($window.type($channel(%chan))=="channel") + part --keep %chan $option(stringPartMessage) + + // Rejoin channel + if(!%key) join %chan + else join %chan %key +} diff --git a/data/defscript/default.kvs b/data/defscript/default.kvs new file mode 100644 index 00000000..fb270da6 --- /dev/null +++ b/data/defscript/default.kvs @@ -0,0 +1,37 @@ +################################################################################################# +# +# This is the default script for KVIrc +# Feel free to use it as base for writing your own scripts +# It is a good starting point; I have tried to add as many comments as possible. +# +# Have fun :) +# Szymon Stefanek +# +################################################################################################# + +%mypath = "$file.extractpath($0)$file.ps" + +# Fetch default scripts data +include "aliases.kvs" %mypath +include "events.kvs" %mypath +include "popups.kvs" %mypath +include "toolbars.kvs" %mypath + +# +# Set the default spam words...(for the anti-spam) detector +# + +# FIXME: these should be MERGED!!!! + +#%tmp = $option(stringlistSpamWords) +#%tmp[] = $array() ??? + +option stringlistSpamWords "http:","#","www.","auto","query","ftp:","sex","free","msg","chat","dynamirc","script" + +options.save + +echo $tr("The default script has been successfully installed.") +echo $tr("To connect to a server, type /server ") +echo "---" +echo $tr("Happy ircing :)") +echo "- Szymon Stefanek $tr("and the KVIrc Development Team")" diff --git a/data/defscript/events.kvs b/data/defscript/events.kvs new file mode 100644 index 00000000..575cfc39 --- /dev/null +++ b/data/defscript/events.kvs @@ -0,0 +1,105 @@ +# Default events file + +event(OnDccChatPopupRequest,default) +{ + popup dccchat $0; +} + +event(OnChannelPopupRequest,default) +{ + popup channeltextview $target; +} + +event(OnConsolePopupRequest,default) +{ + popup consoletextview; +} + +event(OnChannelLinkPopupRequest,default) +{ + if($0 != "") popup channelpopup $0; +} + +event(OnQueryPopupRequest,default) +{ + if($target) popup querytextview $target; +} + +event(OnQueryNickPopupRequest,default) +{ + if($0 != "") popup querytextview $0; +} + +event(OnQueryFileDropped,default) +{ + if($0 != "") dcc.send $target $0; +} + +event(OnNickLinkDefaultActionRequest,default) +{ + if($0 != "") whois $0; +} + +event(OnNickLinkPopupRequest,default) +{ + if($0 != "") popup defaulttextview $0; +} + +event(OnNotifyListDefaultActionRequest,default) +{ + if($0 != "") + { + query $0; whois $0 $0; + } +} + +event(OnNotifyListPopupRequest,default) +{ + if($0 != "") popup defaulttextview $0; +}; + +event(OnWindowPopupRequest,default) +{ + popup windowpopup; +} + +event(OnChannelWindowCreated,default) +{ + button(w,Logging,119,Logging) + { + popup -p=$0,$1 logging; + } +} + +event(OnQueryWindowCreated,default) +{ + button(w,Logging,119,Logging) + { + popup -p=$0,$1 logging; + } +} + +event(OnChannelNickLinkClick,default) +{ + if($0 != "") window.insertInInputText $window $0$option(stringNickCompletionPostfix); +} + +event(OnChannelNickPopupRequest,default) +{ + if($0 != "") popup channel $0; +} + +event(OnChannelNickDefaultActionRequest,default) +{ + if(!$isEmpty($0)) query $0; +} + +event(OnURLLinkPopupRequest,URL popup) +{ + popup urlpopup $0 +} + +event(OnHostLinkPopupRequest,default) +{ + popup hostpopup $0; +} diff --git a/data/defscript/installer.kvs b/data/defscript/installer.kvs new file mode 100644 index 00000000..f974b7ed --- /dev/null +++ b/data/defscript/installer.kvs @@ -0,0 +1,169 @@ +/* + 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/popups.kvs b/data/defscript/popups.kvs new file mode 100644 index 00000000..7197c923 --- /dev/null +++ b/data/defscript/popups.kvs @@ -0,0 +1,1381 @@ +# Default popups file + +# +# Here comes a nice part... +# The popups. KVIrc has a lot of events that merely ask for a popup to be shown :) +# +defpopup(highlight) +{ + prologue + { + if($0!=""){ + %:regName = $reguser.match($mask($0)) + %:beingHl = $reguser.property(%:regName,highlight) + %:beingHlTmp = $tmphighlight.ishighlighted($0) + } + } + + item($tr("Stop Highlighting (Local)")) (%:beingHlTmp && !%:beingHl) + { + tmphighlight.remove $0 + } + + item($tr("Start Highlighting (Local)")) (!%:beingHlTmp && !%:beingHl) + { + tmphighlight.add $0 + } + + popup($tr("Always Highlight")) (!%:beingHl && !%:regName) + { + item($tr("Highlight as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "") + { + reguser.add $0 $mask($0,11); reguser.setproperty $0 highlight 1; + } + + item($tr("Highlight as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "") + { + reguser.add $0 $mask($0,12); reguser.setproperty $0 highlight 1; + } + + item($tr("Highlight as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "") + { + reguser.add $0 $mask($0,13); reguser.setproperty $0 highlight 1; + } + + item($tr("Highlight as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "") + { + reguser.add $0 $mask($0,3); reguser.setproperty $0 highlight 1; + } + + item($tr("Highlight as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "") + { + reguser.add $0 $mask($0,4); reguser.setproperty $0 highlight 1; + } + + item($tr("Highlight as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "") + { + reguser.add $0 $mask($0,5); reguser.setproperty $0 highlight 1; + } + } + + item($tr("Always Highlight")) (!%:beingHl && %:regName) + { + reguser.setproperty $0 highlight 1 + } + + item($tr("Stop Highlighting")) (%:beingHl) + { + reguser.setproperty $0 highlight 0 + } +} + +defpopup(ignore) +{ + prologue + { + %:inIgnoreList = 0 + %:regName = $reguser.match($mask($0)) + %:ignLabelText = "

$0 " + if(%:regName) + { + %:inIgnoreList = $reguser.isIgnoreEnabled(%:regName); + if(%:inIgnoreList) %:ignLabelText << $tr("is being ignored") + else %:ignLabelText << $tr("is not being ignored") + + %:ignLabelText << "

" + } else { + %:ignLabelText << $tr("is not being ignored")"

" + } + } + + label(%:ignLabelText) + + item($tr("Enable Ignore"),168) (!%:inIgnoreList && %:regName) + { + reguser.setIgnoreEnabled %:regName 1; + } + + popup($tr("Ignore as..."),44) (!%:inIgnoreList) + { + item($tr("Ignore as") $0 "("$mask($0,0)")") ("$reguser.exactMatch($mask($0,0))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,0); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,1)")") ("$reguser.exactMatch($mask($0,1))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,1); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,2)")") ("$reguser.exactMatch($mask($0,2))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,2); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,3); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,4); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,5); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,6)")") ("$reguser.exactMatch($mask($0,6))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,6); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,7)")") ("$reguser.exactMatch($mask($0,7))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,7); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,8)")") ("$reguser.exactMatch($mask($0,8))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,8); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,9)")") ("$reguser.exactMatch($mask($0,9))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,9); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,10)")") ("$reguser.exactMatch($mask($0,10))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,10); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,11); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,12); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,13); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,14)")") ("$reguser.exactMatch($mask($0,14))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,14); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,15)")") ("$reguser.exactMatch($mask($0,15))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,15); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,16)")") ("$reguser.exactMatch($mask($0,16))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,16); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,17)")") ("$reguser.exactMatch($mask($0,17))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,17); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,18)")") ("$reguser.exactMatch($mask($0,18))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,18); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,19)")") ("$reguser.exactMatch($mask($0,19))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,19); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,20)")") ("$reguser.exactMatch($mask($0,20))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,20); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,21)")") ("$reguser.exactMatch($mask($0,21))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,21); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,22)")") ("$reguser.exactMatch($mask($0,22))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,22); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,23)")") ("$reguser.exactMatch($mask($0,23))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,23); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,24)")") ("$reguser.exactMatch($mask($0,24))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,24); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,25)")") ("$reguser.exactMatch($mask($0,25))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,25); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + + item($tr("Ignore as") $0 "("$mask($0,26)")") ("$reguser.exactMatch($mask($0,26))" == "") + { + if(!%:regName) reguser.add $0 $mask($0,26); + reguser.setIgnoreEnabled $0 1; + reguser.setIgnoreFlags -p -c -n -t -i -d $0; + } + } + + item($tr("Unignore"),217) (%:inIgnoreList) + { + reguser.setIgnoreEnabled %:regName 0; + } +} + +defpopup(registration) +{ + prologue + { + + # This is really smart...we are loading + # the reguser module only if this popup is being requested (the user effectively + # puts the mouse on the "Registration" item and the sub-popup is being shown) + %:regName = $reguser.match($mask($0)) + %:labelText = "

$0"; + if(%:regName) + { + %:labelText << $tr("is registered as") ": "%:regName"" + # We want to display masks here!!! + %:inNotifyList = $reguser.property(%:regName,notify); + if(%:inNotifyList)%:labelText << "
$0" $tr("is in the notify list") + %:curAvatar = $avatar.name($0); + %:defAvatar = $reguser.property(%:regName,avatar); + if(%:defAvatar)%:labelText << "
$0" $tr("has a default avatar") + %:labelText << "

" + } else { + %:labelText << $tr("is not registered")"

" + } + } + + label(%:labelText) + + item($tr("Register")"...") (!%:regName) + { + reguser.wizard $mask($0) + } + + popup($tr("Quick Registration")) (!%:regName) + { + item($tr("Register as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "") + { + reguser.add $0 $mask($0,11) + } + + item($tr("Register as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "") + { + reguser.add $0 $mask($0,12) + } + + item($tr("Register as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "") + { + reguser.add $0 $mask($0,13) + } + + item($tr("Register as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "") + { + reguser.add $0 $mask($0,3) + } + + item($tr("Register as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "") + { + reguser.add $0 $mask($0,4) + } + + item($tr("Register as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "") + { + reguser.add $0 $mask($0,5) + } + } + + item($tr("Edit Registration")"...",113) (%:regName) + { + reguser.edit "%:regName" + } + + item($tr("Unregister") %:regName) (%:regName) + { + reguser.remove "%:regName" + } + + separator + + item($tr("Add to Notify")) (%:regName && !%:inNotifyList) + { + reguser.setproperty -n "%:regName" notify $0 + } + + item($tr("Remove from Notify")) (%:regName && %:inNotifyList) + { + reguser.setproperty -n "%:regName" notify + } + + popup($tr("Avatar")) (%:regName) + { + item($tr("Choose")"...") (%:regName) + { + dialog.image(f,$tr("Choose Avatar Image File"),"","",$0,"%:regName") + { + if($0) + { + reguser.setproperty -a $2 avatar $0; + } + } + } + + item($tr("Set as Default")) (%:curAvatar && ("%:curAvatar" != "%:defAvatar")) + { + reguser.setproperty "%:regName" avatar %:curAvatar + } + + item($tr("Clear Default")) (%:defAvatar) + { + reguser.setproperty %:regName avatar + # Force the avatar to update + # if("%:curAvatar" == "")who $0 + } + } +} + +defpopup("urlpopup") +{ + item($tr("Copy To Clipboard"),259) + { + str.toClipboard $0 + } +} + +# This code adds a channel popup that accepts +# a comma separated list of nicknames as parameter (to the /popup command) + +defpopup(channel) +{ + prologue + { + # we use the extended scope variables: they are visible in the entire defpopup scope + # %:visible is the string that we will "show to the user" in the popup widget + # for multiple users the string might become long so we are going to change it in "multiple users" + %:visible = $0 + # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list + # of multiple nicknames rather than a single nick + %:multiple = 0 + # finally , set these variables + %:itemBanName = $tr("Ban") + if($str.findfirst(%:visible,",") != -1) + { + # found a comma in the $0 parameter...we have multiple nicknames + %:visible = "("$tr("Multiple Users")")" + %:multiple = 1 + %:itemBanMask = "*!user@*.host.tld" + %:itemBanNick = "nick" + } else { + %:itemBanMask = $mask(%:visible,$option(uintDefaultBanType)) + if("%:itemBanMask" == "*!*@*")%:itemBanName = $tr("&Ban") + %:itemBanNick = %:visible + } + # speed it up + + %:isMeHalfOp = $chan.isMeHalfOp() + %:isMeOp = $chan.isMeOp() + %:isMeOwner = $chan.isMeOwner() + %:isMeAdmin = $chan.isMeAdmin() + %:bCanKB = 0; + + if(%:isMeHalfOp) + { + foreach(%nick,$str.split(",",$0)) + { + if($chan.usermodelevel(%nick) <= $chan.usermodelevel($me)) + { + %:bCanKB = 1; + break; + } + } + } + } + + item("/WHOIS" %:visible "("$tr("idle time")")",75,whois_item) + { + foreach(%i,$str.split(",",$0)) + whois %i %i + } + + separator + + popup($tr("&Information"),49,"information_popup") + { + item("/WHOIS" %:visible,75,"whois_item") + { + whois $0 + } + + item(/WHOWAS %:visible,92) + { + whowas $0 + } + + item(/WHO %:visible,75) + { + who $0 + } + + separator + + item($tr("DNS for") %:visible,75) + { + foreach(%i,$str.split(",",$0))dns %i + } + + item($tr("Mask for") %:visible,75) (!%:multiple) + { + echo $mask($0,11) + } + } + + popup($tr("&Control"),9,"control_popup") (%:isMeHalfOp) + { + label($usermodename($me())) + + item($tr("O&wner") %:visible,260) (%:isMeOwner) + { + chanowner $0 + } + + item($tr("&Deowner") %:visible,261) (%:isMeOwner) + { + dechanowner $0 + } + + item($tr("&Administrator") %:visible,242) (%:isMeAdmin) + { + chanadmin $0 + } + + item($tr("&Deadministrator") %:visible,243) (%:isMeAdmin) + { + dechanadmin $0 + } + + item($tr("&Op") %:visible,34) (%:isMeOp) + { + op $0 + } + + item($tr("&Deop") %:visible,62) (%:isMeOp) + { + deop $0 + } + + item($tr("&Halfop") %:visible,174) (%:isMeOp) + { + halfop $0 + } + + item($tr("&Dehalfop") %:visible,175) (%:isMeOp) + { + dehalfop $0 + } + + item($tr("&Voice") %:visible,35) (%:isMeHalfOp) + { + voice $0 + } + + item($tr("D&evoice") %:visible,63) (%:isMeHalfOp) + { + devoice $0 + } + + separator + + item($tr("&Kick") %:visible,110) (%:bCanKB) + { + foreach(%i,$str.split(",",$0))kick %i + } + + item($tr("K&ick") %:visible $tr("With..."),110) (%:bCanKB) + { + dialog.textinput -d="$me" -i=110 ($tr("Kick Reason"),$tr("Enter a kick reason"),$tr("&Kick"),$tr("Cancel"),,$0) + { + if($0 == 0) + { + foreach(%i,$str.split(",",$2))kick %i $1 + } + } + } + + item($tr("&Ban") %:visible "("%:itemBanMask")",67) (("%:itemBanMask" != "*!*@*") && %:bCanKB) + { + ban $mask($0,$option(uintDefaultBanType)) + } + + item(%:itemBanName %:visible "("%:itemBanNick!*@*")",67) (%:bCanKB) + { + ban $0 + } + + item($tr("Kick/Ban") %:visible,110) (%:bCanKB) + { + kb $0 + } + + item($tr("Kick/Ban") %:visible $tr("With..."),110) (%:bCanKB) + { + dialog.textinput -d="$me" -i=110 ($tr("Kick/Ban Reason"),$tr("Enter a kick/ban reason"),$tr("&Kick/Ban"),$tr("Cancel"),,$0) + { + if($0 == 0) + { + kb $2 $1 + } + } + } + separator + + item($tr("Configure ban mask..."),20) + { + options.edit KviChannelAdvancedOptionsWidget + } + } + + separator + + item($tr("&Query") %:visible,47) + { + query $0 + } + + separator + + extpopup(C&TCP,ctcp,51) + + extpopup(&DCC,dcc,77) (!%:multiple) + + separator + + extpopup($tr("&Registration"),registration,111) (!%:multiple) + + extpopup($tr("&Highlight"),highlight,181) (!%:multiple) + + extpopup($tr("Ig&nore"),ignore,203) (!%:multiple) + + item($tr("Notify Avatar"),57) + { + avatar.notify $0 + } +} + +# Popup to show on right-clicking channel links +# +defpopup(channelpopup) +{ + item($tr("&Join") $0,145) + { + hop $0 + } + + item($tr("&Part") $0,40) + { + if($channel($0)) part $0 $option(stringPartMessage); + } + + separator + + item(/NAMES $0,75) + { + names $0; + } + + item(/WHO $0,75) + { + who $0; + } + separator + + item($tr("Copy Channel Address"),259) + { + str.toClipboard $chan.getUrl($0) + } + +} + +defpopup(channels) +{ + item(#KVirc,46) + { + j #KVirc + } + + item(#MDE,46) + { + j #MDE + } + + item(#kde,46) + { + j #kde + } +} + +defpopup(channeltextview) +{ + extpopup($tr("Channels"),channels,46) + + item($tr("&Join Channels..."),46) ($server) + { + if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open + } + + separator + + item($tr("&Hop") $0,145) + { + hop $0 + } + + item($tr("&Part") $0,40) + { + if($channel($0)) part $0 $option(stringPartMessage); + } + + separator + + extpopup(C&TCP,ctcp,51) + + separator + + item(/NAMES $0,75) + { + names $0; + } + + item(/WHO $0,75) + { + who $0; + } + + item($tr("Notify Avatar"),57) + { + avatar.notify $0 + } + + separator + + item($tr("Copy Channel URL to Clipboard"),259) + { + str.toClipboard $chan.getUrl + } + + item($tr("Clear Buffer"),121) + { + clear; + } + +} + +defpopup(consoletextview) +{ + label($tr("You're not connected to a server")) (!$server) + + extpopup($tr("Channels"),channels,46) + + separator + + item($tr("&Join Channels..."),46) ($server) + { + if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open + } + + popup($tr("&Information"),13) ($server) + { + item(/MOTD,30) + { + motd + } + + item(/INFO,29) + { + info + } + + item(/LUSERS,57) + { + lusers + } + + popup(/STATS,22) + { + item(d "(Debug/DNS?)") + { + stats d + } + + item($tr("l (Connections)")) + { + stats l + } + + item($tr("m (Command Usage)")) + { + stats m + } + + item($tr("o (Operators)")) + { + stats o + } + + item($tr("t (Connection stats ?)"),23) + { + stats t + } + + item($tr("u (Uptime)"),93) + { + stats u + } + + item($tr("y (y-Lines)")) + { + stats y + } + + item($tr("z (Debug Stats?)"),11) + { + stats z + } + } + + item(/TIME,93) + { + time + } + + item(/ADMIN,29) + { + admin + } + + item(/VERSION,16) + { + version + } + + item(/HELP,49) + { + raw help + } + } + + separator + + item($tr("Clear Buffer"),121) + { + clear; + } +} + +# This is a common popup , accepts a list of nicknames as parameter +defpopup(ctcp) +{ + item(PING,36) + { + ctcp $0 PING + } + + item(FINGER,53) + { + ctcp $0 FINGER + } + + item(VERSION,16) + { + ctcp $0 VERSION + } + + item(USERINFO,57) + { + ctcp $0 USERINFO + } + + item(CLIENTINFO,52) + { + ctcp $0 CLIENTINFO + } + + item(SOURCE,14) + { + ctcp $0 SOURCE + } + + item(TIME,93) + { + ctcp $0 TIME + } + + item(PAGE...,223) + { + #dialog.textinput -d="Wakeup!" ($tr("CTCP Page to") $0,$tr("Enter the message text"),$tr("Ok"),$tr("Cancel")) + dialog.textinput(CTCP Page $0,Enter the message text,&Page,Cancel,"",$0) + { + if($0 == 0)ctcp $2 PAGE $1 + } + } + + item(AVATAR,57) + { + ctcp $0 AVATAR + } +} + +defpopup(dcc) +{ + prologue + { + + if($features("SSL"))%:bHaveSSL=1 + else %:bHaveSSL=0 + } + + item($tr("Chat with") $0,78) + { + dcc.chat $0 + } + + item($tr("Reverse Chat with") $0,78) + { + dcc.chat -z $0 + } + + item($tr("Secure Chat with") $0,78) (%:bHaveSSL) + { + dcc.chat -s $0 + } + + separator + + item($tr("Send to") $0,79) + { + dcc.send $0 + } + + item($tr("Secure send to") $0,79) + { + dcc.send -s $0 + } + + item($tr("Reverse Send to") $0,79) + { + dcc.rsend -z $0 + } + + item($tr("Secure Reverse Send to") $0,79) + { + dcc.rsend -z -s $0 + } + + separator + + item($tr("TDCC Send to") $0,77) + { + dcc.send -t $0 + } + + item($tr("TDCC Reverse Send to") $0,77) + { + dcc.rsend -t $0 + } + + separator + + popup($tr("Voice Chat"),166) + { + item($tr("Default")": ADPCM 8 KHz (32 kbps)") + { + dcc.voice $0 + } + + separator + + item("ADPCM 11.025 KHz (44.1 kbps)") + { + dcc.voice -h=11025 $0 + } + + item("ADPCM 16 KHz (64 kbps)") + { + dcc.voice -h=16000 $0 + } + + item("ADPCM 22.05 KHz (88.2 kbps)") + { + dcc.voice -h=22050 $0 + } + + item("GSM 8 KHz (13.2 kbps)") + { + dcc.voice -g=gsm $0 + } + + item("GSM 11.025 KHz (18.1 kbps)") + { + dcc.voice -g=gsm -h=11025 $0 + } + + item("GSM 16 KHz (26.4 kbps)") + { + dcc.voice -g=gsm -h=16000 $0 + } + + item("GSM 22.05 KHz (36.2 kbps)") + { + dcc.voice -g=gsm -h=22050 $0 + } + + item("GSM 44.1 KHz (72.4 kbps)") + { + dcc.voice -g=gsm -h=44100 $0 + } + + item("NULL 8 KHz (128 kbps)") + { + dcc.voice -g=null $0 + } + + item("NULL 11.025 KHz (176.4 kbps)") + { + dcc.voice -g=null -h=11025 $0 + } + } +} + +defpopup(dccchat) +{ + prologue + { + + # we use the extended scope variables: they are visible in the entire defpopup scope + # %:visible is the string that we will "show to the user" in the popup widget + # for multiple users the string might become long so we are going to change it in "multiple users" + %:visible = $0 + # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list + # of multiple nicknames rather than a single nick + %:multiple = 0 + # finally , set these variables + if($str.findfirst(%:visible,",") != -1) + { + # found a comma in the $0 parameter...we have multiple nicknames + %:visible = "("$tr("Multiple Users")")" + %:multiple = 1 + } + } + + separator + + extpopup(C&TCP,ctcp,51) + + extpopup(&DCC,dcc,77) + + separator + + item($tr("Notify Avatar"),57) + { + avatar.notify $0 + } + + separator + + item($tr("Clear Buffer"),121) + { + clear + } +} + +# +# Some minimal work on the query +# A text view popup (right click on a query view) +# + +defpopup(querytextview) +{ + prologue + { + + # we use the extended scope variables: they are visible in the entire defpopup scope + # %:visible is the string that we will "show to the user" in the popup widget + # for multiple users the string might become long so we are going to change it in "multiple users" + %:visible = $0 + # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list + # of multiple nicknames rather than a single nick + %:multiple = 0 + # finally , set these variables + if($str.findfirst(%:visible,",") != -1) + { + # found a comma in the $0 parameter...we have multiple nicknames + %:visible = "("$tr("Multiple Users")")" + %:multiple = 1 + } + } + + item(/WHOIS $0 "("$tr("idle time")")",75) (!%:multiple) + { + whois $0 $0 + } + + separator + + popup($tr("&Information"),49) + { + item(/WHOIS $0,75) + { + whois $0 + } + + item(/WHOWAS $0,92) + { + whowas $0 + } + + item(/WHO $0,75) + { + who $0 + } + + separator + + item($tr("DNS for") $0,75) + { + foreach(%i,$str.split(",",$0))dns %i + } + + item($tr("Mask for") $0,75) (!%:multiple) + { + echo $mask($0,11) + } + } + + separator + + extpopup(C&TCP,ctcp,51) + + extpopup(&DCC,dcc,77) + + separator + + extpopup($tr("&Ignore"),ignore,203) (!%:multiple) + + extpopup($tr("&Registration"),registration,111) (!%:multiple) + + item($tr("Notify Avatar"),57) + { + avatar.notify $0 + } + + separator + + item($tr("Clear Buffer"),121) + { + clear + } +} + + +# +# Logging popup for the windows +# +defpopup(logging) +{ + prologue + { + + # If this window is being logged actually , $log.file will be non empty + # and pointing to the log file actually open. + %:logfile = $str.replace($log.file,,$file.localdir) + } + + label($tr("Logging to"):
%:logfile) ("%:logfile" != "") + + item($tr("Flush Log File"),19) (%:logfile) + { + log.flush + } + + separator + + item($tr("Stop Logging"),58) (%:logfile) + { + log.stop + } + + label($tr("Not Logging")) (!%:logfile) + + item($tr("Log To Default File"),119) (!%:logfile) + { + log.start + } + + item($tr("Log To Default File") "("$tr("Include Existing Buffer")")",119) (!%:logfile) + { + log.start -p + } + + item($tr("Log To..."),119) (!%:logfile) + { + dialog.file(save,$tr("Choose Log Filename")) + { + if($0)log.start $0 + } + } + + item($tr("Log To...") "("$tr("Include Existing Buffer"),119) (!%:logfile) + { + dialog.file(save,$tr("Choose Log Filename")) + { + if($0)log.start -p $0 + } + } +} + +defpopup(defaulttextview) +{ + prologue + { + + # we use the extended scope variables: they are visible in the entire defpopup scope + # %:visible is the string that we will "show to the user" in the popup widget + # for multiple users the string might become long so we are going to change it in "multiple users" + %:visible = $0 + # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list + # of multiple nicknames rather than a single nick + %:multiple = 0 + # finally , set these variables + if($str.findfirst(%:visible,",") != -1) + { + # found a comma in the $0 parameter...we have multiple nicknames + %:visible = "("$tr("Multiple Users")")" + %:multiple = 1 + } + } + + item(/WHOIS $0 "("$tr("idle time")")",75) (!%:multiple) + { + whois $0 $0 + } + + separator + + popup($tr("&Information"),49) + { + item(/WHOIS $0,75) + { + whois $0 + } + + item(/WHOWAS $0,92) + { + whowas $0 + } + + item(/WHO $0,75) + { + who $0 + } + + separator + + item(DNS $0,75) + { + foreach(%i,$str.split(",",$0))dns %i + } + } + + separator + + item($tr("&Query") %:visible,47) + { + query $0 + } + + separator + + extpopup(C&TCP,ctcp,51) + + extpopup(&DCC,dcc,77) + + separator + + extpopup($tr("&Registration"),registration,111) (!%:multiple) + + extpopup($tr("&Highlight"),highlight,181) (!%:multiple) + + extpopup($tr("Ig&nore"),ignore,203) (!%:multiple) + + item($tr("Notify avatar"),57) + { + avatar.notify $0 + } + + separator + + item($tr("Clear Buffer"),121) + { + clear + } +} + +file.addimagepath %mypath/pics/ + +# +# FIXME: Add uninstall part: +# file.delimagepath +# + + +# +# A default popup for the middle click in a text view +# This should manage logging , buffer saving and other +# stuff common to ALL windows +# + +defpopup(windowpopup) +{ + extpopup(Logging,logging,119) + +# popup(Buffer) +# { +# item("Save to file...")window.savebuffer +# item("Clear")window.clear +# item("Find...")window.findtext +# } +# popup(View) +# { +# item("Show images")($window.images == 0)window.images 1 +# item("Enable timestamps")($window.timestamp == 0)window.timestamp 1 +# item("Disable timestamps")($window.timestam == 1)window.timestamp 0 +# item("Set font...")$window.setfont +# item("Set background...")$window.setbackground +# } +# popup(Mdi) +# { +# item("Minimize")window.minimize +# item("Maximize")window.maximize +# } +} + +# Host link popup + +defpopup(hostpopup) +{ + item(Look Up $0,13) + { + host -a $0 + } + + separator + + item(Open ftp://$0/,145) ("$system.ostype" == "unix") + { + openurl ftp://$0/ + } + + item(Telnet to $0,25) + { + if("$system.ostype" == "unix")run xterm -e telnet $0 + else run telnet $0 + } + + separator + + item(Traceroute $0,42) + { + if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Traceroute to $0...\" && traceroute $0 && cat" + else run tracert $0 + } + + item(Traceroute6 $0,42) + { + if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Traceroute (inet6) to $0...\" && traceroute6 $0 && cat" + else run tracert6 $0 + } + + item(Ping $0,147) + { + if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Ping $0...\" && ping $0 && cat" + else run ping $0 + } + + item(Ping6 $0,147) + { + if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Ping (inet6) $0...\" && ping6 $0 && cat" + else run ping6 $0 + } +} \ No newline at end of file diff --git a/data/defscript/theme-install.kvs b/data/defscript/theme-install.kvs new file mode 100644 index 00000000..febbbbc0 --- /dev/null +++ b/data/defscript/theme-install.kvs @@ -0,0 +1,30 @@ +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 diff --git a/data/defscript/toolbars.kvs b/data/defscript/toolbars.kvs new file mode 100644 index 00000000..84e7b93a --- /dev/null +++ b/data/defscript/toolbars.kvs @@ -0,0 +1,43 @@ +# Default toolbars file + +toolbar.create irccontext $tr("IRC Context") $icon("irc4") +# toolbar.additem irccontext kvirc.irccontextdisplay - info dublicated with te status line +toolbar.additem irccontext kvirc.connect +toolbar.additem irccontext kvirc.servermenu +toolbar.additem irccontext kvirc.newirccontext +toolbar.additem irccontext kvirc.separator +toolbar.additem irccontext kvirc.nicknamemenu +toolbar.additem irccontext kvirc.irctools +toolbar.additem irccontext kvirc.ircactions +toolbar.additem irccontext kvirc.usermodemenu +toolbar.show irccontext + +toolbar.create options $tr("Options") $icon("options") +toolbar.additem irccontext kvirc.serveroptions +toolbar.additem options kvirc.identityoptions +toolbar.additem options kvirc.generaloptions +toolbar.additem options kvirc.themeoptions +toolbar.show options + +toolbar.create help $tr("Help") 49 +toolbar.additem help kvirc.helpindex +if($lang(short)==ru) + toolbar.additem help kvirc.kvircruhomepage +else + toolbar.additem help kvirc.kvirchomepage +toolbar.show help + +toolbar.create scripting $tr("Scripting") $icon("binarytext") +toolbar.additem scripting kvirc.actioneditor +toolbar.additem scripting kvirc.aliaseditor +toolbar.additem scripting kvirc.eventeditor +toolbar.additem scripting kvirc.popupeditor +toolbar.additem scripting kvirc.raweditor +toolbar.additem scripting kvirc.codetester +toolbar.additem scripting kvirc.separator +toolbar.additem scripting kvirc.executekvs + +toolbar.create winops $tr("Window operations") $icon("cascadewindows") +toolbar.additem winops kvirc.cascadewindows +toolbar.additem winops kvirc.tilewindows +toolbar.additem winops kvirc.minimizeallwindows \ No newline at end of file -- cgit v1.2.1