alias blist {
if ($dialog(blist) == $null) { dialog -mn blist blist }
else { dialog -c blist blist }
}
dialog blist {
title "blist"
size -1 -1 171 152
option dbu
list 1, 8 8 154 110, vsbar size
button "Add", 2, 79 126 33 12
button "Remove", 3, 124 126 32 13
}
on *:dialog:blist:init:0:{
load-blist
}
on *:dialog:blist:dclick:*:{
;LIST MODIFY
[color:green]; This one doesnt work proper, dunno what to change [/color]
if ($did = 1) {
if ( $did(1).sel ) {
var %m = $input(Modify the text?,ye,blist Modify,$did(blist, 1,$1))
did -o $dname 1 $did(1).sel %m
;if ( $did(1).sel ) .timer_blist_modif 1 0 _modif_blist $v1
;how to write ini new changed stuff and remove old one?
}
}
}
on *:dialog:blist:sclick:*:{
;ADD
if ($did = 2) {
;this doesnt work at all....
var %blist_input = $input(Host:,de,Input Request)
if (%blist_input == $null) { halt }
else { writeini blacklist.ini blackmark $v1 blacklisted }
load-blist
}
}
alias -l _modif_blist {
;modifies list
var %m = $input(Modify the text?,ye,blist Modify,$did(blist, 1,$1))
}
alias -l load-blist {
;reloads list
did -r $dname 1
var %i = $ini(blacklist.ini,blackmark,0)
while (%i) {
did -a $dname 1 $ini(blacklist.ini,blackmark,%i)
dec %i
}
}