git-gui: remove ${NS} indirection for ttk
git-gui uses ${NS} to switch between non-themed and themed widgets, with ${NS} == 'ttk' selecting the latter. As git-gui now always uses ttk, this indirection is not needed. Remove it. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Mark Levedahl committed
Jul 14, 2025 at 12:15 UTC
fdc0e3a29020276de3d9344d2ab0caf4d086fd3a
26 files changed
+308
-313
git-gui.sh
+27
-27
@@ -3259,13 +3259,13 @@ default {
3259
3260
# -- Branch Control
3261
#
3262
-${NS}::frame .branch
3262
+ttk::frame .branch
3263
if {!$use_ttk} {.branch configure -borderwidth 1 -relief sunken}
3264
-${NS}::label .branch.l1 \
3264
+ttk::label .branch.l1 \
3265
-text [mc "Current Branch:"] \
3266
-anchor w \
3267
-justify left
3268
-${NS}::label .branch.cb \
3268
+ttk::label .branch.cb \
3269
-textvariable current_branch \
3270
-anchor w \
3271
-justify left
@@ -3275,8 +3275,8 @@ pack .branch -side top -fill x
3275
3276
# -- Main Window Layout
3277
#
3278
-${NS}::panedwindow .vpane -orient horizontal
3279
-${NS}::panedwindow .vpane.files -orient vertical
3278
+ttk::panedwindow .vpane -orient horizontal
3279
+ttk::panedwindow .vpane.files -orient vertical
3280
if {$use_ttk} {
3281
.vpane add .vpane.files
3282
} else {
@@ -3298,8 +3298,8 @@ ttext $ui_workdir \
3298
-xscrollcommand {.vpane.files.workdir.sx set} \
3299
-yscrollcommand {.vpane.files.workdir.sy set} \
3300
-state disabled
3301
-${NS}::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
3302
-${NS}::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
3301
+ttk::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
3302
+ttk::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
3303
pack .vpane.files.workdir.title -side top -fill x
3304
pack .vpane.files.workdir.sx -side bottom -fill x
3305
pack .vpane.files.workdir.sy -side right -fill y
@@ -3320,8 +3320,8 @@ ttext $ui_index \
3320
-xscrollcommand {.vpane.files.index.sx set} \
3321
-yscrollcommand {.vpane.files.index.sy set} \
3322
-state disabled
3323
-${NS}::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
3324
-${NS}::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
3323
+ttk::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
3324
+ttk::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
3325
pack .vpane.files.index.title -side top -fill x
3326
pack .vpane.files.index.sx -side bottom -fill x
3327
pack .vpane.files.index.sy -side right -fill y
@@ -3355,9 +3355,9 @@ unset i
3355
3356
# -- Diff and Commit Area
3357
#
3358
-${NS}::panedwindow .vpane.lower -orient vertical
3359
-${NS}::frame .vpane.lower.commarea
3360
-${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
3358
+ttk::panedwindow .vpane.lower -orient vertical
3359
+ttk::frame .vpane.lower.commarea
3360
+ttk::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
3361
.vpane.lower add .vpane.lower.diff
3362
.vpane.lower add .vpane.lower.commarea
3363
.vpane add .vpane.lower
@@ -3371,52 +3371,52 @@ if {$use_ttk} {
3371
3372
# -- Commit Area Buttons
3373
#
3374
-${NS}::frame .vpane.lower.commarea.buttons
3375
-${NS}::label .vpane.lower.commarea.buttons.l -text {} \
3374
+ttk::frame .vpane.lower.commarea.buttons
3375
+ttk::label .vpane.lower.commarea.buttons.l -text {} \
3376
-anchor w \
3377
-justify left
3378
pack .vpane.lower.commarea.buttons.l -side top -fill x
3379
pack .vpane.lower.commarea.buttons -side left -fill y
3380
3381
-${NS}::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
3381
+ttk::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
3382
-command ui_do_rescan
3383
pack .vpane.lower.commarea.buttons.rescan -side top -fill x
3384
lappend disable_on_lock \
3385
{.vpane.lower.commarea.buttons.rescan conf -state}
3386
3387
-${NS}::button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
3387
+ttk::button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
3388
-command do_add_all
3389
pack .vpane.lower.commarea.buttons.incall -side top -fill x
3390
lappend disable_on_lock \
3391
{.vpane.lower.commarea.buttons.incall conf -state}
3392
3393
if {![is_enabled nocommitmsg]} {
3394
- ${NS}::button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
3394
+ ttk::button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
3395
-command do_signoff
3396
pack .vpane.lower.commarea.buttons.signoff -side top -fill x
3397
}
3398
3399
-${NS}::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
3399
+ttk::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
3400
-command do_commit
3401
pack .vpane.lower.commarea.buttons.commit -side top -fill x
3402
lappend disable_on_lock \
3403
{.vpane.lower.commarea.buttons.commit conf -state}
3404
3405
if {![is_enabled nocommit]} {
3406
- ${NS}::button .vpane.lower.commarea.buttons.push -text [mc Push] \
3406
+ ttk::button .vpane.lower.commarea.buttons.push -text [mc Push] \
3407
-command do_push_anywhere
3408
pack .vpane.lower.commarea.buttons.push -side top -fill x
3409
}
3410
3411
# -- Commit Message Buffer
3412
#
3413
-${NS}::frame .vpane.lower.commarea.buffer
3414
-${NS}::frame .vpane.lower.commarea.buffer.header
3413
+ttk::frame .vpane.lower.commarea.buffer
3414
+ttk::frame .vpane.lower.commarea.buffer.header
3415
set ui_comm .vpane.lower.commarea.buffer.frame.t
3416
set ui_coml .vpane.lower.commarea.buffer.header.l
3417
3418
if {![is_enabled nocommit]} {
3419
- ${NS}::checkbutton .vpane.lower.commarea.buffer.header.amend \
3419
+ ttk::checkbutton .vpane.lower.commarea.buffer.header.amend \
3420
-text [mc "Amend Last Commit"] \
3421
-variable commit_type_is_amend \
3422
-command do_select_commit_type
@@ -3424,7 +3424,7 @@ if {![is_enabled nocommit]} {
3424
[list .vpane.lower.commarea.buffer.header.amend conf -state]
3425
}
3426
3427
-${NS}::label $ui_coml \
3427
+ttk::label $ui_coml \
3428
-anchor w \
3429
-justify left
3430
proc trace_commit_type {varname args} {
@@ -3459,10 +3459,10 @@ ttext $ui_comm \
3459
-font font_diff \
3460
-xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
3461
-yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
3462
-${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
3462
+ttk::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
3463
-orient horizontal \
3464
-command [list $ui_comm xview]
3465
-${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
3465
+ttk::scrollbar .vpane.lower.commarea.buffer.frame.sby \
3466
-orient vertical \
3467
-command [list $ui_comm yview]
3468
@@ -3585,9 +3585,9 @@ ttext $ui_diff \
3585
-yscrollcommand {.vpane.lower.diff.body.sby set} \
3586
-state disabled
3587
catch {$ui_diff configure -tabstyle wordprocessor}
3588
-${NS}::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
3588
+ttk::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
3589
-command [list $ui_diff xview]
3590
-${NS}::scrollbar .vpane.lower.diff.body.sby -orient vertical \
3590
+ttk::scrollbar .vpane.lower.diff.body.sby -orient vertical \
3591
-command [list $ui_diff yview]
3592
pack .vpane.lower.diff.body.sbx -side bottom -fill x
3593
pack .vpane.lower.diff.body.sby -side right -fill y
lib/about.tcl
+4
-4
@@ -4,19 +4,19 @@
4
proc do_about {} {
5
global appvers copyright oguilib
6
global tcl_patchLevel tk_patchLevel
7
- global ui_comm_spell NS use_ttk
7
+ global ui_comm_spell use_ttk
8
9
set w .about_dialog
10
Dialog $w
11
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
12
13
pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
14
- ${NS}::label $w.header -text [mc "About %s" [appname]] \
14
+ ttk::label $w.header -text [mc "About %s" [appname]] \
15
-font font_uibold -anchor center
16
pack $w.header -side top -fill x
17
18
- ${NS}::frame $w.buttons
19
- ${NS}::button $w.buttons.close -text {Close} \
18
+ ttk::frame $w.buttons
19
+ ttk::button $w.buttons.close -text {Close} \
20
-default active \
21
-command [list destroy $w]
22
pack $w.buttons.close -side right
lib/blame.tcl
+5
-5
@@ -63,7 +63,7 @@ field tooltip_timer {} ; # Current timer event for our tooltip
63
field tooltip_commit {} ; # Commit(s) in tooltip
64
65
constructor new {i_commit i_path i_jump} {
66
- global cursor_ptr M1B M1T NS
66
+ global cursor_ptr M1B M1T
67
variable active_color
68
variable group_colors
69
@@ -210,10 +210,10 @@ constructor new {i_commit i_path i_jump} {
210
211
set w_columns [list $w_amov $w_asim $w_line $w_file]
212
213
- ${NS}::scrollbar $w.file_pane.out.sbx \
213
+ ttk::scrollbar $w.file_pane.out.sbx \
214
-orient h \
215
-command [list $w_file xview]
216
- ${NS}::scrollbar $w.file_pane.out.sby \
216
+ ttk::scrollbar $w.file_pane.out.sby \
217
-orient v \
218
-command [list scrollbar2many $w_columns yview]
219
eval grid $w_columns $w.file_pane.out.sby -sticky nsew
@@ -263,10 +263,10 @@ constructor new {i_commit i_path i_jump} {
263
-background $active_color \
264
-font font_ui
265
$w_cviewer tag raise sel
266
- ${NS}::scrollbar $w.file_pane.cm.sbx \
266
+ ttk::scrollbar $w.file_pane.cm.sbx \
267
-orient h \
268
-command [list $w_cviewer xview]
269
- ${NS}::scrollbar $w.file_pane.cm.sby \
269
+ ttk::scrollbar $w.file_pane.cm.sby \
270
-orient v \
271
-command [list $w_cviewer yview]
272
pack $w.file_pane.cm.sby -side right -fill y
lib/branch_checkout.tcl
+8
-8
@@ -10,7 +10,7 @@ field opt_fetch 1; # refetch tracking branch if used?
10
field opt_detach 0; # force a detached head case?
11
12
constructor dialog {} {
13
- global use_ttk NS
13
+ global use_ttk
14
make_dialog top w
15
wm withdraw $w
16
wm title $top [mc "%s (%s): Checkout Branch" [appname] [reponame]]
@@ -18,16 +18,16 @@ constructor dialog {} {
18
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
19
}
20
21
- ${NS}::label $w.header -text [mc "Checkout Branch"] \
21
+ ttk::label $w.header -text [mc "Checkout Branch"] \
22
-font font_uibold -anchor center
23
pack $w.header -side top -fill x
24
25
- ${NS}::frame $w.buttons
26
- ${NS}::button $w.buttons.create -text [mc Checkout] \
25
+ ttk::frame $w.buttons
26
+ ttk::button $w.buttons.create -text [mc Checkout] \
27
-default active \
28
-command [cb _checkout]
29
pack $w.buttons.create -side right
30
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
30
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
31
-command [list destroy $w]
32
pack $w.buttons.cancel -side right -padx 5
33
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -36,14 +36,14 @@ constructor dialog {} {
36
$w_rev bind_listbox <Double-Button-1> [cb _checkout]
37
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
38
39
- ${NS}::labelframe $w.options -text [mc Options]
39
+ ttk::labelframe $w.options -text [mc Options]
40
41
- ${NS}::checkbutton $w.options.fetch \
41
+ ttk::checkbutton $w.options.fetch \
42
-text [mc "Fetch Tracking Branch"] \
43
-variable @opt_fetch
44
pack $w.options.fetch -anchor nw
45
46
- ${NS}::checkbutton $w.options.detach \
46
+ ttk::checkbutton $w.options.detach \
47
-text [mc "Detach From Local Branch"] \
48
-variable @opt_detach
49
pack $w.options.detach -anchor nw
lib/branch_create.tcl
+17
-17
@@ -16,7 +16,7 @@ field opt_fetch 1; # refetch tracking branch if used?
16
field reset_ok 0; # did the user agree to reset?
17
18
constructor dialog {} {
19
- global repo_config use_ttk NS
19
+ global repo_config use_ttk
20
21
make_dialog top w
22
wm withdraw $w
@@ -25,35 +25,35 @@ constructor dialog {} {
25
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
26
}
27
28
- ${NS}::label $w.header -text [mc "Create New Branch"] \
28
+ ttk::label $w.header -text [mc "Create New Branch"] \
29
-font font_uibold -anchor center
30
pack $w.header -side top -fill x
31
32
- ${NS}::frame $w.buttons
33
- ${NS}::button $w.buttons.create -text [mc Create] \
32
+ ttk::frame $w.buttons
33
+ ttk::button $w.buttons.create -text [mc Create] \
34
-default active \
35
-command [cb _create]
36
pack $w.buttons.create -side right
37
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
37
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
38
-command [list destroy $w]
39
pack $w.buttons.cancel -side right -padx 5
40
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
41
42
- ${NS}::labelframe $w.desc -text [mc "Branch Name"]
43
- ${NS}::radiobutton $w.desc.name_r \
42
+ ttk::labelframe $w.desc -text [mc "Branch Name"]
43
+ ttk::radiobutton $w.desc.name_r \
44
-text [mc "Name:"] \
45
-value user \
46
-variable @name_type
47
if {!$use_ttk} {$w.desc.name_r configure -anchor w}
48
set w_name $w.desc.name_t
49
- ${NS}::entry $w_name \
49
+ ttk::entry $w_name \
50
-width 40 \
51
-textvariable @name \
52
-validate key \
53
-validatecommand [cb _validate %d %S]
54
grid $w.desc.name_r $w_name -sticky we -padx {0 5}
55
56
- ${NS}::radiobutton $w.desc.match_r \
56
+ ttk::radiobutton $w.desc.match_r \
57
-text [mc "Match Tracking Branch Name"] \
58
-value match \
59
-variable @name_type
@@ -66,34 +66,34 @@ constructor dialog {} {
66
set w_rev [::choose_rev::new $w.rev [mc "Starting Revision"]]
67
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
68
69
- ${NS}::labelframe $w.options -text [mc Options]
69
+ ttk::labelframe $w.options -text [mc Options]
70
71
- ${NS}::frame $w.options.merge
72
- ${NS}::label $w.options.merge.l -text [mc "Update Existing Branch:"]
71
+ ttk::frame $w.options.merge
72
+ ttk::label $w.options.merge.l -text [mc "Update Existing Branch:"]
73
pack $w.options.merge.l -side left
74
- ${NS}::radiobutton $w.options.merge.no \
74
+ ttk::radiobutton $w.options.merge.no \
75
-text [mc No] \
76
-value none \
77
-variable @opt_merge
78
pack $w.options.merge.no -side left
79
- ${NS}::radiobutton $w.options.merge.ff \
79
+ ttk::radiobutton $w.options.merge.ff \
80
-text [mc "Fast Forward Only"] \
81
-value ff \
82
-variable @opt_merge
83
pack $w.options.merge.ff -side left
84
- ${NS}::radiobutton $w.options.merge.reset \
84
+ ttk::radiobutton $w.options.merge.reset \
85
-text [mc Reset] \
86
-value reset \
87
-variable @opt_merge
88
pack $w.options.merge.reset -side left
89
pack $w.options.merge -anchor nw
90
91
- ${NS}::checkbutton $w.options.fetch \
91
+ ttk::checkbutton $w.options.fetch \
92
-text [mc "Fetch Tracking Branch"] \
93
-variable @opt_fetch
94
pack $w.options.fetch -anchor nw
95
96
- ${NS}::checkbutton $w.options.checkout \
96
+ ttk::checkbutton $w.options.checkout \
97
-text [mc "Checkout After Creation"] \
98
-variable @opt_checkout
99
pack $w.options.checkout -anchor nw
lib/branch_delete.tcl
+6
-6
@@ -9,7 +9,7 @@ field w_check ; # revision picker for merge test
9
field w_delete ; # delete button
10
11
constructor dialog {} {
12
- global current_branch use_ttk NS
12
+ global current_branch use_ttk
13
14
make_dialog top w
15
wm withdraw $w
@@ -18,25 +18,25 @@ constructor dialog {} {
18
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
19
}
20
21
- ${NS}::label $w.header -text [mc "Delete Local Branch"] \
21
+ ttk::label $w.header -text [mc "Delete Local Branch"] \
22
-font font_uibold -anchor center
23
pack $w.header -side top -fill x
24
25
- ${NS}::frame $w.buttons
25
+ ttk::frame $w.buttons
26
set w_delete $w.buttons.delete
27
- ${NS}::button $w_delete \
27
+ ttk::button $w_delete \
28
-text [mc Delete] \
29
-default active \
30
-state disabled \
31
-command [cb _delete]
32
pack $w_delete -side right
33
- ${NS}::button $w.buttons.cancel \
33
+ ttk::button $w.buttons.cancel \
34
-text [mc Cancel] \
35
-command [list destroy $w]
36
pack $w.buttons.cancel -side right -padx 5
37
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
38
39
- ${NS}::labelframe $w.list -text [mc "Local Branches"]
39
+ ttk::labelframe $w.list -text [mc "Local Branches"]
40
set w_heads $w.list.l
41
slistbox $w_heads \
42
-height 10 \
lib/branch_rename.tcl
+9
-9
@@ -8,7 +8,7 @@ field oldname
8
field newname
9
10
constructor dialog {} {
11
- global current_branch use_ttk NS
11
+ global current_branch use_ttk
12
13
make_dialog top w
14
wm withdraw $w
@@ -20,22 +20,22 @@ constructor dialog {} {
20
set oldname $current_branch
21
set newname [get_config gui.newbranchtemplate]
22
23
- ${NS}::label $w.header -text [mc "Rename Branch"]\
23
+ ttk::label $w.header -text [mc "Rename Branch"]\
24
-font font_uibold -anchor center
25
pack $w.header -side top -fill x
26
27
- ${NS}::frame $w.buttons
28
- ${NS}::button $w.buttons.rename -text [mc Rename] \
27
+ ttk::frame $w.buttons
28
+ ttk::button $w.buttons.rename -text [mc Rename] \
29
-default active \
30
-command [cb _rename]
31
pack $w.buttons.rename -side right
32
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
32
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
33
-command [list destroy $w]
34
pack $w.buttons.cancel -side right -padx 5
35
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
36
37
- ${NS}::frame $w.rename
38
- ${NS}::label $w.rename.oldname_l -text [mc "Branch:"]
37
+ ttk::frame $w.rename
38
+ ttk::label $w.rename.oldname_l -text [mc "Branch:"]
39
if {$use_ttk} {
40
ttk::combobox $w.rename.oldname_m -textvariable @oldname \
41
-values [load_all_heads] -state readonly
@@ -43,8 +43,8 @@ constructor dialog {} {
43
eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]
44
}
45
46
- ${NS}::label $w.rename.newname_l -text [mc "New Name:"]
47
- ${NS}::entry $w.rename.newname_t \
46
+ ttk::label $w.rename.newname_l -text [mc "New Name:"]
47
+ ttk::entry $w.rename.newname_t \
48
-width 40 \
49
-textvariable @newname \
50
-validate key \
lib/browser.tcl
+11
-11
@@ -21,7 +21,7 @@ field browser_busy 1
21
field ls_buf {}; # Buffered record output from ls-tree
22
23
constructor new {commit {path {}}} {
24
- global cursor_ptr M1B use_ttk NS
24
+ global cursor_ptr M1B use_ttk
25
make_dialog top w
26
wm withdraw $top
27
wm title $top [mc "%s (%s): File Browser" [appname] [reponame]]
@@ -35,7 +35,7 @@ constructor new {commit {path {}}} {
35
set browser_commit $commit
36
set browser_path "$browser_commit:[escape_path $path]"
37
38
- ${NS}::label $w.path \
38
+ ttk::label $w.path \
39
-textvariable @browser_path \
40
-anchor w \
41
-justify left \
@@ -43,7 +43,7 @@ constructor new {commit {path {}}} {
43
if {!$use_ttk} { $w.path configure -borderwidth 1 -relief sunken}
44
pack $w.path -anchor w -side top -fill x
45
46
- ${NS}::frame $w.list
46
+ ttk::frame $w.list
47
set w_list $w.list.l
48
text $w_list -background white -foreground black \
49
-borderwidth 0 \
@@ -55,14 +55,14 @@ constructor new {commit {path {}}} {
55
-xscrollcommand [list $w.list.sbx set] \
56
-yscrollcommand [list $w.list.sby set]
57
rmsel_tag $w_list
58
- ${NS}::scrollbar $w.list.sbx -orient h -command [list $w_list xview]
59
- ${NS}::scrollbar $w.list.sby -orient v -command [list $w_list yview]
58
+ ttk::scrollbar $w.list.sbx -orient h -command [list $w_list xview]
59
+ ttk::scrollbar $w.list.sby -orient v -command [list $w_list yview]
60
pack $w.list.sbx -side bottom -fill x
61
pack $w.list.sby -side right -fill y
62
pack $w_list -side left -fill both -expand 1
63
pack $w.list -side top -fill both -expand 1
64
65
- ${NS}::label $w.status \
65
+ ttk::label $w.status \
66
-textvariable @browser_status \
67
-anchor w \
68
-justify left
@@ -269,7 +269,7 @@ field w ; # widget path
269
field w_rev ; # mega-widget to pick the initial revision
270
271
constructor dialog {} {
272
- global use_ttk NS
272
+ global use_ttk
273
make_dialog top w
274
wm withdraw $top
275
wm title $top [mc "%s (%s): Browse Branch Files" [appname] [reponame]]
@@ -278,18 +278,18 @@ constructor dialog {} {
278
wm transient $top .
279
}
280
281
- ${NS}::label $w.header \
281
+ ttk::label $w.header \
282
-text [mc "Browse Branch Files"] \
283
-font font_uibold \
284
-anchor center
285
pack $w.header -side top -fill x
286
287
- ${NS}::frame $w.buttons
288
- ${NS}::button $w.buttons.browse -text [mc Browse] \
287
+ ttk::frame $w.buttons
288
+ ttk::button $w.buttons.browse -text [mc Browse] \
289
-default active \
290
-command [cb _open]
291
pack $w.buttons.browse -side right
292
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
292
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
293
-command [list destroy $w]
294
pack $w.buttons.cancel -side right -padx 5
295
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
lib/choose_font.tcl
+13
-13
@@ -17,7 +17,7 @@ variable all_families [list] ; # All fonts known to Tk
17
18
constructor pick {path title a_family a_size} {
19
variable all_families
20
- global use_ttk NS
20
+ global use_ttk
21
22
set v_family $a_family
23
set v_size $a_size
@@ -33,25 +33,25 @@ constructor pick {path title a_family a_size} {
33
wm title $top "[appname] ([reponame]): $title"
34
wm geometry $top "+[winfo rootx $path]+[winfo rooty $path]"
35
36
- ${NS}::label $w.header -text $title -font font_uibold -anchor center
36
+ ttk::label $w.header -text $title -font font_uibold -anchor center
37
pack $w.header -side top -fill x
38
39
- ${NS}::frame $w.buttons
40
- ${NS}::button $w.buttons.select \
39
+ ttk::frame $w.buttons
40
+ ttk::button $w.buttons.select \
41
-text [mc Select] \
42
-default active \
43
-command [cb _select]
44
- ${NS}::button $w.buttons.cancel \
44
+ ttk::button $w.buttons.cancel \
45
-text [mc Cancel] \
46
-command [list destroy $w]
47
pack $w.buttons.select -side right
48
pack $w.buttons.cancel -side right -padx 5
49
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
50
51
- ${NS}::frame $w.inner
51
+ ttk::frame $w.inner
52
53
- ${NS}::frame $w.inner.family
54
- ${NS}::label $w.inner.family.l \
53
+ ttk::frame $w.inner.family
54
+ ttk::label $w.inner.family.l \
55
-text [mc "Font Family"] \
56
-anchor w
57
set w_family $w.inner.family.v
@@ -66,13 +66,13 @@ constructor pick {path title a_family a_size} {
66
-height 10 \
67
-yscrollcommand [list $w.inner.family.sby set]
68
rmsel_tag $w_family
69
- ${NS}::scrollbar $w.inner.family.sby -command [list $w_family yview]
69
+ ttk::scrollbar $w.inner.family.sby -command [list $w_family yview]
70
pack $w.inner.family.l -side top -fill x
71
pack $w.inner.family.sby -side right -fill y
72
pack $w_family -fill both -expand 1
73
74
- ${NS}::frame $w.inner.size
75
- ${NS}::label $w.inner.size.l \
74
+ ttk::frame $w.inner.size
75
+ ttk::label $w.inner.size.l \
76
-text [mc "Font Size"] \
77
-anchor w
78
tspinbox $w.inner.size.v \
@@ -88,8 +88,8 @@ constructor pick {path title a_family a_size} {
88
grid columnconfigure $w.inner 0 -weight 1
89
pack $w.inner -fill both -expand 1 -padx 5 -pady 5
90
91
- ${NS}::frame $w.example
92
- ${NS}::label $w.example.l \
91
+ ttk::frame $w.example
92
+ ttk::label $w.example.l \
93
-text [mc "Font Example"] \
94
-anchor w
95
set w_example $w.example.t
lib/choose_repository.tcl
+36
-38
@@ -35,7 +35,7 @@ field readtree_err ; # Error output from read-tree (if any)
35
field sorted_recent ; # recent repositories (sorted)
36
37
constructor pick {} {
38
- global M1T M1B use_ttk NS
38
+ global M1T M1B use_ttk
39
40
if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
41
set maxrecent 10
@@ -88,7 +88,7 @@ constructor pick {} {
88
89
set w_body $w.body
90
set opts $w_body.options
91
- ${NS}::frame $w_body
91
+ ttk::frame $w_body
92
text $opts \
93
-cursor $::cursor_ptr \
94
-relief flat \
@@ -158,8 +158,8 @@ constructor pick {} {
158
set lenrecent $maxrecent
159
}
160
161
- ${NS}::label $w_body.space
162
- ${NS}::label $w_body.recentlabel \
161
+ ttk::label $w_body.space
162
+ ttk::label $w_body.recentlabel \
163
-anchor w \
164
-text [mc "Open Recent Repository:"]
165
set w_recentlist $w_body.recentlist
@@ -199,10 +199,10 @@ constructor pick {} {
199
}
200
pack $w_body -fill x -padx 10 -pady 10
201
202
- ${NS}::frame $w.buttons
202
+ ttk::frame $w.buttons
203
set w_next $w.buttons.next
204
set w_quit $w.buttons.quit
205
- ${NS}::button $w_quit \
205
+ ttk::button $w_quit \
206
-text [mc "Quit"] \
207
-command exit
208
pack $w_quit -side right -padx 5
@@ -303,10 +303,9 @@ method _open_recent_path {p} {
303
}
304
305
method _next {action} {
306
- global NS
306
destroy $w_body
307
if {![winfo exists $w_next]} {
309
- ${NS}::button $w_next -default active
308
+ ttk::button $w_next -default active
309
set pos -before
310
if {[tk windowingsystem] eq "win32"} { set pos -after }
311
pack $w_next -side right -padx 5 $pos $w_quit
@@ -379,25 +378,25 @@ proc _objdir {path} {
378
## Create New Repository
379
380
method _do_new {} {
382
- global use_ttk NS
381
+ global use_ttk
382
$w_next conf \
383
-state disabled \
384
-command [cb _do_new2] \
385
-text [mc "Create"]
386
388
- ${NS}::frame $w_body
389
- ${NS}::label $w_body.h \
387
+ ttk::frame $w_body
388
+ ttk::label $w_body.h \
389
-font font_uibold -anchor center \
390
-text [mc "Create New Repository"]
391
pack $w_body.h -side top -fill x -pady 10
392
pack $w_body -fill x -padx 10
393
395
- ${NS}::frame $w_body.where
396
- ${NS}::label $w_body.where.l -text [mc "Directory:"]
397
- ${NS}::entry $w_body.where.t \
394
+ ttk::frame $w_body.where
395
+ ttk::label $w_body.where.l -text [mc "Directory:"]
396
+ ttk::entry $w_body.where.t \
397
-textvariable @local_path \
398
-width 50
400
- ${NS}::button $w_body.where.b \
399
+ ttk::button $w_body.where.b \
400
-text [mc "Browse"] \
401
-command [cb _new_local_path]
402
set w_localpath $w_body.where.t
@@ -463,56 +462,56 @@ proc _new_ok {p} {
462
## Clone Existing Repository
463
464
method _do_clone {} {
466
- global use_ttk NS
465
+ global use_ttk
466
$w_next conf \
467
-state disabled \
468
-command [cb _do_clone2] \
469
-text [mc "Clone"]
470
472
- ${NS}::frame $w_body
473
- ${NS}::label $w_body.h \
471
+ ttk::frame $w_body
472
+ ttk::label $w_body.h \
473
-font font_uibold -anchor center \
474
-text [mc "Clone Existing Repository"]
475
pack $w_body.h -side top -fill x -pady 10
476
pack $w_body -fill x -padx 10
477
478
set args $w_body.args
480
- ${NS}::frame $w_body.args
479
+ ttk::frame $w_body.args
480
pack $args -fill both
481
483
- ${NS}::label $args.origin_l -text [mc "Source Location:"]
484
- ${NS}::entry $args.origin_t \
482
+ ttk::label $args.origin_l -text [mc "Source Location:"]
483
+ ttk::entry $args.origin_t \
484
-textvariable @origin_url \
485
-width 50
487
- ${NS}::button $args.origin_b \
486
+ ttk::button $args.origin_b \
487
-text [mc "Browse"] \
488
-command [cb _open_origin]
489
grid $args.origin_l $args.origin_t $args.origin_b -sticky ew
490
492
- ${NS}::label $args.where_l -text [mc "Target Directory:"]
493
- ${NS}::entry $args.where_t \
491
+ ttk::label $args.where_l -text [mc "Target Directory:"]
492
+ ttk::entry $args.where_t \
493
-textvariable @local_path \
494
-width 50
496
- ${NS}::button $args.where_b \
495
+ ttk::button $args.where_b \
496
-text [mc "Browse"] \
497
-command [cb _new_local_path]
498
grid $args.where_l $args.where_t $args.where_b -sticky ew
499
set w_localpath $args.where_t
500
502
- ${NS}::label $args.type_l -text [mc "Clone Type:"]
503
- ${NS}::frame $args.type_f
501
+ ttk::label $args.type_l -text [mc "Clone Type:"]
502
+ ttk::frame $args.type_f
503
set w_types [list]
505
- lappend w_types [${NS}::radiobutton $args.type_f.hardlink \
504
+ lappend w_types [ttk::radiobutton $args.type_f.hardlink \
505
-state disabled \
506
-text [mc "Standard (Fast, Semi-Redundant, Hardlinks)"] \
507
-variable @clone_type \
508
-value hardlink]
510
- lappend w_types [${NS}::radiobutton $args.type_f.full \
509
+ lappend w_types [ttk::radiobutton $args.type_f.full \
510
-state disabled \
511
-text [mc "Full Copy (Slower, Redundant Backup)"] \
512
-variable @clone_type \
513
-value full]
515
- lappend w_types [${NS}::radiobutton $args.type_f.shared \
514
+ lappend w_types [ttk::radiobutton $args.type_f.shared \
515
-state disabled \
516
-text [mc "Shared (Fastest, Not Recommended, No Backup)"] \
517
-variable @clone_type \
@@ -520,7 +519,7 @@ method _do_clone {} {
519
foreach r $w_types {
520
pack $r -anchor w
521
}
523
- ${NS}::checkbutton $args.type_f.recursive \
522
+ ttk::checkbutton $args.type_f.recursive \
523
-text [mc "Recursively clone submodules too"] \
524
-variable @recursive \
525
-onvalue true -offvalue false
@@ -1048,25 +1047,24 @@ method _do_validate_submodule_cloning {ok} {
1047
## Open Existing Repository
1048
1049
method _do_open {} {
1051
- global NS
1050
$w_next conf \
1051
-state disabled \
1052
-command [cb _do_open2] \
1053
-text [mc "Open"]
1054
1057
- ${NS}::frame $w_body
1058
- ${NS}::label $w_body.h \
1055
+ ttk::frame $w_body
1056
+ ttk::label $w_body.h \
1057
-font font_uibold -anchor center \
1058
-text [mc "Open Existing Repository"]
1059
pack $w_body.h -side top -fill x -pady 10
1060
pack $w_body -fill x -padx 10
1061
1064
- ${NS}::frame $w_body.where
1065
- ${NS}::label $w_body.where.l -text [mc "Repository:"]
1066
- ${NS}::entry $w_body.where.t \
1062
+ ttk::frame $w_body.where
1063
+ ttk::label $w_body.where.l -text [mc "Repository:"]
1064
+ ttk::entry $w_body.where.t \
1065
-textvariable @local_path \
1066
-width 50
1069
- ${NS}::button $w_body.where.b \
1067
+ ttk::button $w_body.where.b \
1068
-text [mc "Browse"] \
1069
-command [cb _open_local_path]
1070
lib/choose_rev.tcl
+16
-17
@@ -32,7 +32,7 @@ proc new_unmerged {path {title {}}} {
32
}
33
34
constructor _new {path unmerged_only title} {
35
- global current_branch is_detached use_ttk NS
35
+ global current_branch is_detached use_ttk
36
37
if {![info exists ::all_remotes]} {
38
load_all_remotes
@@ -41,14 +41,14 @@ constructor _new {path unmerged_only title} {
41
set w $path
42
43
if {$title ne {}} {
44
- ${NS}::labelframe $w -text $title
44
+ ttk::labelframe $w -text $title
45
} else {
46
- ${NS}::frame $w
46
+ ttk::frame $w
47
}
48
bind $w <Destroy> [cb _delete %W]
49
50
if {$is_detached} {
51
- ${NS}::radiobutton $w.detachedhead_r \
51
+ ttk::radiobutton $w.detachedhead_r \
52
-text [mc "This Detached Checkout"] \
53
-value HEAD \
54
-variable @revtype
@@ -56,41 +56,41 @@ constructor _new {path unmerged_only title} {
56
grid $w.detachedhead_r -sticky we -padx {0 5} -columnspan 2
57
}
58
59
- ${NS}::radiobutton $w.expr_r \
59
+ ttk::radiobutton $w.expr_r \
60
-text [mc "Revision Expression:"] \
61
-value expr \
62
-variable @revtype
63
- ${NS}::entry $w.expr_t \
63
+ ttk::entry $w.expr_t \
64
-width 50 \
65
-textvariable @c_expr \
66
-validate key \
67
-validatecommand [cb _validate %d %S]
68
grid $w.expr_r $w.expr_t -sticky we -padx {0 5}
69
70
- ${NS}::frame $w.types
71
- ${NS}::radiobutton $w.types.head_r \
70
+ ttk::frame $w.types
71
+ ttk::radiobutton $w.types.head_r \
72
-text [mc "Local Branch"] \
73
-value head \
74
-variable @revtype
75
pack $w.types.head_r -side left
76
- ${NS}::radiobutton $w.types.trck_r \
76
+ ttk::radiobutton $w.types.trck_r \
77
-text [mc "Tracking Branch"] \
78
-value trck \
79
-variable @revtype
80
pack $w.types.trck_r -side left
81
- ${NS}::radiobutton $w.types.tag_r \
81
+ ttk::radiobutton $w.types.tag_r \
82
-text [mc "Tag"] \
83
-value tag \
84
-variable @revtype
85
pack $w.types.tag_r -side left
86
set w_filter $w.types.filter
87
- ${NS}::entry $w_filter \
87
+ ttk::entry $w_filter \
88
-width 12 \
89
-textvariable @filter \
90
-validate key \
91
-validatecommand [cb _filter %P]
92
pack $w_filter -side right
93
- pack [${NS}::label $w.types.filter_icon \
93
+ pack [ttk::label $w.types.filter_icon \
94
-image ::choose_rev::img_find \
95
] -side right
96
grid $w.types -sticky we -padx {0 5} -columnspan 2
@@ -238,9 +238,9 @@ constructor _new {path unmerged_only title} {
238
}
239
240
method none {text} {
241
- global NS use_ttk
241
+ global use_ttk
242
if {![winfo exists $w.none_r]} {
243
- ${NS}::radiobutton $w.none_r \
243
+ ttk::radiobutton $w.none_r \
244
-value none \
245
-variable @revtype
246
if {!$use_ttk} {$w.none_r configure -anchor w}
@@ -429,7 +429,6 @@ method _delete {current} {
429
}
430
431
method _sb_set {sb orient first last} {
432
- global NS
432
set old_focus [focus -lastfor $w]
433
434
if {$first == 0 && $last == 1} {
@@ -445,10 +444,10 @@ method _sb_set {sb orient first last} {
444
445
if {![winfo exists $sb]} {
446
if {$orient eq {h}} {
448
- ${NS}::scrollbar $sb -orient h -command [list $w_list xview]
447
+ ttk::scrollbar $sb -orient h -command [list $w_list xview]
448
pack $sb -fill x -side bottom -before $w_list
449
} else {
451
- ${NS}::scrollbar $sb -orient v -command [list $w_list yview]
450
+ ttk::scrollbar $sb -orient v -command [list $w_list yview]
451
pack $sb -fill y -side right -before $w_list
452
}
453
if {$old_focus ne {}} {
lib/console.tcl
+7
-8
@@ -27,20 +27,20 @@ constructor embed {path title} {
27
}
28
29
method _init {} {
30
- global M1B use_ttk NS
30
+ global M1B use_ttk
31
32
if {$is_toplevel} {
33
make_dialog top w -autodelete 0
34
wm title $top "[appname] ([reponame]): $t_short"
35
} else {
36
- ${NS}::frame $w
36
+ ttk::frame $w
37
}
38
39
set console_cr 1.0
40
set w_t $w.m.t
41
42
- ${NS}::frame $w.m
43
- ${NS}::label $w.m.l1 \
42
+ ttk::frame $w.m
43
+ ttk::label $w.m.l1 \
44
-textvariable @t_long \
45
-anchor w \
46
-justify left \
@@ -78,7 +78,7 @@ method _init {} {
78
"
79
80
if {$is_toplevel} {
81
- ${NS}::button $w.ok -text [mc "Close"] \
81
+ ttk::button $w.ok -text [mc "Close"] \
82
-state disabled \
83
-command [list destroy $w]
84
pack $w.ok -side bottom -anchor e -pady 10 -padx 10
@@ -207,14 +207,13 @@ method done {ok} {
207
}
208
209
method _sb_set {sb orient first last} {
210
- global NS
210
if {![winfo exists $sb]} {
211
if {$first == $last || ($first == 0 && $last == 1)} return
212
if {$orient eq {h}} {
214
- ${NS}::scrollbar $sb -orient h -command [list $w_t xview]
213
+ ttk::scrollbar $sb -orient h -command [list $w_t xview]
214
pack $sb -fill x -side bottom -before $w_t
215
} else {
217
- ${NS}::scrollbar $sb -orient v -command [list $w_t yview]
216
+ ttk::scrollbar $sb -orient v -command [list $w_t yview]
217
pack $sb -fill y -side right -before $w_t
218
}
219
}
lib/database.tcl
+7
-7
@@ -2,7 +2,7 @@
2
# Copyright (C) 2006, 2007 Shawn Pearce
3
4
proc do_stats {} {
5
- global use_ttk NS
5
+ global use_ttk
6
set fd [git_read [list count-objects -v]]
7
while {[gets $fd line] > 0} {
8
if {[regexp {^([^:]+): (\d+)$} $line _ name value]} {
@@ -26,18 +26,18 @@ proc do_stats {} {
26
wm withdraw $w
27
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
28
29
- ${NS}::frame $w.buttons
30
- ${NS}::button $w.buttons.close -text [mc Close] \
29
+ ttk::frame $w.buttons
30
+ ttk::button $w.buttons.close -text [mc Close] \
31
-default active \
32
-command [list destroy $w]
33
- ${NS}::button $w.buttons.gc -text [mc "Compress Database"] \
33
+ ttk::button $w.buttons.gc -text [mc "Compress Database"] \
34
-default normal \
35
-command "destroy $w;do_gc"
36
pack $w.buttons.close -side right
37
pack $w.buttons.gc -side left
38
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
39
40
- ${NS}::labelframe $w.stat -text [mc "Database Statistics"]
40
+ ttk::labelframe $w.stat -text [mc "Database Statistics"]
41
foreach s {
42
{count {mc "Number of loose objects"}}
43
{size {mc "Disk space used by loose objects"} { KiB}}
@@ -54,8 +54,8 @@ proc do_stats {} {
54
set value "$value[lindex $s 2]"
55
}
56
57
- ${NS}::label $w.stat.l_$name -text [mc "%s:" $label] -anchor w
58
- ${NS}::label $w.stat.v_$name -text $value -anchor w
57
+ ttk::label $w.stat.l_$name -text [mc "%s:" $label] -anchor w
58
+ ttk::label $w.stat.v_$name -text $value -anchor w
59
grid $w.stat.l_$name $w.stat.v_$name -sticky we -padx {0 5}
60
}
61
pack $w.stat -pady 10 -padx 10
lib/error.tcl
+6
-6
@@ -71,13 +71,13 @@ proc ask_popup {msg} {
71
}
72
73
proc hook_failed_popup {hook msg {is_fatal 1}} {
74
- global use_ttk NS
74
+ global use_ttk
75
set w .hookfail
76
Dialog $w
77
wm withdraw $w
78
79
- ${NS}::frame $w.m
80
- ${NS}::label $w.m.l1 -text [mc "%s hook failed:" $hook] \
79
+ ttk::frame $w.m
80
+ ttk::label $w.m.l1 -text [mc "%s hook failed:" $hook] \
81
-anchor w \
82
-justify left \
83
-font font_uibold
@@ -89,10 +89,10 @@ proc hook_failed_popup {hook msg {is_fatal 1}} {
89
-width 80 -height 10 \
90
-font font_diff \
91
-yscrollcommand [list $w.m.sby set]
92
- ${NS}::scrollbar $w.m.sby -command [list $w.m.t yview]
92
+ ttk::scrollbar $w.m.sby -command [list $w.m.t yview]
93
pack $w.m.l1 -side top -fill x
94
if {$is_fatal} {
95
- ${NS}::label $w.m.l2 \
95
+ ttk::label $w.m.l2 \
96
-text [mc "You must correct the above errors before committing."] \
97
-anchor w \
98
-justify left \
@@ -106,7 +106,7 @@ proc hook_failed_popup {hook msg {is_fatal 1}} {
106
$w.m.t insert 1.0 $msg
107
$w.m.t conf -state disabled
108
109
- ${NS}::button $w.ok -text OK \
109
+ ttk::button $w.ok -text OK \
110
-width 15 \
111
-command "destroy $w"
112
pack $w.ok -side bottom -anchor e -pady 10 -padx 10
lib/index.tcl
+4
-4
@@ -22,7 +22,7 @@ proc _close_updateindex {fd} {
22
}
23
24
proc rescan_on_error {err {after {}}} {
25
- global use_ttk NS
25
+ global use_ttk
26
27
set w .indexfried
28
Dialog $w
@@ -35,14 +35,14 @@ proc rescan_on_error {err {after {}}} {
35
-borderwidth 0 -highlightthickness 0 \
36
-background [get_bg_color $w]
37
$w.msg tag configure bold -font font_uibold -justify center
38
- ${NS}::scrollbar $w.vs -command [list $w.msg yview]
38
+ ttk::scrollbar $w.vs -command [list $w.msg yview]
39
$w.msg insert end $s bold \n\n$err {}
40
$w.msg configure -state disabled
41
42
- ${NS}::button $w.continue \
42
+ ttk::button $w.continue \
43
-text [mc "Continue"] \
44
-command [list destroy $w]
45
- ${NS}::button $w.unlock \
45
+ ttk::button $w.unlock \
46
-text [mc "Unlock Index"] \
47
-command "destroy $w; _delete_indexlock"
48
grid $w.msg - $w.vs -sticky news
lib/line.tcl
+4
-4
@@ -9,18 +9,18 @@ field ctext
9
field linenum {}
10
11
constructor new {i_w i_text args} {
12
- global use_ttk NS
12
+ global use_ttk
13
set w $i_w
14
set ctext $i_text
15
16
- ${NS}::frame $w
17
- ${NS}::label $w.l -text [mc "Goto Line:"]
16
+ ttk::frame $w
17
+ ttk::label $w.l -text [mc "Goto Line:"]
18
tentry $w.ent \
19
-textvariable ${__this}::linenum \
20
-background lightgreen \
21
-validate key \
22
-validatecommand [cb _validate %P]
23
- ${NS}::button $w.bn -text [mc Go] -command [cb _goto]
23
+ ttk::button $w.bn -text [mc Go] -command [cb _goto]
24
25
pack $w.l -side left
26
pack $w.bn -side right
lib/merge.tcl
+6
-6
@@ -145,7 +145,7 @@ method _finish {cons ok} {
145
146
constructor dialog {} {
147
global current_branch
148
- global M1B use_ttk NS
148
+ global M1B use_ttk
149
150
if {![_can_merge $this]} {
151
delete_this
@@ -160,21 +160,21 @@ constructor dialog {} {
160
161
set _start [cb _start]
162
163
- ${NS}::label $w.header \
163
+ ttk::label $w.header \
164
-text [mc "Merge Into %s" $current_branch] \
165
-font font_uibold
166
pack $w.header -side top -fill x
167
168
- ${NS}::frame $w.buttons
169
- ${NS}::button $w.buttons.visualize \
168
+ ttk::frame $w.buttons
169
+ ttk::button $w.buttons.visualize \
170
-text [mc Visualize] \
171
-command [cb _visualize]
172
pack $w.buttons.visualize -side left
173
- ${NS}::button $w.buttons.merge \
173
+ ttk::button $w.buttons.merge \
174
-text [mc Merge] \
175
-command $_start
176
pack $w.buttons.merge -side right
177
- ${NS}::button $w.buttons.cancel \
177
+ ttk::button $w.buttons.cancel \
178
-text [mc "Cancel"] \
179
-command [cb _cancel]
180
pack $w.buttons.cancel -side right -padx 5
lib/option.tcl
+24
-24
@@ -91,7 +91,7 @@ proc save_config {} {
91
proc do_options {} {
92
global repo_config global_config font_descs
93
global repo_config_new global_config_new
94
- global ui_comm_spell use_ttk NS
94
+ global ui_comm_spell use_ttk
95
96
array unset repo_config_new
97
array unset global_config_new
@@ -115,23 +115,23 @@ proc do_options {} {
115
wm transient $w [winfo parent $w]
116
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
117
118
- ${NS}::frame $w.buttons
119
- ${NS}::button $w.buttons.restore -text [mc "Restore Defaults"] \
118
+ ttk::frame $w.buttons
119
+ ttk::button $w.buttons.restore -text [mc "Restore Defaults"] \
120
-default normal \
121
-command do_restore_defaults
122
pack $w.buttons.restore -side left
123
- ${NS}::button $w.buttons.save -text [mc Save] \
123
+ ttk::button $w.buttons.save -text [mc Save] \
124
-default active \
125
-command [list do_save_config $w]
126
pack $w.buttons.save -side right
127
- ${NS}::button $w.buttons.cancel -text [mc "Cancel"] \
127
+ ttk::button $w.buttons.cancel -text [mc "Cancel"] \
128
-default normal \
129
-command [list destroy $w]
130
pack $w.buttons.cancel -side right -padx 5
131
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
132
133
- ${NS}::labelframe $w.repo -text [mc "%s Repository" [reponame]]
134
- ${NS}::labelframe $w.global -text [mc "Global (All Repositories)"]
133
+ ttk::labelframe $w.repo -text [mc "%s Repository" [reponame]]
134
+ ttk::labelframe $w.global -text [mc "Global (All Repositories)"]
135
pack $w.repo -side left -fill both -expand 1 -pady 5 -padx 5
136
pack $w.global -side right -fill both -expand 1 -pady 5 -padx 5
137
@@ -170,7 +170,7 @@ proc do_options {} {
170
foreach f {repo global} {
171
switch -glob -- $type {
172
b {
173
- ${NS}::checkbutton $w.$f.$optid -text $text \
173
+ ttk::checkbutton $w.$f.$optid -text $text \
174
-variable ${f}_config_new($name) \
175
-onvalue true \
176
-offvalue false
@@ -178,8 +178,8 @@ proc do_options {} {
178
}
179
i-* {
180
regexp -- {-(\d+)\.\.(\d+)$} $type _junk min max
181
- ${NS}::frame $w.$f.$optid
182
- ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
181
+ ttk::frame $w.$f.$optid
182
+ ttk::label $w.$f.$optid.l -text [mc "%s:" $text]
183
pack $w.$f.$optid.l -side left -anchor w -fill x
184
tspinbox $w.$f.$optid.v \
185
-textvariable ${f}_config_new($name) \
@@ -193,9 +193,9 @@ proc do_options {} {
193
}
194
c -
195
t {
196
- ${NS}::frame $w.$f.$optid
197
- ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
198
- ${NS}::entry $w.$f.$optid.v \
196
+ ttk::frame $w.$f.$optid
197
+ ttk::label $w.$f.$optid.l -text [mc "%s:" $text]
198
+ ttk::entry $w.$f.$optid.v \
199
-width 20 \
200
-textvariable ${f}_config_new($name)
201
pack $w.$f.$optid.l -side left -anchor w
@@ -206,7 +206,7 @@ proc do_options {} {
206
menu $w.$f.$optid.m
207
build_encoding_menu $w.$f.$optid.m \
208
[list set ${f}_config_new($name)] 1
209
- ${NS}::button $w.$f.$optid.b \
209
+ ttk::button $w.$f.$optid.b \
210
-text [mc "Change"] \
211
-command [list popup_btn_menu \
212
$w.$f.$optid.m $w.$f.$optid.b]
@@ -216,8 +216,8 @@ proc do_options {} {
216
}
217
s {
218
set opts [eval [lindex $option 3]]
219
- ${NS}::frame $w.$f.$optid
220
- ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
219
+ ttk::frame $w.$f.$optid
220
+ ttk::label $w.$f.$optid.l -text [mc "%s:" $text]
221
if {$use_ttk} {
222
ttk::combobox $w.$f.$optid.v \
223
-textvariable ${f}_config_new($name) \
@@ -250,8 +250,8 @@ proc do_options {} {
250
set ${f}_config_new(gui.spellingdictionary) $value
251
}
252
253
- ${NS}::frame $w.$f.$optid
254
- ${NS}::label $w.$f.$optid.l -text [mc "Spelling Dictionary:"]
253
+ ttk::frame $w.$f.$optid
254
+ ttk::label $w.$f.$optid.l -text [mc "Spelling Dictionary:"]
255
if {$use_ttk} {
256
ttk::combobox $w.$f.$optid.v \
257
-textvariable ${f}_config_new(gui.spellingdictionary) \
@@ -278,9 +278,9 @@ proc do_options {} {
278
set global_config_new(gui.$font^^size) \
279
[font configure $font -size]
280
281
- ${NS}::frame $w.global.$name
282
- ${NS}::label $w.global.$name.l -text [mc "%s:" $text]
283
- ${NS}::button $w.global.$name.b \
281
+ ttk::frame $w.global.$name
282
+ ttk::label $w.global.$name.l -text [mc "%s:" $text]
283
+ ttk::button $w.global.$name.b \
284
-text [mc "Change Font"] \
285
-command [list \
286
tchoosefont \
@@ -289,9 +289,9 @@ proc do_options {} {
289
global_config_new(gui.$font^^family) \
290
global_config_new(gui.$font^^size) \
291
]
292
- ${NS}::label $w.global.$name.f -textvariable global_config_new(gui.$font^^family)
293
- ${NS}::label $w.global.$name.s -textvariable global_config_new(gui.$font^^size)
294
- ${NS}::label $w.global.$name.pt -text [mc "pt."]
292
+ ttk::label $w.global.$name.f -textvariable global_config_new(gui.$font^^family)
293
+ ttk::label $w.global.$name.s -textvariable global_config_new(gui.$font^^size)
294
+ ttk::label $w.global.$name.pt -text [mc "pt."]
295
pack $w.global.$name.l -side left -anchor w
296
pack $w.global.$name.b -side right -anchor e
297
pack $w.global.$name.pt -side right -anchor w
lib/remote_add.tcl
+14
-14
@@ -13,7 +13,7 @@ field location {}; # location of the remote the user has chosen
13
field opt_action fetch; # action to do after registering the remote locally
14
15
constructor dialog {} {
16
- global repo_config use_ttk NS
16
+ global repo_config use_ttk
17
18
make_dialog top w
19
wm withdraw $top
@@ -22,34 +22,34 @@ constructor dialog {} {
22
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
23
}
24
25
- ${NS}::label $w.header -text [mc "Add New Remote"] \
25
+ ttk::label $w.header -text [mc "Add New Remote"] \
26
-font font_uibold -anchor center
27
pack $w.header -side top -fill x
28
29
- ${NS}::frame $w.buttons
30
- ${NS}::button $w.buttons.create -text [mc Add] \
29
+ ttk::frame $w.buttons
30
+ ttk::button $w.buttons.create -text [mc Add] \
31
-default active \
32
-command [cb _add]
33
pack $w.buttons.create -side right
34
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
34
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
35
-command [list destroy $w]
36
pack $w.buttons.cancel -side right -padx 5
37
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
38
39
- ${NS}::labelframe $w.desc -text [mc "Remote Details"]
39
+ ttk::labelframe $w.desc -text [mc "Remote Details"]
40
41
- ${NS}::label $w.desc.name_l -text [mc "Name:"]
41
+ ttk::label $w.desc.name_l -text [mc "Name:"]
42
set w_name $w.desc.name_t
43
- ${NS}::entry $w_name \
43
+ ttk::entry $w_name \
44
-width 40 \
45
-textvariable @name \
46
-validate key \
47
-validatecommand [cb _validate_name %d %S]
48
grid $w.desc.name_l $w_name -sticky we -padx {0 5}
49
50
- ${NS}::label $w.desc.loc_l -text [mc "Location:"]
50
+ ttk::label $w.desc.loc_l -text [mc "Location:"]
51
set w_loc $w.desc.loc_t
52
- ${NS}::entry $w_loc \
52
+ ttk::entry $w_loc \
53
-width 40 \
54
-textvariable @location
55
grid $w.desc.loc_l $w_loc -sticky we -padx {0 5}
@@ -57,21 +57,21 @@ constructor dialog {} {
57
grid columnconfigure $w.desc 1 -weight 1
58
pack $w.desc -anchor nw -fill x -pady 5 -padx 5
59
60
- ${NS}::labelframe $w.action -text [mc "Further Action"]
60
+ ttk::labelframe $w.action -text [mc "Further Action"]
61
62
- ${NS}::radiobutton $w.action.fetch \
62
+ ttk::radiobutton $w.action.fetch \
63
-text [mc "Fetch Immediately"] \
64
-value fetch \
65
-variable @opt_action
66
pack $w.action.fetch -anchor nw
67
68
- ${NS}::radiobutton $w.action.push \
68
+ ttk::radiobutton $w.action.push \
69
-text [mc "Initialize Remote Repository and Push"] \
70
-value push \
71
-variable @opt_action
72
pack $w.action.push -anchor nw
73
74
- ${NS}::radiobutton $w.action.none \
74
+ ttk::radiobutton $w.action.none \
75
-text [mc "Do Nothing Else Now"] \
76
-value none \
77
-variable @opt_action
lib/remote_branch_delete.tcl
+16
-16
@@ -23,7 +23,7 @@ field full_cache
23
field cached
24
25
constructor dialog {} {
26
- global all_remotes M1B use_ttk NS
26
+ global all_remotes M1B use_ttk
27
28
make_dialog top w
29
wm title $top [mc "%s (%s): Delete Branch Remotely" [appname] [reponame]]
@@ -31,23 +31,23 @@ constructor dialog {} {
31
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
32
}
33
34
- ${NS}::label $w.header -text [mc "Delete Branch Remotely"] \
34
+ ttk::label $w.header -text [mc "Delete Branch Remotely"] \
35
-font font_uibold -anchor center
36
pack $w.header -side top -fill x
37
38
- ${NS}::frame $w.buttons
39
- ${NS}::button $w.buttons.delete -text [mc Delete] \
38
+ ttk::frame $w.buttons
39
+ ttk::button $w.buttons.delete -text [mc Delete] \
40
-default active \
41
-command [cb _delete]
42
pack $w.buttons.delete -side right
43
- ${NS}::button $w.buttons.cancel -text [mc "Cancel"] \
43
+ ttk::button $w.buttons.cancel -text [mc "Cancel"] \
44
-command [list destroy $w]
45
pack $w.buttons.cancel -side right -padx 5
46
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
47
48
- ${NS}::labelframe $w.dest -text [mc "From Repository"]
48
+ ttk::labelframe $w.dest -text [mc "From Repository"]
49
if {$all_remotes ne {}} {
50
- ${NS}::radiobutton $w.dest.remote_r \
50
+ ttk::radiobutton $w.dest.remote_r \
51
-text [mc "Remote:"] \
52
-value remote \
53
-variable @urltype
@@ -68,11 +68,11 @@ constructor dialog {} {
68
} else {
69
set urltype url
70
}
71
- ${NS}::radiobutton $w.dest.url_r \
71
+ ttk::radiobutton $w.dest.url_r \
72
-text [mc "Arbitrary Location:"] \
73
-value url \
74
-variable @urltype
75
- ${NS}::entry $w.dest.url_t \
75
+ ttk::entry $w.dest.url_t \
76
-width 50 \
77
-textvariable @url \
78
-validate key \
@@ -85,19 +85,19 @@ constructor dialog {} {
85
grid columnconfigure $w.dest 1 -weight 1
86
pack $w.dest -anchor nw -fill x -pady 5 -padx 5
87
88
- ${NS}::labelframe $w.heads -text [mc "Branches"]
88
+ ttk::labelframe $w.heads -text [mc "Branches"]
89
slistbox $w.heads.l \
90
-height 10 \
91
-width 70 \
92
-listvariable @head_list \
93
-selectmode extended
94
95
- ${NS}::frame $w.heads.footer
96
- ${NS}::label $w.heads.footer.status \
95
+ ttk::frame $w.heads.footer
96
+ ttk::label $w.heads.footer.status \
97
-textvariable @status \
98
-anchor w \
99
-justify left
100
- ${NS}::button $w.heads.footer.rescan \
100
+ ttk::button $w.heads.footer.rescan \
101
-text [mc "Rescan"] \
102
-command [cb _rescan]
103
pack $w.heads.footer.status -side left -fill x
@@ -107,8 +107,8 @@ constructor dialog {} {
107
pack $w.heads.l -side left -fill both -expand 1
108
pack $w.heads -fill both -expand 1 -pady 5 -padx 5
109
110
- ${NS}::labelframe $w.validate -text [mc "Delete Only If"]
111
- ${NS}::radiobutton $w.validate.head_r \
110
+ ttk::labelframe $w.validate -text [mc "Delete Only If"]
111
+ ttk::radiobutton $w.validate.head_r \
112
-text [mc "Merged Into:"] \
113
-value head \
114
-variable @checktype
@@ -116,7 +116,7 @@ constructor dialog {} {
116
trace add variable @head_list write [cb _write_head_list]
117
trace add variable @check_head write [cb _write_check_head]
118
grid $w.validate.head_r $w.validate.head_m -sticky w
119
- ${NS}::radiobutton $w.validate.always_r \
119
+ ttk::radiobutton $w.validate.always_r \
120
-text [mc "Always (Do not perform merge checks)"] \
121
-value always \
122
-variable @checktype
lib/search.tcl
+7
-7
@@ -21,7 +21,7 @@ field smarktop
21
field smarkbot
22
23
constructor new {i_w i_text args} {
24
- global use_ttk NS
24
+ global use_ttk
25
set w $i_w
26
set ctext $i_text
27
@@ -44,14 +44,14 @@ constructor new {i_w i_text args} {
44
45
set history [list]
46
47
- ${NS}::frame $w
48
- ${NS}::label $w.l -text [mc Find:]
47
+ ttk::frame $w
48
+ ttk::label $w.l -text [mc Find:]
49
tentry $w.ent -textvariable ${__this}::searchstring -background lightgreen
50
- ${NS}::button $w.bn -text [mc Next] -command [cb find_next]
51
- ${NS}::button $w.bp -text [mc Prev] -command [cb find_prev]
52
- ${NS}::checkbutton $w.re -text [mc RegExp] \
50
+ ttk::button $w.bn -text [mc Next] -command [cb find_next]
51
+ ttk::button $w.bp -text [mc Prev] -command [cb find_prev]
52
+ ttk::checkbutton $w.re -text [mc RegExp] \
53
-variable ${__this}::regexpsearch -command [cb _incrsearch]
54
- ${NS}::checkbutton $w.cs -text [mc Case] \
54
+ ttk::checkbutton $w.cs -text [mc Case] \
55
-variable ${__this}::casesensitive -command [cb _incrsearch]
56
pack $w.l -side left
57
pack $w.cs -side right
lib/sshkey.tcl
+7
-7
@@ -18,7 +18,7 @@ proc find_ssh_key {} {
18
}
19
20
proc do_ssh_key {} {
21
- global sshkey_title sshkey_fd use_ttk NS
21
+ global sshkey_title sshkey_fd use_ttk
22
23
set w .sshkey_dialog
24
if {[winfo exists $w]} {
@@ -38,9 +38,9 @@ proc do_ssh_key {} {
38
set gen_state disabled
39
}
40
41
- ${NS}::frame $w.header
42
- ${NS}::label $w.header.lbl -textvariable sshkey_title -anchor w
43
- ${NS}::button $w.header.gen -text [mc "Generate Key"] \
41
+ ttk::frame $w.header
42
+ ttk::label $w.header.lbl -textvariable sshkey_title -anchor w
43
+ ttk::button $w.header.gen -text [mc "Generate Key"] \
44
-command [list make_ssh_key $w] -state $gen_state
45
pack $w.header.lbl -side left -expand 1 -fill x
46
pack $w.header.gen -side right
@@ -52,11 +52,11 @@ proc do_ssh_key {} {
52
if {$use_ttk} { set clr [ttk::style lookup . -selectbackground] }
53
$w.contents configure -inactiveselectbackground $clr
54
55
- ${NS}::frame $w.buttons
56
- ${NS}::button $w.buttons.close -text [mc Close] \
55
+ ttk::frame $w.buttons
56
+ ttk::button $w.buttons.close -text [mc Close] \
57
-default active -command [list destroy $w]
58
pack $w.buttons.close -side right
59
- ${NS}::button $w.buttons.copy -text [mc "Copy To Clipboard"] \
59
+ ttk::button $w.buttons.copy -text [mc "Copy To Clipboard"] \
60
-command [list tk_textCopy $w.contents]
61
pack $w.buttons.copy -side left
62
pack $w.buttons -side bottom -fill x -pady 5 -padx 5
lib/status_bar.tcl
+5
-6
@@ -39,7 +39,7 @@ field operations ; # list of current ongoing operations
39
field completed_operation_count
40
41
constructor new {path} {
42
- global use_ttk NS
42
+ global use_ttk
43
set w $path
44
set w_l $w.l
45
set w_c $w.c
@@ -51,11 +51,11 @@ constructor new {path} {
51
set operations [list]
52
set completed_operation_count 0
53
54
- ${NS}::frame $w
54
+ ttk::frame $w
55
if {!$use_ttk} {
56
$w configure -borderwidth 1 -relief sunken
57
}
58
- ${NS}::label $w_l \
58
+ ttk::label $w_l \
59
-textvariable @status_bar_text \
60
-anchor w \
61
-justify left
@@ -72,7 +72,6 @@ method _oneline_pack {} {
72
}
73
74
constructor two_line {path} {
75
- global NS
75
set w $path
76
set w_l $w.l
77
set w_c $w.c
@@ -84,8 +83,8 @@ constructor two_line {path} {
83
set operations [list]
84
set completed_operation_count 0
85
87
- ${NS}::frame $w
88
- ${NS}::label $w_l \
86
+ ttk::frame $w
87
+ ttk::label $w_l \
88
-textvariable @status_bar_text \
89
-anchor w \
90
-justify left
lib/themed.tcl
+2
-2
@@ -254,7 +254,7 @@ proc pave_toplevel {w} {
254
# On many themes the border for a scrolled listbox needs to go around the
255
# listbox and the scrollbar.
256
proc slistbox {w args} {
257
- global use_ttk NS
257
+ global use_ttk
258
if {$use_ttk} {
259
set f [ttk::frame $w -style SListbox.TFrame -padding 2]
260
} else {
@@ -267,7 +267,7 @@ proc slistbox {w args} {
267
} else {
268
eval [linsert $args 0 listbox $f.list]
269
}
270
- ${NS}::scrollbar $f.vs -command [list $f.list yview]
270
+ ttk::scrollbar $f.vs -command [list $f.list yview]
271
$f.list configure -yscrollcommand [list $f.vs set]
272
grid $f.list $f.vs -sticky news
273
grid rowconfigure $f 0 -weight 1
lib/tools_dlg.tcl
+33
-33
@@ -16,7 +16,7 @@ field ask_branch 0; # ask for a revision
16
field ask_args 0; # ask for additional args
17
18
constructor dialog {} {
19
- global repo_config use_ttk NS
19
+ global repo_config use_ttk
20
21
make_dialog top w
22
wm title $top [mc "%s (%s): Add Tool" [appname] [reponame]]
@@ -25,41 +25,41 @@ constructor dialog {} {
25
wm transient $top .
26
}
27
28
- ${NS}::label $w.header -text [mc "Add New Tool Command"] \
28
+ ttk::label $w.header -text [mc "Add New Tool Command"] \
29
-font font_uibold -anchor center
30
pack $w.header -side top -fill x
31
32
- ${NS}::frame $w.buttons
33
- ${NS}::checkbutton $w.buttons.global \
32
+ ttk::frame $w.buttons
33
+ ttk::checkbutton $w.buttons.global \
34
-text [mc "Add globally"] \
35
-variable @add_global
36
pack $w.buttons.global -side left -padx 5
37
- ${NS}::button $w.buttons.create -text [mc Add] \
37
+ ttk::button $w.buttons.create -text [mc Add] \
38
-default active \
39
-command [cb _add]
40
pack $w.buttons.create -side right
41
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
41
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
42
-command [list destroy $w]
43
pack $w.buttons.cancel -side right -padx 5
44
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
45
46
- ${NS}::labelframe $w.desc -text [mc "Tool Details"]
46
+ ttk::labelframe $w.desc -text [mc "Tool Details"]
47
48
- ${NS}::label $w.desc.name_cmnt -anchor w\
48
+ ttk::label $w.desc.name_cmnt -anchor w\
49
-text [mc "Use '/' separators to create a submenu tree:"]
50
grid x $w.desc.name_cmnt -sticky we -padx {0 5} -pady {0 2}
51
- ${NS}::label $w.desc.name_l -text [mc "Name:"]
51
+ ttk::label $w.desc.name_l -text [mc "Name:"]
52
set w_name $w.desc.name_t
53
- ${NS}::entry $w_name \
53
+ ttk::entry $w_name \
54
-width 40 \
55
-textvariable @name \
56
-validate key \
57
-validatecommand [cb _validate_name %d %S]
58
grid $w.desc.name_l $w_name -sticky we -padx {0 5}
59
60
- ${NS}::label $w.desc.cmd_l -text [mc "Command:"]
60
+ ttk::label $w.desc.cmd_l -text [mc "Command:"]
61
set w_cmd $w.desc.cmd_t
62
- ${NS}::entry $w_cmd \
62
+ ttk::entry $w_cmd \
63
-width 40 \
64
-textvariable @command
65
grid $w.desc.cmd_l $w_cmd -sticky we -padx {0 5} -pady {0 3}
@@ -67,30 +67,30 @@ constructor dialog {} {
67
grid columnconfigure $w.desc 1 -weight 1
68
pack $w.desc -anchor nw -fill x -pady 5 -padx 5
69
70
- ${NS}::checkbutton $w.confirm \
70
+ ttk::checkbutton $w.confirm \
71
-text [mc "Show a dialog before running"] \
72
-variable @confirm -command [cb _check_enable_dlg]
73
74
- ${NS}::labelframe $w.dlg -labelwidget $w.confirm
74
+ ttk::labelframe $w.dlg -labelwidget $w.confirm
75
76
- ${NS}::checkbutton $w.dlg.askbranch \
76
+ ttk::checkbutton $w.dlg.askbranch \
77
-text [mc "Ask the user to select a revision (sets \$REVISION)"] \
78
-variable @ask_branch -state disabled
79
pack $w.dlg.askbranch -anchor w -padx 15
80
81
- ${NS}::checkbutton $w.dlg.askargs \
81
+ ttk::checkbutton $w.dlg.askargs \
82
-text [mc "Ask the user for additional arguments (sets \$ARGS)"] \
83
-variable @ask_args -state disabled
84
pack $w.dlg.askargs -anchor w -padx 15
85
86
pack $w.dlg -anchor nw -fill x -pady {0 8} -padx 5
87
88
- ${NS}::checkbutton $w.noconsole \
88
+ ttk::checkbutton $w.noconsole \
89
-text [mc "Don't show the command output window"] \
90
-variable @no_console
91
pack $w.noconsole -anchor w -padx 5
92
93
- ${NS}::checkbutton $w.needsfile \
93
+ ttk::checkbutton $w.needsfile \
94
-text [mc "Run only if a diff is selected (\$FILENAME not empty)"] \
95
-variable @needs_file
96
pack $w.needsfile -anchor w -padx 5
@@ -179,7 +179,7 @@ field w ; # widget path
179
field w_names ; # name list
180
181
constructor dialog {} {
182
- global repo_config global_config system_config use_ttk NS
182
+ global repo_config global_config system_config use_ttk
183
184
load_config 1
185
@@ -190,21 +190,21 @@ constructor dialog {} {
190
wm transient $top .
191
}
192
193
- ${NS}::label $w.header -text [mc "Remove Tool Commands"] \
193
+ ttk::label $w.header -text [mc "Remove Tool Commands"] \
194
-font font_uibold -anchor center
195
pack $w.header -side top -fill x
196
197
- ${NS}::frame $w.buttons
198
- ${NS}::button $w.buttons.create -text [mc Remove] \
197
+ ttk::frame $w.buttons
198
+ ttk::button $w.buttons.create -text [mc Remove] \
199
-default active \
200
-command [cb _remove]
201
pack $w.buttons.create -side right
202
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
202
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
203
-command [list destroy $w]
204
pack $w.buttons.cancel -side right -padx 5
205
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
206
207
- ${NS}::frame $w.list
207
+ ttk::frame $w.list
208
set w_names $w.list.l
209
slistbox $w_names \
210
-height 10 \
@@ -227,7 +227,7 @@ constructor dialog {} {
227
}
228
229
if {$local_cnt > 0} {
230
- ${NS}::label $w.colorlbl -foreground blue \
230
+ ttk::label $w.colorlbl -foreground blue \
231
-text [mc "(Blue denotes repository-local tools)"]
232
pack $w.colorlbl -fill x -pady 5 -padx 5
233
}
@@ -272,7 +272,7 @@ field is_ok 0; # ok to start
272
field argstr {}; # arguments
273
274
constructor dialog {fullname} {
275
- global M1B use_ttk NS
275
+ global M1B use_ttk
276
277
set title [get_config "guitool.$fullname.title"]
278
if {$title eq {}} {
@@ -292,7 +292,7 @@ constructor dialog {fullname} {
292
set prompt [mc "Run Command: %s" $command]
293
}
294
295
- ${NS}::label $w.header -text $prompt -font font_uibold -anchor center
295
+ ttk::label $w.header -text $prompt -font font_uibold -anchor center
296
pack $w.header -side top -fill x
297
298
set argprompt [get_config "guitool.$fullname.argprompt"]
@@ -306,10 +306,10 @@ constructor dialog {fullname} {
306
set argprompt [mc "Arguments"]
307
}
308
309
- ${NS}::labelframe $w.arg -text $argprompt
309
+ ttk::labelframe $w.arg -text $argprompt
310
311
set w_args $w.arg.txt
312
- ${NS}::entry $w_args \
312
+ ttk::entry $w_args \
313
-width 40 \
314
-textvariable @argstr
315
pack $w_args -padx 5 -pady 5 -fill both
@@ -330,18 +330,18 @@ constructor dialog {fullname} {
330
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
331
}
332
333
- ${NS}::frame $w.buttons
333
+ ttk::frame $w.buttons
334
if {$is_ask_revs} {
335
- ${NS}::button $w.buttons.visualize \
335
+ ttk::button $w.buttons.visualize \
336
-text [mc Visualize] \
337
-command [cb _visualize]
338
pack $w.buttons.visualize -side left
339
}
340
- ${NS}::button $w.buttons.ok \
340
+ ttk::button $w.buttons.ok \
341
-text [mc OK] \
342
-command [cb _start]
343
pack $w.buttons.ok -side right
344
- ${NS}::button $w.buttons.cancel \
344
+ ttk::button $w.buttons.cancel \
345
-text [mc "Cancel"] \
346
-command [cb _cancel]
347
pack $w.buttons.cancel -side right -padx 5
lib/transport.tcl
+14
-14
@@ -120,7 +120,7 @@ trace add variable push_remote write \
120
proc do_push_anywhere {} {
121
global all_remotes current_branch
122
global push_urltype push_remote push_url push_thin push_tags
123
- global push_force use_ttk NS
123
+ global push_force use_ttk
124
125
set w .push_setup
126
toplevel $w
@@ -129,22 +129,22 @@ proc do_push_anywhere {} {
129
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
130
pave_toplevel $w
131
132
- ${NS}::label $w.header -text [mc "Push Branches"] \
132
+ ttk::label $w.header -text [mc "Push Branches"] \
133
-font font_uibold -anchor center
134
pack $w.header -side top -fill x
135
136
- ${NS}::frame $w.buttons
137
- ${NS}::button $w.buttons.create -text [mc Push] \
136
+ ttk::frame $w.buttons
137
+ ttk::button $w.buttons.create -text [mc Push] \
138
-default active \
139
-command [list start_push_anywhere_action $w]
140
pack $w.buttons.create -side right
141
- ${NS}::button $w.buttons.cancel -text [mc "Cancel"] \
141
+ ttk::button $w.buttons.cancel -text [mc "Cancel"] \
142
-default normal \
143
-command [list destroy $w]
144
pack $w.buttons.cancel -side right -padx 5
145
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
146
147
- ${NS}::labelframe $w.source -text [mc "Source Branches"]
147
+ ttk::labelframe $w.source -text [mc "Source Branches"]
148
slistbox $w.source.l \
149
-height 10 \
150
-width 70 \
@@ -159,9 +159,9 @@ proc do_push_anywhere {} {
159
pack $w.source.l -side left -fill both -expand 1
160
pack $w.source -fill both -expand 1 -pady 5 -padx 5
161
162
- ${NS}::labelframe $w.dest -text [mc "Destination Repository"]
162
+ ttk::labelframe $w.dest -text [mc "Destination Repository"]
163
if {$all_remotes ne {}} {
164
- ${NS}::radiobutton $w.dest.remote_r \
164
+ ttk::radiobutton $w.dest.remote_r \
165
-text [mc "Remote:"] \
166
-value remote \
167
-variable push_urltype
@@ -183,11 +183,11 @@ proc do_push_anywhere {} {
183
} else {
184
set push_urltype url
185
}
186
- ${NS}::radiobutton $w.dest.url_r \
186
+ ttk::radiobutton $w.dest.url_r \
187
-text [mc "Arbitrary Location:"] \
188
-value url \
189
-variable push_urltype
190
- ${NS}::entry $w.dest.url_t \
190
+ ttk::entry $w.dest.url_t \
191
-width 50 \
192
-textvariable push_url \
193
-validate key \
@@ -202,16 +202,16 @@ proc do_push_anywhere {} {
202
grid columnconfigure $w.dest 1 -weight 1
203
pack $w.dest -anchor nw -fill x -pady 5 -padx 5
204
205
- ${NS}::labelframe $w.options -text [mc "Transfer Options"]
206
- ${NS}::checkbutton $w.options.force \
205
+ ttk::labelframe $w.options -text [mc "Transfer Options"]
206
+ ttk::checkbutton $w.options.force \
207
-text [mc "Force overwrite existing branch (may discard changes)"] \
208
-variable push_force
209
grid $w.options.force -columnspan 2 -sticky w
210
- ${NS}::checkbutton $w.options.thin \
210
+ ttk::checkbutton $w.options.thin \
211
-text [mc "Use thin pack (for slow network connections)"] \
212
-variable push_thin
213
grid $w.options.thin -columnspan 2 -sticky w
214
- ${NS}::checkbutton $w.options.tags \
214
+ ttk::checkbutton $w.options.tags \
215
-text [mc "Include tags"] \
216
-variable push_tags
217
grid $w.options.tags -columnspan 2 -sticky w