From: <vi...@us...> - 2008-01-29 14:55:20
|
Revision: 9530 http://amsn.svn.sourceforge.net/amsn/?rev=9530&view=rev Author: vivia Date: 2008-01-29 06:55:23 -0800 (Tue, 29 Jan 2008) Log Message: ----------- Consistent line endings Modified Paths: -------------- trunk/amsn/plugins/SearchContact/searchcontact.tcl Modified: trunk/amsn/plugins/SearchContact/searchcontact.tcl =================================================================== --- trunk/amsn/plugins/SearchContact/searchcontact.tcl 2008-01-29 13:14:45 UTC (rev 9529) +++ trunk/amsn/plugins/SearchContact/searchcontact.tcl 2008-01-29 14:55:23 UTC (rev 9530) @@ -1,46 +1,46 @@ -################################################## -# This plugin implements the Search Contact on # -# the bottom of the contactlist, as seen in MSN # -# =========================================== # -# Search Contact Plugin Square87 & Takeshi '07 # -# refactored by Karel "scapor" Demeyer '08 # -# ============================================ # ################################################## +# This plugin implements the Search Contact on # +# the bottom of the contactlist, as seen in MSN # +# =========================================== # +# Search Contact Plugin Square87 & Takeshi '07 # +# refactored by Karel "scapor" Demeyer '08 # +# ============================================ # +################################################## -#TODO: so a binding on the main menu for any-key that stores that keypress, focusses the bar and inserts the pressed key ? - -namespace eval ::searchcontact { - +#TODO: so a binding on the main menu for any-key that stores that keypress, focusses the bar and inserts the pressed key ? + +namespace eval ::searchcontact { + proc Init { dir } { - - ::plugins::RegisterPlugin "Search Contact" - ::plugins::RegisterEvent "Search Contact" contactlistLoaded drawSearchBar + + ::plugins::RegisterPlugin "Search Contact" + ::plugins::RegisterEvent "Search Contact" contactlistLoaded drawSearchBar ::plugins::RegisterEvent "Search Contact" OnDisconnect removeSearchBar - ::plugins::RegisterEvent "Search Contact" Load pluginFullyLoaded - + ::plugins::RegisterEvent "Search Contact" Load pluginFullyLoaded + #load language files set langdir [file join $dir "lang"] load_lang en $langdir load_lang [::config::getGlobalKey language] $langdir #Setting the default configuration - #searchtypes: - # 0 Everything - # 1 Nickname/PSM - # 2 Account - # 3 Groups - # 4 Notes (if plugin loaded) - array set ::searchcontact::config { - searchtype 0 - filter_blocked 0 - filter_removedme 0 + #searchtypes: + # 0 Everything + # 1 Nickname/PSM + # 2 Account + # 3 Groups + # 4 Notes (if plugin loaded) + array set ::searchcontact::config { + searchtype 0 + filter_blocked 0 + filter_removedme 0 input "" historylist "" usewildcards 0 enableoperators 0 - storelastinput 0 + storelastinput 0 } set ::searchcontact::configlist [list \ [list bool "[trans usewildcards]" usewildcards] \ @@ -48,25 +48,25 @@ [list bool "[trans storelastinput]" storelastinput] \ ] - #load the icons - ::skin::setPixmap search search.png pixmaps [file join "$dir" pixmaps] - ::skin::setPixmap clear clear.png pixmaps [file join "$dir" pixmaps] - - #clearing some vars before use - set ::searchcontact::firstcontact "" + #load the icons + ::skin::setPixmap search search.png pixmaps [file join "$dir" pixmaps] + ::skin::setPixmap clear clear.png pixmaps [file join "$dir" pixmaps] + + #clearing some vars before use + set ::searchcontact::firstcontact "" variable clblocked 0 #History begin settings variable history [list ] - variable stepsback 0 - + variable stepsback 0 + } proc pluginFullyLoaded {event evpar} { upvar 2 $evpar newvar - if { $newvar(name) == "Search Contact" && $::contactlist_loaded} { - ::searchcontact::drawSearchBar + if { $newvar(name) == "Search Contact" && $::contactlist_loaded} { + ::searchcontact::drawSearchBar } } @@ -94,62 +94,62 @@ set cluetextpresent 1 } } - - proc removeSearchBar {event evPar} { + + proc removeSearchBar {event evPar} { set frame .main.searchbar.sunkenframe - #remove bindings + #remove bindings bind . <Control-f> "" bind .main <FocusIn> "" bind .main <FocusOut> "" if { $event == "OnDisconnect" } { set ::contactlist_loaded 0 } ;# in aMNS 0.97.0 when we log out contactlist_loaded is still 1 - after cancel ::searchcontact::drawSearchBar - destroy .main.searchbar - variable ::guiContactList::external_lock 0 - } - - proc clearSearch { } { + after cancel ::searchcontact::drawSearchBar + destroy .main.searchbar + variable ::guiContactList::external_lock 0 + } + + proc clearSearch { } { .main.searchbar.sunkenframe.input delete 0 end - ::searchcontact::resetSearchBarColor - set ::searchcontact::firstcontact "" - pack forget .main.searchbar.sunkenframe.clearbutton - ::searchcontact::drawContacts - } - - + ::searchcontact::resetSearchBarColor + set ::searchcontact::firstcontact "" + pack forget .main.searchbar.sunkenframe.clearbutton + ::searchcontact::drawContacts + } + + proc drawSearchBar {{event none} {evPar ""} } { - + if {![winfo exists .main.searchbar]} { #we only register those now as otherwise it's already called during login while the bar isn't even drawn yet - ::plugins::RegisterEvent "Search Contact" ChangeState redoSearch + ::plugins::RegisterEvent "Search Contact" ChangeState redoSearch ::plugins::RegisterEvent "Search Contact" parse_contact redoSearch - frame .main.searchbar -bg white -borderwidth 1 -highlightthickness 0 - label .main.searchbar.label -text "[trans filter]:" -bg white - frame .main.searchbar.sunkenframe -relief sunken -bg white - pack .main.searchbar.label -side left - pack .main.searchbar.sunkenframe -side left -fill x -expand 1 -padx 20 - - set frame .main.searchbar.sunkenframe - - label $frame.searchbutton -image [::skin::loadPixmap search] -bg white - entry $frame.input -relief flat -bg white -font splainf -selectbackground #b7d1ff -fg grey - label $frame.clearbutton -image [::skin::loadPixmap clear] -bg white - - pack $frame.searchbutton -side left - pack $frame.input -side left -fill x -expand 1 - pack .main.searchbar -fill x -expand false - bind $frame.clearbutton <<Button1>> ::searchcontact::clearSearch - bind $frame.searchbutton <<Button1>> "::searchcontact::showFilterMenu %X %Y" - bind $frame.input <Any-Key> "after cancel ::searchcontact::drawContacts;after 250 ::searchcontact::drawContacts;after 0 ::searchcontact::updateClearIcon" - bind $frame.input <Return> ::searchcontact::enterPressed - bind $frame.input <<Escape>> ::searchcontact::clearSearch - # binding to give focus + frame .main.searchbar -bg white -borderwidth 1 -highlightthickness 0 + label .main.searchbar.label -text "[trans filter]:" -bg white + frame .main.searchbar.sunkenframe -relief sunken -bg white + pack .main.searchbar.label -side left + pack .main.searchbar.sunkenframe -side left -fill x -expand 1 -padx 20 + + set frame .main.searchbar.sunkenframe + + label $frame.searchbutton -image [::skin::loadPixmap search] -bg white + entry $frame.input -relief flat -bg white -font splainf -selectbackground #b7d1ff -fg grey + label $frame.clearbutton -image [::skin::loadPixmap clear] -bg white + + pack $frame.searchbutton -side left + pack $frame.input -side left -fill x -expand 1 + pack .main.searchbar -fill x -expand false + bind $frame.clearbutton <<Button1>> ::searchcontact::clearSearch + bind $frame.searchbutton <<Button1>> "::searchcontact::showFilterMenu %X %Y" + bind $frame.input <Any-Key> "after cancel ::searchcontact::drawContacts;after 250 ::searchcontact::drawContacts;after 0 ::searchcontact::updateClearIcon" + bind $frame.input <Return> ::searchcontact::enterPressed + bind $frame.input <<Escape>> ::searchcontact::clearSearch + # binding to give focus bind . <Control-f> "focus $frame.input" #history bindings bind $frame.input <Key-Up> ::searchcontact::historyUp - bind $frame.input <Key-Down> ::searchcontact::historyDown + bind $frame.input <Key-Down> ::searchcontact::historyDown #insert the clue text @@ -159,35 +159,35 @@ #bindings to remove/add clue text bind .main <FocusIn> ::searchcontact::focusInSearchbar - bind .main <FocusOut> ::searchcontact::focusOutSearchbar + bind .main <FocusOut> ::searchcontact::focusOutSearchbar if { $::searchcontact::config(storelastinput) == 1 } { #set the stored input ::searchcontact::restoreSavedInput - } - - } else { - variable output "" - destroy .main.searchbar - variable ::guiContactList::external_lock 0 - ::guiContactList::organiseList .main.f.cl.cvs [::guiContactList::getContactList] - } - } - - proc enterPressed {} { + } + + } else { + variable output "" + destroy .main.searchbar + variable ::guiContactList::external_lock 0 + ::guiContactList::organiseList .main.f.cl.cvs [::guiContactList::getContactList] + } + } + + proc enterPressed {} { variable history variable stepsback - if {$::searchcontact::firstcontact != ""} { - ::amsn::chatUser $::searchcontact::firstcontact + if {$::searchcontact::firstcontact != ""} { + ::amsn::chatUser $::searchcontact::firstcontact #change history lappend history [::searchcontact::getInput] set stepsback 0 - #now remove the filter - ::searchcontact::clearSearch + #now remove the filter + ::searchcontact::clearSearch } - + } proc historyUp {} { @@ -244,122 +244,121 @@ foreach widget [list .main.searchbar.sunkenframe.searchbutton .main.searchbar.sunkenframe.input .main.searchbar.sunkenframe.clearbutton ] { $widget configure -bg white } - } - - proc updateClearIcon {} { - if {[getInput] != ""} { - #show icon to clear if input is not empty - pack .main.searchbar.sunkenframe.clearbutton -side right - } else { - #remove icon if input is empty - pack forget .main.searchbar.sunkenframe.clearbutton - } - } - - proc restoreSavedInput {} { + } + + proc updateClearIcon {} { + if {[getInput] != ""} { + #show icon to clear if input is not empty + pack .main.searchbar.sunkenframe.clearbutton -side right + } else { + #remove icon if input is empty + pack forget .main.searchbar.sunkenframe.clearbutton + } + } + + proc restoreSavedInput {} { variable clblocked - variable history - + variable history + set input [lindex $::searchcontact::config(historylist) end] set history [lrange $::searchcontact::config(historylist) 0 end-1] - - #if there's some filter applied, block the cl redrawing + + #if there's some filter applied, block the cl redrawing if {$input != ""} { ::searchcontact::focusInSearchbar - #set the stored input - .main.searchbar.sunkenframe.input insert 0 "$input" - ::searchcontact::updateClearIcon - set clblocked 1 - } elseif { $::searchcontact::config(filter_blocked) || $::searchcontact::config(filter_removedme) } { - set clblocked 1 - } else { - set clblocked 0 - return - } - - #search to have the filters applied - after 1 ::searchcontact::redoSearch - - } - - proc showFilterMenu {x y} { + #set the stored input + .main.searchbar.sunkenframe.input insert 0 "$input" + ::searchcontact::updateClearIcon + set clblocked 1 + } elseif { $::searchcontact::config(filter_blocked) || $::searchcontact::config(filter_removedme) } { + set clblocked 1 + } else { + set clblocked 0 + return + } + + #search to have the filters applied + after 1 ::searchcontact::redoSearch + + } + + proc showFilterMenu {x y} { set m .filtermenu set notesloaded [namespace exists ::notes] if { $notesloaded && $::searchcontact::config(searchtype) == 4 } { set ::searchcontact::config(searchtype) 0 - } - if { [winfo exists $m] } { destroy $m } - menu $m -tearoff 0 -type normal - $m add radiobutton -label "[trans all]" \ - -value 0 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch - $m add radiobutton -label "[trans nickandpsm]" \ - -value 1 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch - $m add radiobutton -label "[trans account]" \ - -value 2 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch - $m add radiobutton -label "[trans groupname]" \ - -value 3 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch + } + if { [winfo exists $m] } { destroy $m } + menu $m -tearoff 0 -type normal + $m add radiobutton -label "[trans all]" \ + -value 0 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch + $m add radiobutton -label "[trans nickandpsm]" \ + -value 1 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch + $m add radiobutton -label "[trans account]" \ + -value 2 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch + $m add radiobutton -label "[trans groupname]" \ + -value 3 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch if { $notesloaded } { - $m add radiobutton -label "[trans note]" \ + $m add radiobutton -label "[trans note]" \ -value 4 -variable ::searchcontact::config(searchtype) -command ::searchcontact::redoSearch } $m add separator - $m add checkbutton -label "[trans filterblocked]" \ - -onvalue 1 -offvalue 0 -variable ::searchcontact::config(filter_blocked) -command [list ::searchcontact::redoSearch filterChange] - $m add checkbutton -label "[trans filterremovedme]" \ - -onvalue 1 -offvalue 0 -variable ::searchcontact::config(filter_removedme) -command [list ::searchcontact::redoSearch filterChange] + $m add checkbutton -label "[trans filterblocked]" \ + -onvalue 1 -offvalue 0 -variable ::searchcontact::config(filter_blocked) -command [list ::searchcontact::redoSearch filterChange] + $m add checkbutton -label "[trans filterremovedme]" \ + -onvalue 1 -offvalue 0 -variable ::searchcontact::config(filter_removedme) -command [list ::searchcontact::redoSearch filterChange] - tk_popup $m $x $y - } - - - proc DeInit { } { + tk_popup $m $x $y + } + + + proc DeInit { } { variable cluetextpresent if { $::searchcontact::config(storelastinput) == 1} { variable history set history [lappend history [getInput]] set ::searchcontact::config(historylist) [lrange $history end-9 end] } - ::searchcontact::removeSearchBar deInit "" - - #redraw CL - ::guiContactList::organiseList .main.f.cl.cvs [::guiContactList::getContactList] - variable clblocked + ::searchcontact::removeSearchBar deInit "" + #redraw CL + ::guiContactList::organiseList .main.f.cl.cvs [::guiContactList::getContactList] + variable clblocked unset clblocked #can't delete 'm as the skins system thinks it's still loaded afterwards # image delete [::skin::loadPixmap search] # image delete [::skin::loadPixmap clear] - - } - - - proc getInput {} { + + } + + + proc getInput {} { variable cluetextpresent set input .main.searchbar.sunkenframe.input if {[winfo exists $input] && $cluetextpresent != 1} { - return [string tolower [$input get] ] - } else { - return "" - } - } - - #return a list of contacts filtered according to $searchtype - proc filterContacts {input} { + return [string tolower [$input get] ] + } else { + return "" + } + } + + #return a list of contacts filtered according to $searchtype + proc filterContacts {input} { set type $::searchcontact::config(searchtype) - - #Parse $input to backslash some chars + + #Parse $input to backslash some chars set input [string map -nocase { "[" "\\[" "]" "\\]" "\\" "\\\\" } $input] if { $::searchcontact::config(usewildcards) != 1 } { set input [string map -nocase [list {?} {\?} {*} {\*}] $input ] - } + } #set default operator set operator "EX" if { $::searchcontact::config(enableoperators) == 1 } { - #check for OR or EX at the beginning + #check for OR or EX at the beginning if { [string first "& " $input ] == 0 } { #exact phrase matching set operator "AND" @@ -368,7 +367,7 @@ #if only one of the keywords match set operator "OR" set input [string range $input 2 end] - } + } if {$operator == "AND" || $operator == "OR" } { set inputs [split $input " ,\n\t;"] @@ -381,15 +380,15 @@ if { $operator == "EX" } { set input [list "$input"] } - - #searchtypes: - # 0 Everything - # 1 Nickname/PSM - # 2 Account - # 3 Groups - # 4 Notes + #searchtypes: + # 0 Everything + # 1 Nickname/PSM + # 2 Account + # 3 Groups + # 4 Notes + #make it possible to search without input if {$input == ""} { set input [list ""] @@ -398,62 +397,62 @@ #search for every input item for matches set matches [list ] foreach item $input { - set output [list ] - foreach contact [::MSN::sortedContactList] { - #Filters: - #filter_blocked - #filter_removedme - #don't think about adding not blocked/removedme contacts if the filter is on - if { ($::searchcontact::config(filter_blocked) == 1 && [string last "BL" [::abook::getContactData $contact lists]] == -1) ||\ - ($::searchcontact::config(filter_removedme) == 1 && [string last "RL" [::abook::getContactData $contact lists]] != -1) - } { continue } - - - #if no input, add all users that passed the filters + set output [list ] + foreach contact [::MSN::sortedContactList] { + #Filters: + #filter_blocked + #filter_removedme + #don't think about adding not blocked/removedme contacts if the filter is on + if { ($::searchcontact::config(filter_blocked) == 1 && [string last "BL" [::abook::getContactData $contact lists]] == -1) ||\ + ($::searchcontact::config(filter_removedme) == 1 && [string last "RL" [::abook::getContactData $contact lists]] != -1) + } { continue } + + + #if no input, add all users that passed the filters if {$input == ""} { - lappend output $contact - continue - } - - - - #filter per searchtype - if {$type == 1 || $type == 0} { - if { [string match "*$item*" [string tolower [::abook::getNick $contact]]] == 1 || \ - [string match "*$item*" [string tolower [::abook::getVolatileData $contact PSM]]] == 1 ||\ - [string match "*$item*" [string tolower [::abook::getContactData $contact customnick]]] == 1 - } { - - if { [lsearch output $contact] == -1 } {lappend output $contact} - } - } - if {$type == 2 || $type == 0} { - if { [string match "*$item*" $contact] == 1 } { - if { [lsearch output $contact] == -1 } {lappend output $contact} - } - } - if {$type == 3 || $type == 0} { - - foreach group [::abook::getGroupsname $contact] { - if { [string match -nocase "*$item*" $group] == 1 } { - if { [lsearch output $contact] == -1 } {lappend output $contact} - } - } - } + lappend output $contact + continue + } + + + + #filter per searchtype + if {$type == 1 || $type == 0} { + if { [string match "*$item*" [string tolower [::abook::getNick $contact]]] == 1 || \ + [string match "*$item*" [string tolower [::abook::getVolatileData $contact PSM]]] == 1 ||\ + [string match "*$item*" [string tolower [::abook::getContactData $contact customnick]]] == 1 + } { + + if { [lsearch output $contact] == -1 } {lappend output $contact} + } + } + if {$type == 2 || $type == 0} { + if { [string match "*$item*" $contact] == 1 } { + if { [lsearch output $contact] == -1 } {lappend output $contact} + } + } + if {$type == 3 || $type == 0} { + + foreach group [::abook::getGroupsname $contact] { + if { [string match -nocase "*$item*" $group] == 1 } { + if { [lsearch output $contact] == -1 } {lappend output $contact} + } + } + } if { [namespace exists ::notes] } { - if {$type == 4 || $type == 0} { - - if {[::notes::get_Note $contact] != ""} { - catch { - if { [lsearch -regexp [string tolower $::notes::notes] [string tolower $item]] != -1 } { - if { [lsearch output $contact] == -1 } {lappend output $contact} - } - } - } + if {$type == 4 || $type == 0} { + + if {[::notes::get_Note $contact] != ""} { + catch { + if { [lsearch -regexp [string tolower $::notes::notes] [string tolower $item]] != -1 } { + if { [lsearch output $contact] == -1 } {lappend output $contact} + } + } + } } - } - + } + } lappend matches [lsort -unique $output] } @@ -492,8 +491,8 @@ } - } - + } + } proc shortestList {list1 list2} { @@ -506,104 +505,104 @@ } else { return -1 } - } - - - #Do the drawing of the CL.main.searchbar.sunkenframe.input - proc drawContacts {} { + } + + + #Do the drawing of the CL.main.searchbar.sunkenframe.input + proc drawContacts {} { variable cluetextpresent if {$cluetextpresent == 1} { return } variable ::guiContactList::external_lock - set input [getInput] + set input [getInput] set ::searchcontact::firstcontact "" - - #if any filter is applied, block the drawing + + #if any filter is applied, block the drawing if {$input == "" && $::searchcontact::config(filter_blocked) == 0 && $::searchcontact::config(filter_removedme) == 0} { ::searchcontact::resetSearchBarColor - set ::guiContactList::external_lock 0 + set ::guiContactList::external_lock 0 ::guiContactList::drawContacts .main.f.cl.cvs - #redraw CL - ::guiContactList::organiseList .main.f.cl.cvs [::guiContactList::getContactList] - - variable clblocked 0 - return "" - } - + #redraw CL + ::guiContactList::organiseList .main.f.cl.cvs [::guiContactList::getContactList] + + variable clblocked 0 + return "" + } + set filtered [filterContacts $input] - - set output_element [list] + + set output_element [list] if {$filtered != [list "" ] } { ::searchcontact::resetSearchBarColor - foreach element [::guiContactList::getContactList full] { - #if the element is not a contact - if {[lindex $element 0] != "C"} { - #if the latest item in $output_element is not a contact (thus is a group) - if {[lindex [lindex $output_element end] 0] != "C"} { - #replace the latest element (the group) with this element (this group) - #this removes empty groups - set output_element [lreplace $output_element end end] - } - #append every element (groups here only) to $output_element - lappend output_element [lindex $element] - #if the element is a contact, and is in the filtered list, add it to $output_element - } elseif {[string first [lindex $element 1] $filtered] != -1} { - lappend output_element [lindex $element] - } - } - - #if the latest item is not a contact (thus a group), remove it - if {[lindex [lindex $output_element end] 0] != "C"} { - set output_element [lreplace $output_element end end] - } + foreach element [::guiContactList::getContactList full] { + #if the element is not a contact + if {[lindex $element 0] != "C"} { + #if the latest item in $output_element is not a contact (thus is a group) + if {[lindex [lindex $output_element end] 0] != "C"} { + #replace the latest element (the group) with this element (this group) + #this removes empty groups + set output_element [lreplace $output_element end end] + } + #append every element (groups here only) to $output_element + lappend output_element [lindex $element] + #if the element is a contact, and is in the filtered list, add it to $output_element + } elseif {[string first [lindex $element 1] $filtered] != -1} { + lappend output_element [lindex $element] + } + } - set ::searchcontact::firstcontact [lindex [lsearch -regexp -inline $output_element [list "C" *]] 1] - + #if the latest item is not a contact (thus a group), remove it + if {[lindex [lindex $output_element end] 0] != "C"} { + set output_element [lreplace $output_element end end] + } + + set ::searchcontact::firstcontact [lindex [lsearch -regexp -inline $output_element [list "C" *]] 1] + set groupID "offline" - set ::guiContactList::external_lock 0 - - foreach element $output_element { - #draw each contact according to it's group - if {[lindex $element 0] == "C" } { - ::guiContactList::drawContact .main.f.cl.cvs $element $groupID - } else { - set groupID [lindex $element 0] - } - } + set ::guiContactList::external_lock 0 + + foreach element $output_element { + #draw each contact according to it's group + if {[lindex $element 0] == "C" } { + ::guiContactList::drawContact .main.f.cl.cvs $element $groupID + } else { + set groupID [lindex $element 0] + } + } } else { foreach widget [list .main.searchbar.sunkenframe.searchbutton .main.searchbar.sunkenframe.input .main.searchbar.sunkenframe.clearbutton ] { $widget configure -bg red } - } - - set ::guiContactList::external_lock 0 - ::guiContactList::organiseList .main.f.cl.cvs $output_element + } + + set ::guiContactList::external_lock 0 + ::guiContactList::organiseList .main.f.cl.cvs $output_element variable clblocked 1 - set ::guiContactList::external_lock $clblocked - - - } - - - proc redoSearch {{event ""} {evPar ""}} { + set ::guiContactList::external_lock $clblocked + + + } + + + proc redoSearch {{event ""} {evPar ""}} { if {!$::contactlist_loaded} { return } variable clblocked - - if { $event == "filterChange" || $event == "historyScroll" } { - set clblocked 1 - } - - if { $event == "ChangeState" } { - set tick 100 - } else { - set tick 250 - } - - if {$clblocked && [winfo exists .main.searchbar]} { - after $tick ::searchcontact::drawContacts - } + + if { $event == "filterChange" || $event == "historyScroll" } { + set clblocked 1 + } + + if { $event == "ChangeState" } { + set tick 100 + } else { + set tick 250 + } + + if {$clblocked && [winfo exists .main.searchbar]} { + after $tick ::searchcontact::drawContacts + } } #proc to time our filter proc @@ -614,6 +613,6 @@ } return [expr { $sum / $loops } ] } - - -} + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |