Tkabber plugins

Check-in [2e384e3e11]
Login

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

Overview
Comment:Adapted the Jidlink filetransfer plugin to the Ttk based interface. Fixed namespace issues.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2e384e3e119bdacd4729249ab28dfa18a8f3ae08
User & Date: sgolovan 2015-05-09 06:56:12
Context
2015-05-09
07:04
Reformatted the code. Removed unnecessary [expr]. check-in: efbfff847b user: sgolovan tags: trunk
06:56
Adapted the Jidlink filetransfer plugin to the Ttk based interface. Fixed namespace issues. check-in: 2e384e3e11 user: sgolovan tags: trunk
05:11
Reformatted the code. check-in: 004a3082ce user: sgolovan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1




2
3
4
5
6
7
8
2015-05-09  Sergei Golovan  <sgolovan@nes.ru>





	* jidlink/jidlink.tcl, jidlink/msgs/de.msg, jidlink/msgs/es.msg,
	  jidlink/msgs/pl.msg, jidlink/msgs/ru.msg, jidlink/plugins/dtcp.tcl,
	  jidlink/plugins/filetransfer.tcl, jidlink/plugins/ibb.tcl,
	  jidlink/trans/ru.msg: Reformatted the code.

	* iconsets/amibulb/icondef.xml, iconsets/gabber/icondef.xml,

>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2015-05-09  Sergei Golovan  <sgolovan@nes.ru>

	* jidlink/plugins/filetransfer.tcl, jidlink/plugins/ibb.tcl: Adapted
	  the Jidlink filetransfer plugin to the Ttk based interface. Fixed
	  namespace issues.

	* jidlink/jidlink.tcl, jidlink/msgs/de.msg, jidlink/msgs/es.msg,
	  jidlink/msgs/pl.msg, jidlink/msgs/ru.msg, jidlink/plugins/dtcp.tcl,
	  jidlink/plugins/filetransfer.tcl, jidlink/plugins/ibb.tcl,
	  jidlink/trans/ru.msg: Reformatted the code.

	* iconsets/amibulb/icondef.xml, iconsets/gabber/icondef.xml,

Changes to jidlink/plugins/filetransfer.tcl.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
    custom::defgroup Jidlink \
        [::msgcat::mc "Jidlink options."] \
        -group {File Transfer}
}

proc ftjl::load {} {
    ::xmpp::iq::register set query jabber:iq:filexfer \
                         [namespace current]::ftjl::iq_set_handler

    ft::register_protocol jidlink \
        -priority 20 \
        -label "Jidlink" \
        -send [namespace current]::ftjl::send_file \
        -close [namespace current]::ftjl::send_file_close
}

proc ftjl::unload {} {
    ::xmpp::iq::unregister set query jabber:iq:filexfer

    ft::unregister_protocol jidlink

................................................................................

    while {[winfo exists $w]} {
        incr winid
        set w .rfd$winid
    }

    Dialog $w -title [::msgcat::mc "Receive file from %s" $from] \
        -separator 1 -anchor e -transient 0 \
        -modal none -default 0 -cancel 1


    set f [$w getframe]

    label $f.lname -text [::msgcat::mc "Name:"]
    label $f.name -text $name

    label $f.lsize -text [::msgcat::mc "Size:"]
    label $f.size -text $size

    label $f.ldesc -text [::msgcat::mc "Description:"]
    message $f.desc -width 10c -text $desc

    set dir $ft::options(download_dir)
    label $f.lsaveas -text [::msgcat::mc "Save as:"]
    entry $f.saveas -textvariable [namespace current]::saveas$winid
    variable saveas$winid [file join $dir $name]
    button $f.browsefile -text [::msgcat::mc "Browse..."] \
        -command [list [namespace current]::set_receive_file_name \
                       $w $winid $dir $name]

    set pbvar [namespace current]::progress$f.pb
    ProgressBar $f.pb -variable $pbvar
    $f.pb configure -maximum $size
    set $pbvar 0

    grid $f.lname   -row 0 -column 0 -sticky e
    grid $f.name    -row 0 -column 1 -sticky w
    
    grid $f.lsize   -row 1 -column 0 -sticky e







|




|
|







 







|





|
|

|
|

|
|


|
|

|




|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
    custom::defgroup Jidlink \
        [::msgcat::mc "Jidlink options."] \
        -group {File Transfer}
}

