Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Diff on Key-Return Minor fixes. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
51fd8ceb3d939fe1601feffdab1abfdb |
User & Date: | peter 2008-01-13 19:36:51.000 |
Context
2008-01-13
| ||
19:37 | No need to explicitely run dirdiff in tutorial. check-in: 532e44f1cd user: peter tags: trunk | |
19:36 | Diff on Key-Return Minor fixes. check-in: 51fd8ceb3d user: peter tags: trunk | |
2007-12-26
| ||
16:53 | Cleaned up directory diff preferences. check-in: a8638dcafc user: peter tags: trunk | |
Changes
Changes to src/dirdiff.tcl.
︙ | ︙ | |||
241 242 243 244 245 246 247 | component tree component hsb component vsb option -leftdir -default "" -configuremethod SetDirOption option -rightdir -default "" -configuremethod SetDirOption | | | < < < < < < | | | | < < > > | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | 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 "" constructor {args} { install tree using ttk::treeview $win.tree -height 20 \ -columns {type status leftfull leftname leftsize leftdate rightfull rightname rightsize rightdate} \ -displaycolumns {leftname leftsize leftdate rightname rightsize rightdate} 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 -yscroll "$vsb set" -xscroll "$hsb set" $tree heading \#0 -text "Structure" $tree heading leftname -text "Name" $tree heading leftsize -text "Size" $tree heading leftdate -text "Date" $tree heading rightname -text "Name" $tree heading rightsize -text "Size" |
︙ | ︙ | |||
290 291 292 293 294 295 296 297 298 299 300 301 302 303 | $tree tag configure new -foreground green $tree tag configure old -foreground blue $tree tag configure change -foreground red bind $tree <<TreeviewOpen>> "[mymethod UpdateDirNode] \[%W focus\]" bind $tree <Button-3> "[mymethod ContextMenu] %x %y %X %Y" bind $tree <Double-ButtonPress-1> "[mymethod DoubleClick] %x %y" grid $tree $vsb -sticky nsew grid $hsb -sticky nsew grid columnconfigure $win 0 -weight 1 grid rowconfigure $win 0 -weight 1 $self configurelist $args | > | 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | $tree tag configure new -foreground green $tree tag configure old -foreground blue $tree tag configure change -foreground red bind $tree <<TreeviewOpen>> "[mymethod UpdateDirNode] \[%W focus\]" bind $tree <Button-3> "[mymethod ContextMenu] %x %y %X %Y" bind $tree <Double-ButtonPress-1> "[mymethod DoubleClick] %x %y" bind $tree <Key-Return> [mymethod KeyReturn] grid $tree $vsb -sticky nsew grid $hsb -sticky nsew grid columnconfigure $win 0 -weight 1 grid rowconfigure $win 0 -weight 1 $self configurelist $args |
︙ | ︙ | |||
436 437 438 439 440 441 442 | set rf [$tree set $node rightfull] set type [$tree set $node type] # On a file that exists on both sides, start a file diff if {$type eq "file" && $lf ne "" && $rf ne ""} { newDiff $lf $rf # Stop the default bindings from running | | > > > > > > > > > > > > > > > > | 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | set rf [$tree set $node rightfull] set type [$tree set $node type] # On a file that exists on both sides, start a file diff if {$type eq "file" && $lf ne "" && $rf ne ""} { newDiff $lf $rf # Stop the default bindings from running return -code break } } # React on Return key method KeyReturn {} { set node [$tree focus] if {$node eq ""} return set lf [$tree set $node leftfull] set rf [$tree set $node rightfull] set type [$tree set $node type] # On a file that exists on both sides, start a file diff if {$type eq "file" && $lf ne "" && $rf ne ""} { newDiff $lf $rf # Stop the default bindings from running return -code break } } # Bring up a context menu on a file. method ContextMenu {x y X Y} { #global dirdiff Pref |
︙ | ︙ | |||
626 627 628 629 630 631 632 633 634 635 636 637 638 639 | set values [list $type unknown \ $df1 "" "" "" \ $df2 "" "" ""] } else { set values [list $type unknown \ $df1 [file tail $df1] $size1 $time1 \ $df2 [file tail $df2] $size2 $time2] } set id [$tree insert $node end -text $name \ -values $values] if {$type eq "directory"} { ## Make it so that this node is openable $tree insert $id 0 -text dummy ;# a dummy $tree item $id -text $name/ | > > > | 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | set values [list $type unknown \ $df1 "" "" "" \ $df2 "" "" ""] } else { set values [list $type unknown \ $df1 [file tail $df1] $size1 $time1 \ $df2 [file tail $df2] $size2 $time2] } if {$type ne "directory"} { set name "" } set id [$tree insert $node end -text $name \ -values $values] if {$type eq "directory"} { ## Make it so that this node is openable $tree insert $id 0 -text dummy ;# a dummy $tree item $id -text $name/ |
︙ | ︙ | |||
734 735 736 737 738 739 740 741 742 743 744 745 746 747 | } $self SetNodeStatus $node $status } } snit::widget DirDiff { hulltype toplevel component tree constructor {args} { lappend ::diff(diffWindows) $win wm title $win "Eskil Dir" wm protocol $win WM_DELETE_WINDOW [list cleanupAndExit $win] | > | 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 | } $self SetNodeStatus $node $status } } 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] |
︙ | ︙ | |||
773 774 775 776 777 778 779 | menu $win.m.mo.mc $win.m.mo.mc add radiobutton -variable Pref(dir,comparelevel) -value 0 \ -label "Do not check contents" $win.m.mo.mc add radiobutton -variable Pref(dir,comparelevel) -value 1 \ -label "Normal compare" $win.m.mo.mc add radiobutton -variable Pref(dir,comparelevel) -value 2 \ | | | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | menu $win.m.mo.mc $win.m.mo.mc add radiobutton -variable Pref(dir,comparelevel) -value 0 \ -label "Do not check contents" $win.m.mo.mc add radiobutton -variable Pref(dir,comparelevel) -value 1 \ -label "Normal compare" $win.m.mo.mc add radiobutton -variable Pref(dir,comparelevel) -value 2 \ -label "Exact compare" $win.m.mo.mc add checkbutton -variable Pref(dir,ignorekey) \ -label "Ignore \$Keyword:\$" $win.m add cascade -label "Tools" -underline 0 -menu $win.m.mt menu $win.m.mt $win.m.mt add command -label "New Diff Window" -underline 0 \ -command makeDiffWin |
︙ | ︙ | |||
844 845 846 847 848 849 850 | 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 | | | | | | | 859 860 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 888 889 890 891 892 893 894 895 896 897 898 899 | 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 {} { $tree configure -leftdir $::dirdiff(leftDir) \ -rightdir $::dirdiff(rightDir) } # Go up one level in directory hierarchy. # 0 = both method UpDir {{n 0}} { global dirdiff Pref switch $n { 0 { set dirdiff(leftDir) [file dirname $dirdiff(leftDir)] set dirdiff(rightDir) [file dirname $dirdiff(rightDir)] $win.e1 xview end $win.e2 xview end } 1 { set dirdiff(leftDir) [file dirname $dirdiff(leftDir)] $win.e1 xview end } 2 { set dirdiff(rightDir) [file dirname $dirdiff(rightDir)] $win.e2 xview end } } $self DoDirCompare } } # Transfer preferences from dialog to real settings |
︙ | ︙ | |||
932 933 934 935 936 937 938 | set check [labelframe $top.check -text "Check" -padx 3 -pady 3] radiobutton $check.rb1 -variable TmpPref(dir,comparelevel) -value 0 \ -text "Do not check contents" radiobutton $check.rb2 -variable TmpPref(dir,comparelevel) -value 1 \ -text "Normal compare" radiobutton $check.rb3 -variable TmpPref(dir,comparelevel) -value 2 \ | | | 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 | set check [labelframe $top.check -text "Check" -padx 3 -pady 3] radiobutton $check.rb1 -variable TmpPref(dir,comparelevel) -value 0 \ -text "Do not check contents" radiobutton $check.rb2 -variable TmpPref(dir,comparelevel) -value 1 \ -text "Normal compare" radiobutton $check.rb3 -variable TmpPref(dir,comparelevel) -value 2 \ -text "Exact compare" grid $check.rb1 -sticky w -padx 3 -pady 3 grid $check.rb2 -sticky w -padx 3 -pady 3 grid $check.rb3 -sticky w -padx 3 -pady 3 grid columnconfigure $check {0 1 2} -uniform a -weight 1 set opts [labelframe $top.opts -text "Options" -padx 3 -pady 3] checkbutton $opts.cb1 -variable TmpPref(dir,ignorekey) \ |
︙ | ︙ | |||
1003 1004 1005 1006 1007 1008 1009 | grid $top.l2 $top.e2 -sticky we grid columnconfigure $top 1 -weight 1 grid rowconfigure $top 2 -weight 1 } proc makeDirDiffWin {{redraw 0}} { | > | | > > | > > > | 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | grid $top.l2 $top.e2 -sticky we grid columnconfigure $top 1 -weight 1 grid rowconfigure $top 2 -weight 1 } proc makeDirDiffWin {{redraw 0}} { if {![info exists ::dirdiff(leftDir)]} { set ::dirdiff(leftDir) "" } if {![info exists ::dirdiff(rightDir)]} { set ::dirdiff(rightDir) "" } destroy .dirdiff DirDiff .dirdiff } |