Eskil

Check-in [133c0fd5bc]
Login

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

Overview
Comment:Use images from tablelist
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | table-list
Files: files | file ages | folders
SHA1: 133c0fd5bc1c8f841260d3a9194aaebb12902174
User & Date: peter.spjuth@gmail.com 2011-05-03 22:35:57
Context
2011-05-03
23:56
Added command column in dirdiff window check-in: 1f4057c700 user: peter.spjuth@gmail.com tags: table-list
22:35
Use images from tablelist check-in: 133c0fd5bc user: peter.spjuth@gmail.com tags: table-list
21:37
Merge branch 'master' into tablelist check-in: 93bf0308fc user: peter.spjuth@gmail.com tags: table-list
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

16
17
18
19
20
21
22

23
24
25
26
27
28
29
..
56
57
58
59
60
61
62


63
64
65
66
67
68
69
..
85
86
87
88
89
90
91

92
93
94
95
96
97
98
TEXTSEARCH = /home/peter/src/textsearch
DIFFUTIL   = /home/peter/src/DiffUtilTcl/lib.vfs/DiffUtil
WCB        = /home/peter/src/packages/wcb3.0
PDF4TCL    = /home/peter/src/pdf4tcl/pkg
SNIT       = /home/peter/tcl/tcllib/modules/snit
STRUCT     = /home/peter/tcl/tcllib/modules/struct
CMDLINE    = /home/peter/tcl/tcllib/modules/cmdline

TWAPI      = /home/peter/src/packages/twapi
TKDND      = /home/peter/src/packages/tkdnd/lib/tkdnd1.0

# Tools
NAGELFAR    = nagelfar

all: setup
................................................................................
	cd eskil.vfs/lib ; ln -s $(TEXTSEARCH) textsearch
eskil.vfs/lib/diffutil:
	cd eskil.vfs/lib ; ln -s $(DIFFUTIL) diffutil
eskil.vfs/lib/pdf4tcl:
	cd eskil.vfs/lib ; ln -s $(PDF4TCL) pdf4tcl
eskil.vfs/lib/tkdnd:
	cd eskil.vfs/lib ; ln -s $(TKDND) tkdnd


eskil.vfs/lib/snit:
	cd eskil.vfs/lib ; mkdir snit
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/pkgIndex.tcl
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/snit.tcl
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/snit2.tcl
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/main2.tcl
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/main1.tcl
................................................................................
	eskil.vfs/lib/textsearch\
	eskil.vfs/lib/diffutil\
	eskil.vfs/lib/pdf4tcl\
	eskil.vfs/lib/snit\
	eskil.vfs/lib/struct\
	eskil.vfs/lib/cmdline\
	eskil.vfs/lib/tkdnd\

	eskil.vfs/lib/wcb

setup: links

#----------------------------------------------------------------
# Testing
#----------------------------------------------------------------







>







 







>
>







 







>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
TEXTSEARCH = /home/peter/src/textsearch
DIFFUTIL   = /home/peter/src/DiffUtilTcl/lib.vfs/DiffUtil
WCB        = /home/peter/src/packages/wcb3.0
PDF4TCL    = /home/peter/src/pdf4tcl/pkg
SNIT       = /home/peter/tcl/tcllib/modules/snit
STRUCT     = /home/peter/tcl/tcllib/modules/struct
CMDLINE    = /home/peter/tcl/tcllib/modules/cmdline
TABLELIST  = /home/peter/src/packages/tablelist/tablelist5.2
TWAPI      = /home/peter/src/packages/twapi
TKDND      = /home/peter/src/packages/tkdnd/lib/tkdnd1.0

# Tools
NAGELFAR    = nagelfar

all: setup
................................................................................
	cd eskil.vfs/lib ; ln -s $(TEXTSEARCH) textsearch
eskil.vfs/lib/diffutil:
	cd eskil.vfs/lib ; ln -s $(DIFFUTIL) diffutil
eskil.vfs/lib/pdf4tcl:
	cd eskil.vfs/lib ; ln -s $(PDF4TCL) pdf4tcl
eskil.vfs/lib/tkdnd:
	cd eskil.vfs/lib ; ln -s $(TKDND) tkdnd
eskil.vfs/lib/tablelist:
	cd eskil.vfs/lib ; ln -s $(TABLELIST) tablelist
eskil.vfs/lib/snit:
	cd eskil.vfs/lib ; mkdir snit
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/pkgIndex.tcl
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/snit.tcl
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/snit2.tcl
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/main2.tcl
	cd eskil.vfs/lib/snit ; ln -s $(SNIT)/main1.tcl
................................................................................
	eskil.vfs/lib/textsearch\
	eskil.vfs/lib/diffutil\
	eskil.vfs/lib/pdf4tcl\
	eskil.vfs/lib/snit\
	eskil.vfs/lib/struct\
	eskil.vfs/lib/cmdline\
	eskil.vfs/lib/tkdnd\
	eskil.vfs/lib/tablelist\
	eskil.vfs/lib/wcb

setup: links

#----------------------------------------------------------------
# Testing
#----------------------------------------------------------------

Changes to src/dirdiff.tcl.

254
255
256
257
258
259
260

261
262
263
264
265



266
267
268
269
270
271






272
273
274
275
276
277
278
...
366
367
368
369
370
371
372

373
374
375
376
377
378
379










380
381
382
383
384
385
386
...
732
733
734
735
736
737
738

739
740
741
742
743
744
745
746

