Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Moved block compare to its own file. Made menus into a real menubar. Made other controls into toolbar. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
5ef46d8599e77d85d2e5d9b164e0c546 |
User & Date: | peter 2005-07-21 19:39:05.000 |
Context
2005-07-21
| ||
19:40 | Turn on toolbar when in revision mode. check-in: e5b0568e7d user: peter tags: trunk | |
19:39 | Moved block compare to its own file. Made menus into a real menubar. Made other controls into toolbar. check-in: 5ef46d8599 user: peter tags: trunk | |
18:26 | *** empty log message *** check-in: 686cc7533f user: peter tags: trunk | |
Changes
Changes to src/eskil.tcl.
︙ | ︙ | |||
34 35 36 37 38 39 40 | # Stop Tk from meddling with the command line by copying it first. set ::eskil(argv) $::argv set ::eskil(argc) $::argc set ::argv {} set ::argc 0 | | | | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # Stop Tk from meddling with the command line by copying it first. set ::eskil(argv) $::argv set ::eskil(argc) $::argc set ::argv {} set ::argc 0 set debug 1 set diffver "Version 2.0.7+ 2005-07-21" set ::thisScript [file join [pwd] [info script]] # Do initalisations for needed packages and globals. # This is not run until needed to speed up command line error reporting. proc Init {} { package require Tk 8.4 catch {package require textSearch} |
︙ | ︙ | |||
65 66 67 68 69 70 71 72 73 74 75 76 77 78 | set tmplink [file readlink $tmplink] set tmplink [file normalize [file join $::thisDir $tmplink]] set ::thisDir [file dirname $tmplink] } # Get all other source files source $::thisDir/clip.tcl source $::thisDir/map.tcl source $::thisDir/registry.tcl source $::thisDir/dirdiff.tcl source $::thisDir/help.tcl source $::thisDir/print.tcl source $::thisDir/rev.tcl | > | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | set tmplink [file readlink $tmplink] set tmplink [file normalize [file join $::thisDir $tmplink]] set ::thisDir [file dirname $tmplink] } # Get all other source files source $::thisDir/clip.tcl source $::thisDir/compare.tcl source $::thisDir/map.tcl source $::thisDir/registry.tcl source $::thisDir/dirdiff.tcl source $::thisDir/help.tcl source $::thisDir/print.tcl source $::thisDir/rev.tcl |
︙ | ︙ | |||
190 191 192 193 194 195 196 | foreach f $::tmpfiles { catch {file delete $f} } set ::tmpfiles {} } } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | foreach f $::tmpfiles { catch {file delete $f} } set ::tmpfiles {} } } # Insert lineno and text proc insertLine {top n line text {tag {}}} { $::widgets($top,wDiff$n) insert end "$text\n" $tag if {$tag != ""} { set tag "hl$::HighLightCount $tag" } $::widgets($top,wLine$n) insert end [myFormL $line] $tag |
︙ | ︙ | |||
786 787 788 789 790 791 792 | addChange $top $n1 $tag1 $line1 $n1 $line2 $n2 } } } } proc enableRedo {top} { | | | | | | 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | addChange $top $n1 $tag1 $line1 $n1 $line2 $n2 } } } } proc enableRedo {top} { $top.m.mf entryconfigure "Redo Diff" -state normal $top.m.mt entryconfigure "Merge" -state normal } proc disableRedo {top} { $top.m.mf entryconfigure "Redo Diff" -state disabled $top.m.mt entryconfigure "Merge" -state disabled } proc busyCursor {top} { global oldcursor oldcursor2 if {![info exists oldcursor]} { set oldcursor [$top cget -cursor] set oldcursor2 [$::widgets($top,wDiff1) cget -cursor] |
︙ | ︙ | |||
1504 1505 1506 1507 1508 1509 1510 | # Editing ##################################### # Clear Editing state proc resetEdit {top} { set ::diff($top,leftEdit) 0 set ::diff($top,rightEdit) 0 | | | 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 | # Editing ##################################### # Clear Editing state proc resetEdit {top} { set ::diff($top,leftEdit) 0 set ::diff($top,rightEdit) 0 $top.m.mt entryconfigure "Edit Mode" -state normal resetEditW $::widgets($top,wDiff1) resetEditW $::widgets($top,wDiff2) } # Clear Editing state for a Text widget proc resetEditW {w} { |
︙ | ︙ | |||
1587 1588 1589 1590 1591 1592 1593 | $w configure -undo 1 set ::diff($w,allowChange) line } # Turn on editing on sides where it has not been disallowed proc allowEdit {top} { | | | | 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 | $w configure -undo 1 set ::diff($w,allowChange) line } # Turn on editing on sides where it has not been disallowed proc allowEdit {top} { $top.m.mt entryconfigure "Edit Mode" -state disable if {$::diff($top,leftEdit) == 0} { set ::diff($top,leftEdit) 1 turnOnEdit $::widgets($top,wDiff1) } if {$::diff($top,rightEdit) == 0} { set ::diff($top,rightEdit) 1 turnOnEdit $::widgets($top,wDiff2) } } # Turn off editing on sides that do not correspond to a file proc disallowEdit {top {side 0}} { if {$side == 0 || $side == 1} { set ::diff($top,leftEdit) -1 } if {$side == 0 || $side == 2} { set ::diff($top,rightEdit) -1 } if {$::diff($top,leftEdit) == -1 && $::diff($top,rightEdit) == -1} { $top.m.mt entryconfigure "Edit Mode" -state disabled } } # Ask if editing is allowed on a side proc mayEdit {top side} { if {$side == 1} { return [expr {$::diff($top,leftEdit) == 1}] |
︙ | ︙ | |||
2835 2836 2837 2838 2839 2840 2841 | lappend ::diff(diffWindows) $top } wm title $top "Eskil:" wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top] frame $top.f | | > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 | lappend ::diff(diffWindows) $top } wm title $top "Eskil:" wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top] frame $top.f grid $top.f -row 0 -columnspan 4 -sticky nws lappend ::widgets(toolbars) $top.f if {!$::Pref(toolbar)} { grid remove $top.f } if {$tcl_platform(platform) eq "windows"} { #frame $top.f.line -height 1 -bg SystemButtonHighlight #pack $top.f.line -side bottom -fill x } menu $top.m $top configure -menu $top.m $top.m add cascade -label "File" -underline 0 -menu $top.m.mf menu $top.m.mf $top.m.mf add command -label "Redo Diff" -underline 5 \ -command [list redoDiff $top] -state disabled if {$debug == 1} { $top.m.mf entryconfigure "Redo Diff" -state normal } $top.m.mf add separator $top.m.mf add command -label "Open Both..." -underline 0 \ -command [list openBoth $top 0] $top.m.mf add command -label "Open Both (forget)..." \ -command [list openBoth $top 1] $top.m.mf add command -label "Open Left File..." \ -command [list openLeft $top] $top.m.mf add command -label "Open Right File..." \ -command [list openRight $top] $top.m.mf add separator $top.m.mf add command -label "Open Conflict File..." \ -command [list openConflict $top] $top.m.mf add command -label "Open Patch File..." \ -command [list openPatch $top] $top.m.mf add command -label "Revision Diff..." -underline 0 \ -command [list openRev $top] $top.m.mf add separator $top.m.mf add command -label "Print..." -underline 0 \ -command [list doPrint $top] $top.m.mf add separator $top.m.mf add command -label "Close" -underline 0 \ -command [list cleanupAndExit $top] $top.m.mf add separator $top.m.mf add command -label "Quit" -underline 0 \ -command {cleanupAndExit all} $top.m add cascade -label "Options" -underline 0 -menu $top.m.mo menu $top.m.mo $top.m.mo add cascade -label "Font" -underline 0 -menu $top.m.mo.f $top.m.mo add cascade -label "Ignore" -underline 0 -menu $top.m.mo.i $top.m.mo add command -label "Preprocess..." -underline 0 \ -command [list EditPrefRegsub $top] $top.m.mo add cascade -label "Parse" -underline 1 -menu $top.m.mo.p $top.m.mo add command -label "Colours..." -underline 0 -command makePrefWin $top.m.mo add cascade -label "Context" -underline 1 -menu $top.m.mo.c $top.m.mo add separator $top.m.mo add checkbutton -label "Toolbar" -variable ::Pref(toolbar) $top.m.mo add separator $top.m.mo add command -label "Save default" \ -command [list saveOptions $top] menu $top.m.mo.f $top.m.mo.f add command -label "Select..." -command makeFontWin \ -underline 0 $top.m.mo.f add radiobutton -label 6 -variable Pref(fontsize) -value 6 \ -command chFont $top.m.mo.f add radiobutton -label 7 -variable Pref(fontsize) -value 7 \ -command chFont $top.m.mo.f add radiobutton -label 8 -variable Pref(fontsize) -value 8 \ -command chFont $top.m.mo.f add radiobutton -label 9 -variable Pref(fontsize) -value 9 \ -command chFont $top.m.mo.f add radiobutton -label 10 -variable Pref(fontsize) -value 10 \ -command chFont menu $top.m.mo.i $top.m.mo.i add radiobutton -label "No spaces" \ -variable Pref(ignore) -value " " $top.m.mo.i add radiobutton -label "Space changes (-b)" \ -variable Pref(ignore) -value "-b" $top.m.mo.i add radiobutton -label "All spaces (-w)" \ -variable Pref(ignore) -value "-w" $top.m.mo.i add separator $top.m.mo.i add checkbutton -label "Case (-i)" \ -variable Pref(nocase) $top.m.mo.i add checkbutton -label "Digits" \ -variable Pref(nodigit) menu $top.m.mo.p $top.m.mo.p add radiobutton -label "Nothing" -variable Pref(parse) -value 0 $top.m.mo.p add radiobutton -label "Lines" -variable Pref(parse) -value 1 $top.m.mo.p add radiobutton -label "Blocks (small)" -variable Pref(parse) \ -value 2 $top.m.mo.p add radiobutton -label "Blocks" -variable Pref(parse) -value 3 $top.m.mo.p add separator $top.m.mo.p add radiobutton -label "Characters" \ -variable Pref(lineparsewords) -value "0" $top.m.mo.p add radiobutton -label "Words" \ -variable Pref(lineparsewords) -value "1" $top.m.mo.p add separator $top.m.mo.p add checkbutton -label "Mark last" -variable Pref(marklast) menu $top.m.mo.c $top.m.mo.c add radiobutton -label "Show all lines" \ -variable ::Pref(context) -value 0 $top.m.mo.c add separator $top.m.mo.c add radiobutton -label "Context 2 lines" \ -variable ::Pref(context) -value 2 $top.m.mo.c add radiobutton -label "Context 5 lines" \ -variable ::Pref(context) -value 5 $top.m.mo.c add radiobutton -label "Context 10 lines" \ -variable ::Pref(context) -value 10 $top.m.mo.c add radiobutton -label "Context 20 lines" \ -variable ::Pref(context) -value 20 $top.m add cascade -label "Search" -underline 0 -menu $top.m.ms menu $top.m.ms if {[info procs textSearch::searchMenu] != ""} { textSearch::searchMenu $top.m.ms } else { $top.m.ms add command -label "Text search not available" \ -state disabled } $top.m add cascade -label "Tools" -underline 0 -menu $top.m.mt menu $top.m.mt $top.m.mt add command -label "New Diff Window" -underline 0 \ -command makeDiffWin $top.m.mt add command -label "Directory Diff" -underline 0 \ -command makeDirDiffWin $top.m.mt add command -label "Clip Diff" -underline 0 \ -command makeClipDiffWin $top.m.mt add command -label "Merge" -underline 0 \ -command [list makeMergeWin $top] -state disabled $top.m.mt add command -label "Edit Mode" -underline 0 \ -command [list allowEdit $top] -state disabled $top.m.mt add command -label "Clear Align" \ -command [list clearAlign $top] -state disabled set ::widgets($top,enableAlignCmd) [list \ $top.m.mt entryconfigure "Clear Align" -state normal] set ::widgets($top,disableAlignCmd) [list \ $top.m.mt entryconfigure "Clear Align" -state disabled] if {$::tcl_platform(platform) eq "windows"} { if {![catch {package require registry}]} { $top.m.mt add separator $top.m.mt add command -label "Setup Registry" -underline 6 \ -command makeRegistryWin } } $top.m add cascade -label "Help" -underline 0 -menu $top.m.help menu $top.m.help $top.m.help add command -label "General" -command makeHelpWin -underline 0 $top.m.help add command -label "Tutorial" -command makeTutorialWin \ -underline 0 foreach label {{Revision Control} {Edit Mode}} \ file {revision.txt editmode.txt} { $top.m.help add command -label $label \ -command [list makeDocWin $file] -underline 0 } $top.m.help add separator $top.m.help add command -label "About" -command makeAboutWin -underline 0 label $top.lr1 -text "Rev 1" addBalloon $top.lr1 "Revision number for CVS/RCS/ClearCase diff." entry $top.er1 -width 12 -textvariable diff($top,doptrev1) set ::widgets($top,rev1) $top.er1 label $top.lr2 -text "Rev 2" addBalloon $top.lr2 "Revision number for CVS/RCS/ClearCase diff." |
︙ | ︙ | |||
3095 3096 3097 3098 3099 3100 3101 | bind $top <Key-Prior> [list scrollText $top -1 p] bind $top <Key-Next> [list scrollText $top 1 p] bind $top <Key-Escape> [list focus $top] if {$debug == 0} { bind $top <Key> "backDoor %A" } | < < | | | | | | | | | | | | | | | | < | 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 | bind $top <Key-Prior> [list scrollText $top -1 p] bind $top <Key-Next> [list scrollText $top 1 p] bind $top <Key-Escape> [list focus $top] if {$debug == 0} { bind $top <Key> "backDoor %A" } pack $top.bfn -in $top.f -side right -padx {3 6} pack $top.bfp $top.er2 $top.lr2 $top.er1 $top.lr1 \ -in $top.f -side right -padx 3 if {$debug == 1} { $top.m add cascade -label "Debug" -menu $top.m.md -underline 0 menu $top.m.md if {$tcl_platform(platform) eq "windows"} { $top.m.md add checkbutton -label "Console" -variable consolestate \ -onvalue show -offvalue hide \ -command {console $consolestate} $top.m.md add separator } $top.m.md add checkbutton -label "Wrap" -variable wrapstate \ -onvalue char -offvalue none -command \ "$top.ft1.tt configure -wrap \$wrapstate ;\ $top.ft2.tt configure -wrap \$wrapstate" $top.m.md add command -label "Date Filter" \ -command {set ::diff(filter) {^Date}} $top.m.md add separator $top.m.md add command -label "Reread Source" -underline 0 \ -command {EskilRereadSource} $top.m.md add separator $top.m.md add command -label "Redraw Window" \ -command [list makeDiffWin $top] $top.m.md add separator $top.m.md add command -label "Normal Cursor" \ -command [list normalCursor $top] $top.m.md add separator $top.m.md add command -label "Evalstats" -command {evalstats} $top.m.md add command -label "_stats" -command {parray _stats} $top.m.md add command -label "Nuisance" -command [list makeNuisance \ $top "It looks like you are trying out the debug menu."] } initDiffData $top return $top } # Set new preferences. |
︙ | ︙ | |||
3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 | set Pref(bgnew2) \#e0e0ff set Pref(context) 0 set Pref(marklast) 1 set Pref(linewidth) 80 set Pref(lines) 60 set Pref(editor) "" set Pref(regsub) {} # Print options set Pref(grayLevel1) 0.6 set Pref(grayLevel2) 0.8 set Pref(wideLines) 0 # Directory diff options | > > | 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 | set Pref(bgnew2) \#e0e0ff set Pref(context) 0 set Pref(marklast) 1 set Pref(linewidth) 80 set Pref(lines) 60 set Pref(editor) "" set Pref(regsub) {} set Pref(toolbar) 0 set Pref(ddtoolbar) 0 # Print options set Pref(grayLevel1) 0.6 set Pref(grayLevel2) 0.8 set Pref(wideLines) 0 # Directory diff options |
︙ | ︙ | |||
3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 | } # If the user's file has this old option, translate it to the new if {$Pref(onlydiffs) == 0} { set Pref(context) 0 } unset Pref(onlydiffs) } # Global code is only run the first time to be able to reread source if {![info exists gurkmeja]} { set gurkmeja 1 package require pstools namespace import -force pstools::* getOptions if {![info exists ::eskil_testsuite]} { parseCommandLine } } | > > > > > > > > > > > > > > > > > > > > > > > > > > > | 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 | } # If the user's file has this old option, translate it to the new if {$Pref(onlydiffs) == 0} { set Pref(context) 0 } unset Pref(onlydiffs) # Set up reactions to some Pref settings if {![info exists ::widgets(toolbars)]} { set ::widgets(toolbars) {} } if {![info exists ::widgets(ddtoolbars)]} { set ::widgets(ddtoolbars) {} } # FIXA: Move to procs, handle destroyed windows. trace add variable ::Pref(toolbar) write " foreach __ \$::widgets(toolbars) { if {\$::Pref(toolbar)} { grid configure \$__ } else { grid remove \$__ } } \# " trace add variable ::Pref(ddtoolbar) write " foreach __ \$::widgets(ddtoolbars) { if {\$::Pref(ddtoolbar)} { grid configure \$__ } else { grid remove \$__ } } \# " } # Global code is only run the first time to be able to reread source if {![info exists gurkmeja]} { set gurkmeja 1 package require pstools namespace import -force pstools::* getOptions if {![info exists ::eskil_testsuite]} { parseCommandLine } } |