TclApps Library Source Code
Check-in [7ea5f06710]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use message catalogs in all literal strings. Add a new quick help dialog. Remove executable bit from ru message catalog.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | dialogs-spacing
Files: files | file ages | folders
SHA3-256: 7ea5f067100fd617c2c37705fe2ec9a70f3c2cc60f39e5a4f82632e5a2136d69
User & Date: emiliano 2024-01-17 04:40:29.057
Context
2024-01-17
04:40
Use message catalogs in all literal strings. Add a new quick help dialog. Remove executable bit from ru message catalog. Leaf check-in: 7ea5f06710 user: emiliano tags: dialogs-spacing
03:55
Added initial spanish translation to Tkchat check-in: cd3f093bf4 user: emiliano tags: dialogs-spacing
Changes
Unified Diff Ignore Whitespace Patch
Changes to apps/tkchat/tkchat.vfs/bin/msgs/en.msg.
96
97
98
99
100
101
102


103
104
105
106
107
108
109
    "Console"               "Console"

    "&Quick help..."        "&Quick help..."
    "Help (&wiki)..."       "Help (&wiki)..."
    "&Check version"        "&Check version"
    "&View Change&Log..."   "&View ChangeLog..."
    "&About..."             "&About..."



    "Hide user"             "Hide user"
    "Set/Unset bookmark"    "Set/Unset bookmark"
    "Prev bookmark"         "Prev bookmark"
    "Next bookmark"         "Next bookmark"
    "Clear bookmarks"       "Clear bookmarks"
    "Google selection"      "Google selection"







>
>







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
    "Console"               "Console"

    "&Quick help..."        "&Quick help..."
    "Help (&wiki)..."       "Help (&wiki)..."
    "&Check version"        "&Check version"
    "&View Change&Log..."   "&View ChangeLog..."
    "&About..."             "&About..."

    "Tkchat %s help"        "Tkchat %s help"

    "Hide user"             "Hide user"
    "Set/Unset bookmark"    "Set/Unset bookmark"
    "Prev bookmark"         "Prev bookmark"
    "Next bookmark"         "Next bookmark"
    "Clear bookmarks"       "Clear bookmarks"
    "Google selection"      "Google selection"
Changes to apps/tkchat/tkchat.vfs/bin/msgs/ru.msg.
Changes to apps/tkchat/tkchat.vfs/bin/tkchat.tcl.
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
}

if {![info exists env(PATH)]} {
    set env(PATH) .
}

# For development, it is very convenient to be able to drop the extra
# packages into the CVS tree. Make sure we have the real location of 
# the script and not a link.
set script [file normalize [info script]]
while {[file type $script] eq "link"} {
    set script [file join [file dirname $script] [file readlink $script]]
}
set tkchat_dir [file dirname [file normalize $script]]
set imgdir [file join $tkchat_dir images]







|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
}

if {![info exists env(PATH)]} {
    set env(PATH) .
}

# For development, it is very convenient to be able to drop the extra
# packages into the CVS tree. Make sure we have the real location of
# the script and not a link.
set script [file normalize [info script]]
while {[file type $script] eq "link"} {
    set script [file join [file dirname $script] [file readlink $script]]
}
set tkchat_dir [file dirname [file normalize $script]]
set imgdir [file join $tkchat_dir images]
70
71
72
73
74
75
76





77
78
79
80
81
82
83
package require uri             ; # tcllib
package require uuid            ; # tcllib
package require sha1		; # tcllib
package require jlib		; # jabberlib
package require muc		; # jabberlib
package require disco           ; # jabberlib






# Override the normal logging to include a timestamp
proc log::Puts {level text} {
    variable channelMap
    variable fill
    set chan $channelMap($level)
    if {$chan ne {}} {
        set t [clock format [clock seconds] -format {%T }]







>
>
>
>
>







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package require uri             ; # tcllib
package require uuid            ; # tcllib
package require sha1		; # tcllib
package require jlib		; # jabberlib
package require muc		; # jabberlib
package require disco           ; # jabberlib

# load message catalogs
# -------------------------------------------------------------------------
::msgcat::mcload [file join $tkchat_dir msgs]
# -------------------------------------------------------------------------

# Override the normal logging to include a timestamp
proc log::Puts {level text} {
    variable channelMap
    variable fill
    set chan $channelMap($level)
    if {$chan ne {}} {
        set t [clock format [clock seconds] -format {%T }]
263
264
265
266
267
268
269
270

271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291

########################################################################
# Systray
#
# catch is needed in order to be able to reload the script from the
# debug menu
catch {
    tk systray create -image ::tkchat-32 -text "The Tcler's Chat" \

        -button1 {
            if { [wm state .] eq "withdrawn" } {
                wm deiconify .
                focus .eMsg
            } else {
                wm withdraw .
            }
        } -button3 ""
}

# -------------------------------------------------------------------------
::msgcat::mcload [file join $tkchat_dir msgs]
# -------------------------------------------------------------------------

#This is causing difficult-to-diagnose errors in downloading data 
if 0 {
    # There is currently a bug in the ipv6 socket handling in 8.6 where if a 
    # site has an ipv6 address and does not provide a services on that address
    # then socket -async will return an error to tcl. A synchronous socket
    # will try ipv6 and then ipv4 before returning to tcl. To work around this
    # we can force http requests to use ipv4 until a fix is enabled. We could







|
>










<
<
<
<







268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286




287
288
289
290
291
292
293

########################################################################
# Systray
#
# catch is needed in order to be able to reload the script from the
# debug menu
catch {
    tk systray create -image ::tkchat-32 \
        -text [::msgcat::mc "The Tcler's Chat"] \
        -button1 {
            if { [wm state .] eq "withdrawn" } {
                wm deiconify .
                focus .eMsg
            } else {
                wm withdraw .
            }
        } -button3 ""
}





#This is causing difficult-to-diagnose errors in downloading data 
if 0 {
    # There is currently a bug in the ipv6 socket handling in 8.6 where if a 
    # site has an ipv6 address and does not provide a services on that address
    # then socket -async will return an error to tcl. A synchronous socket
    # will try ipv6 and then ipv4 before returning to tcl. To work around this
    # we can force http requests to use ipv4 until a fix is enabled. We could
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
                    -value $i \
                    -variable tkchat::HistQueryNum
		grid $f.rb$i -sticky w -padx 15 -pady 0 -column 1
		incr i
	    }

	    ttk::radiobutton $f.rb$i \
                -text "None" \
                -value $i \
                -variable tkchat::HistQueryNum
	    ttk::button $f.ok \
                -text Ok \
                -width 8 \
                -command [list destroy $t] \
                -default active

	    grid $f.rb$i -sticky w -padx 15 -pady 0 -column 1
	    grid $f.ok -padx 5 -pady 10 -column 1








|



|







609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
                    -value $i \
                    -variable tkchat::HistQueryNum
		grid $f.rb$i -sticky w -padx 15 -pady 0 -column 1
		incr i
	    }

	    ttk::radiobutton $f.rb$i \
                -text [mc "None"] \
                -value $i \
                -variable tkchat::HistQueryNum
	    ttk::button $f.ok \
                -text [mc "Ok"] \
                -width 8 \
                -command [list destroy $t] \
                -default active

	    grid $f.rb$i -sticky w -padx 15 -pady 0 -column 1
	    grid $f.ok -padx 5 -pady 10 -column 1

1643
1644
1645
1646
1647
1648
1649
1650


1651
1652
1653
1654
1655
1656
1657
        return
    }
    set dlg [Dialog .statushistory]
    wm withdraw $dlg
    set f [ttk::frame $dlg.f]
    text $f.txt -yscrollcommand [list $f.vs set]
    ttk::scrollbar $f.vs -command [list $f.txt yview]
    ttk::button $f.ok -text OK -command [list destroy $dlg] -default active



    grid $f.txt $f.vs -sticky news
    grid $f.ok  -     -sticky e
    grid rowconfigure $f 0 -weight 1
    grid columnconfigure $f 0 -weight 1
    grid $f -sticky news
    grid rowconfigure $dlg 0 -weight 1







|
>
>







1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
        return
    }
    set dlg [Dialog .statushistory]
    wm withdraw $dlg
    set f [ttk::frame $dlg.f]
    text $f.txt -yscrollcommand [list $f.vs set]
    ttk::scrollbar $f.vs -command [list $f.txt yview]
    ttk::button $f.ok -text [mc "Ok"] \
	-command [list destroy $dlg] \
	-default active

    grid $f.txt $f.vs -sticky news
    grid $f.ok  -     -sticky e
    grid rowconfigure $f 0 -weight 1
    grid columnconfigure $f 0 -weight 1
    grid $f -sticky news
    grid rowconfigure $dlg 0 -weight 1
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
    set bodyf [ttk::frame $dlg.bodyf -style FakeText]
    set body [text $bodyf.body -font FNT -wrap word \
                  -background "#[getColor MainBG]" \
                  -foreground "#[getColor MainFG]" \
                  -width 80 -height 12 \
                  -yscrollcommand [list $bodyf.vs set]]
    ttk::scrollbar $bodyf.vs -command [list $bodyf.body yview]
    ttk::button $dlg.ok -text [mc OK] -default active \
        -command [namespace code [list SendMemoDone $dlg $jid ok]]
    ttk::button $dlg.cancel -text [mc Cancel] \
        -command [namespace code [list SendMemoDone $dlg $jid cancel]]

    grid $bodyf.body -row 0 -column 0 -sticky news -padx {1 0} -pady 1
    grid $bodyf.vs   -row 0 -column 1 -sticky news -padx {0 1} -pady 1
    grid rowconfigure $bodyf 0 -weight 1
    grid columnconfigure $bodyf 0 -weight 1
    







|

|







1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
    set bodyf [ttk::frame $dlg.bodyf -style FakeText]
    set body [text $bodyf.body -font FNT -wrap word \
                  -background "#[getColor MainBG]" \
                  -foreground "#[getColor MainFG]" \
                  -width 80 -height 12 \
                  -yscrollcommand [list $bodyf.vs set]]
    ttk::scrollbar $bodyf.vs -command [list $bodyf.body yview]
    ttk::button $dlg.ok -text [mc "Ok"] -default active \
        -command [namespace code [list SendMemoDone $dlg $jid ok]]
    ttk::button $dlg.cancel -text [mc "Cancel"] \
        -command [namespace code [list SendMemoDone $dlg $jid cancel]]

    grid $bodyf.body -row 0 -column 0 -sticky news -padx {1 0} -pady 1
    grid $bodyf.vs   -row 0 -column 1 -sticky news -padx {0 1} -pady 1
    grid rowconfigure $bodyf 0 -weight 1
    grid columnconfigure $bodyf 0 -weight 1
    
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
        set n 0
        while {[winfo exists [set dlg .memo[string map {. _} $jid]$n]]} {
            incr n
        }
        set dlg [CreateMemoDialog $dlg $jid]
        $dlg.subject insert end $subject
        $dlg.bodyf.body insert end $body
        $dlg.ok configure -text [mc Close] \
            -command [namespace code [list SendMemoDone $dlg $jid close]]
        $dlg.cancel configure -text [mc Reply] \
            -command [namespace code [list SendMemoDone $dlg $jid reply]]
        wm deiconify $dlg
    }
}

proc tkchat::SendMemoDone {dlg jid status} {
    variable $dlg







|

|







1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
        set n 0
        while {[winfo exists [set dlg .memo[string map {. _} $jid]$n]]} {
            incr n
        }
        set dlg [CreateMemoDialog $dlg $jid]
        $dlg.subject insert end $subject
        $dlg.bodyf.body insert end $body
        $dlg.ok configure -text [mc "Close"] \
            -command [namespace code [list SendMemoDone $dlg $jid close]]
        $dlg.cancel configure -text [mc "Reply"] \
            -command [namespace code [list SendMemoDone $dlg $jid reply]]
        wm deiconify $dlg
    }
}

proc tkchat::SendMemoDone {dlg jid status} {
    variable $dlg
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
        option add *Menu.activeBorderWidth      0
        option add *mbar.relief                 flat
    }
    menu .mbar

    if {[tk windowingsystem] eq "aqua"} {
        menu .mbar.apple
        .mbar.apple add command -label "About TkChat" -command [namespace origin About]
        .mbar add cascade -label Apple -menu .mbar.apple
    }
    menu .mbar.file
    menu .mbar.edit
    menu .mbar.emot
    menu .mbar.vis
    menu .mbar.alert
    menu .mbar.dbg