747
748
749
750
751
752
753
    variable ScheduledRestart 0
    variable IdleQueue {}
    variable IdleQueueArr
    variable leftMark ""
    variable rightMark ""
    variable leftDir ""
    variable rightDir ""


    constructor {args} {
        variable color
        install tree using tablelist::tablelist $win.tree -height 20 \
                -movablecolumns no -setgrid no -showseparators yes \



                -columns {0 "Structure" 0 Size 0 Date 0 Size 0 Date}
        install vsb using scrollbar $win.vsb -orient vertical \
                -command "$tree yview"
        install hsb using scrollbar $win.hsb -orient horizontal \
                -command "$tree xview"







        set AfterId ""
        set IdleQueue {}

        $tree configure -yscrollcommand "$vsb set" -xscrollcommand "$hsb set"

        $tree columnconfigure 0 -name structure
        $tree columnconfigure 1 -name leftsize -align right
................................................................................
        set d1 [file tail $leftDir]
        set d2 [file tail $rightDir]
        if {$d1 eq $d2} {
            $tree cellconfigure $topIndex,structure -text $d1
        } else {
            $tree cellconfigure $topIndex,structure -text "$d1 vs $d2"
        }

        $tree rowattrib $topIndex type directory
        $self SetNodeStatus $topIndex empty
        $tree rowattrib $topIndex leftfull $leftDir             
        $tree rowattrib $topIndex rightfull $rightDir            

        $self UpdateDirNode $topIndex
    }











    # Format a time stamp for display
    proc FormatDate {date} {
        clock format $date -format "%Y-%m-%d %H:%M:%S"
    }

    # Remove all equal nodes from tree
................................................................................
                    $size2 $time2]
        }
        set id [$tree insertchild $node end $values]
        $tree rowattrib $id type $type
        $tree rowattrib $id status unknown
        $tree rowattrib $id leftfull $df1
        $tree rowattrib $id rightfull $df2


        if {$type eq "directory"} {
            ## Make it so that this node is openable
            $tree collapse $id
            #$tree insertchild $id end dummy ;# a dummy
            $tree cellconfigure $id,structure -text $name/
            $self SetNodeStatus $id empty
            $self AddNodeToIdle $id

        } elseif {$size1 == $size2 && \
                $time1 == $time2} {
            $self SetNodeStatus $id equal
        } elseif {$size1 == ""} {
            $self SetNodeStatus $id new
        } elseif {$size2 == ""} {
            $self SetNodeStatus $id old







>





>
>
>






>
>
>
>
>
>







 







>







>
>
>
>
>
>
>
>
>
>







 







>








>







254
255
256
257
258
259
260
261
262
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
...
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
...
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
    variable ScheduledRestart 0
    variable IdleQueue {}
    variable IdleQueueArr
    variable leftMark ""
    variable rightMark ""
    variable leftDir ""
    variable rightDir ""
    variable img

    constructor {args} {
        variable color
        install tree using tablelist::tablelist $win.tree -height 20 \
                -movablecolumns no -setgrid no -showseparators yes \
                -expandcommand [mymethod expandCmd] \
                -collapsecommand [mymethod collapseCmd] \
                -fullseparators yes \
                -columns {0 "Structure" 0 Size 0 Date 0 Size 0 Date}
        install vsb using scrollbar $win.vsb -orient vertical \
                -command "$tree yview"
        install hsb using scrollbar $win.hsb -orient horizontal \
                -command "$tree xview"

        # Use demo images from Tablelist
        set dir $::eskil(thisDir)/../lib/tablelist/demos
        set img(clsd) [image create photo -file [file join $dir clsdFolder.gif]]
        set img(open) [image create photo -file [file join $dir openFolder.gif]]
        set img(file) [image create photo -file [file join $dir file.gif]]

        set AfterId ""
        set IdleQueue {}

        $tree configure -yscrollcommand "$vsb set" -xscrollcommand "$hsb set"

        $tree columnconfigure 0 -name structure
        $tree columnconfigure 1 -name leftsize -align right
................................................................................
        set d1 [file tail $leftDir]
        set d2 [file tail $rightDir]
        if {$d1 eq $d2} {
            $tree cellconfigure $topIndex,structure -text $d1
        } else {
            $tree cellconfigure $topIndex,structure -text "$d1 vs $d2"
        }
        $tree cellconfigure $topIndex,structure -image $img(open)
        $tree rowattrib $topIndex type directory
        $self SetNodeStatus $topIndex empty
        $tree rowattrib $topIndex leftfull $leftDir             
        $tree rowattrib $topIndex rightfull $rightDir            

        $self UpdateDirNode $topIndex
    }

    method expandCmd {tbl row} {
        if {[$tree childcount $row] != 0} {
            $tree cellconfigure $row,0 -image $img(open)
        }
    }

    method collapseCmd {tbl row} {
        $tree cellconfigure $row,0 -image $img(clsd)
    }

    # Format a time stamp for display
    proc FormatDate {date} {
        clock format $date -format "%Y-%m-%d %H:%M:%S"
    }

    # Remove all equal nodes from tree
................................................................................
                    $size2 $time2]
        }
        set id [$tree insertchild $node end $values]
        $tree rowattrib $id type $type
        $tree rowattrib $id status unknown
        $tree rowattrib $id leftfull $df1
        $tree rowattrib $id rightfull $df2
        $tree cellconfigure $id,structure -image $img(file)

        if {$type eq "directory"} {
            ## Make it so that this node is openable
            $tree collapse $id
            #$tree insertchild $id end dummy ;# a dummy
            $tree cellconfigure $id,structure -text $name/
            $self SetNodeStatus $id empty
            $self AddNodeToIdle $id
            $tree cellconfigure $id,structure -image $img(clsd)
        } elseif {$size1 == $size2 && \
                $time1 == $time2} {
            $self SetNodeStatus $id equal
        } elseif {$size1 == ""} {
            $self SetNodeStatus $id new
        } elseif {$size2 == ""} {
            $self SetNodeStatus $id old