Eskil

Check-in [9384abd564]
Login

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

Overview
Comment:Added status line showing background progress.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9384abd5641645d6ddaf97cc00ecdc0b5fa0d34f
User & Date: peter 2008-01-13 19:56:14.000
Context
2008-01-13
20:06
Require Tile Don't explicitely start dirdiff. check-in: eb24d4a4ea user: peter tags: trunk
19:56
Added status line showing background progress. check-in: 9384abd564 user: peter tags: trunk
19:37
No need to explicitely run dirdiff in tutorial. check-in: 532e44f1cd user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/dirdiff.tcl.
240
241
242
243
244
245
246

247
248
249
250
251
252
253
snit::widget DirCompare {
    component tree
    component hsb
    component vsb

    option -leftdir  -default "" -configuremethod SetDirOption
    option -rightdir -default "" -configuremethod SetDirOption


    variable AfterId ""
    variable IdleQueue {}
    variable IdleQueueArr
    variable leftMark ""
    variable rightMark ""








>







240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
snit::widget DirCompare {
    component tree
    component hsb
    component vsb

    option -leftdir  -default "" -configuremethod SetDirOption
    option -rightdir -default "" -configuremethod SetDirOption
    option -statusvar -default ""

    variable AfterId ""
    variable IdleQueue {}
    variable IdleQueueArr
    variable leftMark ""
    variable rightMark ""

533
534
535
536
537
538
539



540








541
542

543
544
545
546
547
548
549
                $self UpdateDirNode $node
            }
            # Work for at least 20 ms to keep things efficient
            set post [clock clicks -milliseconds]
            if {($post - $pre) > 20} break
        }




        if {[llength $IdleQueue] > 0} {








            set AfterId [after 1 [mymethod UpdateIdle]]
        } else {

            set AfterId ""
        }
    }

    method SetNodeStatus {node status} {
        $tree set $node status $status
        $tree item $node -tags $status







>
>
>

>
>
>
>
>
>
>
>


>







534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
                $self UpdateDirNode $node
            }
            # Work for at least 20 ms to keep things efficient
            set post [clock clicks -milliseconds]
            if {($post - $pre) > 20} break
        }

        if {$options(-statusvar) ne ""} {
            upvar \#0 $options(-statusvar) statusvar
        }
        if {[llength $IdleQueue] > 0} {
            set leftfull [$tree set $node leftfull]
            set rightfull [$tree set $node rightfull]
            if {$leftfull ne ""} {
                set statusvar $leftfull
            } else {
                set statusvar $rightfull
            }

            set AfterId [after 1 [mymethod UpdateIdle]]
        } else {
            set statusvar ""
            set AfterId ""
        }
    }

    method SetNodeStatus {node status} {
        $tree set $node status $status
        $tree item $node -tags $status
750
751
752
753
754
755
756

757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
    }
}

snit::widget DirDiff {
    hulltype toplevel
    widgetclass Toplevel
    component tree


    constructor {args} {
        lappend ::diff(diffWindows) $win
        wm title $win "Eskil Dir"
        wm protocol $win WM_DELETE_WINDOW [list cleanupAndExit $win]

        install tree using DirCompare $win.dc -leftdir $::dirdiff(leftDir) \
                -rightdir $::dirdiff(rightDir)

        frame $win.fe1
        frame $win.fe2

        menu $win.m
        $hull configure -menu $win.m








>







|







763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
    }
}

snit::widget DirDiff {
    hulltype toplevel
    widgetclass Toplevel
    component tree
    variable statusVar

    constructor {args} {
        lappend ::diff(diffWindows) $win
        wm title $win "Eskil Dir"
        wm protocol $win WM_DELETE_WINDOW [list cleanupAndExit $win]

        install tree using DirCompare $win.dc -leftdir $::dirdiff(leftDir) \
                -rightdir $::dirdiff(rightDir) -statusvar [myvar statusVar]

        frame $win.fe1
        frame $win.fe2

        menu $win.m
        $hull configure -menu $win.m

847
848
849
850
851
852
853


854
855
856
857
858
859
860
861
862
863

864
865
866
867
868
869
870
        button $win.bu2 -text "Up" -padx 10 -command [mymethod UpDir 2]
        button $win.bb2 -text "Browse" -padx 10 \
                -command "[list BrowseDir dirdiff(rightDir) $win.e2]
                          [mymethod DoDirCompare]"
        $win.e2 xview end
        bind $win.e1 <Return> [mymethod DoDirCompare]
        bind $win.e2 <Return> [mymethod DoDirCompare]


        
        pack $win.bb1 $win.bu1 -in $win.fe1 -side right -pady 1
        pack $win.bu1 -padx 6
        pack $win.e1 -in $win.fe1 -side left -fill x -expand 1
        pack $win.bb2 $win.bu2 -in $win.fe2 -side right -pady 1
        pack $win.bu2 -padx 6
        pack $win.e2 -in $win.fe2 -side left -fill x -expand 1
        
        grid $win.fe1  $win.bu $win.fe2  -sticky we
        grid $tree     -       -         -sticky news

        grid $win.bu -padx 6

        grid rowconfigure    $win  1    -weight 1
        grid columnconfigure $win {0 2} -weight 1
    }

    method DoDirCompare {} {







>
>










>







861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
        button $win.bu2 -text "Up" -padx 10 -command [mymethod UpDir 2]
        button $win.bb2 -text "Browse" -padx 10 \
                -command "[list BrowseDir dirdiff(rightDir) $win.e2]
                          [mymethod DoDirCompare]"
        $win.e2 xview end
        bind $win.e1 <Return> [mymethod DoDirCompare]
        bind $win.e2 <Return> [mymethod DoDirCompare]

        label $win.sl -anchor w -textvariable [myvar statusVar]
        
        pack $win.bb1 $win.bu1 -in $win.fe1 -side right -pady 1
        pack $win.bu1 -padx 6
        pack $win.e1 -in $win.fe1 -side left -fill x -expand 1
        pack $win.bb2 $win.bu2 -in $win.fe2 -side right -pady 1
        pack $win.bu2 -padx 6
        pack $win.e2 -in $win.fe2 -side left -fill x -expand 1
        
        grid $win.fe1  $win.bu $win.fe2  -sticky we
        grid $tree     -       -         -sticky news
        grid $win.sl   -       -         -sticky we
        grid $win.bu -padx 6

        grid rowconfigure    $win  1    -weight 1
        grid columnconfigure $win {0 2} -weight 1
    }

    method DoDirCompare {} {