Log Viewer — File Browser

LogViewerv1.0 / LogViewerv1.0 / logview.mrc

logview.mrc — 4.54 KB — Download this file

;-----------------
;------------------
;  Log Viewer by KiX
;   mdx.dll by Dragonzap
;------------------------
;-------------------------

On *:load:{ 
  if ($version != 6.03) { echo 4 -a ::Sorry!! You need m8I9R12C4 version 6.03 to use this script | .unload $+(",$script,") | halt } 
  else { echo 9 -a ::Log Viewer by .::KiX::. | echo 9 -a ::Usage: Right click the main, status, or nicklist and go to logviewer }
}
On *:unload:{ if (logview.mrc isin $script) { unset %lg.file } }
menu channel,nicklist,status {
  -
  Log Viewer
  .Open:{ if ($dialog(lv)) { dialog -ve lv } | else { dialog -mod lv lv } }
  .-
  .Help:{ run $+(",$scriptdirreadme.txt,") }
}
menu @lv {
  -
  Clear:Clear @lv
}
Alias -l mdxlog_fullpath { return $+(",$scriptdirmdx.dll,") }
Alias -l mdxlog { dll $mdxlog_fullpath $1- }
Alias -l mdxloginit { dll $mdxlog_fullpath SetMircVersion $version | dll $mdxlog_fullpath MarkDialog $dname }
Alias -l read.log { if ($isfile($1-) == $true) { clear @lv | loadbuf $+(1,-,$lines($1-)) -pi @lv $1- } }
Alias logs { did -ra lv 1 0 3 %lg.file | did -i lv 1 1 headertext 0 - $+ $findfile(%lg.file,*.*,0,did -a lv 1 0 2 $nopath($1-)) $+ - Log Files } 
Alias lg.seek { did -ra lv 1 0 3 %lg.file | did -i lv 1 1 headertext 0 - $+ $findfile(%lg.file,$+(*,$did($dname,7).text,*),0,did -a lv 1 0 2 $nopath($1-)) $+ - File(s) Found }
dialog lv {
  title "Log Viewer"
  size 58 55 338 196
  option dbu
  icon sbar.icl, 2
  list 1, 205 0 132 154, size
  button "Button", 2, 2 1 201 193
  button "View", 3, 206 157 32 10
  button "Clear", 11, 272 157 32 10
  button "Edit", 4, 239 157 32 10
  button "Send", 5, 305 170 32 12
  button "Delete", 6, 305 157 32 10
  edit "Find Log", 7, 205 183 99 12, return autohs center
  button "Search", 8, 305 183 32 12
  edit "Send To", 12, 205 170 99 12, return autohs center
  menu "Directory", 9
  item "Change", 10, 9
  item "Open", 18, 9
  menu "Refresh", 16
  item "Log List", 17, 16
  menu "Exit", 14
  item "Yes", 15, 14, ok
}
On *:dialog:lv:init:0:{
  mdxloginit | mdxlog SetControlMDX $dname 2 Window > $scriptdirdialog.mdx | mdxlog SetControlMDX $dname 1 ListView report rowselect single grid > $scriptdirviews.mdx
  mdxlog SetBorderStyle $dname 3,4,5,6,8,11 staticedge 
  mdxlog SetFont $dname 3,4,5,6,7,8,11,12 ANSI 15 900 Arial
  window -ehk[0] @lv | did -a $dname 2 grab $window(@lv).hwnd @lv
  if (!%lg.file) { set %lg.file $+(",$mircdirlogs\,") }
  did -i $dname 1 1 headerdims 250
  did -i $dname 1 1 headertext 3 Logs
  did -i $dname 1 1 iconsize normal small
  did -i $dname 1 1 seticon normal 8, $+ $scriptdirsbar.icl
  did -i $dname 1 1 seticon normal 8, $+ $scriptdirsbar.icl
  did -i $dname 1 1 seticon normal 13, $+ $scriptdirsbar.icl
  logs | editbox @lv $chr(9) Enter text to find, and hit the enter key on your keyboard.
}
On *:dialog:lv:sclick:1:{ 
  if ($isfile($+(",$remove(%lg.file,") $+ $gettok($did($dname,1).seltext,6-,32),")) == $true) {
    dialog -t $dname Log Viewer - $gettok($did($dname,1).seltext,6-,32) - $round($calc($file($+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),")).size / 975),0) $+ kb - | halt 
  }
  if ($isdir($+(",$gettok($did($dname,1).seltext,6-,32),")) == $true) { dialog -t lv Log Viewer Directory $gettok($did($dname,1).seltext,6-,32) | halt }
  else { dialog -t $dname Log Viewer }
}
On *:dialog:lv:dclick:1:{ read.log $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),") }
On *:dialog:lv:sclick:3:{ read.log $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),") }
On *:dialog:lv:sclick:4:{ var %log = $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),"),%l = 1 | if ($isfile(%log) == $true) { echo 4 @lv ::Editing15 $nopath(%log) | run %log } }
On *:dialog:lv:sclick:5:{ var %log = $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),"),%l = 1 | if ($isfile(%log) == $true) { echo 4 @lv ::Sending15 $nopath(%log) to $did($dname,12).text | dcc send -c $did($dname,12).text %log } }
On *:dialog:lv:sclick:6:{ var %log = $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),"),%l = 1 | if ($isfile(%log) == $true) { echo 4 @lv ::Removing15 $nopath(%log) to Recycle Bin | .remove -b %log | logs | did -cf $dname 1 3 } }
On *:dialog:lv:sclick:8:{ lg.seek }
On *:dialog:lv:sclick:11:{ clear @lv }
On *:dialog:lv:menu:10:{ set %lg.file $+(",$sdir($mircdir),") | logs }
On *:dialog:lv:menu:17:{ logs }
On *:dialog:lv:menu:18:{ run %lg.file }
On *:input:@lv:{ var %f = $1- | findtext %f | editbox @lv %f }

;----------
;-----------
; end of file
;-------------
;--------------