|
|







2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
        option add *Menu.activeBorderWidth      0
        option add *mbar.relief                 flat
    }
    menu .mbar

    if {[tk windowingsystem] eq "aqua"} {
        menu .mbar.apple
        .mbar.apple add command -label [mc "About TkChat"] -command [namespace origin About]
        .mbar add cascade -label [mc "Apple"] -menu .mbar.apple
    }
    menu .mbar.file
    menu .mbar.edit
    menu .mbar.emot
    menu .mbar.vis
    menu .mbar.alert
    menu .mbar.dbg
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
        -command tkchat::logonScreen
    if {[package provide picoirc] ne {}} {
        tk::AmpMenuArgs $m add command \
            -label [mc "Login via &IRC..."] \
            -command tkchat::IRCLogonScreen
    }
    tk::AmpMenuArgs $m add command \
        -label [mc "&Save Options"] \
        -command tkchat::saveRC
    $m add separator
    tk::AmpMenuArgs $m add command \
        -label [mc "Open &whiteboard"] \
        -command tkchat::Whiteboard::Init
    tk::AmpMenuArgs $m add command \
        -label [mc "Open &paste dialog"] \







|







2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
        -command tkchat::logonScreen
    if {[package provide picoirc] ne {}} {
        tk::AmpMenuArgs $m add command \
            -label [mc "Login via &IRC..."] \
            -command tkchat::IRCLogonScreen
    }
    tk::AmpMenuArgs $m add command \
        -label [mc "&Save options"] \
        -command tkchat::saveRC
    $m add separator
    tk::AmpMenuArgs $m add command \
        -label [mc "Open &whiteboard"] \
        -command tkchat::Whiteboard::Init
    tk::AmpMenuArgs $m add command \
        -label [mc "Open &paste dialog"] \
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
    menu $m.mnu
    tk::AmpMenuArgs $m add cascade -menu $m.mnu \
        -label [mc "&Insert"]

    ## Visibility Menu
    ##
    set m .mbar.vis
    foreach tag $Options(ElideTags) text {
        "Hide &single dot messages"
        "Hide &online/away status messages"
        "Hide &logon/logoff messages"
        "Hide &all system messages"
        "Hide &error messages"
    } {
        tk::AmpMenuArgs $m add checkbutton \
            -label [mc $text] \
            -variable Options(Visibility,$tag) \
            -onvalue 1 \
            -offvalue 0 \
            -command [list tkchat::DoVis $tag]
    }
    tk::AmpMenuArgs $m add checkbutton \
        -label [mc "Hide &timestamps"] \







|
|
|
|
|
|
|

|







2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
    menu $m.mnu
    tk::AmpMenuArgs $m add cascade -menu $m.mnu \
        -label [mc "&Insert"]

    ## Visibility Menu
    ##
    set m .mbar.vis
    foreach tag $Options(ElideTags) text [list \
        [mc "Hide &single dot messages"] \
        [mc "Hide &online/away status messages"] \
        [mc "Hide &logon/logoff messages"] \
        [mc "Hide &all system messages"] \
        [mc "Hide &error messages"]
    ] {
        tk::AmpMenuArgs $m add checkbutton \
            -label $text \
            -variable Options(Visibility,$tag) \
            -onvalue 1 \
            -offvalue 0 \
            -command [list tkchat::DoVis $tag]
    }
    tk::AmpMenuArgs $m add checkbutton \
        -label [mc "Hide &timestamps"] \
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
    tk::AmpMenuArgs $m add command \
        -label [mc "Show &current history in new pane"] \
        -command {tkchat::HistoryPaneToggle}

    ## Alert Menu
    ##
    set m .mbar.alert
    foreach { tag text } {
        ALL	"Alert when any &message received"
        ME	"Alert when &username mentioned"
        TOPIC	"Alert when s&omeone speaks who was quiet"
        SUBJECT "Alert when &specified subject mentioned"
    } {
        tk::AmpMenuArgs $m add checkbutton \
            -label [mc $text] \
            -variable Options(Alert,$tag) \
            -onvalue 1 \
            -offvalue 0 \
            -command [list tkchat::setAlert $tag]
    }
    $m add separator
    foreach { tag text } {
        SOUND	"&Beep on alert"
        RAISE	"&Raise to top on alert"
        GROWL	"&Use notifications for alerts"
        BOUNCE	"&Raise icon on alert"
    } {
        tk::AmpMenuArgs $m add checkbutton \
            -label [mc $text] \
            -variable Options(Alert,$tag) \
            -onvalue 1 \
            -offvalue 0
    }
    $m add separator
    foreach {tag text} {
        NORMAL	"Alert on regular &posts"
        ACTION	"Alert on &whispers and \"/me\" posts"
    } {
        tk::AmpMenuArgs $m add checkbutton \
            -label [mc $text] \
            -variable Options(Alert,$tag) \
            -onvalue 1 \
            -offvalue 0
    }

    ## Debug Menu
    ##







|
|
|
|
|
|

|






|
|
|
|
|
|

|





|
|
|
|

|







