From: Fred <gad...@us...> - 2004-08-30 08:14:58
|
Update of /cvsroot/amsn/msn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12642/msn Modified Files: abook.tcl groups.tcl Log Message: Change the presentation of the groups in the properties window Index: abook.tcl =================================================================== RCS file: /cvsroot/amsn/msn/abook.tcl,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** abook.tcl 29 Aug 2004 08:34:38 -0000 1.96 --- abook.tcl 30 Aug 2004 08:14:38 -0000 1.97 *************** *** 789,793 **** pack $nbIdent.customcolorf.brem -side left -padx 3 -pady 2 ! label $nbIdent.g -text "[trans group]:" label $nbIdent.g1 -text "[::abook::getGroupsname $email]" -font splainf -fg blue -justify left -wraplength 300 button $nbIdent.g2 -text [trans change] -command "::groups::Groupmanager $email $nbIdent" --- 789,793 ---- pack $nbIdent.customcolorf.brem -side left -padx 3 -pady 2 ! label $nbIdent.g -text "[trans group]" -font bboldunderf label $nbIdent.g1 -text "[::abook::getGroupsname $email]" -font splainf -fg blue -justify left -wraplength 300 button $nbIdent.g2 -text [trans change] -command "::groups::Groupmanager $email $nbIdent" *************** *** 860,893 **** grid $nbIdent.customcolorf -row 6 -column 1 -sticky w ! grid $nbIdent.g -row 7 -column 0 -sticky en ! grid $nbIdent.g1 -row 7 -column 1 -sticky wn ! grid $nbIdent.g2 -row 7 -column 2 ! grid $nbIdent.titlephones -row 8 -column 0 -pady 5 -padx 5 -columnspan 2 -sticky w ! grid $nbPhone.phh -row 9 -column 0 -sticky e ! grid $nbPhone.phh1 -row 9 -column 1 -sticky w ! grid $nbPhone.phw -row 10 -column 0 -sticky e ! grid $nbPhone.phw1 -row 10 -column 1 -sticky w ! grid $nbPhone.phm -row 11 -column 0 -sticky e ! grid $nbPhone.phm1 -row 11 -column 1 -sticky w ! grid $nbPhone.php -row 12 -column 0 -sticky e ! grid $nbPhone.php1 -row 12 -column 1 -sticky w ! grid $nbIdent.titleothers -row 17 -column 0 -pady 5 -padx 5 -columnspan 2 -sticky w ! grid $nbPhone.lastlogin -row 18 -column 0 -sticky e ! grid $nbPhone.lastlogin1 -row 18 -column 1 -sticky w ! grid $nbPhone.lastlogout -row 18 -column 2 -sticky e ! grid $nbPhone.lastlogout1 -row 18 -column 3 -sticky w ! grid $nbPhone.lastmsgedme -row 20 -column 0 -sticky e ! grid $nbPhone.lastmsgedme1 -row 20 -column 1 -sticky w ! grid $nbPhone.lastseen -row 20 -column 2 -sticky e ! grid $nbPhone.lastseen1 -row 20 -column 3 -sticky w ! grid $nbPhone.clientname -row 21 -column 0 -sticky e ! grid $nbPhone.clientname1 -row 21 -column 1 -sticky w ! grid $nbPhone.chatlogging -row 21 -column 2 -sticky e ! grid $nbPhone.chatlogging1 -row 21 -column 3 -sticky w ! grid $nbPhone.titlepic -row 27 -column 0 -sticky w -columnspan 2 -pady 5 -padx 5 ! grid $nbPhone.displaypic -row 28 -column 0 -sticky w -columnspan 2 -padx 8 #grid columnconfigure $nbIdent.fothers 1 -weight 1 --- 860,893 ---- grid $nbIdent.customcolorf -row 6 -column 1 -sticky w ! grid $nbIdent.g -row 7 -column 0 -pady 5 -padx 5 -sticky w ! grid $nbIdent.g1 -row 8 -column 0 -sticky e ! grid $nbIdent.g2 -row 8 -column 1 -sticky w ! grid $nbIdent.titlephones -row 9 -column 0 -pady 5 -padx 5 -columnspan 2 -sticky w ! grid $nbPhone.phh -row 10 -column 0 -sticky e ! grid $nbPhone.phh1 -row 10 -column 1 -sticky w ! grid $nbPhone.phw -row 11 -column 0 -sticky e ! grid $nbPhone.phw1 -row 11 -column 1 -sticky w ! grid $nbPhone.phm -row 12 -column 0 -sticky e ! grid $nbPhone.phm1 -row 12 -column 1 -sticky w ! grid $nbPhone.php -row 13 -column 0 -sticky e ! grid $nbPhone.php1 -row 13 -column 1 -sticky w ! grid $nbIdent.titleothers -row 18 -column 0 -pady 5 -padx 5 -columnspan 2 -sticky w ! grid $nbPhone.lastlogin -row 19 -column 0 -sticky e ! grid $nbPhone.lastlogin1 -row 19 -column 1 -sticky w ! grid $nbPhone.lastlogout -row 19 -column 2 -sticky e ! grid $nbPhone.lastlogout1 -row 19 -column 3 -sticky w ! grid $nbPhone.lastmsgedme -row 21 -column 0 -sticky e ! grid $nbPhone.lastmsgedme1 -row 21 -column 1 -sticky w ! grid $nbPhone.lastseen -row 21 -column 2 -sticky e ! grid $nbPhone.lastseen1 -row 21 -column 3 -sticky w ! grid $nbPhone.clientname -row 22 -column 0 -sticky e ! grid $nbPhone.clientname1 -row 22 -column 1 -sticky w ! grid $nbPhone.chatlogging -row 22 -column 2 -sticky e ! grid $nbPhone.chatlogging1 -row 22 -column 3 -sticky w ! grid $nbPhone.titlepic -row 28 -column 0 -sticky w -columnspan 2 -pady 5 -padx 5 ! grid $nbPhone.displaypic -row 29 -column 0 -sticky w -columnspan 2 -padx 8 #grid columnconfigure $nbIdent.fothers 1 -weight 1 *************** *** 976,980 **** moveinscreen $w 30 - status_log YOYOYO } --- 976,979 ---- Index: groups.tcl =================================================================== RCS file: /cvsroot/amsn/msn/groups.tcl,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** groups.tcl 29 Aug 2004 08:34:39 -0000 1.48 --- groups.tcl 30 Aug 2004 08:14:39 -0000 1.49 *************** *** 625,628 **** --- 625,629 ---- } + #Tests if a contact belong to a group or not proc Belongtogp {email gid} { *************** *** 645,649 **** toplevel $w wm title $w "[trans groups] ($email)" ! wm geometry $w 350x200+30+30 wm protocol $w WM_DELETE_WINDOW "::groups::GroupmanagerClose $email" --- 646,650 ---- toplevel $w wm title $w "[trans groups] ($email)" ! #wm geometry $w 350x200+30+30 wm protocol $w WM_DELETE_WINDOW "::groups::GroupmanagerClose $email" *************** *** 656,659 **** --- 657,661 ---- set thelistnames [list] + #Create a list with the names of the groups the contact belong to foreach gid $gidlist { set thename [::groups::GetName $gid] *************** *** 661,664 **** --- 663,667 ---- } + #Sort the list by names (sortlist is a list of lists with name and gid of a group) set sortlist [lsort -dictionary -index 0 $thelistnames] set sortlist2 [list] *************** *** 686,689 **** --- 689,694 ---- pack configure $w.button -side bottom -fill x -ipady 10 -ipadx 10 + moveinscreen $w 30 + } *************** *** 697,700 **** --- 702,706 ---- set gidlistno [list] + #Check which groups the contact belong to (gidlistyes) and which he doesn't (gidlistno) foreach gid $gidlist { set state [::config::getKey tempgroup_[::md5::md5 $email]($gid)] *************** *** 707,710 **** --- 713,717 ---- } + #If the contact doesn't belong to any groups, put it in the "Nogroup" group if {$gidlistyes == ""} { lappend gidlistyes 0 *************** *** 714,717 **** --- 721,725 ---- set timer 0 + #First add the contact to the new groups foreach gid $gidlistyes { if {[lsearch [::abook::getGroups $email] $gid] == -1} { *************** *** 721,724 **** --- 729,733 ---- } + #Then remove their from the former groups foreach gid $gidlistno { if {[lsearch [::abook::getGroups $email] $gid] != -1} { *************** *** 730,733 **** --- 739,743 ---- destroy .gpmanage_[::md5::md5 $email] + #If the properties window is open, change the groups of the contact in it if {$winpref != ""} { set groups "" |