374
375
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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
|
} else {
destroy {*}[winfo children $w]
}
set anyC $::eskil($top,mergeSelection,AnyConflict)
wm title $w "Merge result: [TitleTail $top]"
menu $w.m
$w configure -menu $w.m
$w.m add cascade -label "File" -underline 0 -menu $w.m.mf
menu $w.m.mf
$w.m.mf add command -label "Save" -underline 0 -command "saveMerge $top"
$w.m.mf add separator
$w.m.mf add command -label "Close" -underline 0 -command "closeMerge $top"
$w.m add cascade -label "Select" -underline 0 -menu $w.m.ms
menu $w.m.ms
$w.m.ms add radiobutton -label "Left+Right" -value 12 \
-variable ::eskil($top,curMergeSel) -command "selectMerge $top"
$w.m.ms add radiobutton -label "Left" -underline 0 -value 1 \
-variable ::eskil($top,curMergeSel) -command "selectMerge $top"
$w.m.ms add radiobutton -label "Right" -underline 0 -value 2 \
-variable ::eskil($top,curMergeSel) -command "selectMerge $top"
$w.m.ms add radiobutton -label "Right+Left" -value 21 \
-variable ::eskil($top,curMergeSel) -command "selectMerge $top"
$w.m.ms add separator
$w.m.ms add command -label "All Left" -command "selectMergeAll $top 1"
$w.m.ms add command -label "All Right" -command "selectMergeAll $top 2"
$w.m add cascade -label "Goto" -underline 0 -menu $w.m.mg
menu $w.m.mg
$w.m.mg add command -accelerator "Up" -label "Previous" -command "nextMerge $top -1"
$w.m.mg add command -accelerator "Down" -label "Next" -command "nextMerge $top 1"
if {$anyC} {
$w.m.mg add command -accelerator "Ctrl-Up" -label "Previous Conflict" -command "nextMerge $top -1000"
$w.m.mg add command -accelerator "Ctrl-Down" -label "Next Conflict" -command "nextMerge $top 1000"
}
$w.m.mg add command -accelerator "Shift-Up" -label "Previous 10" -command "nextMerge $top -10"
$w.m.mg add command -accelerator "Shift-Down" -label "Next 10" -command "nextMerge $top 10"
$w.m add cascade -label "Config" -underline 0 -menu $w.m.mc
menu $w.m.mc
$w.m.mc add radiobutton -label "Line end LF" -value lf -variable ::eskil($top,mergetranslation)
$w.m.mc add radiobutton -label "Line end CRLF" -value crlf -variable ::eskil($top,mergetranslation)
if {$::eskil($top,mode) eq "conflict"} {
$w.m.mc add separator
$w.m.mc add checkbutton -label "Pure" -variable ::eskil($top,modetype) \
-onvalue "Pure" -offvalue "" -command {doDiff}
}
ttk::frame $w.f
ttk::radiobutton $w.f.rb1 -text "LR" -value 12 \
-variable ::eskil($top,curMergeSel) \
-command "selectMerge $top"
|
|
<
|
<
|
<
>
|
|
|
<
<
|
|
<
|
<
|
<
<
>
>
>
|
|
|
|
<
|
|
|
|
|
|
|
|
|
>
|
|
>
|
|
|
<
>
|
|
>
>
|
374
375
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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
} else {
destroy {*}[winfo children $w]
}
set anyC $::eskil($top,mergeSelection,AnyConflict)
wm title $w "Merge result: [TitleTail $top]"
psmenu::psmenu $w {
"&File" {
"&Save" -cmd "saveMerge $top"
----
"&Close" -cmd "closeMerge $top"
}
"&Select" {
_Radio -var ::ruleset($top,curMergeSel) -cmd "selectMerge $top" {
"Left+Right" -value 12
"&Left" -value 1
"&Right" -value 2
"Right+Left" -value 21
}
---
"All Left" -cmd "selectMergeAll $top 1"
"All Right" -cmd "selectMergeAll $top 2"
}
"&Goto" {
"Previous" -accelerator "Up" -cmd "nextMerge $top -1"
"Next" -accelerator "Down" -cmd "nextMerge $top 1"
if {$anyC} {
"Previous Conflict" -accelerator "Ctrl-Up" -cmd "nextMerge $top -1000"
"Next Conflict" -accelerator "Ctrl-Down" -cmd "nextMerge $top 1000"
}
"Previous 10" -accelerator "Shift-Up" -cmd "nextMerge $top -10"
"Next 10" -accelerator "Shift-Down" -cmd "nextMerge $top 10"
}
}
# Test how to add more cascade in more calls
psmenu::psmenu $w {
"&Config" {
"Line end LF" -value lf -var ::eskil($top,mergetranslation)
"Line end CRLF" -value crlf -var ::eskil($top,mergetranslation)
if {$::eskil($top,mode) eq "conflict"} {
----
"Pure" -var ::eskil($top,modetype) \
-onvalue "Pure" -offvalue "" -cmd "doDiff $top"
}
}
}
ttk::frame $w.f
ttk::radiobutton $w.f.rb1 -text "LR" -value 12 \
-variable ::eskil($top,curMergeSel) \
-command "selectMerge $top"
|