Hide / Show Window Dialog

By Scakk on Aug 13, 2008

http://www.hawkee.com/snippet/730/ Original base script and idea from ch1zra.

Image

With this dialog you can hide ( or show if hidden ) Channels , @Windows and Query windows. You can hide/show one at a time or all at once.

Edit 13Aug08: It will now join you to the channel you double click ( hidden or not hidden ) , make the Query and the @Window your active window ( hidden or not ) which will make them no longer hidden and reseting the Visible / Hidden list as needed.

Edit 14Aug08: It will now unhide the channel/query if text is entered into it. Will also update the Visisble/Hidden list as needed.

Edit 15Aug08: You can now move more than one item from one list to the other list.

Edit 17Aug08: Added Menu for refeshing for use on multiple Networks. Click refersh and it redoes the list based on the network active when it reopens. Also the title states the network it is working for.

Edit 4Sep08: Fixed the issue with the returning of the channel query if text was entered into them.

menu channel,status {
  .$iif($server, Channel Show/Hide) :winhide
}
alias winhide { dialog $iif($dialog(winhide), -v, -m) winhide winhide } 

dialog winhide {
  title "Hide/Show Windows"
  size -1 -1 160 82
  option dbu
  menu "&More" 1000
  item "&Refresh", 2000
  box "Visible", 1, 3 1 68 79
  list 2, 8 10 58 70, sort autovs check
  box "Hidden", 3, 91 1 68 79
  list 4, 96 10 58 70, sort autovs check
  button ">", 5, 74 18 15 15, flat
  button ">>", 7, 74 58 15 10, flat
  button "<<", 8, 74 70 15 10, flat
  text "One Item", 9, 73 3 15 15, center
  text "All Items", 10, 73 43 15 15, center
}
on *:dialog:winhide:*:*: {
  if ($devent == init) { ch.load | dialog -t $dname Hide/Show Windows for $network }
  if ($devent == menu) { if ($did == 2000) { dialog -x winhide | dialog -mh winhide winhide } }
  if ($devent == close) { 
    if ($exists(HideView.txt)) { .remove HideView.txt } 
    if ($exists(HideViewC.txt)) { .remove HideViewC.txt }
    if ($exists(HideViewCC.txt)) { .remove HideViewCC.txt }
    if ($exists(HideViewCQ.txt)) { .remove HideViewCQ.txt }
  }
  if ($devent == dclick) { 
    if ($did == 2) { 
      if ($window($did(2).seltext).type = channel) { join $did(2).seltext | goto next1 }
      if ($window($did(2).seltext).type = custom) { window -a $did(2).seltext | goto next1 } 
      if ($window($did(2).seltext).type = query) { window -a $did(2).seltext | goto next1 } 
      :next1
      ch.load  
    }
    if ($did == 4) { 
      if ($window($did(4).seltext).type = channel) { join $did(4).seltext | goto next2 }
      if ($window($did(4).seltext).type = custom) { window -a $did(4).seltext | goto next2 } 
      if ($window($did(4).seltext).type = query) { window -a $did(4).seltext | goto next2 } 
      :next2
      ch.load 
    }
  }
  if ($devent == sclick) { 
    if ($did == 2) {
      if ($did(2,$did(2).sel).cstate == 1) { write HideView.txt $did(2).seltext }
      if ($did(2,$did(2).sel).cstate == 0) { write -ds $+ $did(2).seltext HideView.txt }
      did -u $dname 4
      did -a $dname 5 >
    }
    if ($did == 4) {
      if ($did(4).seltext) {
        if ($window($did(4).seltext).type = channel) {
          if ($did(4,$did(4).sel).cstate == 1) { write HideViewC.txt $did(4).seltext }
          if ($did(4,$did(4).sel).cstate == 0) { write -ds $+ $did(4).seltext HideViewC.txt }
        }
        if ($window($did(4).seltext).type = custom) { 
          if ($did(4,$did(4).sel).cstate == 1) { write HideViewCC.txt $did(4).seltext }
          if ($did(4,$did(4).sel).cstate == 0) { write -ds $+ $did(4).seltext HideViewCC.txt }
        }
        if ($window($did(4).seltext).type = query) { 
          if ($did(4,$did(4).sel).cstate == 1) { write HideViewCQ.txt $did(4).seltext }
          if ($did(4,$did(4).sel).cstate == 0) { write -ds $+ $did(4).seltext HideViewCQ.txt }
        }
      }
      did -u $dname 2
      did -a $dname 5 <
    }
    if ($did == 5) {
      if ($did(5) == >) { 
        if ($exists(HideView.txt)) {
          var %i 1
          while (%i <= $lines(HideView.txt)) {
            window -h $read(HideView.txt,%i)
            inc %i
          }
          ch.load 
        }
      }
      if ($did(5) == <) {  
        var %i 1
        while (%i <= $chan(0)) {
          if ($window($chan($read(HideViewC.txt,%i))).state == hidden) { window -wr $read(HideViewC.txt,%i) }
          inc %i
        }
        var %i 1
        while (%i <= $window(0)) {
          if ($window($window($read(HideViewCC.txt,%i))).state == hidden) { window -nw(0) $read(HideViewCC.txt,%i) } 
          inc %i
        }
        var %i 1
        while (%i <= $query(0)) {
          if ($window($query($read(HideViewCQ.txt,%i))).state == hidden) { window -nw(0) $read(HideViewCQ.txt,%i) }
          inc %i
        }
        ch.load   
      }
    }
    if ($did == 7) {
      did -r winhide 2,4
      var %i 1
      while (%i <= $chan(0)) {
        if ($window($chan(%i)).state != hidden) { window -h $chan(%i) }
        inc %i
      }
      var %i 1
      while (%i <= $window(0)) {
        if ($window($window(%i)).state != hidden) { window -h $window(%i) } 
        inc %i
      }
      var %i 1
      while (%i <= $query(0)) {
        if ($window($query(%i)).state != hidden) { window -h $query(%i) }
        inc %i
      }
      ch.load
    }
    if ($did == 8) { 
      did -r winhide 2,4
      var %i 1
      while (%i <= $chan(0)) {
        if ($window($chan(%i)).state == hidden) { window -wr $chan(%i) }
        inc %i
      }
      var %i 1
      while (%i <= $window(0)) {
        if ($window($window(%i)).state == hidden) { window -nw(0) $window(%i) } 
        inc %i
      }
      var %i 1
      while (%i <= $query(0)) {
        if ($window($query(%i)).state == hidden) { window -nw(0) $query(%i) }
        inc %i
      }
      ch.load
    }
  }
}
alias ch.load {
  if ($exists(HideView.txt)) { .remove HideView.txt } 
  if ($exists(HideViewC.txt)) { .remove HideViewC.txt }
  if ($exists(HideViewCC.txt)) { .remove HideViewCC.txt }
  if ($exists(HideViewCQ.txt)) { .remove HideViewCQ.txt }
  did -r winhide 2,4
  var %i 1
  while (%i <= $chan(0)) {
    $iif($window($chan(%i)).state == hidden, did -a winhide 4 $chan(%i), did -a winhide 2 $chan(%i)) 
    inc %i
  }
  var %i 1
  while (%i <= $window(0)) {
    $iif($window($window(%i)).state == hidden, did -a winhide 4 $window(%i), did -a winhide 2 $window(%i)) 
    inc %i
  }
  var %i 1
  while (%i <= $query(0)) {
    $iif($window($query(%i)).state == hidden, did -a winhide 4 $query(%i), did -a winhide 2 $query(%i)) 
    inc %i
  }
}

on *:action:*:#: {
  if ($window($chan).state == hidden) { window -wr $chan | if ($dialog(winhide)) { ch.load } }
}
on *:action:*:?: {
  if ($window($($query($nick),3)).state == hidden) { window -wr $($query($nick),3) | if ($dialog(winhide)) { ch.load } } 
}
on *:notice:*:#: {
  if ($window($chan).state == hidden) { window -wr $chan | if ($dialog(winhide)) { ch.load } }
}
on *:notice:*:?: {
  if ($window($($query($nick),3)).state == hidden) { window -wr $($query($nick),3) | if ($dialog(winhide)) { ch.load } } 
}
on *:text:*:#: {
  if ($window($chan($active)).state == hidden) { window -wr $chan | if ($dialog(winhide)) { ch.load } ) }
}
on *:text:*:?: {  
  if ($window($($query($nick),3)).state == hidden) { window -wr $($query($nick),3) | if ($dialog(winhide)) { ch.load } } 
}

Comments

Sign in to comment.
RicJames   -  Oct 21, 2010

Great script. Is it possible to get this to hide the channels you set to hide as soon as your client loads up?

 Respond  
EL   -  Sep 15, 2008

Nice another good update;p.Useful as all get out.`-.-´

 Respond  
Scakk   -  Sep 04, 2008

Edit 4Sep08: Fixed the issue with the returning of the channel query if text was entered into them.

 Respond  
Eugenio   -  Aug 26, 2008

yeah update pwnz0rs even more.....looks abit nicer aswell
/me leaves rating >D

 Respond  
EL   -  Aug 26, 2008

Nice updates scakk.`-.-´

 Respond  
Eugenio   -  Aug 17, 2008

Sam: I cba to hide/bring em back manually

 Respond  
^Neptune   -  Aug 17, 2008

Eugene: /window -h @window makes a hidden window :]

 Respond  
Scakk   -  Aug 17, 2008

Edit 17Aug08: Added Menu for refeshing for use on multiple Networks. Click refersh and it redoes the list based on the network active when it reopens. Also the title states the network it is working for.

 Respond  
Scakk   -  Aug 15, 2008

Edit 15Aug08: You can now move more than one item from one list to the other list.

 Respond  
Scakk   -  Aug 14, 2008

Edit 14Aug08: It will now unhide the channel/query if text is entered into it. Will also update the Visible / Hidden list as needed.

 Respond  
Eugenio   -  Aug 13, 2008

nice one xD this is so usefull for me lol, bloody @windows >;[
think double click join/show window idea is really good >D

 Respond  
Scakk   -  Aug 13, 2008

Eugenio: Will work on adding that now.

Edit: It will now join you to the channel you double click ( hidden or not hidden ) , make the Query and the @Window your active window ( hidden or not ) which will make them no longer hidden and reseting the Visible / Hidden list as needed.

 Respond  
Eugenio   -  Aug 13, 2008

fuxin hell scakk this pwnz, I can hide some of my bloody @windows now ;p
/me rates 8
make it so if you double click on a window it takes you to that window .......?!?

 Respond  
EL   -  Aug 13, 2008

Works welll scakk.I use ch1zra\'s script atm but i ll switch to this bein it does more windows.\"Rate it or Hate it?\"...7/10.`-.-´

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.