alias iglist { 
  { set %ig.chan # | /dialog -m iglist iglist }
  var %igno = $ignore(0) | while (%igno) { did -a iglist 1 $ignore(%igno) | dec %igno }
  var %o = $notify(0)  | while (%o) { did -a iglist 101 $notify(%o) | dec %o }
}
on *:dialog:iglist:init:0:{ 
  var %i = 1 | while $nick(%ig.chan,%i) != $null { did -a $dname 16 $nick(%ig.chan,%i) | if $nick(%ig.chan,%i) == $snick(%ig.chan,1) { var %l = %i } | inc %i 1 } 
  var %i = 1 | while $nick(%ig.chan,%i) != $null { did -a $dname 116 $nick(%ig.chan,%i) | if $nick(%ig.chan,%i) == $snick(%ig.chan,1) { var %l = %i } | inc %i 1 }
  did -c $dname 16 %l
  did -c $dname 116 %l
}


dialog iglist {

  title "Darna Relations"
  size -1 -1 300 320
  button "OK", 550, 10 297 280 20, ok
  tab "Ignore" , 10 ,  10 10 280 210
  tab "Notify" , 20  

  list 1, 20 70 160 110,  vsbar, sort, hsbar, autohs ,multi , tab 10 
  text "IGNORE  LIST" , 2 , 20 58 160 15 , center , disabled , tab 10
  edit "",3, 20 40 160 20,autohs , read , center, tab 10
  button "Enlever cet Ignore", 50, 20 170 160 20 , tab 10  
  button "Vider la liste",51, 20 190 160 20, tab 10
  edit "" 15 , 190 40 95 20,autohs , read , center, tab 10
  combo 16, 190 68 100 80,drop , tab 10
  button "Ignorer" ,17 , 200 100 80 25 ,tab 10
  button "Options"  18 , 200 130 80 20 ,tab 10 ,center   
  text "Darna" 14,  200 190 80 20 , disabled center 
  text "@ IGNORE @" 19, 200 170 80 20 , disabled , center ,TAB 10
  box "" 13 , 200 155 80 55 , disabled

  list 101,  20 70 160 110,  vsbar, sort, hsbar, autohs ,tab 20
  text "NOTIFY  LIST" , 102 , 20 58 160 15 , center , disabled , tab 20
  edit "",103, 20 40 160 20,autohs , read , center, tab 20
  edit "" 115 , 190 40 95 20,autohs , read , center, tab 20
  combo 116, 190 68 100 80,drop , tab 20
  button "Notifier" ,117 , 200 100 80 25 ,tab 20
  button "Options"  118 , 200 130 80 20 ,tab 20 ,center 
  text "@ NOTIFY @" 119, 200 170 80 20 , disabled , center , tab 20
  button "Enlever ce Notify", 150 , 20 170 160 20 , tab 20  
  icon 4, 10 222 280 70,  images\icones\notify.jpg, 0, noborder center
}



------aCTIONS----
on 1:dialog:iglist:sclick:*:{ 
  if ($did == 1 ) { did -ra $dname 3 $did($dname,1,$did($dname,1).sel).text }
  if ($did == 101) { did -ra $dname 103 $did($dname,101,$did($dname,101).sel).text }
  if ($did == 16 ) {  if ($did(16) != $null) did -ra $dname 15 $did(16) |  else { halt } }
  if ($did == 116 ) { if ($did(116) != $null) did -ra $dname 115 $did(116) |  else { halt } }
  if ($did == 17) { 
    if  ($did(16).seltext == $me) { /echo -a 14Tu veux t ignorer ???? ben deconnectes...;o) | halt }
    ignore  $did(16).seltext 
    did -a $dname 1 $did(16).seltext 
    did -d $dname 15 $did (16) 
    echo -a  7[10  $did(16).seltext 14est ignoré a présent 7] 
    if (%misenigno == on) { .notice $did(16).seltext 14 %meimess }
    else { halt }
    halt 
  }
  if ($did == 117)   { 
    notify  $did(116).seltext  
    did -a $dname 101 $did(116).seltext 
    did -d $dname 115 $did (116) 
    echo -a  7[10  $did(116).seltext 14est notifié a présent 7] 
    if (%misennoti == on) {  .notice  $did(116).seltext 4 %menot }
  halt }
  if ($did == 50) { 
    echo -a  7[10 $did(1).seltext 14n'est plus dans la liste des ignorés a présent 7] 
    if (%enlevigno == on) {  .notice $did(1).seltext 14 %designmess }
    ignore -r $did(1).seltext  
    did -d iglist 1 $did(1).sel  
    halt
  }

  if ($did == 150) { 
    echo -a  7[10 $did(101).seltext 14n'est plus dans la liste des notifiés a présent 7] 
    if (%enlevnoti == on) { .notice $did(101).seltext 4 %denoti }
    notify -r $did(101).seltext  
    did -d iglist 101 $did(101).sel 
    halt
  }

  if ($did == 51)  { ignore -r  | did -rc $dname 1 %l  | .echo 14 -a 7[La liste des Ignorés est vide 7] | halt }
  if ($did == 18) { dialog -m opti1 opti1 }
  if ($did == 118) { dialog -m opti2 opti2 }
}


------dIALOGUE OPTIONS
dialog opti1 {
  title "Options des Ignores" 
  size 10 10 300 150
  button "OK" ,1 , 10 120 280 20 , ok
  text "Prevenir l'ignoré" , 2 , 20 10 80 20
  check  "A sa mise en ignore " 3 , 20 30 140 15 
  text " Message -------> " 6 , 20 50 80 20
  edit "" 4 ,  100 45 180 20 , autohs 
  check "A son retrait des ignores" , 5 , 20 75 150 15
  text " Message -------> " 7 , 20 95 80 20
  edit "" 8 ,  100 95 180 20 , autohs 
}

--------
on *:dialog:opti1:sclick:1:{
  set %meimess $did(opti1,4) 
  set %designmess $did(opti1,8) 
}
on *:dialog:opti1:sclick:3:{
  if (%misenigno == $null) { //set %misenigno on  | //did -c opti1 3 | //did -e opti1 4 | halt  }
  if (%misenigno == on) { //set %misenigno off | //did -b opti1 4 | halt  }
  if (%misenigno == off) { //set %misenigno on | //did -c opti1 3 |  //did -e opti1 4  }
}
on *:dialog:opti1:sclick:5:{
  if (%enlevigno == $null) { //set %enlevigno on  | //did -c opti1 5 |  //did -e opti1 8 | halt }
  if (%enlevigno == on) { //set %enlevigno off | //did -b opti1 8 | halt  }
  if (%enlevigno == off) { //set %enlevigno on | //did -c opti1 5  | //did -e opti1 8 }
}

on *:dialog:opti1:init:0:{
  if (%misenigno  == on) { //did -c opti1 3 }
  else { //did -b opti1 4  }
  if (%enlevigno == on) { //did -c opti1 5  }
  else { //did -b opti1 8 }
  did -ca opti1 4 %meimess
  did -ca opti1 8 %designmess

}


----OPTIONS NOTIFIES-----

dialog opti2 {
  title "Options des Notifiés" 
  size 330 10 300 150
  button "OK" ,1 , 10 120 280 20 , ok
  text "Prevenir le Notifié" , 2 , 20 10 180 20
  check  "A sa notification " 3 , 20 30 140 15 
  text " Message -------> " 6 , 20 50 80 20
  edit "" 4 ,  100 45 180 20 , autohs 
  check "A son retrait des notifiés" , 5 , 20 75 150 15
  text " Message -------> " 7 , 20 95 80 20
  edit "" 8 ,  100 95 180 20 , autohs 
}
on *:dialog:opti2:sclick:1:{
  set %menot $did(opti2,4) 
  set %denoti $did(opti2,8) 
}

on *:dialog:opti2:sclick:3:{
  if (%misennoti == $null) { //set %misennoti on  | //did -c opti2 3 |  //did -e opti2 4 | halt }
  if (%misennoti == on) { //set %misennoti off | //did -b opti2 4 | halt  }
  if (%misennoti == off) { //set %misennoti on | //did -c opti2 3 | //did -e opti2 4 }
}
on *:dialog:opti2:sclick:5:{
  if (%enlevnoti  == $null) { //set %enlevnoti  on  | //did -c opti2 8 |  //did -e opti2 8 | halt }
  if (%enlevnoti  == on) { //set %enlevnoti  off | //did -b opti2 8 | halt  }
  if (%enlevnoti   == off) { //set %enlevnoti  on | //did -c opti2 8 |  //did -e opti2 8 }
}
on *:dialog:opti2:init:0:{
  if (%misennoti  == on) { //did -c opti2 3 | //did -e opti2 4 }
  else { //did -b opti2 4 }
  if (%enlevnoti == on) { //did -c opti2 5 | //did -e opti2 8 }
  else { //did -b opti2 8 }
  did -ca opti2 4 %menot 
  did -ca opti2 8 %denoti
}