2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
    tk::AmpMenuArgs $m add command \
        -label [mc "Show &current history in new pane"] \
        -command {tkchat::HistoryPaneToggle}

    ## Alert Menu
    ##
    set m .mbar.alert
    foreach { tag text } [list \
        ALL	[mc "Alert when any &message received"] \
        ME	[mc "Alert when &username mentioned"] \
        TOPIC	[mc "Alert when s&omeone speaks who was quiet"] \
        SUBJECT [mc "Alert when &specified subject mentioned"]
    ] {
        tk::AmpMenuArgs $m add checkbutton \
            -label $text \
            -variable Options(Alert,$tag) \
            -onvalue 1 \
            -offvalue 0 \
            -command [list tkchat::setAlert $tag]
    }
    $m add separator
    foreach { tag text } [list \
        SOUND	[mc "&Beep on alert"] \
        RAISE	[mc "&Raise to top on alert"] \
        GROWL	[mc "&Use notifications for alerts"] \
        BOUNCE	[mc "&Raise icon on alert"]
    ] {
        tk::AmpMenuArgs $m add checkbutton \
            -label $text \
            -variable Options(Alert,$tag) \
            -onvalue 1 \
            -offvalue 0
    }
    $m add separator
    foreach {tag text} [list \
        NORMAL	[mc "Alert on regular &posts"] \
        ACTION	[mc "Alert on &whispers and \"/me\" posts"]
    ] {
        tk::AmpMenuArgs $m add checkbutton \
            -label $text \
            -variable Options(Alert,$tag) \
            -onvalue 1 \
            -offvalue 0
    }

    ## Debug Menu
    ##
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
    set m .mbar.help

    if {[tk windowingsystem] eq "aqua"} {
        proc ::tk::mac::ShowHelp {} {
            tkchat::Help
        }
    } else {
        tk::AmpMenuArgs $m add command -label [mc "&Quick Help..."] \
            -command [list [namespace origin Help]]
    }
    tk::AmpMenuArgs $m add command -label [mc "Help (&wiki)..."] \
        -command [list [namespace origin gotoURL] http://wiki.tcl.tk/tkchat]
    $m add separator
    tk::AmpMenuArgs $m add command -label [mc "&Check version"] \
        -command [list after idle [list [namespace origin CheckVersion]]]







|







2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
    set m .mbar.help

    if {[tk windowingsystem] eq "aqua"} {
        proc ::tk::mac::ShowHelp {} {
            tkchat::Help
        }
    } else {
        tk::AmpMenuArgs $m add command -label [mc "&Quick help..."] \
            -command [list [namespace origin Help]]
    }
    tk::AmpMenuArgs $m add command -label [mc "Help (&wiki)..."] \
        -command [list [namespace origin gotoURL] http://wiki.tcl.tk/tkchat]
    $m add separator
    tk::AmpMenuArgs $m add command -label [mc "&Check version"] \
        -command [list after idle [list [namespace origin CheckVersion]]]
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
    bind .eMsg <Shift-Key-Up>   { .txt yview scroll -1 units }
    bind .eMsg <Shift-Key-Down> { .txt yview scroll  1 units }
    bind .eMsg <Button-3>       [namespace code [list OnEntryPopup %W %X %Y]]
  
    text .tMsg -height 6 -font FNT
    bind .tMsg <Key-Tab>	{ tkchat::nickComplete ; break }

    ttk::button .post -text [mc Post] -command [namespace code userPost]

    ttk::menubutton .mb \
        -menu .mb.mnu \
        -textvariable Options(MsgTo) \
        -direction above
    menu .mb.mnu
    .mb.mnu add command \







|







2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
    bind .eMsg <Shift-Key-Up>   { .txt yview scroll -1 units }
    bind .eMsg <Shift-Key-Down> { .txt yview scroll  1 units }
    bind .eMsg <Button-3>       [namespace code [list OnEntryPopup %W %X %Y]]
  
    text .tMsg -height 6 -font FNT
    bind .tMsg <Key-Tab>	{ tkchat::nickComplete ; break }

    ttk::button .post -text [mc "Post"] -command [namespace code userPost]

    ttk::menubutton .mb \
        -menu .mb.mnu \
        -textvariable Options(MsgTo) \
        -direction above
    menu .mb.mnu
    .mb.mnu add command \
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
        -text ">>" \
        -width 0 \
        -command [list tkchat::showExtra $parent]
    ttk::entry $parent.eMsg
    bind $parent.eMsg <Key-Prior> [list $parent.txt yview scroll -1 pages]
    bind $parent.eMsg <Key-Next>  [list $parent.txt yview scroll  1 pages]
    text $parent.tMsg -height 6 -font FNT
    ttk::button $parent.post -text "Post"

    $parent.txt configure -width 10
    grid $parent.txt $parent.sbar \
        -in $parent.txtframe  -sticky news -padx 1 -pady 2
    grid columnconfigure $parent.txtframe 0 -weight 1
    grid rowconfigure $parent.txtframe 0 -weight 1
    $parent.pane add $parent.txtframe







|







3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
        -text ">>" \
        -width 0 \
        -command [list tkchat::showExtra $parent]
    ttk::entry $parent.eMsg
    bind $parent.eMsg <Key-Prior> [list $parent.txt yview scroll -1 pages]
    bind $parent.eMsg <Key-Next>  [list $parent.txt yview scroll  1 pages]
    text $parent.tMsg -height 6 -font FNT
    ttk::button $parent.post -text [mc "Post"]

    $parent.txt configure -width 10
    grid $parent.txt $parent.sbar \
        -in $parent.txtframe  -sticky news -padx 1 -pady 2
    grid columnconfigure $parent.txtframe 0 -weight 1
    grid rowconfigure $parent.txtframe 0 -weight 1
    $parent.pane add $parent.txtframe
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
    if {$icon ne ""} {
	catch {wm iconphoto $dlg $icon}
    }
    set ver [mc "Using Tcl %s, Tk %s" [package provide Tcl] [package provide Tk]]
    if {[package provide tls] ne {}} {
	append ver ", tls [package provide tls]"
    }
    ttk::button $w.b -text Dismiss -width -12 -command [list destroy $dlg] -default active
    ScrolledWidget text $w.text 0 1 -height 24 -width 80 \
        -padx 2 -pady 2 -font FNT
    grid $w.text -sticky news
    grid $w.b -sticky se
    grid rowconfigure $w 0 -weight 1
    grid columnconfigure $w 0 -weight 1
    $w.text tag configure center -justify center







|







3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
    if {$icon ne ""} {
	catch {wm iconphoto $dlg $icon}
    }
    set ver [mc "Using Tcl %s, Tk %s" [package provide Tcl] [package provide Tk]]
    if {[package provide tls] ne {}} {
	append ver ", tls [package provide tls]"
    }
    ttk::button $w.b -text [mc "Dismiss"] -width -12 -command [list destroy $dlg] -default active
    ScrolledWidget text $w.text 0 1 -height 24 -width 80 \
        -padx 2 -pady 2 -font FNT
    grid $w.text -sticky news
    grid $w.b -sticky se
    grid rowconfigure $w 0 -weight 1
    grid columnconfigure $w 0 -weight 1
    $w.text tag configure center -justify center
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
    set t [ttk::frame $nb.conferencetab]
    $nb add $t -text [mc "Conference"]
    tk::AmpWidget ttk::label $t.lconf \
	-text [mc "Jabber con&ference"]
    ttk::entry $t.econf \
	-textvariable Options(JabberConference)
    tk::AmpWidget ttk::label $t.lnick \
	-text [mc "Nickname"]
    ttk::entry $t.enick \
	-textvariable Options(Nickname)
    # lay them out
    grid $t.lconf $t.econf -sticky w -pady 2 -padx 2
    grid $t.lnick $t.enick -sticky w -pady 2 -padx 2
    # keyboard accel
    bind $t.lconf <<AltUnderlined>> [list focus $t.econf]
    bind $t.lnick <<AltUnderlined>> [list focus $t.enick]
    # ssl tab
    set t [ttk::frame $nb.ssltab]
    $nb add $t -text [mc "Encryption"]
    tk::AmpWidget ttk::radiobutton $t.rnossl \
	-text [mc "N&o SSL"] \
	-variable Options(UseJabberSSL) \
	-value "no" \
	-command tkjabber::TwiddlePort
    tk::AmpWidget ttk::radiobutton $t.rjabberssl \
	-text [mc "Jabber SSL"] \
	-variable Options(UseJabberSSL) \
	-value "ssl" \
	-command tkjabber::TwiddlePort
    tk::AmpWidget ttk::radiobutton $t.rstarttls \
	-text [mc "STARTTLS"] \
	-variable Options(UseJabberSSL) \
	-value "starttls" \
	-command tkjabber::TwiddlePort
    tk::AmpWidget ttk::checkbutton $t.vsc \
	-text [mc "&Validate SSL certificates"] \
	-variable Options(ValidateSSLChain)
    # lay them out







|

















|




|







4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
    set t [ttk::frame $nb.conferencetab]
    $nb add $t -text [mc "Conference"]
    tk::AmpWidget ttk::label $t.lconf \
	-text [mc "Jabber con&ference"]
    ttk::entry $t.econf \
	-textvariable Options(JabberConference)
    tk::AmpWidget ttk::label $t.lnick \
	-text [mc "Nic&kname"]
    ttk::entry $t.enick \
	-textvariable Options(Nickname)
    # lay them out
    grid $t.lconf $t.econf -sticky w -pady 2 -padx 2
    grid $t.lnick $t.enick -sticky w -pady 2 -padx 2
    # keyboard accel
    bind $t.lconf <<AltUnderlined>> [list focus $t.econf]
    bind $t.lnick <<AltUnderlined>> [list focus $t.enick]
    # ssl tab
    set t [ttk::frame $nb.ssltab]
    $nb add $t -text [mc "Encryption"]
    tk::AmpWidget ttk::radiobutton $t.rnossl \
	-text [mc "N&o SSL"] \
	-variable Options(UseJabberSSL) \
	-value "no" \
	-command tkjabber::TwiddlePort
    tk::AmpWidget ttk::radiobutton $t.rjabberssl \
	-text [mc "Jabber &SSL"] \
	-variable Options(UseJabberSSL) \
	-value "ssl" \
	-command tkjabber::TwiddlePort
    tk::AmpWidget ttk::radiobutton $t.rstarttls \
	-text [mc "STAR&TTLS"] \
	-variable Options(UseJabberSSL) \
	-value "starttls" \
	-command tkjabber::TwiddlePort
    tk::AmpWidget ttk::checkbutton $t.vsc \
	-text [mc "&Validate SSL certificates"] \
	-variable Options(ValidateSSLChain)
    # lay them out
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
    if {![winfo exists $dlg]} {
        set dlg [Dialog $dlg]
        wm withdraw $dlg
        wm title $dlg "Connect to IRC"
        
        set f [ttk::frame $dlg.f]
        set g [ttk::frame $f.g]
        ttk::label $f.sl -text Server
        ttk::entry $f.se -textvariable [namespace which -variable irc](server)
        ttk::entry $f.sp -textvariable [namespace which -variable irc](port) -width 5
        ttk::label $f.cl -text Channel
        ttk::entry $f.cn -textvariable [namespace which -variable irc](channel)
        ttk::label $f.nl -text Nick
        ttk::entry $f.nn -textvariable [namespace which -variable Options](Nickname)
        ttk::button $f.ok -text Login -default active \
            -command [list set [namespace which -variable $dlg] "ok"]
        ttk::button $f.cancel -text Cancel \
            -command [list set [namespace which -variable $dlg] "cancel"]
        
        bind $dlg <Return> [list $f.ok invoke]
        bind $dlg <Escape> [list $f.cancel invoke]
        wm protocol $dlg WM_DELETE_WINDOW [list $f.cancel invoke]
        
        grid $f.sl $f.se $f.sp -in $g -sticky new -padx 1 -pady 1







|


|

|

|

|







4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
    if {![winfo exists $dlg]} {
        set dlg [Dialog $dlg]
        wm withdraw $dlg
        wm title $dlg "Connect to IRC"
        
        set f [ttk::frame $dlg.f]
        set g [ttk::frame $f.g]
        ttk::label $f.sl -text [mc "Server"]
        ttk::entry $f.se -textvariable [namespace which -variable irc](server)
        ttk::entry $f.sp -textvariable [namespace which -variable irc](port) -width 5
        ttk::label $f.cl -text [mc "Channel"]
        ttk::entry $f.cn -textvariable [namespace which -variable irc](channel)
        ttk::label $f.nl -text [mc "Nick"]
        ttk::entry $f.nn -textvariable [namespace which -variable Options](Nickname)
        ttk::button $f.ok -text [mc "Login"] -default active \
            -command [list set [namespace which -variable $dlg] "ok"]
        ttk::button $f.cancel -text [mc "Cancel"] \
            -command [list set [namespace which -variable $dlg] "cancel"]
        
        bind $dlg <Return> [list $f.ok invoke]
        bind $dlg <Escape> [list $f.cancel invoke]
        wm protocol $dlg WM_DELETE_WINDOW [list $f.cancel invoke]
        
        grid $f.sl $f.se $f.sp -in $g -sticky new -padx 1 -pady 1
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
        set r .register.f
    } else {
	Dialog $dlg
	wm withdraw $dlg
	wm title $dlg "Register for the Tcler's Chat"
        
        set r [ttk::frame $dlg.f]
	ttk::label $r.lfn -text "Full name" -underline 9
	ttk::label $r.lem -text "Email address" -underline 9
	ttk::label $r.lnm -text "Chat Username" -underline 9
	ttk::label $r.lpw -text "Chat Password" -underline 6
	ttk::label $r.lpwc -text "Confirm Password" -underline 6
	ttk::entry $r.efn -textvariable Options(Fullname)
	ttk::entry $r.eem -textvariable Options(Email)
	ttk::entry $r.enm -textvariable Options(Username)
	ttk::entry $r.epw -textvariable Options(Password) -show \u2022
	ttk::entry $r.epwc -textvariable tkchat::PasswordCheck -show \u2022

	ttk::button $r.ok -text "Ok" -width 8 -underline 0 \
            -command { set tkchat::DlgDone ok }
	ttk::button $r.cn -text "Cancel" -width 8 -underline 0 \
            -command { set tkchat::DlgDone cancel }

	bind $r <Alt-k> [list $r.ok invoke]
	bind $r <Alt-q> [list $r.cn invoke]
	bind $r <Alt-n> [list focus $r.enm]
	bind $r <Alt-a> [list focus $r.epw]








|
|
|
|
|






|

|







4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
        set r .register.f
    } else {
	Dialog $dlg
	wm withdraw $dlg
	wm title $dlg "Register for the Tcler's Chat"
        
        set r [ttk::frame $dlg.f]
	ttk::label $r.lfn -text [mc "Full name"] -underline 9
	ttk::label $r.lem -text [mc "Email address"] -underline 9
	ttk::label $r.lnm -text [mc "Chat Username"] -underline 9
	ttk::label $r.lpw -text [mc "Chat Password"] -underline 6
	ttk::label $r.lpwc -text [mc "Confirm Password"] -underline 6
	ttk::entry $r.efn -textvariable Options(Fullname)
	ttk::entry $r.eem -textvariable Options(Email)
	ttk::entry $r.enm -textvariable Options(Username)
	ttk::entry $r.epw -textvariable Options(Password) -show \u2022
	ttk::entry $r.epwc -textvariable tkchat::PasswordCheck -show \u2022

	ttk::button $r.ok -text [mc "Ok"] -width 8 -underline 0 \
            -command { set tkchat::DlgDone ok }
	ttk::button $r.cn -text [mc "Cancel"] -width 8 -underline 0 \
            -command { set tkchat::DlgDone cancel }

	bind $r <Alt-k> [list $r.ok invoke]
	bind $r <Alt-q> [list $r.cn invoke]
	bind $r <Alt-n> [list focus $r.enm]
	bind $r <Alt-a> [list focus $r.epw]

4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
    .txt tag remove found 1.0 end
    .txt see end
}

proc tkchat::SpecifySubjects {parent} {
    set dlg [winfo toplevel $parent]
    set t [ttk::frame $parent.tkchatSubjects]
    ttk::labelframe $t.pat -text Patterns
    ttk::labelframe $t.new -text "New pattern"
    $t.pat configure -underline 0
    $t.new configure -underline 0
    ttk::label $t.hlp -justify left -anchor nw -text \
        "Specify match-text as a case-insensitive glob pattern."
    listbox $t.lst -yscrollcommand [list $t.scr set] -height 8 -selectmode extended
    ttk::scrollbar $t.scr -command [list $t.lst yview]
    ttk::entry $t.sub
    ttk::button $t.sav -text Add -underline 0 \
        -command [list [namespace origin SubjectSave] $t]
    ttk::button $t.del -text Delete -underline 0 \
        -command [list [namespace origin SubjectKill] $t.lst]

    bind $t.sub <Return> [list $t.sav invoke]
    bind $t.lst <Double-Button-1> {tkchat::SubjectSel %W @%x,%y}
    bind $dlg <Alt-p> [list focus $t.lst]
    bind $dlg <Alt-n> [list focus $t.sub]
    bind $dlg <Alt-d> [list $t.del invoke]







|
|



|



|

|







4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
    .txt tag remove found 1.0 end
    .txt see end
}

proc tkchat::SpecifySubjects {parent} {
    set dlg [winfo toplevel $parent]
    set t [ttk::frame $parent.tkchatSubjects]
    ttk::labelframe $t.pat -text [mc "Patterns"]
    ttk::labelframe $t.new -text [mc "New pattern"]
    $t.pat configure -underline 0
    $t.new configure -underline 0
    ttk::label $t.hlp -justify left -anchor nw -text \
        [mc "Specify match-text as a case-insensitive glob pattern."]
    listbox $t.lst -yscrollcommand [list $t.scr set] -height 8 -selectmode extended
    ttk::scrollbar $t.scr -command [list $t.lst yview]
    ttk::entry $t.sub
    ttk::button $t.sav -text [mc "Add"] -underline 0 \
        -command [list [namespace origin SubjectSave] $t]
    ttk::button $t.del -text [mc "Delete"] -underline 0 \
        -command [list [namespace origin SubjectKill] $t.lst]

    bind $t.sub <Return> [list $t.sav invoke]
    bind $t.lst <Double-Button-1> {tkchat::SubjectSel %W @%x,%y}
    bind $dlg <Alt-p> [list focus $t.lst]
    bind $dlg <Alt-n> [list focus $t.sub]
    bind $dlg <Alt-d> [list $t.del invoke]
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
	}
    }
}

proc tkchat::EditMacros {parent} {
    set t [ttk::frame $parent.tkchatMacros]

    set mf [ttk::labelframe $t.mf -text "Macros"]
    listbox $mf.lst -yscrollcommand [list $mf.scr set] -selectmode extended
    ttk::scrollbar $mf.scr -command [list $t.lst yview]
    ttk::button $mf.del -text Delete -command [list [namespace origin MacroKill] $mf.lst]
    grid $mf.lst $mf.scr -sticky news
    grid $mf.del -       -sticky e
    grid rowconfigure $mf 0 -weight 1
    grid columnconfigure $mf 0 -weight 1

    set af [ttk::labelframe $t.af -text "Define new macros"]
    ttk::label $af.lbl1 -anchor w -text "Name:"
    ttk::entry $af.mac -width 10 -validate all -validatecommand {regexp -- {^\S*$} %P}
    ttk::label $af.lbl2 -anchor w -text "Text:"
    ttk::entry $af.txt -width 40
    ttk::button $af.sav -text Save -command [list [namespace origin MacroSave] $t]
    ttk::button $af.hlp -text Help -command [list [namespace origin MacroHelp] $t]

    grid $af.lbl1 $af.mac - -sticky new -padx 1 -pady 1
    grid $af.lbl2 $af.txt - -sticky new -padx 1 -pady 1
    grid x $af.sav $af.hlp -sticky ne  -padx 1 -pady 1
    grid rowconfigure $af 4 -weight 1
    grid columnconfigure $af 1 -weight 1








|


|





|
|

|

|
|







5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
	}
    }
}