proc ftjl::load {} {
    ::xmpp::iq::register set query jabber:iq:filexfer \
                         [namespace current]::iq_set_handler

    ft::register_protocol jidlink \
        -priority 20 \
        -label "Jidlink" \
        -send [namespace current]::send_file \
        -close [namespace current]::send_file_close
}

proc ftjl::unload {} {
    ::xmpp::iq::unregister set query jabber:iq:filexfer

    ft::unregister_protocol jidlink

................................................................................

    while {[winfo exists $w]} {
        incr winid
        set w .rfd$winid
    }

    Dialog $w -title [::msgcat::mc "Receive file from %s" $from] \
        -anchor e -transient 0 \
        -modal none -default 0 -cancel 1


    set f [$w getframe]

    Label $f.lname -text [::msgcat::mc "Name:"]
    Label $f.name -text $name

    Label $f.lsize -text [::msgcat::mc "Size:"]
    Label $f.size -text $size

    Label $f.ldesc -text [::msgcat::mc "Description:"]
    Message $f.desc -width 10c -text $desc

    set dir $ft::options(download_dir)
    Label $f.lsaveas -text [::msgcat::mc "Save as:"]
    Entry $f.saveas -textvariable [namespace current]::saveas$winid
    variable saveas$winid [file join $dir $name]
    Button $f.browsefile -text [::msgcat::mc "Browse..."] \
        -command [list [namespace current]::set_receive_file_name \
                       $w $winid $dir $name]

    set pbvar [namespace current]::progress$f.pb
    Progressbar $f.pb -variable $pbvar
    $f.pb configure -maximum $size
    set $pbvar 0

    grid $f.lname   -row 0 -column 0 -sticky e
    grid $f.name    -row 0 -column 1 -sticky w
    
    grid $f.lsize   -row 1 -column 0 -sticky e

Changes to jidlink/plugins/ibb.tcl.

37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
..
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
    ::xmpp::sendIQ $xlib set \
        -query [::xmpp::xml::create query \
                    -xmlns jabber:iq:ibb \
                    -subelement [::xmpp::xml::create comment \
                                    -subelement [::xmpp::xml::create key \
                                                        -cdata $key]]] \
        -to $jid \

        -command [list ibb::recv_connect_response $xlib $jid $key]
         
    vwait [namespace current]::connection(status,$key)
}

proc ibb::recv_connect_response {xlib jid key status xml} {
    variable connection

................................................................................
        -query [::xmpp::xml::create query \
                    -xmlns jabber:iq:inband \
                    -subelement [::xmpp::xml::create streamid \
                                        -cdata $key_stream($key)] \
                    -subelement [::xmpp::xml::create data \
                                        -cdata [base64::encode $data]]] \
        -to $connection(jid,$key) \
        -command [list ibb::send_data_ack $key]

    vwait [namespace current]::connection(ack,$key)

    return $connection(ack,$key)
}

proc ibb::send_data_ack {key status xml} {







>
|







 







|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
..
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
    ::xmpp::sendIQ $xlib set \
        -query [::xmpp::xml::create query \
                    -xmlns jabber:iq:ibb \
                    -subelement [::xmpp::xml::create comment \
                                    -subelement [::xmpp::xml::create key \
                                                        -cdata $key]]] \
        -to $jid \
        -command [list [namespace current]::recv_connect_response \
                       $xlib $jid $key]
         
    vwait [namespace current]::connection(status,$key)
}

proc ibb::recv_connect_response {xlib jid key status xml} {
    variable connection

................................................................................
        -query [::xmpp::xml::create query \
                    -xmlns jabber:iq:inband \
                    -subelement [::xmpp::xml::create streamid \
                                        -cdata $key_stream($key)] \
                    -subelement [::xmpp::xml::create data \
                                        -cdata [base64::encode $data]]] \
        -to $connection(jid,$key) \
        -command [list [namespace current]::send_data_ack $key]

    vwait [namespace current]::connection(ack,$key)

    return $connection(ack,$key)
}

proc ibb::send_data_ack {key status xml} {