Tk Library Source Code

Artifact [86a43f0ec8]
Login

Artifact 86a43f0ec81efcabe574251f948ab5f5de978010:

Attachment "tkchat_diff_377_377sh" to ticket [1633074fff] added by decosterjos 2007-04-26 19:40:43.
1100a1101
>     set subjectFound 0
1123a1125,1130
>     if { $nick ne $Options(Nickname) } {
> 	set subjectFound [checkSubject $w $msgtype $nick $msg]
> 	if { !$alert && $Options(Alert,SUBJECT) && $subjectFound } {
> 	    set alert 1
> 	}
>     }
1127a1135,1147
>     return $subjectFound
> }
> 
> proc ::tkchat::checkSubject { w msgtype nick msg } {
>     global Options
>     if { [info exists Options(Subjects)] } {
> 	foreach subj $Options(Subjects) {
> 	    if { [string match $subj $msg] } {
> 		return 1
> 	    }
> 	}
>     }
>     return 0
1168a1189
>     set subjectFound 0
1170c1191
< 	checkAlert $w $msgtype $nick $msg
---
> 	set subjectFound [checkAlert $w $msgtype $nick $msg]
1176c1197,1199
<     }
---
>     } else {
> 	set subjectFound [checkSubject $w $msgtype $nick $msg]
>     }	    
1187a1211,1213
>     if { $subjectFound } {
> 	lappend tags SUBJ
>     }
1949a1976,1979
>     $m add command \
> 	    -label "Subjects ..." \
> 	    -underline 0 \
> 	    -command ::tkchat::SpecifySubjects
2199a2230
> 	SUBJECT "Alert when specified subject mentioned"
2697a2729
>     $txt tag configure SUBJ -background yellow
4348a4381,4459
> proc ::tkchat::SpecifySubjects {} {
>     variable NS
>     
>     set t .macros
>     catch {destroy $t}
>     toplevel $t -class Dialog
>     wm transient $t .
>     wm withdraw $t
>     wm title $t "Specify alert subjects"
> 
>     listbox $t.lst -yscroll "$t.scr set" -font FNT -selectmode extended
>     ${NS}::scrollbar $t.scr -command "$t.lst yview"
>     ${NS}::label $t.lbl1 -text "Subject:" -font NAME
>     ${NS}::entry $t.sub -font FNT
>     bind $t.sub <Return> "$t.sav invoke"
>     bind $t.lst <Double-Button-1> "::tkchat::SubjectSel %W @%x,%y"
>     button $t.sav -text Save -command "::tkchat::SubjectSave $t"
>     button $t.del -text Delete -command "::tkchat::SubjectKill $t.lst"
>     set    help "Specify subject as pattern suitable for use with:\n\n"
>     append help "    string match -nocase <pattern> <message>\n"
>     append help "\n"
>     ${NS}::label $t.hlp -text $help -font FNT -justify left
> 
>     grid $t.lst - $t.scr -sticky news
>     grid $t.del - - -sticky {} -pady 3
>     grid $t.lbl1 $t.sub - -sticky news
>     grid $t.sav - - -sticky {} -pady 3
>     grid $t.hlp - - -sticky news -padx 10
> 
>     grid rowconfigure $t 0 -weight 10
>     grid columnconfigure $t 1 -weight 10
> 
>     tkchat::SubjectList $t.lst
>     catch {::tk::PlaceWindow $t widget .}
>     wm deiconify $t
> }
> proc ::tkchat::SubjectSave {t} {
>     global Options
>     if { ![info exists Options(Subjects)] } {
> 	set Options(Subjects) {}
>     }
>     set m [string trim [$t.sub get]]
>     if {[string length $m] > 0} {
> 	lappend Options(Subjects) $m
> 	::tkchat::SubjectList $t.lst
>     }
> }
> proc ::tkchat::SubjectKill { w } {
>     global Options
>     if { [info exists Options(Subjects)] } {
> 	foreach idx [$w curselection] {
> 	    set m [$w get $idx]
> 	    set i [lsearch $Options(Subjects) $m]
> 	    if { $i >= 0 } {
> 		set Options(Subjects) [lreplace $Options(Subjects) $i $i]
> 	    }
> 	}
>     }
>     tkchat::SubjectList $w
> }
> proc ::tkchat::SubjectSel { w idx} {
>     global Options
>     set m [$w get $idx]
>     if {[info exists Options(Subjects)] && 
> 	[lsearch $Options(Subjects) $m] >= 0} {
> 	[winfo parent $w].sub delete 0 end
> 	[winfo parent $w].sub insert end $m
>     }
> }
> proc ::tkchat::SubjectList {w} {
>     global Options
>     $w delete 0 end
>     if { [info exists Options(Subjects)] } {
> 	foreach idx $Options(Subjects) {
> 	    $w insert end $idx
> 	}
>     }
> }
> 
4504c4615
<     foreach {idx str} {MainBG Background MainFG Foreground SearchBG Searchbackgr} {
---
>     foreach {idx str} {MainBG Background MainFG Foreground SearchBG Searchbackgr SubjectBG Subjectbackgr} {
4595a4707
>     $txt tag configure SUBJ -background "#[getColor SubjectBG]"
4805,4806c4917,4918
< 	ServerLogging Style Theme Transparency UseBabelfish UseJabberSSL
< 	UseProxy Username Visibility,*
---
> 	ServerLogging Style Subjects Theme Transparency UseBabelfish 
>         UseJabberSSL UseProxy Username Visibility,*
5470a5583
> 		SubjectBG -
5713a5827
> 	Subjects                {}
5730c5844
<     foreach { nick clr } { MainBG ffffff MainFG 000000 SearchBG ff8c44 } {
---
>     foreach { nick clr } { MainBG ffffff MainFG 000000 SearchBG ff8c44 SubjectBG ffff00 } {