proc tkchat::EditMacros {parent} {
    set t [ttk::frame $parent.tkchatMacros]

    set mf [ttk::labelframe $t.mf -text [mc "Macros"]]
    listbox $mf.lst -yscrollcommand [list $mf.scr set] -selectmode extended
    ttk::scrollbar $mf.scr -command [list $t.lst yview]
    ttk::button $mf.del -text [mc "Delete"] -command [list [namespace origin MacroKill] $mf.lst]
    grid $mf.lst $mf.scr -sticky news
    grid $mf.del -       -sticky e
    grid rowconfigure $mf 0 -weight 1
    grid columnconfigure $mf 0 -weight 1

    set af [ttk::labelframe $t.af -text [mc "Define new macros"]]
    ttk::label $af.lbl1 -anchor w -text [mc "Name"]:
    ttk::entry $af.mac -width 10 -validate all -validatecommand {regexp -- {^\S*$} %P}
    ttk::label $af.lbl2 -anchor w -text [mc "Text"]:
    ttk::entry $af.txt -width 40
    ttk::button $af.sav -text [mc "Save"] -command [list [namespace origin MacroSave] $t]
    ttk::button $af.hlp -text [mc "Help"] -command [list [namespace origin MacroHelp] $t]

    grid $af.lbl1 $af.mac - -sticky new -padx 1 -pady 1
    grid $af.lbl2 $af.txt - -sticky new -padx 1 -pady 1
    grid x $af.sav $af.hlp -sticky ne  -padx 1 -pady 1
    grid rowconfigure $af 4 -weight 1
    grid columnconfigure $af 1 -weight 1

5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
	set buildRow_seq 1
    } else {
	incr buildRow_seq
    }
    set seq $buildRow_seq
    ttk::label $f.nm$seq -text "$disp" -anchor w
    radiobutton $f.def$seq -padx 0 -pady 0 -indicatoron 0 \
        -text "default" \
        -variable tkchat::DlgData($idx) \
        -value 1 \
        -foreground  "#[lindex $DlgData(Color,$idx) 1]" \
        -selectcolor "#[lindex $DlgData(Color,$idx) 1]"
    radiobutton $f.inv$seq -padx 0 -pady 0 -indicatoron 0 \
        -text "inverted" \
        -variable tkchat::DlgData($idx) \
        -value 2 \
        -foreground "#[lindex $DlgData(Color,$idx) 2]" \
        -selectcolor "#[lindex $DlgData(Color,$idx) 2]"
    radiobutton $f.ovr$seq -padx 0 -pady 0 -indicatoron 0 \
        -text "custom" \
        -variable tkchat::DlgData($idx) \
        -value 3 \
        -foreground "#[lindex $DlgData(Color,$idx) 3]" \
        -selectcolor  "#[lindex $DlgData(Color,$idx) 3]"
    button $f.clr$seq -padx 0 -pady 0 \
        -text "..." \
        -command [list tkchat::newColor $f.ovr$seq $idx]







|





|





|







5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
	set buildRow_seq 1
    } else {
	incr buildRow_seq
    }
    set seq $buildRow_seq
    ttk::label $f.nm$seq -text "$disp" -anchor w
    radiobutton $f.def$seq -padx 0 -pady 0 -indicatoron 0 \
        -text [mc "default"] \
        -variable tkchat::DlgData($idx) \
        -value 1 \
        -foreground  "#[lindex $DlgData(Color,$idx) 1]" \
        -selectcolor "#[lindex $DlgData(Color,$idx) 1]"
    radiobutton $f.inv$seq -padx 0 -pady 0 -indicatoron 0 \
        -text [mc "inverted"] \
        -variable tkchat::DlgData($idx) \
        -value 2 \
        -foreground "#[lindex $DlgData(Color,$idx) 2]" \
        -selectcolor "#[lindex $DlgData(Color,$idx) 2]"
    radiobutton $f.ovr$seq -padx 0 -pady 0 -indicatoron 0 \
        -text [mc "custom"] \
        -variable tkchat::DlgData($idx) \
        -value 3 \
        -foreground "#[lindex $DlgData(Color,$idx) 3]" \
        -selectcolor  "#[lindex $DlgData(Color,$idx) 3]"
    button $f.clr$seq -padx 0 -pady 0 \
        -text "..." \
        -command [list tkchat::newColor $f.ovr$seq $idx]
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218




5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
    #Build screen
    set t .opts
    catch {destroy $t}
    Dialog $t
    wm withdraw $t
    wm title $t "Color Settings"

    ttk::label $t.l1 -text "Posting Color"
    label $t.l2 -text "Example Text" -background white \
	-foreground #$DlgData(MyColor) -font ACT
    ttk::button $t.myclr -text "Change..." \
        -command [list [namespace which ChangeColorsMyColor] $t.l2]

    ttk::labelframe $t.f -text "Colour overrides" -height 300
    set c [canvas $t.f.cvs -yscrollcommand [list $t.f.scr set] \
        -width 10 -height 300 -highlightthickness 0 -bd 0]
    bind $t <MouseWheel> [list tk::MouseWheel $c y %D -40.0]
    ttk::scrollbar $t.f.scr -command [list $c yview]
    pack $c -side left -expand 1 -fill both
    pack $t.f.scr -side left -fill y
    set f [ttk::frame $c.frm -padding 5]
    $c create window 0 0 -anchor nw -window $f
    bind $f <Configure> [list apply {{c t w h} {
	$c configure -width $w -scrollregion [list 0 0 $w $h]
	update idletasks
	wm geometry $t {}
    }} $c $t %w %h]
    foreach {key str} { 1 "All\nDefault" 2 "All\nInverted" 3 "All\nCustom"} {




	ttk::button $f.all$key -text $str \
	    -command [list [namespace which ChangeColorsAllButtons] $key]
    }
    grid x $f.all1 $f.all2 $f.all3 x -padx 1 -pady 1
    foreach {idx str} {MainBG Background MainFG Foreground SearchBG Searchbackgr SubjectBG Subjectbackgr} {
	buildRow $f $idx $str
    }
    grid [ttk::label $f.online -text "Online Users"] - - -
    set UserList [list]
    foreach network $OnlineUsers(networks) {
	set UserList [concat $UserList $OnlineUsers($network)]
    }
    set UserList [lsort -dictionary -unique $UserList]
    foreach nick $UserList {
	if { [info exists DlgData(Color,NICK-$nick)] } {
	    buildRow $f NICK-$nick $nick
	}
    }
    grid [ttk::label $f.offline -text "Offline Users"] - - -
    foreach nick $Options(NickList) {
	set nick [lindex $nick 0]
	if { $nick ni $UserList } {
	    buildRow $f NICK-$nick $nick
	}
    }
    ttk::frame $t.f2
    ttk::button $t.f2.ok -text "OK" -default active\
        -command [list [namespace which ChangeColorsOk] $t]
    ttk::button $t.f2.app -text "Apply" \
        -command [namespace which ChangeColorsApply]
    ttk::button $t.f2.can -text "Cancel" \
        -command [list destroy $t]
    pack $t.f2.ok $t.f2.app $t.f2.can -side left -expand 1 -fill none

    grid $t.l1  $t.l2 $t.myclr x -padx 1 -pady 3 -sticky {}
    #grid $t.l3    -       -    - -padx 1 -pady 3 -sticky ew
    grid $t.f     -       -    - -padx 1 -pady 5 -sticky news
    grid $t.f2    -       -    - -padx 1 -pady 10 -sticky news







|
|

|


|













|
>
>
>
>







|










|







|

|

|







5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
    #Build screen
    set t .opts
    catch {destroy $t}
    Dialog $t
    wm withdraw $t
    wm title $t "Color Settings"

    ttk::label $t.l1 -text [mc "Posting Color"]
    label $t.l2 -text [mc "Example Text"] -background white \
	-foreground #$DlgData(MyColor) -font ACT
    ttk::button $t.myclr -text [mc "Change"] ... \
        -command [list [namespace which ChangeColorsMyColor] $t.l2]

    ttk::labelframe $t.f -text [mc "Colour overrides"] -height 300
    set c [canvas $t.f.cvs -yscrollcommand [list $t.f.scr set] \
        -width 10 -height 300 -highlightthickness 0 -bd 0]
    bind $t <MouseWheel> [list tk::MouseWheel $c y %D -40.0]
    ttk::scrollbar $t.f.scr -command [list $c yview]
    pack $c -side left -expand 1 -fill both
    pack $t.f.scr -side left -fill y
    set f [ttk::frame $c.frm -padding 5]
    $c create window 0 0 -anchor nw -window $f
    bind $f <Configure> [list apply {{c t w h} {
	$c configure -width $w -scrollregion [list 0 0 $w $h]
	update idletasks
	wm geometry $t {}
    }} $c $t %w %h]
    foreach {key str} [list     \
	    1 [mc "All\nDefault"]  \
	    2 [mc "All\nInverted"] \
	    3 [mc "All\nCustom"]
	] {
	ttk::button $f.all$key -text $str \
	    -command [list [namespace which ChangeColorsAllButtons] $key]
    }
    grid x $f.all1 $f.all2 $f.all3 x -padx 1 -pady 1
    foreach {idx str} {MainBG Background MainFG Foreground SearchBG Searchbackgr SubjectBG Subjectbackgr} {
	buildRow $f $idx $str
    }
    grid [ttk::label $f.online -text [mc "Online Users"]] - - -
    set UserList [list]
    foreach network $OnlineUsers(networks) {
	set UserList [concat $UserList $OnlineUsers($network)]
    }
    set UserList [lsort -dictionary -unique $UserList]
    foreach nick $UserList {
	if { [info exists DlgData(Color,NICK-$nick)] } {
	    buildRow $f NICK-$nick $nick
	}
    }
    grid [ttk::label $f.offline -text [mc "Offline Users"]] - - -
    foreach nick $Options(NickList) {
	set nick [lindex $nick 0]
	if { $nick ni $UserList } {
	    buildRow $f NICK-$nick $nick
	}
    }
    ttk::frame $t.f2
    ttk::button $t.f2.ok -text [mc "Ok"] -default active\
        -command [list [namespace which ChangeColorsOk] $t]
    ttk::button $t.f2.app -text [mc "Apply"] \
        -command [namespace which ChangeColorsApply]
    ttk::button $t.f2.can -text [mc "Cancel"] \
        -command [list destroy $t]
    pack $t.f2.ok $t.f2.app $t.f2.can -side left -expand 1 -fill none

    grid $t.l1  $t.l2 $t.myclr x -padx 1 -pady 3 -sticky {}
    #grid $t.l3    -       -    - -padx 1 -pady 3 -sticky ew
    grid $t.f     -       -    - -padx 1 -pady 5 -sticky news
    grid $t.f2    -       -    - -padx 1 -pady 10 -sticky news
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
	wm title $t "Available Emoticons"
	wm withdraw $t
	wm protocol $t WM_DELETE_WINDOW [list wm withdraw $t]
	set txt [text $f.txt -font NAME -tabs {1.5i l 2.0i l} \
                     -height [expr {[llength $images] + 6}]]
	set sb [ttk::scrollbar $f.sb -command [list $txt yview]]
	$txt configure -yscrollcommand [list $sb set]
        set b [ttk::button $f.ok -default active -text OK \
                   -width -8 -command [list wm withdraw $t]]
	bind $t <Escape> [list $b invoke]
        bind $t <Return> [list $b invoke]

	foreach name $images {
            set image "::tkchat::img::$name"
	    $txt insert end "$name\t"







|







5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
	wm title $t "Available Emoticons"
	wm withdraw $t
	wm protocol $t WM_DELETE_WINDOW [list wm withdraw $t]
	set txt [text $f.txt -font NAME -tabs {1.5i l 2.0i l} \
                     -height [expr {[llength $images] + 6}]]
	set sb [ttk::scrollbar $f.sb -command [list $txt yview]]
	$txt configure -yscrollcommand [list $sb set]
        set b [ttk::button $f.ok -default active -text [mc "Ok"] \
                   -width -8 -command [list wm withdraw $t]]
	bind $t <Escape> [list $b invoke]
        bind $t <Return> [list $b invoke]

	foreach name $images {
            set image "::tkchat::img::$name"
	    $txt insert end "$name\t"
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
        wm withdraw $dlg
        wm title $dlg $UI(FN)
        wm protocol $dlg WM_DELETE_WINDOW [string map [list %img $img %dlg $dlg] {
            destroy %dlg
            image delete %img
        }]
        ttk::label $dlg.photo -image $img
        ttk::button $dlg.ok -text Close -width -10 -command [list destroy $dlg]
        grid $dlg.photo -sticky news
        grid $dlg.ok    -sticky e
        grid rowconfigure $dlg 0 -weight 1
        grid columnconfigure $dlg 0 -weight 1
        wm deiconify $dlg
    } err]} {
        tk_messageBox -icon error -title "Failed to display image" -message $err







|







6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
        wm withdraw $dlg
        wm title $dlg $UI(FN)
        wm protocol $dlg WM_DELETE_WINDOW [string map [list %img $img %dlg $dlg] {
            destroy %dlg
            image delete %img
        }]
        ttk::label $dlg.photo -image $img
        ttk::button $dlg.ok -text [mc "Close"] -width -10 -command [list destroy $dlg]
        grid $dlg.photo -sticky news
        grid $dlg.ok    -sticky e
        grid rowconfigure $dlg 0 -weight 1
        grid columnconfigure $dlg 0 -weight 1
        wm deiconify $dlg
    } err]} {
        tk_messageBox -icon error -title "Failed to display image" -message $err
6703
6704
6705
6706
6707
6708
6709
6710



6711

6712


6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
    set dlg [Dialog .$id]
    wm withdraw $dlg
    wm title $dlg "User info for $jid"
    set f [ttk::frame $dlg.f]

    # country Country city City age Age
    # photo_url "Picture URL" icq_uin "ICQ uin"
    foreach {key text} {FN "Real name" EMAIL_USERID Email URL "Homepage URL" \



			    ADR_LOCALITY "City"  ADR_CTRY "Country" \

			    PHOTO_EXTVAL "Photo URL" BDAY "Birthday"} {


	set l [ttk::label $f.l$key -text $text -anchor nw]
	set e [ttk::entry $f.e$key -textvariable [set uivar]($key)]
	grid configure $l $e -sticky news -padx 1 -pady 1
    }
    set l [ttk::label $f.lstuff -text "Anything else" -anchor nw]
    set e [ttk::frame $f.estuff]
    set et [text $e.text -height 6 -bd 1 -background white -font FIXED]
    set es [ttk::scrollbar $e.scroll -command [list $et yview]]
    $et configure -yscrollcommand [list $es set]
    catch {$et insert 0.0 $UI(DESC)}
    grid configure $et $es -sticky news
    grid rowconfigure $e 0 -weight 1
    grid columnconfigure $e 0 -weight 1

    grid configure $l $e -sticky news -padx 1 -pady 1
    grid columnconfigure $f 1 -weight 1
    grid rowconfigure $f 7 -weight 1

    set btns [ttk::frame $dlg.buttons]
    ttk::button $btns.photo -text "Photo" -width 10 -state disabled \
        -command [list [namespace origin UserInfoPhotoDialog] $dlg $uivar]
    ttk::button $btns.ok -text Save -width 10 -state disabled \
	-command [list set [namespace current]::$id 1]
    ttk::button $btns.cancel -text Close -width 10 -state active \
	-command [list set [namespace current]::$id 0]
    pack $btns.cancel $btns.ok $btns.photo -side right

    pack $btns -fill x -side bottom
    pack $f -fill both -expand 1 -side top

    if {[tkjabber::jid !resource $jid] eq [tkjabber::jid !resource $myId]} {







|
>
>
>
|
>
|
>
>




|














|

|

|







6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
    set dlg [Dialog .$id]
    wm withdraw $dlg
    wm title $dlg "User info for $jid"
    set f [ttk::frame $dlg.f]

    # country Country city City age Age
    # photo_url "Picture URL" icq_uin "ICQ uin"
    foreach {key text} [list \
	FN           [mc "Real name"] \
	EMAIL_USERID [mc "Email"] \
	URL          [mc "Homepage URL"] \
	ADR_LOCALITY [mc "City"] \
	ADR_CTRY     [mc "Country"] \
	PHOTO_EXTVAL [mc "Photo URL"] \
	BDAY         [mc "Birthday"]
    ] {
	set l [ttk::label $f.l$key -text $text -anchor nw]
	set e [ttk::entry $f.e$key -textvariable [set uivar]($key)]
	grid configure $l $e -sticky news -padx 1 -pady 1
    }
    set l [ttk::label $f.lstuff -text [mc "Anything else"] -anchor nw]
    set e [ttk::frame $f.estuff]
    set et [text $e.text -height 6 -bd 1 -background white -font FIXED]
    set es [ttk::scrollbar $e.scroll -command [list $et yview]]
    $et configure -yscrollcommand [list $es set]
    catch {$et insert 0.0 $UI(DESC)}
    grid configure $et $es -sticky news
    grid rowconfigure $e 0 -weight 1
    grid columnconfigure $e 0 -weight 1

    grid configure $l $e -sticky news -padx 1 -pady 1
    grid columnconfigure $f 1 -weight 1
    grid rowconfigure $f 7 -weight 1

    set btns [ttk::frame $dlg.buttons]
    ttk::button $btns.photo -text [mc "Photo"] -width 10 -state disabled \
        -command [list [namespace origin UserInfoPhotoDialog] $dlg $uivar]
    ttk::button $btns.ok -text [mc "Save"] -width 10 -state disabled \
	-command [list set [namespace current]::$id 1]
    ttk::button $btns.cancel -text [mc "Close"] -width 10 -state active \
	-command [list set [namespace current]::$id 0]
    pack $btns.cancel $btns.ok $btns.photo -side right

    pack $btns -fill x -side bottom
    pack $f -fill both -expand 1 -side top

    if {[tkjabber::jid !resource $jid] eq [tkjabber::jid !resource $myId]} {
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
    set EditOptions(ClickFocusEntry) $Options(ClickFocusEntry)
    set EditOptions(LogPrivateChat)  $Options(LogPrivateChat)
    set EditOptions(ShowNormalInline) $Options(ShowNormalInline)

    set dlg [winfo toplevel $parent]
    set page [ttk::frame $parent.preferences -borderwidth 0]

    set af [ttk::labelframe $page.af -text "General"]
    ttk::checkbutton $af.store -text "Store private messages" \
        -variable tkchat::EditOptions(StoreMessages) \
        -underline 0 -onvalue 1 -offvalue 0
    ttk::checkbutton $af.norminline -text "Show whispers inline" \
        -variable tkchat::EditOptions(ShowNormalInline) \
        -underline 2 -onvalue 1 -offvalue 0
    ttk::checkbutton $af.traffic -underline 1 \
        -text "Show humorous entered/left messages" -offvalue 0\
        -variable tkchat::EditOptions(FunkyTraffic) -onvalue 1
    ttk::checkbutton $af.catz -text "I hate LOLCATZ"  -offvalue 0 \
        -variable tkchat::EditOptions(HateLolcatz) -onvalue 1
    ttk::checkbutton $af.cfe -text "Keep focus on entry"  -offvalue 0 \
        -variable tkchat::EditOptions(ClickFocusEntry) -onvalue 1
    ttk::checkbutton $af.lpc -text "Log private chat" -offvalue 0 \
        -variable tkchat::EditOptions(LogPrivateChat) -onvalue 1
    ttk::checkbutton $af.abq -text "Ask before exiting" -offvalue 0 \
        -variable tkchat::EditOptions(AskBeforeQuit) -onvalue 1
    ttk::checkbutton $af.unn -text "Unify TkChat/IRC/Slack nicknames" -offvalue 0 \
        -variable tkchat::EditOptions(UnifyNicknames) -onvalue 1
    ttk::label $af.aal -text "Inactive message" -underline 0 \
        -anchor ne
    ttk::entry $af.aae -textvariable tkchat::EditOptions(AutoAwayMsg)

    tooltip $af.store "Control the persistence of one-to-one\
        chats to the ~/.tkchat_msgs file."
    tooltip $af.norminline "Enable to show whispered messages\
        in the main body of the chat.\nOtherwise they are displayed in a\







|
|


|



|

|

|

|

|

|

|







7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
    set EditOptions(ClickFocusEntry) $Options(ClickFocusEntry)
    set EditOptions(LogPrivateChat)  $Options(LogPrivateChat)
    set EditOptions(ShowNormalInline) $Options(ShowNormalInline)

    set dlg [winfo toplevel $parent]
    set page [ttk::frame $parent.preferences -borderwidth 0]

    set af [ttk::labelframe $page.af -text [mc "General"]]
    ttk::checkbutton $af.store -text [mc "Store private messages"] \
        -variable tkchat::EditOptions(StoreMessages) \
        -underline 0 -onvalue 1 -offvalue 0
    ttk::checkbutton $af.norminline -text [mc "Show whispers inline"] \
        -variable tkchat::EditOptions(ShowNormalInline) \
        -underline 2 -onvalue 1 -offvalue 0
    ttk::checkbutton $af.traffic -underline 1 \
        -text [mc "Show humorous entered/left messages"] -offvalue 0\
        -variable tkchat::EditOptions(FunkyTraffic) -onvalue 1
    ttk::checkbutton $af.catz -text [mc "I hate LOLCATZ"] -offvalue 0 \
        -variable tkchat::EditOptions(HateLolcatz) -onvalue 1
    ttk::checkbutton $af.cfe -text [mc "Keep focus on entry"] -offvalue 0 \
        -variable tkchat::EditOptions(ClickFocusEntry) -onvalue 1
    ttk::checkbutton $af.lpc -text [mc "Log private chat"] -offvalue 0 \
        -variable tkchat::EditOptions(LogPrivateChat) -onvalue 1
    ttk::checkbutton $af.abq -text [mc "Ask before exiting"] -offvalue 0 \
        -variable tkchat::EditOptions(AskBeforeQuit) -onvalue 1
    ttk::checkbutton $af.unn -text [mc "Unify TkChat/IRC/Slack nicknames"] -offvalue 0 \
        -variable tkchat::EditOptions(UnifyNicknames) -onvalue 1
    ttk::label $af.aal -text [mc "Inactive message"] -underline 0 \
        -anchor ne
    ttk::entry $af.aae -textvariable tkchat::EditOptions(AutoAwayMsg)

    tooltip $af.store "Control the persistence of one-to-one\
        chats to the ~/.tkchat_msgs file."
    tooltip $af.norminline "Enable to show whispered messages\
        in the main body of the chat.\nOtherwise they are displayed in a\
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
    grid $af.lpc     -   -sticky ew -padx 2
    grid $af.abq     -   -sticky ew -padx 2
    grid $af.unn     -   -sticky ew -padx 2
    grid $af.aal $af.aae -sticky ew -padx 2
    grid columnconfigure $af 1 -weight 1

    if {$tcl_platform(platform) ne "windows"} {
        set bf [ttk::labelframe $page.bf -text "Preferred browser"]
        $bf configure -underline 10

        ttk::label $bf.m -anchor nw -wraplength 4i -justify left \
            -text "Provide the command used to launch your web browser. For\
	    instance /opt/bin/mozilla or xterm -e links. The URL to\
	    be opened will be appended to the command string and for\
	    mozilla-type browsers we will call the -remote option to\
	    try to use a previously existing browser."
        ttk::entry $bf.e -textvariable tkchat::EditOptions(Browser)
        ttk::button $bf.b -text "..."  -width 4 -command {
            if {[set file [tk_getOpenFile]] ne {}} {
                set EditOptions(Browser) $file
            }
        }
        ttk::checkbutton $bf.tab -underline 0 \
            -text "Force new Tab, if possible (Unix only)" \
            -variable tkchat::EditOptions(BrowserTab)

        bind $dlg <Alt-b> [list focus $bf.e]
        bind $dlg <Alt-f> [list $bf.tab invoke]
        grid $bf.m -     -sticky news -padx 2
        grid $bf.e $bf.b -sticky ew   -padx 2
        grid $bf.tab     -sticky ew   -padx 2 -columnspan 2
        grid rowconfigure    $bf 0 -weight 1
        grid columnconfigure $bf 0 -weight 1
    }

    # Gimmicks section.
    set gimmicks 0
    set gf [ttk::labelframe $page.gf -text "Gimmiks"] ;#  -padx 1 -pady 1
    if {[dict exists [wm attributes .] -alpha]} {
	set gimmicks 1
	ttk::checkbutton $gf.fade -text "When not active, fade to " \
            -underline 2 -variable tkchat::EditOptions(AutoFade)
        ttk::spinbox $gf.fadelimit -from 1 -to 100 -width 4 \
            -validate all -format %.0f \
            -validatecommand {string is integer %P} \
            -textvariable tkchat::EditOptions(AutoFadeLimit)
	ttk::label $gf.pct -text "%"
	ttk::label $gf.alabel -text Transparency -underline 1 \
            -anchor ne
	ttk::scale $gf.alpha -from 1 -to 100 -orient horizontal
	$gf.alpha set $EditOptions(Transparency)
	#[expr {int([wm attributes . -alpha] * 100)}]
	$gf.alpha configure -command [namespace origin SetAlpha]

	bind $dlg <Alt-e> [list $gf.fade invoke]







|



|



|







|













|


|






|







7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
    grid $af.lpc     -   -sticky ew -padx 2
    grid $af.abq     -   -sticky ew -padx 2
    grid $af.unn     -   -sticky ew -padx 2
    grid $af.aal $af.aae -sticky ew -padx 2
    grid columnconfigure $af 1 -weight 1

    if {$tcl_platform(platform) ne "windows"} {
        set bf [ttk::labelframe $page.bf -text [mc "Preferred browser"]]
        $bf configure -underline 10

        ttk::label $bf.m -anchor nw -wraplength 4i -justify left \
            -text [mc "Provide the command used to launch your web browser. For\
	    instance /opt/bin/mozilla or xterm -e links. The URL to\
	    be opened will be appended to the command string and for\
	    mozilla-type browsers we will call the -remote option to\
	    try to use a previously existing browser."]
        ttk::entry $bf.e -textvariable tkchat::EditOptions(Browser)
        ttk::button $bf.b -text "..."  -width 4 -command {
            if {[set file [tk_getOpenFile]] ne {}} {
                set EditOptions(Browser) $file
            }
        }
        ttk::checkbutton $bf.tab -underline 0 \
            -text [mc "Force new Tab, if possible (Unix only)"] \
            -variable tkchat::EditOptions(BrowserTab)

        bind $dlg <Alt-b> [list focus $bf.e]
        bind $dlg <Alt-f> [list $bf.tab invoke]
        grid $bf.m -     -sticky news -padx 2
        grid $bf.e $bf.b -sticky ew   -padx 2
        grid $bf.tab     -sticky ew   -padx 2 -columnspan 2
        grid rowconfigure    $bf 0 -weight 1
        grid columnconfigure $bf 0 -weight 1
    }

    # Gimmicks section.
    set gimmicks 0
    set gf [ttk::labelframe $page.gf -text [mc "Gimmiks"]] ;#  -padx 1 -pady 1
    if {[dict exists [wm attributes .] -alpha]} {
	set gimmicks 1
	ttk::checkbutton $gf.fade -text [mc "When not active, fade to "] \
            -underline 2 -variable tkchat::EditOptions(AutoFade)
        ttk::spinbox $gf.fadelimit -from 1 -to 100 -width 4 \
            -validate all -format %.0f \
            -validatecommand {string is integer %P} \
            -textvariable tkchat::EditOptions(AutoFadeLimit)
	ttk::label $gf.pct -text "%"
	ttk::label $gf.alabel -text [mc "Transparency"] -underline 1 \
            -anchor ne
	ttk::scale $gf.alpha -from 1 -to 100 -orient horizontal
	$gf.alpha set $EditOptions(Transparency)
	#[expr {int([wm attributes . -alpha] * 100)}]
	$gf.alpha configure -command [namespace origin SetAlpha]

	bind $dlg <Alt-e> [list $gf.fade invoke]
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294

    set col 0
    foreach pair $pages {
        foreach {title page} $pair break
        $nb add $page -text $title
    }
    
    set b_ok [ttk::button $dlg.ok -text OK -underline 0 -default active \
                  -command [list [namespace origin EditOptionsClose] $dlg ok $pages]]
    set b_cn [ttk::button $dlg.cancel -text Cancel -underline 0 \
                  -command [list [namespace origin EditOptionsClose] $dlg cancel $pages]]

    grid $nb   -     -sticky news -padx 2 -pady 2
    grid $b_ok $b_cn -sticky se
    grid rowconfigure    $dlg 0 -weight 1
    grid columnconfigure $dlg 0 -weight 1








|

|







7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308

    set col 0
    foreach pair $pages {
        foreach {title page} $pair break
        $nb add $page -text $title
    }
    
    set b_ok [ttk::button $dlg.ok -text [mc "Ok"] -underline 0 -default active \
                  -command [list [namespace origin EditOptionsClose] $dlg ok $pages]]
    set b_cn [ttk::button $dlg.cancel -text [mc "Cancel"] -underline 0 \
                  -command [list [namespace origin EditOptionsClose] $dlg cancel $pages]]

    grid $nb   -     -sticky news -padx 2 -pady 2
    grid $b_ok $b_cn -sticky se
    grid rowconfigure    $dlg 0 -weight 1
    grid columnconfigure $dlg 0 -weight 1

7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608

    set m .pane.names_popup
    catch { destroy $m }
    menu $m
    switch -exact -- $network {
        "IRC" {
            $m add command \
		-label "User info" \
		-command [list tkjabber::msgSend "whois $nick" \
                              -type chat \
                              -tojid [email protected]/ijbridge]
        }
        "Jabber" {
            if {[info exists OnlineUsers($network-$nick,jid)]} {
                set jid $OnlineUsers($network-$nick,jid)
                $m add command -label "Send message" \
                    -command [list tkchat::SendMemo $jid]
            }
            $m add command \
		-label "Private Chat" \
		-command [list tkjabber::getChatWidget $conference/$nick $nick]
            $m add command \
		-label "User info" \
		-command [list tkjabber::msgSend "/userinfo $nick"]

            $m add command \
                -label "Version info" \
                -command [list tkjabber::query_user $nick version]

            # FIX ME: if the user is an admin/moderator then we want to show
            # an admin list
            if {[get_role $Options(Nickname)] eq "moderator"} {
                $m add cascade -label "Admin" -underline 0 \
                    -menu [set ma [menu $m.admin]]
                $ma add checkbutton -label "Mute" -underline 0 \
                    -onvalue visitor -offvalue participant \
                    -variable tkchat::OnlineUsers(Jabber-$nick,role) \
                    -command [list [namespace origin ToggleRole] voice $nick]
                $ma add checkbutton -label "Moderator" -underline 2 \
                    -onvalue moderator -offvalue participant \
                    -variable tkchat::OnlineUsers(Jabber-$nick,role) \
                    -command [list [namespace origin ToggleRole] admin $nick]
                $ma add command -label "Kick" -underline 0 \
                    -command [list [namespace origin Kick] $nick]
                $ma add command -label "Ban" -underline 0 \
                    -command [list [namespace origin Kick] $nick ban]
            }
        }
    }
    if { [info exists Options(Visibility,NICK-$nick)] } {
        if { $Options(Visibility,NICK-$nick) } {
	    $m add command -label "Show user"
	} else {
	    $m add command -label "Hide user"
	}
	$m entryconfigure last \
            -command [list tkchat::OnNameToggleVis NICK-$nick]
    }
    tk_popup $m $x $y
}








|







|



|


|



|





|

|



|



|

|






|

|







7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622

    set m .pane.names_popup
    catch { destroy $m }
    menu $m
    switch -exact -- $network {
        "IRC" {
            $m add command \
		-label [mc "User info"] \
		-command [list tkjabber::msgSend "whois $nick" \
                              -type chat \
                              -tojid [email protected]/ijbridge]
        }
        "Jabber" {
            if {[info exists OnlineUsers($network-$nick,jid)]} {
                set jid $OnlineUsers($network-$nick,jid)
                $m add command -label [mc "Send message"] \
                    -command [list tkchat::SendMemo $jid]
            }
            $m add command \
		-label [mc "Private Chat"] \
		-command [list tkjabber::getChatWidget $conference/$nick $nick]
            $m add command \
		-label [mc "User info"] \
		-command [list tkjabber::msgSend "/userinfo $nick"]

            $m add command \
                -label [mc "Version info"] \
                -command [list tkjabber::query_user $nick version]

            # FIX ME: if the user is an admin/moderator then we want to show
            # an admin list
            if {[get_role $Options(Nickname)] eq "moderator"} {
                $m add cascade -label [mc "Admin"] -underline 0 \
                    -menu [set ma [menu $m.admin]]
                $ma add checkbutton -label [mc "Mute"] -underline 0 \
                    -onvalue visitor -offvalue participant \
                    -variable tkchat::OnlineUsers(Jabber-$nick,role) \
                    -command [list [namespace origin ToggleRole] voice $nick]
                $ma add checkbutton -label [mc "Moderator"] -underline 2 \
                    -onvalue moderator -offvalue participant \
                    -variable tkchat::OnlineUsers(Jabber-$nick,role) \
                    -command [list [namespace origin ToggleRole] admin $nick]
                $ma add command -label [mc "Kick"] -underline 0 \
                    -command [list [namespace origin Kick] $nick]
                $ma add command -label [mc "Ban"] -underline 0 \
                    -command [list [namespace origin Kick] $nick ban]
            }
        }
    }
    if { [info exists Options(Visibility,NICK-$nick)] } {
        if { $Options(Visibility,NICK-$nick) } {
	    $m add command -label [mc "Show user"]
	} else {
	    $m add command -label [mc "Hide user"]
	}
	$m entryconfigure last \
            -command [list tkchat::OnNameToggleVis NICK-$nick]
    }
    tk_popup $m $x $y
}

7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
    $t insert end "\n" {} "Validity" HEAD "\n" {}
    $t insert end "Issued On\t$C(notBefore)\n"
    $t insert end "Expires On\t$C(notAfter)\n"
    $t insert end "\n" {} "Fingerprints" HEAD "\n" {}
    $t insert end "SHA1 Fingerprint\t[SafeGet C sha1_hash]\n"
    $t insert end "MD5 Fingerprint\t[SafeGet C md5_hash]\n"
    $t configure -state disabled
    ttk::button $dlg.ok -text OK -width -10 -command [list destroy $top] -default active
    ttk::button $dlg.is -text Issuer -width -10 -state disabled
    if {!$self_signed && $depth < ([llength $CertChain] - 1)} {
        set next [incr depth]
        set issuer [lindex $CertChain [expr {[llength $CertChain] - $next - 1}]]
        $dlg.is configure -state normal \
            -command [list [namespace origin ShowCertificate] $top \
                          [lindex $issuer 1] [lindex $issuer 7]]
    }







|
|







7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
    $t insert end "\n" {} "Validity" HEAD "\n" {}
    $t insert end "Issued On\t$C(notBefore)\n"
    $t insert end "Expires On\t$C(notAfter)\n"
    $t insert end "\n" {} "Fingerprints" HEAD "\n" {}
    $t insert end "SHA1 Fingerprint\t[SafeGet C sha1_hash]\n"
    $t insert end "MD5 Fingerprint\t[SafeGet C md5_hash]\n"
    $t configure -state disabled
    ttk::button $dlg.ok -text [mc "Ok"] -width -10 -command [list destroy $top] -default active
    ttk::button $dlg.is -text [mc "Issuer"] -width -10 -state disabled
    if {!$self_signed && $depth < ([llength $CertChain] - 1)} {
        set next [incr depth]
        set issuer [lindex $CertChain [expr {[llength $CertChain] - $next - 1}]]
        $dlg.is configure -state normal \
            -command [list [namespace origin ShowCertificate] $top \
                          [lindex $issuer 1] [lindex $issuer 7]]
    }
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831

    set t [Dialog .paste$id -padx 3 -pady 3]
    wm title $t [mc "Paste data to %s" paste.tclers.tk]
    wm transient $t {}

    # top frame. Subject and body
    set f [ttk::frame $t.topframe]
    ttk::label $f.label -text [mc Subject]
    set subject [ttk::entry $f.subject]
    set tf [ttk::frame $f.txtframe]
    set txt [text $tf.txt -background white -yscrollcommand [list $tf.vs set]]
    ttk::scrollbar $tf.vs -command [list $txt yview]

    pack $tf.vs -side right -fill y
    pack $txt -expand 1 -fill both







|







7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845

    set t [Dialog .paste$id -padx 3 -pady 3]
    wm title $t [mc "Paste data to %s" paste.tclers.tk]
    wm transient $t {}

    # top frame. Subject and body
    set f [ttk::frame $t.topframe]
    ttk::label $f.label -text [mc "Subject"]
    set subject [ttk::entry $f.subject]
    set tf [ttk::frame $f.txtframe]
    set txt [text $tf.txt -background white -yscrollcommand [list $tf.vs set]]
    ttk::scrollbar $tf.vs -command [list $txt yview]

    pack $tf.vs -side right -fill y
    pack $txt -expand 1 -fill both
Changes to apps/tkchat/tkchat.vfs/bin/tkchat_about.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# overwrite the standard "about" dialog
# provide both credits and license information
proc ::tkchat::About {} {
    variable version

    # don't cache this window - if user reloads on the fly
    # we want to make sure it displays latest greatest info!
    set w .about
    destroy $w
    Dialog $w
    wm withdraw $w

    set icon [lindex [info commands ::tkchat::img::Tkchat] 0]
    set ver [mc "Using Tcl %s, Tk %s" [package provide Tcl] [package provide Tk]]


    if {[package provide tls] ne {}} {
	append ver ", tls [package provide tls]"
    }

    set bf [ttk::frame $w.buttonframe]
    ttk::button $bf.credits \
	-text [mc "Credits"] \
	-command [list [namespace which About-Credits] $w.text]
    ttk::button $bf.license \
	-text [mc "License"] \
	-command [list [namespace which About-License] $w.text]
    ttk::button $bf.close \
	-text [mc "Close"] \
	-command [list destroy $w] \
	-default active
    ttk::label $w.title \
	-text "TkChat v$version\n" \
	-font {Courier -18 bold}
    ttk::label $w.ver \
	-text $ver \
	-font {Sans -12 bold}
    if {$icon ne ""} {
	$w.title configure \
	    -image $icon \
	    -compound left
    }
    ScrolledWidget text $w.text 0 1 \
	-height 20 \
	-width 75 \
	-padx 2 -pady 2 \
	-font TkDefaultFont
    $w.text tag configure title \
	-justify center \
	-font [dict merge [font actual TkDefaultFont] {-weight bold}]
    About-Credits $w.text

    pack $bf.close $bf.license $bf.credits -padx 6 -pady 6 -side right
    grid $w.title -pady 6
    grid $w.ver   -pady 6
    grid $w.text  -sticky news
    grid $bf      -sticky e
    grid rowconfigure $w $w.text    -weight 1
    grid columnconfigure $w $w.text -weight 1

    bind $w <Return> [list $bf.close invoke]
    bind $w <Escape> [list $bf.close invoke]

    wm title $w [mc "About TkChat %s" $version]
    if {$icon ne ""} {
	catch {wm iconphoto $dw $icon}
    }
    tk::PlaceWindow $w widget .
    wm deiconify $w
}

proc ::tkchat::About-Credits {t} {
    $t configure -state normal












|
|
>
>
















|











|
|
<


|


|


|
|








|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# overwrite the standard "about" dialog
# provide both credits and license information
proc ::tkchat::About {} {
    variable version

    # don't cache this window - if user reloads on the fly
    # we want to make sure it displays latest greatest info!
    set w .about
    destroy $w
    Dialog $w
    wm withdraw $w

    lassign [info commands ::tkchat::img::Tkchat] icon
    set ver [mc "Using Tcl %s, Tk %s" \
	[package provide Tcl] \
	[package provide Tk]]
    if {[package provide tls] ne {}} {
	append ver ", tls [package provide tls]"
    }

    set bf [ttk::frame $w.buttonframe]
    ttk::button $bf.credits \
	-text [mc "Credits"] \
	-command [list [namespace which About-Credits] $w.text]
    ttk::button $bf.license \
	-text [mc "License"] \
	-command [list [namespace which About-License] $w.text]
    ttk::button $bf.close \
	-text [mc "Close"] \
	-command [list destroy $w] \
	-default active
    ttk::label $w.title \
	-text [mc "TkChat v%s" $version] \
	-font {Courier -18 bold}
    ttk::label $w.ver \
	-text $ver \
	-font {Sans -12 bold}
    if {$icon ne ""} {
	$w.title configure \
	    -image $icon \
	    -compound left
    }
    ScrolledWidget text $w.text 0 1 \
	-height 20 \
	-width 80 \
	-padx 2 -pady 2

    $w.text tag configure title \
	-justify center \
	-font [dict merge [font actual TkTextFont] {-weight bold}]
    About-Credits $w.text

    pack $bf.close $bf.license $bf.credits -padx {6 0} -pady 6 -side right
    grid $w.title -pady 6
    grid $w.ver   -pady 6
    grid $w.text  -sticky news -padx 6
    grid $bf      -sticky e -padx 6
    grid rowconfigure $w $w.text    -weight 1
    grid columnconfigure $w $w.text -weight 1

    bind $w <Return> [list $bf.close invoke]
    bind $w <Escape> [list $bf.close invoke]

    wm title $w [mc "About TkChat %s" $version]
    if {$icon ne ""} {
	catch {wm iconphoto $w $icon}
    }
    tk::PlaceWindow $w widget .
    wm deiconify $w
}

proc ::tkchat::About-Credits {t} {
    $t configure -state normal
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
    lappend txt "Joe English"		"<[email protected]>"
    lappend txt "Joe Mistachkin"	"<[email protected]>"
    lappend txt "Donal K. Fellows"	"<[email protected]>"
    lappend txt "Daniel South"		"<[email protected]>"
    lappend txt "Steve Landers"		"<[email protected]>"
    lappend txt "Elchonon Edelson"	"<[email protected]>"
    lappend txt "Kevin Walzer"		"<[email protected]>"
    lappend txt "Emiliano Gavilan"	"<[email protected]>"
    insertHelpText $t $txt
    $t delete "end -1 char" end
    $t configure -state disabled
}

proc ::tkchat::About-License {t} {
    global tkchat_dir

    $t configure -state normal
    $t delete 1.0 end
    $t insert end "License terms" {title} "\n\n"
    set fd [open [file join $tkchat_dir license.terms]]
    $t insert end [chan read -nonewline $fd]
    chan close $fd
    $t configure -state disabled
}







|










|





85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    lappend txt "Joe English"		"<[email protected]>"
    lappend txt "Joe Mistachkin"	"<[email protected]>"
    lappend txt "Donal K. Fellows"	"<[email protected]>"
    lappend txt "Daniel South"		"<[email protected]>"
    lappend txt "Steve Landers"		"<[email protected]>"
    lappend txt "Elchonon Edelson"	"<[email protected]>"
    lappend txt "Kevin Walzer"		"<[email protected]>"
    lappend txt "Emiliano Gavil\u00e1n" "<[email protected]>"
    insertHelpText $t $txt
    $t delete "end -1 char" end
    $t configure -state disabled
}

proc ::tkchat::About-License {t} {
    global tkchat_dir

    $t configure -state normal
    $t delete 1.0 end
    $t insert end [mc "License terms"] {title} "\n\n"
    set fd [open [file join $tkchat_dir license.terms]]
    $t insert end [chan read -nonewline $fd]
    chan close $fd
    $t configure -state disabled
}
Changes to apps/tkchat/tkchat.vfs/bin/tkchat_clock.tcl.
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
}

proc ::tkchat::clock::OptionsHook {parent} {
    variable Options
    variable EditOptions
    array set EditOptions [array get Options]
    set f [ttk::frame $parent.clock]
    set eb [ttk::checkbutton $f.eb -text "Enable clock" \
                -variable [namespace current]::EditOptions(Enabled)]
    set lf [ttk::labelframe $f.lf -labelwidget $eb]
    ttk::label $lf.ltz -anchor w -text Timezone
    ttk::entry $lf.etz -textvariable [namespace current]::EditOptions(Timezone)
    ttk::label $lf.lft -anchor w -text Format
    ttk::entry $lf.eft -textvariable [namespace current]::EditOptions(Format)
    ttk::label $lf.ltt -anchor w -text Tooltip
    ttk::entry $lf.ett -textvariable [namespace current]::EditOptions(Tooltip)
    trace add variable [namespace current]::EditOptions(Enabled) write \
        [list [namespace origin ClockEnable] [list $lf.etz $lf.eft $lf.ett]]
    grid $lf.ltz $lf.etz -sticky news -padx 1 -pady 1
    grid $lf.lft $lf.eft -sticky news -padx 1 -pady 1
    grid $lf.ltt $lf.ett -sticky news -padx 1 -pady 1
    grid rowconfigure $lf 10 -weight 1







|


|

|

|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
}

proc ::tkchat::clock::OptionsHook {parent} {
    variable Options
    variable EditOptions
    array set EditOptions [array get Options]
    set f [ttk::frame $parent.clock]
    set eb [ttk::checkbutton $f.eb -text [mc "Enable clock"] \
                -variable [namespace current]::EditOptions(Enabled)]
    set lf [ttk::labelframe $f.lf -labelwidget $eb]
    ttk::label $lf.ltz -anchor w -text [mc "Timezone"]
    ttk::entry $lf.etz -textvariable [namespace current]::EditOptions(Timezone)
    ttk::label $lf.lft -anchor w -text [mc "Format"]
    ttk::entry $lf.eft -textvariable [namespace current]::EditOptions(Format)
    ttk::label $lf.ltt -anchor w -text [mc "Tooltip"]
    ttk::entry $lf.ett -textvariable [namespace current]::EditOptions(Tooltip)
    trace add variable [namespace current]::EditOptions(Enabled) write \
        [list [namespace origin ClockEnable] [list $lf.etz $lf.eft $lf.ett]]
    grid $lf.ltz $lf.etz -sticky news -padx 1 -pady 1
    grid $lf.lft $lf.eft -sticky news -padx 1 -pady 1
    grid $lf.ltt $lf.ett -sticky news -padx 1 -pady 1
    grid rowconfigure $lf 10 -weight 1
Changes to apps/tkchat/tkchat.vfs/bin/tkchat_console.tcl.
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
                    .console tag configure proc -foreground lightgreen
                    .console tag configure var -background darkblue
                }
            }
        }            
    
        unset consoleInterp
        $name title "[wm title .] Console"
        $name hide
}

proc ::tkchat::EmbeddedConsoleDemo {parent} {
    set dlg [toplevel [join [list $parent embedconsoledemo] .] -class Dialog]
    set nb [ttk::notebook $dlg.nb]
    frame $nb.page0 -container 1 
    tkchat::ConsoleInit $nb.page0 ::firstconsole

    frame $nb.page1 -container 0 -background blue

    $nb add $nb.page0 -text Console
    $nb add $nb.page1 -text Second
    grid $nb -sticky news
    grid rowconfigure $dlg 0 -weight 1
    grid columnconfigure $dlg 0 -weight 1
    
    bind $dlg <Destroy> {interp delete ::firstconsole}
}







|











|
|






200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
                    .console tag configure proc -foreground lightgreen
                    .console tag configure var -background darkblue
                }
            }
        }            
    
        unset consoleInterp
        $name title [mc "%s Console" [wm title .]]
        $name hide
}

proc ::tkchat::EmbeddedConsoleDemo {parent} {
    set dlg [toplevel [join [list $parent embedconsoledemo] .] -class Dialog]
    set nb [ttk::notebook $dlg.nb]
    frame $nb.page0 -container 1 
    tkchat::ConsoleInit $nb.page0 ::firstconsole

    frame $nb.page1 -container 0 -background blue

    $nb add $nb.page0 -text [mc "Console"]
    $nb add $nb.page1 -text [mc "Second"]
    grid $nb -sticky news
    grid rowconfigure $dlg 0 -weight 1
    grid columnconfigure $dlg 0 -weight 1
    
    bind $dlg <Destroy> {interp delete ::firstconsole}
}
Added apps/tkchat/tkchat.vfs/bin/tkchat_help.tcl.


















































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
proc ::tkchat::Help {} {
    variable version

    set w .qhelp
    destroy $w
    Dialog $w
    wm withdraw $w

    lassign [info commands ::tkchat::img::Tkchat] icon
    set title [mc "TkChat %s help" $version]

    ttk::label $w.title \
	-text $title \
	-font {Courier -18 bold}
    if {$icon ne ""} {
	$w.title configure \
	    -image $icon \
	    -compound left
    }
    ScrolledWidget text $w.text 0 1 \
	-height 24 \
	-width 90 \
	-wrap word
    ttk::button $w.b \
	-text [mc "Close"] \
	-command [list destroy $w] \
	-default active

    grid $w.title -pady 6
    grid $w.text  -sticky news -padx 6
    grid $w.b     -sticky e -pady 6 -padx 6
    grid rowconfigure $w $w.text -weight 1
    grid columnconfigure $w $w.text -weight 1

    $w.text tag configure h1 \
	-justify left \
	-font [dict merge [font actual TkTextFont] {-weight bold}]

    $w.text insert end "Commands\n" h1
    lappend txt "/msg <nick|JID> <text>"
    lappend txt [list "Send private message to a user identified by nickname\
	 or JID."]
    lappend txt "/whisper <nick|JID> <text>"
    lappend txt [list "Synonym for /msg ."]
    lappend txt "/chat <nick|JID> ?text?"
    lappend txt [list "Open a separate window to privately chat with the user\
	identified by nickname or JID, optionally posting an initial message."]
    lappend txt "/userinfo <nick>"
    lappend txt [list "Display registered information for user <nick>."]
    lappend txt "/afk ?reason?"
    lappend txt [list "Set your status to away with an optional reason."]
    lappend txt "/back ?reason?"
    lappend txt [list "Indicate that you have returned."]
    lappend txt "/away ?reason?"
    lappend txt [list "Synonym for /afk ."]
    lappend txt "/google <text>"
    lappend txt [list "Open a google query for <text> in web browser."]
    lappend txt "/googlefight <word> <word>"
    lappend txt [list "Perform a google fight between two words or phrases\
	(in quotes)."]
    lappend txt "/tip:<NUM>"
    lappend txt [list "Open the specified TIP document in web browser."]
    lappend txt "/wiki <text>"
    lappend txt [list "Do a Tclers wiki query with the remainder of the line."]
    lappend txt "/wikipedia <text>"
    lappend txt [list "Send a query to wikipedia (abbr. /wikip <text>)."]
    lappend txt "/wiktionary <text>"
    lappend txt [list "Send a query to wikipedia dictionary (abbr. /wikid\
	 <text>)."]
    lappend txt "/bug ?group? ?tracker? id"
    lappend txt [list "Open a sourceforge tracker item in browser."]
    lappend txt "/noisy ?<nick>? ?<minutes>?"
    lappend txt [list "Toggle <nick> noisy for x minutes (default 5).\
	Messages from noisy users are not diplayed. Not specifying a nick\
	will give you a list of noisy users."]
    lappend txt "/see <mark>"
    lappend txt [list "Goto named mark or index (eg: bookmark1 end 0.0)."]
    lappend txt "/alias <name> <type> <body>"
    lappend txt [list "<type> is 'proc' or 'script', type proc takes exactly\
	one argument." \
	"e.g: /alias foo script addSystem .txt \"test!\"" \
	"/alias foo proc thisProc" \
	"proc thisProc { arguments } { addSystem .txt \$arguments }"]
    lappend txt "/unalias <pattern>"
    lappend txt [list "Removes one or more aliases." "e.g: /unalias f*"]
    insertHelpText $w.text $txt

    $w.text insert end "\n" {} "Administrative commands\n" h1
    set txt ""
    lappend txt "/kick nick ?reason?"
    lappend txt [list "Remove an undesirable user."]
    lappend txt "/mute nick ?reason?"
    lappend txt [list "Globally silence a user."]
    lappend txt "/unmute nick ?reason?"
    lappend txt [list "Unmute a muted user."]
    lappend txt "/op nick ?reason?"
    lappend txt [list "Make user an administrator."]
    lappend txt "/deop nick ?reason?"
    lappend txt [list "Remove admin privileges from user."]
    insertHelpText $w.text $txt

    set txt ""
    $w.text insert end "\n" {} "Searching\n" h1
    lappend txt "/?<text>"
    lappend txt [list "Search the chat buffer for matching text.\
	Repeating the command will progress to the previous match."]
    lappend txt "/!"
    lappend txt [list "Clear the previous search result."]
    insertHelpText $w.text $txt
    $w.text configure -state disabled

    bind $w <Key-Escape> [list $w.b invoke]
    bind $w <Key-Return> [list $w.b invoke]

    wm title $w $title
    if {$icon ne ""} {
	catch {wm iconphoto $w $icon}
    }
    tk::PlaceWindow $w widget .
    wm deiconify $w
}
Changes to apps/tkchat/tkchat.vfs/bin/tkchat_rss.tcl.
212
213
214
215
216
217
218
219
220
221
222
223

