aMSN Forums
February 26, 2018, 12:32:41 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [Suggestion] Collapse/Expand all groups on the contact list  (Read 5281 times)
afv
Newbie

Offline Offline

Posts: 31


View Profile
« on: May 08, 2009, 09:11:53 pm »

Would it be interesting to have an option, maybe at View menu, to Collapse/Expand all groups on the contact list? Smiley
Logged
afv
Newbie

Offline Offline

Posts: 31


View Profile
« Reply #1 on: May 09, 2009, 01:53:41 pm »

I have made it. :shock: :shock:

Wow, my first time looking and editing the aMSN code :lol:

How do I share the modified code so you can check if it should/can be added? Cheesy
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #2 on: May 09, 2009, 08:47:58 pm »

Humm.. you could just paste the diff in here... however, I'm not sure if we'lll ever add that, it would make the menu too bloated and i don't think there's any real need for such an option.
glad you did it though! Smiley
Logged

KaKaRoTo
afv
Newbie

Offline Offline

Posts: 31


View Profile
« Reply #3 on: May 09, 2009, 09:49:38 pm »

Quote from: "kakaroto"
Humm.. you could just paste the diff in here... however, I'm not sure if we'lll ever add that, it would make the menu too bloated and i don't think there's any real need for such an option.
glad you did it though! Smiley


I don't know if there's a better "output view" for diff but here it is what I could get:

gui.tcl
Code:

4818a4819,4827
> $view add command -label "[trans groupexpandall]" -command [list ::guiContactList::expandAllGroups] -state disabled
> $view add command -label "[trans groupcollapseall]" -command [list ::guiContactList::collapseAllGroups] -state disabled
> $view add command -label "[trans grouptoggleall]" -command [list ::guiContactList::toggleAllGroups] -state disabled
> #-------------------
> $view add separator
> $view add checkbutton -label "[trans showdetailedview]" -onvalue 1 -offvalue 0 -state disabled \
>    -variable [::config::getVar show_detailed_view] -command [list ::guiContactList::DetailedView]
> #-------------------
> $view add separator
5186a5196,5198
> set groupexpandall_idx [$menu index "[trans groupexpandall]"]
> set groupcollapseall_idx [$menu index "[trans groupcollapseall]"]
> set grouptoggleall_idx [$menu index "[trans grouptoggleall]"]
5191c5203
< enableEntries $menu [list $contact_sorting_idx $email_idx $nick_idx $asc_idx $desc_idx $detview_idx $nonim_idx $spaces_idx $offline_idx]
---
> enableEntries $menu [list $contact_sorting_idx $email_idx $nick_idx $asc_idx $desc_idx $groupexpandall_idx $groupcollapseall_idx $grouptoggleall_idx $detview_idx $nonim_idx $spaces_idx $offline_idx]
5266a5279,5281
> set groupexpandall_idx [$menu index "[trans groupexpandall]"]
> set groupcollapseall_idx [$menu index "[trans groupcollapseall]"]
> set grouptoggleall_idx [$menu index "[trans grouptoggleall]"]
5271c5286
< enableEntries $menu [list $contact_sorting_idx $email_idx $nick_idx $asc_idx $desc_idx $detview_idx $nonim_idx $spaces_idx $offline_idx] 0
---
> enableEntries $menu [list $contact_sorting_idx $email_idx $nick_idx $asc_idx $desc_idx $groupexpandall_idx $groupcollapseall_idx $grouptoggleall_idx $detview_idx $nonim_idx $spaces_idx $offline_idx] 0


guicontactlist.tcl
Code:

595c595,616
<
---
>
> proc expandAllGroups { } {
> foreach group [getGroupList 0 1] {
> ::groups::expandAll [lindex $group 0]
> }
> updateCL
> }
>
> proc collapseAllGroups { } {
> foreach group [getGroupList 0 1] {
> ::groups::collapseAll [lindex $group 0]
> }
> updateCL
> }
>
> proc toggleAllGroups { } {
> foreach group [getGroupList 0 1] {
> ::groups::ToggleStatus [lindex $group 0]
> }
> updateCL
> }
>


groups.tcl
Code:

396a397,428
>
> proc expandAll {gid} {
> variable bShowing
>
> if {![info exists bShowing($gid)]} {
> return 0
> }
>
> if { $bShowing($gid) == 0 } {
> set bShowing($gid) 1
> }
>
> ::config::setKey expanded_group_$gid [set bShowing($gid)]
>
> return [set bShowing($gid)]
> }
>
> proc collapseAll {gid} {
> variable bShowing
>
> if {![info exists bShowing($gid)]} {
> return 0
> }
>
> if { $bShowing($gid) == 1 } {
> set bShowing($gid) 0
> }
>
> ::config::setKey expanded_group_$gid [set bShowing($gid)]
>
> return [set bShowing($gid)]
> }


lang/langen
Code:

428a429
> groupcollapseall Collapse all groups
432a434
> groupexpandall Expand all groups
440a443
> grouptoggleall Toggle expanded/collapsed groups


Maybe the last option (Toogle expanded/collapsed) wouldn't have a real need but the other ones (collapse/expand all) would be useful for people with many groups. Just a guess. :wink:

Is it possible to have it as a plugin (for myself)? How can I do it? Tongue I'll take a look at current plugins to check how they work (when I have some time Tongue).
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!