Eskil

Check-in [b07b1877ff]
Login

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

Overview
Comment:Moved nice setting to Preferences. Save prefs from dirdiff window.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b07b1877ffc39fc27bcc606ceec42d5f69e66ac5
User & Date: peter 2015-02-25 23:04:45.772
Context
2015-02-25
23:50
Postpone fossil whatis call until needed. check-in: 12cbadae02 user: peter tags: trunk
23:04
Moved nice setting to Preferences. Save prefs from dirdiff window. check-in: b07b1877ff user: peter tags: trunk
22:37
Do not trigger a revision dirdiff when starting blank. check-in: ce73fe5d82 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/dirdiff.tcl.
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
}

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

    constructor {args} {
        eskilRegisterToplevel $win
        wm title $win "Eskil Dir"
        wm protocol $win WM_DELETE_WINDOW [list cleanupAndExit $win]

        install tree using DirCompareTree $win.dc \







<







966
967
968
969
970
971
972

973
974
975
976
977
978
979
}

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


    constructor {args} {
        eskilRegisterToplevel $win
        wm title $win "Eskil Dir"
        wm protocol $win WM_DELETE_WINDOW [list cleanupAndExit $win]

        install tree using DirCompareTree $win.dc \
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029



1030
1031
1032
1033
1034
1035
1036
        $win.m.mo.mc add checkbutton -variable ::Pref(dir,ignorekey) \
                -label "Ignore \$Keyword:\$"

        $win.m.mo add command -label "Plugins..." -underline 1 \
                -command [list EditPrefPlugins $win 1]
        $win.m.mo add cascade -label "Nice" -menu $win.m.mo.mn
        menu $win.m.mo.mn
        $win.m.mo.mn add radiobutton -variable [myvar nice] -value 1 \
                -command [mymethod DoNice] -label 1
        $win.m.mo.mn add radiobutton -variable [myvar nice] -value 50 \
                -command [mymethod DoNice] -label 50
        $win.m.mo.mn add radiobutton -variable [myvar nice] -value 100 \
                -command [mymethod DoNice] -label 100
        $win.m.mo.mn add radiobutton -variable [myvar nice] -value 1000 \
                -command [mymethod DoNice] -label 1000




        $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
        $win.m.mt add command -label "Clip Diff" -underline 0 \
                -command makeClipDiffWin







|

|

|

|

>
>
>







1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
        $win.m.mo.mc add checkbutton -variable ::Pref(dir,ignorekey) \
                -label "Ignore \$Keyword:\$"

        $win.m.mo add command -label "Plugins..." -underline 1 \
                -command [list EditPrefPlugins $win 1]
        $win.m.mo add cascade -label "Nice" -menu $win.m.mo.mn
        menu $win.m.mo.mn
        $win.m.mo.mn add radiobutton -variable ::Pref(dir,nice) -value 1 \
                -command [mymethod DoNice] -label 1
        $win.m.mo.mn add radiobutton -variable ::Pref(dir,nice) -value 50 \
                -command [mymethod DoNice] -label 50
        $win.m.mo.mn add radiobutton -variable ::Pref(dir,nice) -value 100 \
                -command [mymethod DoNice] -label 100
        $win.m.mo.mn add radiobutton -variable ::Pref(dir,nice) -value 1000 \
                -command [mymethod DoNice] -label 1000
        $win.m.mo add separator
        $win.m.mo add command -label "Save default" \
                -command [list saveOptions $win]

        $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
        $win.m.mt add command -label "Clip Diff" -underline 0 \
                -command makeClipDiffWin
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
    method DoDirCompare {} {
        # Reconfiguring the dirdiff widget triggers a rerun
        $tree configure -leftdirvariable ::dirdiff(leftDir) \
                -rightdirvariable ::dirdiff(rightDir)
    }

    method DoNice {} {
        $tree nice $nice
    }

    # Go up one level in directory hierarchy.
    # 0 = both
    method UpDir {{n 0}} {
        global dirdiff
        switch $n {







|







1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
    method DoDirCompare {} {
        # Reconfiguring the dirdiff widget triggers a rerun
        $tree configure -leftdirvariable ::dirdiff(leftDir) \
                -rightdirvariable ::dirdiff(rightDir)
    }

    method DoNice {} {
        $tree nice $::Pref(dir,nice)
    }

    # Go up one level in directory hierarchy.
    # 0 = both
    method UpDir {{n 0}} {
        global dirdiff
        switch $n {
Changes to src/eskil.tcl.
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# 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 ::eskil(debug) 0
set ::eskil(diffver) "Version 2.7 2015-02-24"
set ::eskil(thisScript) [file join [pwd] [info script]]

namespace import tcl::mathop::+
namespace import tcl::mathop::-
namespace import tcl::mathop::*
namespace import tcl::mathop::/








|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# 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 ::eskil(debug) 0
set ::eskil(diffver) "Version 2.7 2015-02-25"
set ::eskil(thisScript) [file join [pwd] [info script]]

namespace import tcl::mathop::+
namespace import tcl::mathop::-
namespace import tcl::mathop::*
namespace import tcl::mathop::/

4429
4430
4431
4432
4433
4434
4435


4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450


4451
4452
4453

4454
4455
4456
4457
4458
4459
4460
        }
    }
    return $top
}

# Save options to file ~/.eskilrc
proc saveOptions {top} {


    # Check if the window size has changed
    set w $::widgets($top,wDiff1)
    if {[winfo reqwidth $w] != [winfo width $w] || \
            [winfo reqheight $w] != [winfo height $w]} {
        set dx [expr {[winfo width $w] - [winfo reqwidth $w]}]
        set dy [expr {[winfo height $w] - [winfo reqheight $w]}]
        set cx [font measure myfont 0]
        set cy [font metrics myfont -linespace]
        set neww [expr {[$w cget -width]  + $dx / $cx}]
        set newh [expr {[$w cget -height] + $dy / $cy}]
        if {$neww != $::Pref(linewidth) || $newh != $::Pref(lines)} {
            set apa [tk_messageBox -title "Save Preferences" -icon question \
                    -type yesno -message "Should I save the current window\
                    size with the preferences?\nCurrent: $neww x $newh  Old:\
                    $::Pref(linewidth) x $::Pref(lines)"]


            if {$apa == "yes"} {
                set ::Pref(linewidth) $neww
                set ::Pref(lines) $newh

            }
        }
    }

    set rcfile "~/.eskilrc"
    if {[catch {set ch [open $rcfile "w"]} err]} {
        tk_messageBox -icon error -title "File error" -message \







>
>
|
|
|
|
|
|
|
|
|
|
|
<
|

|
>
>
|
|
|
>







4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448

4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
        }
    }
    return $top
}

# Save options to file ~/.eskilrc
proc saveOptions {top} {
    # Is this a diff win or some other win?
    if {[info exists ::widgets($top,wDiff1)]} {
        # Check if the window size has changed
        set w $::widgets($top,wDiff1)
        if {[winfo reqwidth $w] != [winfo width $w] || \
                    [winfo reqheight $w] != [winfo height $w]} {
            set dx [expr {[winfo width $w] - [winfo reqwidth $w]}]
            set dy [expr {[winfo height $w] - [winfo reqheight $w]}]
            set cx [font measure myfont 0]
            set cy [font metrics myfont -linespace]
            set neww [expr {[$w cget -width]  + $dx / $cx}]
            set newh [expr {[$w cget -height] + $dy / $cy}]
            if {$neww != $::Pref(linewidth) || $newh != $::Pref(lines)} {

                set msg "Should I save the current window\
                    size with the preferences?\nCurrent: $neww x $newh  Old:\
                    $::Pref(linewidth) x $::Pref(lines)"
                set apa [tk_messageBox -title "Save Preferences" \
                                 -icon question -type yesno -message $msg]
                if {$apa == "yes"} {
                    set ::Pref(linewidth) $neww
                    set ::Pref(lines) $newh
                }
            }
        }
    }

    set rcfile "~/.eskilrc"
    if {[catch {set ch [open $rcfile "w"]} err]} {
        tk_messageBox -icon error -title "File error" -message \
4520
4521
4522
4523
4524
4525
4526

4527
4528
4529
4530
4531
4532
4533
    set ::DefaultPref(dir,comparelevel) 1
    set ::DefaultPref(dir,ignorekey) 0
    set ::DefaultPref(dir,incfiles) ""
    set ::DefaultPref(dir,exfiles) "*.o"
    set ::DefaultPref(dir,incdirs) ""
    set ::DefaultPref(dir,exdirs) "RCS CVS .git .svn .hg"
    set ::DefaultPref(dir,onlyrev) 0


    # Start with default preferences, before loading setup file
    array set ::Pref [array get ::DefaultPref]

    # Backward compatibilty options
    set ::Pref(onlydiffs) -1
    set ::Pref(regsub) {}







>







4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
    set ::DefaultPref(dir,comparelevel) 1
    set ::DefaultPref(dir,ignorekey) 0
    set ::DefaultPref(dir,incfiles) ""
    set ::DefaultPref(dir,exfiles) "*.o"
    set ::DefaultPref(dir,incdirs) ""
    set ::DefaultPref(dir,exdirs) "RCS CVS .git .svn .hg"
    set ::DefaultPref(dir,onlyrev) 0
    set ::DefaultPref(dir,nice) 1

    # Start with default preferences, before loading setup file
    array set ::Pref [array get ::DefaultPref]

    # Backward compatibilty options
    set ::Pref(onlydiffs) -1
    set ::Pref(regsub) {}