224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
    wm withdraw $t
    wm title $t "RSS Feeds"
    wm transient $t .

    # format:
    # column {heading show stretch anchor     width}
    #         "text"  bool bool    tk_anchor  integer
    set colspec {
        #0          {"Title" 1 0 w 300}
        date        {"Date"  1 0 e 100}
        mtime       {""      0 0 e 0}
    }

    set tv [ttk::treeview $t.tv]
    ttk::scrollbar $t.sy1 -command [list $tv yview]
    ttk::scrollbar $t.sx1 -orient horizontal -command [list $tv xview]
    $tv configure \
        -yscrollcommand [list $t.sy1 set] \
        -xscrollcommand [list $t.sx1 set] \
        -columns [dict keys [dict remove $colspec #0]] \
        -selectmode browse
    set dcols {}
    dict for {col spec} $colspec {
        lassign $spec he sh st an wi
        $tv heading $col -text [mc $he]
        $tv column  $col -anchor $an -stretch $st -width $wi
        if {$sh} {
            lappend dcols $col
        }
    }
    $tv configure -displaycolumns [lsearch -all -inline -not $dcols #0]
    $tv tag configure Channel -font TkHeadingFont -foreground red4







|
|
|
|
<
>











|







212
213
214
215
216
217
218
219
220
221
222

223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
    wm withdraw $t
    wm title $t "RSS Feeds"
    wm transient $t .

    # format:
    # column {heading show stretch anchor     width}
    #         "text"  bool bool    tk_anchor  integer
    set colspec [list \
        #0          [list [mc "Title"] 1 0 w 300] \
        date        [list [mc "Date"]  1 0 e 100] \
        mtime       [list ""      0 0 e 0]

    ]
    set tv [ttk::treeview $t.tv]
    ttk::scrollbar $t.sy1 -command [list $tv yview]
    ttk::scrollbar $t.sx1 -orient horizontal -command [list $tv xview]
    $tv configure \
        -yscrollcommand [list $t.sy1 set] \
        -xscrollcommand [list $t.sx1 set] \
        -columns [dict keys [dict remove $colspec #0]] \
        -selectmode browse
    set dcols {}
    dict for {col spec} $colspec {
        lassign $spec he sh st an wi
        $tv heading $col -text $he
        $tv column  $col -anchor $an -stretch $st -width $wi
        if {$sh} {
            lappend dcols $col
        }
    }
    $tv configure -displaycolumns [lsearch -all -inline -not $dcols #0]
    $tv tag configure Channel -font TkHeadingFont -foreground red4
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
    $txt tag configure LAST -wrap none
    $txt tag bind LINK <Enter> {%W configure -cursor hand2}
    $txt tag bind LINK <Leave> {%W configure -cursor {}}

    set f [ttk::frame $t.bf]
    ttk::button $f.ok \
        -default active \
        -text "Ok"\
        -command [list destroy $t]
    ttk::button $f.reload \
        -text "\u27f3 Reload" \
        -command [list after 10 [namespace which CheckRSSFeeds]]
    pack $f.ok $f.reload -padx 3 -pady 3 -side right

    grid $tv    $t.sy1 $txt   $t.sy2 -sticky news
    grid $t.sx1 x      $t.sx2 x      -sticky news
    grid $f - - - -sticky e 
    grid columnconfigure $t 2 -weight 1







|


|







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
    $txt tag configure LAST -wrap none
    $txt tag bind LINK <Enter> {%W configure -cursor hand2}
    $txt tag bind LINK <Leave> {%W configure -cursor {}}

    set f [ttk::frame $t.bf]
    ttk::button $f.ok \
        -default active \
        -text [mc "Ok"] \
        -command [list destroy $t]
    ttk::button $f.reload \
        -text "\u27f3 [mc "Reload"]" \
        -command [list after 10 [namespace which CheckRSSFeeds]]
    pack $f.ok $f.reload -padx 3 -pady 3 -side right

    grid $tv    $t.sy1 $txt   $t.sy2 -sticky news
    grid $t.sx1 x      $t.sx2 x      -sticky news
    grid $f - - - -sticky e 
    grid columnconfigure $t 2 -weight 1
Changes to apps/tkchat/tkchat.vfs/bin/tkchat_whiteboard.tcl.
1
2
3
4
5
6
7
8
9


10
11
12
13
14
15
16
#
# Safe Whiteboard
#
# $Id: tkchat_whiteboard.tcl,v 1.4 2008/11/09 16:28:09 patthoyts Exp $

namespace eval ::tkchat::Whiteboard {
    variable version 1.0
    variable History
    if {![info exists History]} { set History [list] }


}

proc ::tkchat::Whiteboard::Init {} {
    global Options
    if { [winfo exists .whiteboard] } {

        wm deiconify .whiteboard









>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
# Safe Whiteboard
#
# $Id: tkchat_whiteboard.tcl,v 1.4 2008/11/09 16:28:09 patthoyts Exp $

namespace eval ::tkchat::Whiteboard {
    variable version 1.0
    variable History
    if {![info exists History]} { set History [list] }

    namespace import ::msgcat::mc
}

proc ::tkchat::Whiteboard::Init {} {
    global Options
    if { [winfo exists .whiteboard] } {

        wm deiconify .whiteboard
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42
        bind $dlg <Destroy> [list catch [list interp delete $slave]]
        interp alias $slave ::WhiteboardClear {} [namespace origin Clear]
        interp alias $slave ::WhiteboardLine {} [namespace origin Line]
        interp alias $slave ::WhiteboardScript {} [namespace origin Script]
        whiteboard eval {
            ttk::frame .wb
            ttk::entry .wb.e -textvariable wbentry

            ttk::button .wb.bclear -text Clear -command WhiteboardClear
            ttk::label .wb.status -anchor w
            canvas .wb.c -background white -width 350 -height 300
            bind .wb.c <Button-1> {
                set id [%W create line %x %y %x %y]
            }
            bind .wb.c <Button1-Motion> {
                %W coords $id [concat [%W coords $id] %x %y]







>
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
        bind $dlg <Destroy> [list catch [list interp delete $slave]]
        interp alias $slave ::WhiteboardClear {} [namespace origin Clear]
        interp alias $slave ::WhiteboardLine {} [namespace origin Line]
        interp alias $slave ::WhiteboardScript {} [namespace origin Script]
        whiteboard eval {
            ttk::frame .wb
            ttk::entry .wb.e -textvariable wbentry
            # we can't use message catalogs here; set -text from master
            ttk::button .wb.bclear -command WhiteboardClear
            ttk::label .wb.status -anchor w
            canvas .wb.c -background white -width 350 -height 300
            bind .wb.c <Button-1> {
                set id [%W create line %x %y %x %y]
            }
            bind .wb.c <Button1-Motion> {
                %W coords $id [concat [%W coords $id] %x %y]
54
55
56
57
58
59
60

61
62
63
64
65
66
67

            grid .wb -sticky news
            grid columnconfigure . 0 -weight 1
            grid rowconfigure    . 0 -weight 1
            proc Status {s} {.wb.status configure -text $s}
        }
        whiteboard eval [list ::ttk::setTheme $::ttk::currentTheme]


        wm deiconify $dlg
        #if {$Options(UseTkOnly)} { wm geometry $dlg 350x300 }
    }
}

# -------------------------------------------------------------------------







>







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

            grid .wb -sticky news
            grid columnconfigure . 0 -weight 1
            grid rowconfigure    . 0 -weight 1
            proc Status {s} {.wb.status configure -text $s}
        }
        whiteboard eval [list ::ttk::setTheme $::ttk::currentTheme]
        whiteboard eval [list .wb.bclear configure -text [mc "Clear"]]

        wm deiconify $dlg
        #if {$Options(UseTkOnly)} { wm geometry $dlg 350x300 }
    }
}

# -------------------------------------------------------------------------