# -- Branch Control
#
-${NS}::frame .branch
+ttk::frame .branch
if {!$use_ttk} {.branch configure -borderwidth 1 -relief sunken}
-${NS}::label .branch.l1 \
+ttk::label .branch.l1 \
-text [mc "Current Branch:"] \
-anchor w \
-justify left
-${NS}::label .branch.cb \
+ttk::label .branch.cb \
-textvariable current_branch \
-anchor w \
-justify left
# -- Main Window Layout
#
-${NS}::panedwindow .vpane -orient horizontal
-${NS}::panedwindow .vpane.files -orient vertical
+ttk::panedwindow .vpane -orient horizontal
+ttk::panedwindow .vpane.files -orient vertical
if {$use_ttk} {
.vpane add .vpane.files
} else {
-xscrollcommand {.vpane.files.workdir.sx set} \
-yscrollcommand {.vpane.files.workdir.sy set} \
-state disabled
-${NS}::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
-${NS}::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
+ttk::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
+ttk::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
pack .vpane.files.workdir.title -side top -fill x
pack .vpane.files.workdir.sx -side bottom -fill x
pack .vpane.files.workdir.sy -side right -fill y
-xscrollcommand {.vpane.files.index.sx set} \
-yscrollcommand {.vpane.files.index.sy set} \
-state disabled
-${NS}::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
-${NS}::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
+ttk::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
+ttk::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
pack .vpane.files.index.title -side top -fill x
pack .vpane.files.index.sx -side bottom -fill x
pack .vpane.files.index.sy -side right -fill y
# -- Diff and Commit Area
#
-${NS}::panedwindow .vpane.lower -orient vertical
-${NS}::frame .vpane.lower.commarea
-${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
+ttk::panedwindow .vpane.lower -orient vertical
+ttk::frame .vpane.lower.commarea
+ttk::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
.vpane.lower add .vpane.lower.diff
.vpane.lower add .vpane.lower.commarea
.vpane add .vpane.lower
# -- Commit Area Buttons
#
-${NS}::frame .vpane.lower.commarea.buttons
-${NS}::label .vpane.lower.commarea.buttons.l -text {} \
+ttk::frame .vpane.lower.commarea.buttons
+ttk::label .vpane.lower.commarea.buttons.l -text {} \
-anchor w \
-justify left
pack .vpane.lower.commarea.buttons.l -side top -fill x
pack .vpane.lower.commarea.buttons -side left -fill y
-${NS}::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
+ttk::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
-command ui_do_rescan
pack .vpane.lower.commarea.buttons.rescan -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.rescan conf -state}
-${NS}::button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
+ttk::button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
-command do_add_all
pack .vpane.lower.commarea.buttons.incall -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.incall conf -state}
if {![is_enabled nocommitmsg]} {
- ${NS}::button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
+ ttk::button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
-command do_signoff
pack .vpane.lower.commarea.buttons.signoff -side top -fill x
}
-${NS}::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
+ttk::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
-command do_commit
pack .vpane.lower.commarea.buttons.commit -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.commit conf -state}
if {![is_enabled nocommit]} {
- ${NS}::button .vpane.lower.commarea.buttons.push -text [mc Push] \
+ ttk::button .vpane.lower.commarea.buttons.push -text [mc Push] \
-command do_push_anywhere
pack .vpane.lower.commarea.buttons.push -side top -fill x
}
# -- Commit Message Buffer
#
-${NS}::frame .vpane.lower.commarea.buffer
-${NS}::frame .vpane.lower.commarea.buffer.header
+ttk::frame .vpane.lower.commarea.buffer
+ttk::frame .vpane.lower.commarea.buffer.header
set ui_comm .vpane.lower.commarea.buffer.frame.t
set ui_coml .vpane.lower.commarea.buffer.header.l
if {![is_enabled nocommit]} {
- ${NS}::checkbutton .vpane.lower.commarea.buffer.header.amend \
+ ttk::checkbutton .vpane.lower.commarea.buffer.header.amend \
-text [mc "Amend Last Commit"] \
-variable commit_type_is_amend \
-command do_select_commit_type
[list .vpane.lower.commarea.buffer.header.amend conf -state]
}
-${NS}::label $ui_coml \
+ttk::label $ui_coml \
-anchor w \
-justify left
proc trace_commit_type {varname args} {
-font font_diff \
-xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
-yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
-${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
+ttk::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
-orient horizontal \
-command [list $ui_comm xview]
-${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
+ttk::scrollbar .vpane.lower.commarea.buffer.frame.sby \
-orient vertical \
-command [list $ui_comm yview]
-yscrollcommand {.vpane.lower.diff.body.sby set} \
-state disabled
catch {$ui_diff configure -tabstyle wordprocessor}
-${NS}::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
+ttk::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
-command [list $ui_diff xview]
-${NS}::scrollbar .vpane.lower.diff.body.sby -orient vertical \
+ttk::scrollbar .vpane.lower.diff.body.sby -orient vertical \
-command [list $ui_diff yview]
pack .vpane.lower.diff.body.sbx -side bottom -fill x
pack .vpane.lower.diff.body.sby -side right -fill y
proc do_about {} {
global appvers copyright oguilib
global tcl_patchLevel tk_patchLevel
- global ui_comm_spell NS use_ttk
+ global ui_comm_spell use_ttk
set w .about_dialog
Dialog $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
- ${NS}::label $w.header -text [mc "About %s" [appname]] \
+ ttk::label $w.header -text [mc "About %s" [appname]] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.close -text {Close} \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.close -text {Close} \
-default active \
-command [list destroy $w]
pack $w.buttons.close -side right
field tooltip_commit {} ; # Commit(s) in tooltip
constructor new {i_commit i_path i_jump} {
- global cursor_ptr M1B M1T NS
+ global cursor_ptr M1B M1T
variable active_color
variable group_colors
set w_columns [list $w_amov $w_asim $w_line $w_file]
- ${NS}::scrollbar $w.file_pane.out.sbx \
+ ttk::scrollbar $w.file_pane.out.sbx \
-orient h \
-command [list $w_file xview]
- ${NS}::scrollbar $w.file_pane.out.sby \
+ ttk::scrollbar $w.file_pane.out.sby \
-orient v \
-command [list scrollbar2many $w_columns yview]
eval grid $w_columns $w.file_pane.out.sby -sticky nsew
-background $active_color \
-font font_ui
$w_cviewer tag raise sel
- ${NS}::scrollbar $w.file_pane.cm.sbx \
+ ttk::scrollbar $w.file_pane.cm.sbx \
-orient h \
-command [list $w_cviewer xview]
- ${NS}::scrollbar $w.file_pane.cm.sby \
+ ttk::scrollbar $w.file_pane.cm.sby \
-orient v \
-command [list $w_cviewer yview]
pack $w.file_pane.cm.sby -side right -fill y
field opt_detach 0; # force a detached head case?
constructor dialog {} {
- global use_ttk NS
+ global use_ttk
make_dialog top w
wm withdraw $w
wm title $top [mc "%s (%s): Checkout Branch" [appname] [reponame]]
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- ${NS}::label $w.header -text [mc "Checkout Branch"] \
+ ttk::label $w.header -text [mc "Checkout Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.create -text [mc Checkout] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.create -text [mc Checkout] \
-default active \
-command [cb _checkout]
pack $w.buttons.create -side right
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
$w_rev bind_listbox <Double-Button-1> [cb _checkout]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
- ${NS}::labelframe $w.options -text [mc Options]
+ ttk::labelframe $w.options -text [mc Options]
- ${NS}::checkbutton $w.options.fetch \
+ ttk::checkbutton $w.options.fetch \
-text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw
- ${NS}::checkbutton $w.options.detach \
+ ttk::checkbutton $w.options.detach \
-text [mc "Detach From Local Branch"] \
-variable @opt_detach
pack $w.options.detach -anchor nw
field reset_ok 0; # did the user agree to reset?
constructor dialog {} {
- global repo_config use_ttk NS
+ global repo_config use_ttk
make_dialog top w
wm withdraw $w
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- ${NS}::label $w.header -text [mc "Create New Branch"] \
+ ttk::label $w.header -text [mc "Create New Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.create -text [mc Create] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.create -text [mc Create] \
-default active \
-command [cb _create]
pack $w.buttons.create -side right
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::labelframe $w.desc -text [mc "Branch Name"]
- ${NS}::radiobutton $w.desc.name_r \
+ ttk::labelframe $w.desc -text [mc "Branch Name"]
+ ttk::radiobutton $w.desc.name_r \
-text [mc "Name:"] \
-value user \
-variable @name_type
if {!$use_ttk} {$w.desc.name_r configure -anchor w}
set w_name $w.desc.name_t
- ${NS}::entry $w_name \
+ ttk::entry $w_name \
-width 40 \
-textvariable @name \
-validate key \
-validatecommand [cb _validate %d %S]
grid $w.desc.name_r $w_name -sticky we -padx {0 5}
- ${NS}::radiobutton $w.desc.match_r \
+ ttk::radiobutton $w.desc.match_r \
-text [mc "Match Tracking Branch Name"] \
-value match \
-variable @name_type
set w_rev [::choose_rev::new $w.rev [mc "Starting Revision"]]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
- ${NS}::labelframe $w.options -text [mc Options]
+ ttk::labelframe $w.options -text [mc Options]
- ${NS}::frame $w.options.merge
- ${NS}::label $w.options.merge.l -text [mc "Update Existing Branch:"]
+ ttk::frame $w.options.merge
+ ttk::label $w.options.merge.l -text [mc "Update Existing Branch:"]
pack $w.options.merge.l -side left
- ${NS}::radiobutton $w.options.merge.no \
+ ttk::radiobutton $w.options.merge.no \
-text [mc No] \
-value none \
-variable @opt_merge
pack $w.options.merge.no -side left
- ${NS}::radiobutton $w.options.merge.ff \
+ ttk::radiobutton $w.options.merge.ff \
-text [mc "Fast Forward Only"] \
-value ff \
-variable @opt_merge
pack $w.options.merge.ff -side left
- ${NS}::radiobutton $w.options.merge.reset \
+ ttk::radiobutton $w.options.merge.reset \
-text [mc Reset] \
-value reset \
-variable @opt_merge
pack $w.options.merge.reset -side left
pack $w.options.merge -anchor nw
- ${NS}::checkbutton $w.options.fetch \
+ ttk::checkbutton $w.options.fetch \
-text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw
- ${NS}::checkbutton $w.options.checkout \
+ ttk::checkbutton $w.options.checkout \
-text [mc "Checkout After Creation"] \
-variable @opt_checkout
pack $w.options.checkout -anchor nw
field w_delete ; # delete button
constructor dialog {} {
- global current_branch use_ttk NS
+ global current_branch use_ttk
make_dialog top w
wm withdraw $w
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- ${NS}::label $w.header -text [mc "Delete Local Branch"] \
+ ttk::label $w.header -text [mc "Delete Local Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
+ ttk::frame $w.buttons
set w_delete $w.buttons.delete
- ${NS}::button $w_delete \
+ ttk::button $w_delete \
-text [mc Delete] \
-default active \
-state disabled \
-command [cb _delete]
pack $w_delete -side right
- ${NS}::button $w.buttons.cancel \
+ ttk::button $w.buttons.cancel \
-text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::labelframe $w.list -text [mc "Local Branches"]
+ ttk::labelframe $w.list -text [mc "Local Branches"]
set w_heads $w.list.l
slistbox $w_heads \
-height 10 \
field newname
constructor dialog {} {
- global current_branch use_ttk NS
+ global current_branch use_ttk
make_dialog top w
wm withdraw $w
set oldname $current_branch
set newname [get_config gui.newbranchtemplate]
- ${NS}::label $w.header -text [mc "Rename Branch"]\
+ ttk::label $w.header -text [mc "Rename Branch"]\
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.rename -text [mc Rename] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.rename -text [mc Rename] \
-default active \
-command [cb _rename]
pack $w.buttons.rename -side right
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::frame $w.rename
- ${NS}::label $w.rename.oldname_l -text [mc "Branch:"]
+ ttk::frame $w.rename
+ ttk::label $w.rename.oldname_l -text [mc "Branch:"]
if {$use_ttk} {
ttk::combobox $w.rename.oldname_m -textvariable @oldname \
-values [load_all_heads] -state readonly
eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]
}
- ${NS}::label $w.rename.newname_l -text [mc "New Name:"]
- ${NS}::entry $w.rename.newname_t \
+ ttk::label $w.rename.newname_l -text [mc "New Name:"]
+ ttk::entry $w.rename.newname_t \
-width 40 \
-textvariable @newname \
-validate key \
field ls_buf {}; # Buffered record output from ls-tree
constructor new {commit {path {}}} {
- global cursor_ptr M1B use_ttk NS
+ global cursor_ptr M1B use_ttk
make_dialog top w
wm withdraw $top
wm title $top [mc "%s (%s): File Browser" [appname] [reponame]]
set browser_commit $commit
set browser_path "$browser_commit:[escape_path $path]"
- ${NS}::label $w.path \
+ ttk::label $w.path \
-textvariable @browser_path \
-anchor w \
-justify left \
if {!$use_ttk} { $w.path configure -borderwidth 1 -relief sunken}
pack $w.path -anchor w -side top -fill x
- ${NS}::frame $w.list
+ ttk::frame $w.list
set w_list $w.list.l
text $w_list -background white -foreground black \
-borderwidth 0 \
-xscrollcommand [list $w.list.sbx set] \
-yscrollcommand [list $w.list.sby set]
rmsel_tag $w_list
- ${NS}::scrollbar $w.list.sbx -orient h -command [list $w_list xview]
- ${NS}::scrollbar $w.list.sby -orient v -command [list $w_list yview]
+ ttk::scrollbar $w.list.sbx -orient h -command [list $w_list xview]
+ ttk::scrollbar $w.list.sby -orient v -command [list $w_list yview]
pack $w.list.sbx -side bottom -fill x
pack $w.list.sby -side right -fill y
pack $w_list -side left -fill both -expand 1
pack $w.list -side top -fill both -expand 1
- ${NS}::label $w.status \
+ ttk::label $w.status \
-textvariable @browser_status \
-anchor w \
-justify left
field w_rev ; # mega-widget to pick the initial revision
constructor dialog {} {
- global use_ttk NS
+ global use_ttk
make_dialog top w
wm withdraw $top
wm title $top [mc "%s (%s): Browse Branch Files" [appname] [reponame]]
wm transient $top .
}
- ${NS}::label $w.header \
+ ttk::label $w.header \
-text [mc "Browse Branch Files"] \
-font font_uibold \
-anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.browse -text [mc Browse] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.browse -text [mc Browse] \
-default active \
-command [cb _open]
pack $w.buttons.browse -side right
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
constructor pick {path title a_family a_size} {
variable all_families
- global use_ttk NS
+ global use_ttk
set v_family $a_family
set v_size $a_size
wm title $top "[appname] ([reponame]): $title"
wm geometry $top "+[winfo rootx $path]+[winfo rooty $path]"
- ${NS}::label $w.header -text $title -font font_uibold -anchor center
+ ttk::label $w.header -text $title -font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.select \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.select \
-text [mc Select] \
-default active \
-command [cb _select]
- ${NS}::button $w.buttons.cancel \
+ ttk::button $w.buttons.cancel \
-text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.select -side right
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::frame $w.inner
+ ttk::frame $w.inner
- ${NS}::frame $w.inner.family
- ${NS}::label $w.inner.family.l \
+ ttk::frame $w.inner.family
+ ttk::label $w.inner.family.l \
-text [mc "Font Family"] \
-anchor w
set w_family $w.inner.family.v
-height 10 \
-yscrollcommand [list $w.inner.family.sby set]
rmsel_tag $w_family
- ${NS}::scrollbar $w.inner.family.sby -command [list $w_family yview]
+ ttk::scrollbar $w.inner.family.sby -command [list $w_family yview]
pack $w.inner.family.l -side top -fill x
pack $w.inner.family.sby -side right -fill y
pack $w_family -fill both -expand 1
- ${NS}::frame $w.inner.size
- ${NS}::label $w.inner.size.l \
+ ttk::frame $w.inner.size
+ ttk::label $w.inner.size.l \
-text [mc "Font Size"] \
-anchor w
tspinbox $w.inner.size.v \
grid columnconfigure $w.inner 0 -weight 1
pack $w.inner -fill both -expand 1 -padx 5 -pady 5
- ${NS}::frame $w.example
- ${NS}::label $w.example.l \
+ ttk::frame $w.example
+ ttk::label $w.example.l \
-text [mc "Font Example"] \
-anchor w
set w_example $w.example.t
field sorted_recent ; # recent repositories (sorted)
constructor pick {} {
- global M1T M1B use_ttk NS
+ global M1T M1B use_ttk
if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
set maxrecent 10
set w_body $w.body
set opts $w_body.options
- ${NS}::frame $w_body
+ ttk::frame $w_body
text $opts \
-cursor $::cursor_ptr \
-relief flat \
set lenrecent $maxrecent
}
- ${NS}::label $w_body.space
- ${NS}::label $w_body.recentlabel \
+ ttk::label $w_body.space
+ ttk::label $w_body.recentlabel \
-anchor w \
-text [mc "Open Recent Repository:"]
set w_recentlist $w_body.recentlist
}
pack $w_body -fill x -padx 10 -pady 10
- ${NS}::frame $w.buttons
+ ttk::frame $w.buttons
set w_next $w.buttons.next
set w_quit $w.buttons.quit
- ${NS}::button $w_quit \
+ ttk::button $w_quit \
-text [mc "Quit"] \
-command exit
pack $w_quit -side right -padx 5
}
method _next {action} {
- global NS
destroy $w_body
if {![winfo exists $w_next]} {
- ${NS}::button $w_next -default active
+ ttk::button $w_next -default active
set pos -before
if {[tk windowingsystem] eq "win32"} { set pos -after }
pack $w_next -side right -padx 5 $pos $w_quit
## Create New Repository
method _do_new {} {
- global use_ttk NS
+ global use_ttk
$w_next conf \
-state disabled \
-command [cb _do_new2] \
-text [mc "Create"]
- ${NS}::frame $w_body
- ${NS}::label $w_body.h \
+ ttk::frame $w_body
+ ttk::label $w_body.h \
-font font_uibold -anchor center \
-text [mc "Create New Repository"]
pack $w_body.h -side top -fill x -pady 10
pack $w_body -fill x -padx 10
- ${NS}::frame $w_body.where
- ${NS}::label $w_body.where.l -text [mc "Directory:"]
- ${NS}::entry $w_body.where.t \
+ ttk::frame $w_body.where
+ ttk::label $w_body.where.l -text [mc "Directory:"]
+ ttk::entry $w_body.where.t \
-textvariable @local_path \
-width 50
- ${NS}::button $w_body.where.b \
+ ttk::button $w_body.where.b \
-text [mc "Browse"] \
-command [cb _new_local_path]
set w_localpath $w_body.where.t
## Clone Existing Repository
method _do_clone {} {
- global use_ttk NS
+ global use_ttk
$w_next conf \
-state disabled \
-command [cb _do_clone2] \
-text [mc "Clone"]
- ${NS}::frame $w_body
- ${NS}::label $w_body.h \
+ ttk::frame $w_body
+ ttk::label $w_body.h \
-font font_uibold -anchor center \
-text [mc "Clone Existing Repository"]
pack $w_body.h -side top -fill x -pady 10
pack $w_body -fill x -padx 10
set args $w_body.args
- ${NS}::frame $w_body.args
+ ttk::frame $w_body.args
pack $args -fill both
- ${NS}::label $args.origin_l -text [mc "Source Location:"]
- ${NS}::entry $args.origin_t \
+ ttk::label $args.origin_l -text [mc "Source Location:"]
+ ttk::entry $args.origin_t \
-textvariable @origin_url \
-width 50
- ${NS}::button $args.origin_b \
+ ttk::button $args.origin_b \
-text [mc "Browse"] \
-command [cb _open_origin]
grid $args.origin_l $args.origin_t $args.origin_b -sticky ew
- ${NS}::label $args.where_l -text [mc "Target Directory:"]
- ${NS}::entry $args.where_t \
+ ttk::label $args.where_l -text [mc "Target Directory:"]
+ ttk::entry $args.where_t \
-textvariable @local_path \
-width 50
- ${NS}::button $args.where_b \
+ ttk::button $args.where_b \
-text [mc "Browse"] \
-command [cb _new_local_path]
grid $args.where_l $args.where_t $args.where_b -sticky ew
set w_localpath $args.where_t
- ${NS}::label $args.type_l -text [mc "Clone Type:"]
- ${NS}::frame $args.type_f
+ ttk::label $args.type_l -text [mc "Clone Type:"]
+ ttk::frame $args.type_f
set w_types [list]
- lappend w_types [${NS}::radiobutton $args.type_f.hardlink \
+ lappend w_types [ttk::radiobutton $args.type_f.hardlink \
-state disabled \
-text [mc "Standard (Fast, Semi-Redundant, Hardlinks)"] \
-variable @clone_type \
-value hardlink]
- lappend w_types [${NS}::radiobutton $args.type_f.full \
+ lappend w_types [ttk::radiobutton $args.type_f.full \
-state disabled \
-text [mc "Full Copy (Slower, Redundant Backup)"] \
-variable @clone_type \
-value full]
- lappend w_types [${NS}::radiobutton $args.type_f.shared \
+ lappend w_types [ttk::radiobutton $args.type_f.shared \
-state disabled \
-text [mc "Shared (Fastest, Not Recommended, No Backup)"] \
-variable @clone_type \
foreach r $w_types {
pack $r -anchor w
}
- ${NS}::checkbutton $args.type_f.recursive \
+ ttk::checkbutton $args.type_f.recursive \
-text [mc "Recursively clone submodules too"] \
-variable @recursive \
-onvalue true -offvalue false
## Open Existing Repository
method _do_open {} {
- global NS
$w_next conf \
-state disabled \
-command [cb _do_open2] \
-text [mc "Open"]
- ${NS}::frame $w_body
- ${NS}::label $w_body.h \
+ ttk::frame $w_body
+ ttk::label $w_body.h \
-font font_uibold -anchor center \
-text [mc "Open Existing Repository"]
pack $w_body.h -side top -fill x -pady 10
pack $w_body -fill x -padx 10
- ${NS}::frame $w_body.where
- ${NS}::label $w_body.where.l -text [mc "Repository:"]
- ${NS}::entry $w_body.where.t \
+ ttk::frame $w_body.where
+ ttk::label $w_body.where.l -text [mc "Repository:"]
+ ttk::entry $w_body.where.t \
-textvariable @local_path \
-width 50
- ${NS}::button $w_body.where.b \
+ ttk::button $w_body.where.b \
-text [mc "Browse"] \
-command [cb _open_local_path]
}
constructor _new {path unmerged_only title} {
- global current_branch is_detached use_ttk NS
+ global current_branch is_detached use_ttk
if {![info exists ::all_remotes]} {
load_all_remotes
set w $path
if {$title ne {}} {
- ${NS}::labelframe $w -text $title
+ ttk::labelframe $w -text $title
} else {
- ${NS}::frame $w
+ ttk::frame $w
}
bind $w <Destroy> [cb _delete %W]
if {$is_detached} {
- ${NS}::radiobutton $w.detachedhead_r \
+ ttk::radiobutton $w.detachedhead_r \
-text [mc "This Detached Checkout"] \
-value HEAD \
-variable @revtype
grid $w.detachedhead_r -sticky we -padx {0 5} -columnspan 2
}
- ${NS}::radiobutton $w.expr_r \
+ ttk::radiobutton $w.expr_r \
-text [mc "Revision Expression:"] \
-value expr \
-variable @revtype
- ${NS}::entry $w.expr_t \
+ ttk::entry $w.expr_t \
-width 50 \
-textvariable @c_expr \
-validate key \
-validatecommand [cb _validate %d %S]
grid $w.expr_r $w.expr_t -sticky we -padx {0 5}
- ${NS}::frame $w.types
- ${NS}::radiobutton $w.types.head_r \
+ ttk::frame $w.types
+ ttk::radiobutton $w.types.head_r \
-text [mc "Local Branch"] \
-value head \
-variable @revtype
pack $w.types.head_r -side left
- ${NS}::radiobutton $w.types.trck_r \
+ ttk::radiobutton $w.types.trck_r \
-text [mc "Tracking Branch"] \
-value trck \
-variable @revtype
pack $w.types.trck_r -side left
- ${NS}::radiobutton $w.types.tag_r \
+ ttk::radiobutton $w.types.tag_r \
-text [mc "Tag"] \
-value tag \
-variable @revtype
pack $w.types.tag_r -side left
set w_filter $w.types.filter
- ${NS}::entry $w_filter \
+ ttk::entry $w_filter \
-width 12 \
-textvariable @filter \
-validate key \
-validatecommand [cb _filter %P]
pack $w_filter -side right
- pack [${NS}::label $w.types.filter_icon \
+ pack [ttk::label $w.types.filter_icon \
-image ::choose_rev::img_find \
] -side right
grid $w.types -sticky we -padx {0 5} -columnspan 2
}
method none {text} {
- global NS use_ttk
+ global use_ttk
if {![winfo exists $w.none_r]} {
- ${NS}::radiobutton $w.none_r \
+ ttk::radiobutton $w.none_r \
-value none \
-variable @revtype
if {!$use_ttk} {$w.none_r configure -anchor w}
}
method _sb_set {sb orient first last} {
- global NS
set old_focus [focus -lastfor $w]
if {$first == 0 && $last == 1} {
if {![winfo exists $sb]} {
if {$orient eq {h}} {
- ${NS}::scrollbar $sb -orient h -command [list $w_list xview]
+ ttk::scrollbar $sb -orient h -command [list $w_list xview]
pack $sb -fill x -side bottom -before $w_list
} else {
- ${NS}::scrollbar $sb -orient v -command [list $w_list yview]
+ ttk::scrollbar $sb -orient v -command [list $w_list yview]
pack $sb -fill y -side right -before $w_list
}
if {$old_focus ne {}} {
}
method _init {} {
- global M1B use_ttk NS
+ global M1B use_ttk
if {$is_toplevel} {
make_dialog top w -autodelete 0
wm title $top "[appname] ([reponame]): $t_short"
} else {
- ${NS}::frame $w
+ ttk::frame $w
}
set console_cr 1.0
set w_t $w.m.t
- ${NS}::frame $w.m
- ${NS}::label $w.m.l1 \
+ ttk::frame $w.m
+ ttk::label $w.m.l1 \
-textvariable @t_long \
-anchor w \
-justify left \
"
if {$is_toplevel} {
- ${NS}::button $w.ok -text [mc "Close"] \
+ ttk::button $w.ok -text [mc "Close"] \
-state disabled \
-command [list destroy $w]
pack $w.ok -side bottom -anchor e -pady 10 -padx 10
}
method _sb_set {sb orient first last} {
- global NS
if {![winfo exists $sb]} {
if {$first == $last || ($first == 0 && $last == 1)} return
if {$orient eq {h}} {
- ${NS}::scrollbar $sb -orient h -command [list $w_t xview]
+ ttk::scrollbar $sb -orient h -command [list $w_t xview]
pack $sb -fill x -side bottom -before $w_t
} else {
- ${NS}::scrollbar $sb -orient v -command [list $w_t yview]
+ ttk::scrollbar $sb -orient v -command [list $w_t yview]
pack $sb -fill y -side right -before $w_t
}
}
# Copyright (C) 2006, 2007 Shawn Pearce
proc do_stats {} {
- global use_ttk NS
+ global use_ttk
set fd [git_read [list count-objects -v]]
while {[gets $fd line] > 0} {
if {[regexp {^([^:]+): (\d+)$} $line _ name value]} {
wm withdraw $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.close -text [mc Close] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.close -text [mc Close] \
-default active \
-command [list destroy $w]
- ${NS}::button $w.buttons.gc -text [mc "Compress Database"] \
+ ttk::button $w.buttons.gc -text [mc "Compress Database"] \
-default normal \
-command "destroy $w;do_gc"
pack $w.buttons.close -side right
pack $w.buttons.gc -side left
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::labelframe $w.stat -text [mc "Database Statistics"]
+ ttk::labelframe $w.stat -text [mc "Database Statistics"]
foreach s {
{count {mc "Number of loose objects"}}
{size {mc "Disk space used by loose objects"} { KiB}}
set value "$value[lindex $s 2]"
}
- ${NS}::label $w.stat.l_$name -text [mc "%s:" $label] -anchor w
- ${NS}::label $w.stat.v_$name -text $value -anchor w
+ ttk::label $w.stat.l_$name -text [mc "%s:" $label] -anchor w
+ ttk::label $w.stat.v_$name -text $value -anchor w
grid $w.stat.l_$name $w.stat.v_$name -sticky we -padx {0 5}
}
pack $w.stat -pady 10 -padx 10
}
proc hook_failed_popup {hook msg {is_fatal 1}} {
- global use_ttk NS
+ global use_ttk
set w .hookfail
Dialog $w
wm withdraw $w
- ${NS}::frame $w.m
- ${NS}::label $w.m.l1 -text [mc "%s hook failed:" $hook] \
+ ttk::frame $w.m
+ ttk::label $w.m.l1 -text [mc "%s hook failed:" $hook] \
-anchor w \
-justify left \
-font font_uibold
-width 80 -height 10 \
-font font_diff \
-yscrollcommand [list $w.m.sby set]
- ${NS}::scrollbar $w.m.sby -command [list $w.m.t yview]
+ ttk::scrollbar $w.m.sby -command [list $w.m.t yview]
pack $w.m.l1 -side top -fill x
if {$is_fatal} {
- ${NS}::label $w.m.l2 \
+ ttk::label $w.m.l2 \
-text [mc "You must correct the above errors before committing."] \
-anchor w \
-justify left \
$w.m.t insert 1.0 $msg
$w.m.t conf -state disabled
- ${NS}::button $w.ok -text OK \
+ ttk::button $w.ok -text OK \
-width 15 \
-command "destroy $w"
pack $w.ok -side bottom -anchor e -pady 10 -padx 10
}
proc rescan_on_error {err {after {}}} {
- global use_ttk NS
+ global use_ttk
set w .indexfried
Dialog $w
-borderwidth 0 -highlightthickness 0 \
-background [get_bg_color $w]
$w.msg tag configure bold -font font_uibold -justify center
- ${NS}::scrollbar $w.vs -command [list $w.msg yview]
+ ttk::scrollbar $w.vs -command [list $w.msg yview]
$w.msg insert end $s bold \n\n$err {}
$w.msg configure -state disabled
- ${NS}::button $w.continue \
+ ttk::button $w.continue \
-text [mc "Continue"] \
-command [list destroy $w]
- ${NS}::button $w.unlock \
+ ttk::button $w.unlock \
-text [mc "Unlock Index"] \
-command "destroy $w; _delete_indexlock"
grid $w.msg - $w.vs -sticky news
field linenum {}
constructor new {i_w i_text args} {
- global use_ttk NS
+ global use_ttk
set w $i_w
set ctext $i_text
- ${NS}::frame $w
- ${NS}::label $w.l -text [mc "Goto Line:"]
+ ttk::frame $w
+ ttk::label $w.l -text [mc "Goto Line:"]
tentry $w.ent \
-textvariable ${__this}::linenum \
-background lightgreen \
-validate key \
-validatecommand [cb _validate %P]
- ${NS}::button $w.bn -text [mc Go] -command [cb _goto]
+ ttk::button $w.bn -text [mc Go] -command [cb _goto]
pack $w.l -side left
pack $w.bn -side right
constructor dialog {} {
global current_branch
- global M1B use_ttk NS
+ global M1B use_ttk
if {![_can_merge $this]} {
delete_this
set _start [cb _start]
- ${NS}::label $w.header \
+ ttk::label $w.header \
-text [mc "Merge Into %s" $current_branch] \
-font font_uibold
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.visualize \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.visualize \
-text [mc Visualize] \
-command [cb _visualize]
pack $w.buttons.visualize -side left
- ${NS}::button $w.buttons.merge \
+ ttk::button $w.buttons.merge \
-text [mc Merge] \
-command $_start
pack $w.buttons.merge -side right
- ${NS}::button $w.buttons.cancel \
+ ttk::button $w.buttons.cancel \
-text [mc "Cancel"] \
-command [cb _cancel]
pack $w.buttons.cancel -side right -padx 5
proc do_options {} {
global repo_config global_config font_descs
global repo_config_new global_config_new
- global ui_comm_spell use_ttk NS
+ global ui_comm_spell use_ttk
array unset repo_config_new
array unset global_config_new
wm transient $w [winfo parent $w]
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.restore -text [mc "Restore Defaults"] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.restore -text [mc "Restore Defaults"] \
-default normal \
-command do_restore_defaults
pack $w.buttons.restore -side left
- ${NS}::button $w.buttons.save -text [mc Save] \
+ ttk::button $w.buttons.save -text [mc Save] \
-default active \
-command [list do_save_config $w]
pack $w.buttons.save -side right
- ${NS}::button $w.buttons.cancel -text [mc "Cancel"] \
+ ttk::button $w.buttons.cancel -text [mc "Cancel"] \
-default normal \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::labelframe $w.repo -text [mc "%s Repository" [reponame]]
- ${NS}::labelframe $w.global -text [mc "Global (All Repositories)"]
+ ttk::labelframe $w.repo -text [mc "%s Repository" [reponame]]
+ ttk::labelframe $w.global -text [mc "Global (All Repositories)"]
pack $w.repo -side left -fill both -expand 1 -pady 5 -padx 5
pack $w.global -side right -fill both -expand 1 -pady 5 -padx 5
foreach f {repo global} {
switch -glob -- $type {
b {
- ${NS}::checkbutton $w.$f.$optid -text $text \
+ ttk::checkbutton $w.$f.$optid -text $text \
-variable ${f}_config_new($name) \
-onvalue true \
-offvalue false
}
i-* {
regexp -- {-(\d+)\.\.(\d+)$} $type _junk min max
- ${NS}::frame $w.$f.$optid
- ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
+ ttk::frame $w.$f.$optid
+ ttk::label $w.$f.$optid.l -text [mc "%s:" $text]
pack $w.$f.$optid.l -side left -anchor w -fill x
tspinbox $w.$f.$optid.v \
-textvariable ${f}_config_new($name) \
}
c -
t {
- ${NS}::frame $w.$f.$optid
- ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
- ${NS}::entry $w.$f.$optid.v \
+ ttk::frame $w.$f.$optid
+ ttk::label $w.$f.$optid.l -text [mc "%s:" $text]
+ ttk::entry $w.$f.$optid.v \
-width 20 \
-textvariable ${f}_config_new($name)
pack $w.$f.$optid.l -side left -anchor w
menu $w.$f.$optid.m
build_encoding_menu $w.$f.$optid.m \
[list set ${f}_config_new($name)] 1
- ${NS}::button $w.$f.$optid.b \
+ ttk::button $w.$f.$optid.b \
-text [mc "Change"] \
-command [list popup_btn_menu \
$w.$f.$optid.m $w.$f.$optid.b]
}
s {
set opts [eval [lindex $option 3]]
- ${NS}::frame $w.$f.$optid
- ${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
+ ttk::frame $w.$f.$optid
+ ttk::label $w.$f.$optid.l -text [mc "%s:" $text]
if {$use_ttk} {
ttk::combobox $w.$f.$optid.v \
-textvariable ${f}_config_new($name) \
set ${f}_config_new(gui.spellingdictionary) $value
}
- ${NS}::frame $w.$f.$optid
- ${NS}::label $w.$f.$optid.l -text [mc "Spelling Dictionary:"]
+ ttk::frame $w.$f.$optid
+ ttk::label $w.$f.$optid.l -text [mc "Spelling Dictionary:"]
if {$use_ttk} {
ttk::combobox $w.$f.$optid.v \
-textvariable ${f}_config_new(gui.spellingdictionary) \
set global_config_new(gui.$font^^size) \
[font configure $font -size]
- ${NS}::frame $w.global.$name
- ${NS}::label $w.global.$name.l -text [mc "%s:" $text]
- ${NS}::button $w.global.$name.b \
+ ttk::frame $w.global.$name
+ ttk::label $w.global.$name.l -text [mc "%s:" $text]
+ ttk::button $w.global.$name.b \
-text [mc "Change Font"] \
-command [list \
tchoosefont \
global_config_new(gui.$font^^family) \
global_config_new(gui.$font^^size) \
]
- ${NS}::label $w.global.$name.f -textvariable global_config_new(gui.$font^^family)
- ${NS}::label $w.global.$name.s -textvariable global_config_new(gui.$font^^size)
- ${NS}::label $w.global.$name.pt -text [mc "pt."]
+ ttk::label $w.global.$name.f -textvariable global_config_new(gui.$font^^family)
+ ttk::label $w.global.$name.s -textvariable global_config_new(gui.$font^^size)
+ ttk::label $w.global.$name.pt -text [mc "pt."]
pack $w.global.$name.l -side left -anchor w
pack $w.global.$name.b -side right -anchor e
pack $w.global.$name.pt -side right -anchor w
field opt_action fetch; # action to do after registering the remote locally
constructor dialog {} {
- global repo_config use_ttk NS
+ global repo_config use_ttk
make_dialog top w
wm withdraw $top
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- ${NS}::label $w.header -text [mc "Add New Remote"] \
+ ttk::label $w.header -text [mc "Add New Remote"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.create -text [mc Add] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.create -text [mc Add] \
-default active \
-command [cb _add]
pack $w.buttons.create -side right
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::labelframe $w.desc -text [mc "Remote Details"]
+ ttk::labelframe $w.desc -text [mc "Remote Details"]
- ${NS}::label $w.desc.name_l -text [mc "Name:"]
+ ttk::label $w.desc.name_l -text [mc "Name:"]
set w_name $w.desc.name_t
- ${NS}::entry $w_name \
+ ttk::entry $w_name \
-width 40 \
-textvariable @name \
-validate key \
-validatecommand [cb _validate_name %d %S]
grid $w.desc.name_l $w_name -sticky we -padx {0 5}
- ${NS}::label $w.desc.loc_l -text [mc "Location:"]
+ ttk::label $w.desc.loc_l -text [mc "Location:"]
set w_loc $w.desc.loc_t
- ${NS}::entry $w_loc \
+ ttk::entry $w_loc \
-width 40 \
-textvariable @location
grid $w.desc.loc_l $w_loc -sticky we -padx {0 5}
grid columnconfigure $w.desc 1 -weight 1
pack $w.desc -anchor nw -fill x -pady 5 -padx 5
- ${NS}::labelframe $w.action -text [mc "Further Action"]
+ ttk::labelframe $w.action -text [mc "Further Action"]
- ${NS}::radiobutton $w.action.fetch \
+ ttk::radiobutton $w.action.fetch \
-text [mc "Fetch Immediately"] \
-value fetch \
-variable @opt_action
pack $w.action.fetch -anchor nw
- ${NS}::radiobutton $w.action.push \
+ ttk::radiobutton $w.action.push \
-text [mc "Initialize Remote Repository and Push"] \
-value push \
-variable @opt_action
pack $w.action.push -anchor nw
- ${NS}::radiobutton $w.action.none \
+ ttk::radiobutton $w.action.none \
-text [mc "Do Nothing Else Now"] \
-value none \
-variable @opt_action
field cached
constructor dialog {} {
- global all_remotes M1B use_ttk NS
+ global all_remotes M1B use_ttk
make_dialog top w
wm title $top [mc "%s (%s): Delete Branch Remotely" [appname] [reponame]]
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- ${NS}::label $w.header -text [mc "Delete Branch Remotely"] \
+ ttk::label $w.header -text [mc "Delete Branch Remotely"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.delete -text [mc Delete] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.delete -text [mc Delete] \
-default active \
-command [cb _delete]
pack $w.buttons.delete -side right
- ${NS}::button $w.buttons.cancel -text [mc "Cancel"] \
+ ttk::button $w.buttons.cancel -text [mc "Cancel"] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::labelframe $w.dest -text [mc "From Repository"]
+ ttk::labelframe $w.dest -text [mc "From Repository"]
if {$all_remotes ne {}} {
- ${NS}::radiobutton $w.dest.remote_r \
+ ttk::radiobutton $w.dest.remote_r \
-text [mc "Remote:"] \
-value remote \
-variable @urltype
} else {
set urltype url
}
- ${NS}::radiobutton $w.dest.url_r \
+ ttk::radiobutton $w.dest.url_r \
-text [mc "Arbitrary Location:"] \
-value url \
-variable @urltype
- ${NS}::entry $w.dest.url_t \
+ ttk::entry $w.dest.url_t \
-width 50 \
-textvariable @url \
-validate key \
grid columnconfigure $w.dest 1 -weight 1
pack $w.dest -anchor nw -fill x -pady 5 -padx 5
- ${NS}::labelframe $w.heads -text [mc "Branches"]
+ ttk::labelframe $w.heads -text [mc "Branches"]
slistbox $w.heads.l \
-height 10 \
-width 70 \
-listvariable @head_list \
-selectmode extended
- ${NS}::frame $w.heads.footer
- ${NS}::label $w.heads.footer.status \
+ ttk::frame $w.heads.footer
+ ttk::label $w.heads.footer.status \
-textvariable @status \
-anchor w \
-justify left
- ${NS}::button $w.heads.footer.rescan \
+ ttk::button $w.heads.footer.rescan \
-text [mc "Rescan"] \
-command [cb _rescan]
pack $w.heads.footer.status -side left -fill x
pack $w.heads.l -side left -fill both -expand 1
pack $w.heads -fill both -expand 1 -pady 5 -padx 5
- ${NS}::labelframe $w.validate -text [mc "Delete Only If"]
- ${NS}::radiobutton $w.validate.head_r \
+ ttk::labelframe $w.validate -text [mc "Delete Only If"]
+ ttk::radiobutton $w.validate.head_r \
-text [mc "Merged Into:"] \
-value head \
-variable @checktype
trace add variable @head_list write [cb _write_head_list]
trace add variable @check_head write [cb _write_check_head]
grid $w.validate.head_r $w.validate.head_m -sticky w
- ${NS}::radiobutton $w.validate.always_r \
+ ttk::radiobutton $w.validate.always_r \
-text [mc "Always (Do not perform merge checks)"] \
-value always \
-variable @checktype
field smarkbot
constructor new {i_w i_text args} {
- global use_ttk NS
+ global use_ttk
set w $i_w
set ctext $i_text
set history [list]
- ${NS}::frame $w
- ${NS}::label $w.l -text [mc Find:]
+ ttk::frame $w
+ ttk::label $w.l -text [mc Find:]
tentry $w.ent -textvariable ${__this}::searchstring -background lightgreen
- ${NS}::button $w.bn -text [mc Next] -command [cb find_next]
- ${NS}::button $w.bp -text [mc Prev] -command [cb find_prev]
- ${NS}::checkbutton $w.re -text [mc RegExp] \
+ ttk::button $w.bn -text [mc Next] -command [cb find_next]
+ ttk::button $w.bp -text [mc Prev] -command [cb find_prev]
+ ttk::checkbutton $w.re -text [mc RegExp] \
-variable ${__this}::regexpsearch -command [cb _incrsearch]
- ${NS}::checkbutton $w.cs -text [mc Case] \
+ ttk::checkbutton $w.cs -text [mc Case] \
-variable ${__this}::casesensitive -command [cb _incrsearch]
pack $w.l -side left
pack $w.cs -side right
}
proc do_ssh_key {} {
- global sshkey_title sshkey_fd use_ttk NS
+ global sshkey_title sshkey_fd use_ttk
set w .sshkey_dialog
if {[winfo exists $w]} {
set gen_state disabled
}
- ${NS}::frame $w.header
- ${NS}::label $w.header.lbl -textvariable sshkey_title -anchor w
- ${NS}::button $w.header.gen -text [mc "Generate Key"] \
+ ttk::frame $w.header
+ ttk::label $w.header.lbl -textvariable sshkey_title -anchor w
+ ttk::button $w.header.gen -text [mc "Generate Key"] \
-command [list make_ssh_key $w] -state $gen_state
pack $w.header.lbl -side left -expand 1 -fill x
pack $w.header.gen -side right
if {$use_ttk} { set clr [ttk::style lookup . -selectbackground] }
$w.contents configure -inactiveselectbackground $clr
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.close -text [mc Close] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.close -text [mc Close] \
-default active -command [list destroy $w]
pack $w.buttons.close -side right
- ${NS}::button $w.buttons.copy -text [mc "Copy To Clipboard"] \
+ ttk::button $w.buttons.copy -text [mc "Copy To Clipboard"] \
-command [list tk_textCopy $w.contents]
pack $w.buttons.copy -side left
pack $w.buttons -side bottom -fill x -pady 5 -padx 5
field completed_operation_count
constructor new {path} {
- global use_ttk NS
+ global use_ttk
set w $path
set w_l $w.l
set w_c $w.c
set operations [list]
set completed_operation_count 0
- ${NS}::frame $w
+ ttk::frame $w
if {!$use_ttk} {
$w configure -borderwidth 1 -relief sunken
}
- ${NS}::label $w_l \
+ ttk::label $w_l \
-textvariable @status_bar_text \
-anchor w \
-justify left
}
constructor two_line {path} {
- global NS
set w $path
set w_l $w.l
set w_c $w.c
set operations [list]
set completed_operation_count 0
- ${NS}::frame $w
- ${NS}::label $w_l \
+ ttk::frame $w
+ ttk::label $w_l \
-textvariable @status_bar_text \
-anchor w \
-justify left
# On many themes the border for a scrolled listbox needs to go around the
# listbox and the scrollbar.
proc slistbox {w args} {
- global use_ttk NS
+ global use_ttk
if {$use_ttk} {
set f [ttk::frame $w -style SListbox.TFrame -padding 2]
} else {
} else {
eval [linsert $args 0 listbox $f.list]
}
- ${NS}::scrollbar $f.vs -command [list $f.list yview]
+ ttk::scrollbar $f.vs -command [list $f.list yview]
$f.list configure -yscrollcommand [list $f.vs set]
grid $f.list $f.vs -sticky news
grid rowconfigure $f 0 -weight 1
field ask_args 0; # ask for additional args
constructor dialog {} {
- global repo_config use_ttk NS
+ global repo_config use_ttk
make_dialog top w
wm title $top [mc "%s (%s): Add Tool" [appname] [reponame]]
wm transient $top .
}
- ${NS}::label $w.header -text [mc "Add New Tool Command"] \
+ ttk::label $w.header -text [mc "Add New Tool Command"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::checkbutton $w.buttons.global \
+ ttk::frame $w.buttons
+ ttk::checkbutton $w.buttons.global \
-text [mc "Add globally"] \
-variable @add_global
pack $w.buttons.global -side left -padx 5
- ${NS}::button $w.buttons.create -text [mc Add] \
+ ttk::button $w.buttons.create -text [mc Add] \
-default active \
-command [cb _add]
pack $w.buttons.create -side right
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::labelframe $w.desc -text [mc "Tool Details"]
+ ttk::labelframe $w.desc -text [mc "Tool Details"]
- ${NS}::label $w.desc.name_cmnt -anchor w\
+ ttk::label $w.desc.name_cmnt -anchor w\
-text [mc "Use '/' separators to create a submenu tree:"]
grid x $w.desc.name_cmnt -sticky we -padx {0 5} -pady {0 2}
- ${NS}::label $w.desc.name_l -text [mc "Name:"]
+ ttk::label $w.desc.name_l -text [mc "Name:"]
set w_name $w.desc.name_t
- ${NS}::entry $w_name \
+ ttk::entry $w_name \
-width 40 \
-textvariable @name \
-validate key \
-validatecommand [cb _validate_name %d %S]
grid $w.desc.name_l $w_name -sticky we -padx {0 5}
- ${NS}::label $w.desc.cmd_l -text [mc "Command:"]
+ ttk::label $w.desc.cmd_l -text [mc "Command:"]
set w_cmd $w.desc.cmd_t
- ${NS}::entry $w_cmd \
+ ttk::entry $w_cmd \
-width 40 \
-textvariable @command
grid $w.desc.cmd_l $w_cmd -sticky we -padx {0 5} -pady {0 3}
grid columnconfigure $w.desc 1 -weight 1
pack $w.desc -anchor nw -fill x -pady 5 -padx 5
- ${NS}::checkbutton $w.confirm \
+ ttk::checkbutton $w.confirm \
-text [mc "Show a dialog before running"] \
-variable @confirm -command [cb _check_enable_dlg]
- ${NS}::labelframe $w.dlg -labelwidget $w.confirm
+ ttk::labelframe $w.dlg -labelwidget $w.confirm
- ${NS}::checkbutton $w.dlg.askbranch \
+ ttk::checkbutton $w.dlg.askbranch \
-text [mc "Ask the user to select a revision (sets \$REVISION)"] \
-variable @ask_branch -state disabled
pack $w.dlg.askbranch -anchor w -padx 15
- ${NS}::checkbutton $w.dlg.askargs \
+ ttk::checkbutton $w.dlg.askargs \
-text [mc "Ask the user for additional arguments (sets \$ARGS)"] \
-variable @ask_args -state disabled
pack $w.dlg.askargs -anchor w -padx 15
pack $w.dlg -anchor nw -fill x -pady {0 8} -padx 5
- ${NS}::checkbutton $w.noconsole \
+ ttk::checkbutton $w.noconsole \
-text [mc "Don't show the command output window"] \
-variable @no_console
pack $w.noconsole -anchor w -padx 5
- ${NS}::checkbutton $w.needsfile \
+ ttk::checkbutton $w.needsfile \
-text [mc "Run only if a diff is selected (\$FILENAME not empty)"] \
-variable @needs_file
pack $w.needsfile -anchor w -padx 5
field w_names ; # name list
constructor dialog {} {
- global repo_config global_config system_config use_ttk NS
+ global repo_config global_config system_config use_ttk
load_config 1
wm transient $top .
}
- ${NS}::label $w.header -text [mc "Remove Tool Commands"] \
+ ttk::label $w.header -text [mc "Remove Tool Commands"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.create -text [mc Remove] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.create -text [mc Remove] \
-default active \
-command [cb _remove]
pack $w.buttons.create -side right
- ${NS}::button $w.buttons.cancel -text [mc Cancel] \
+ ttk::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::frame $w.list
+ ttk::frame $w.list
set w_names $w.list.l
slistbox $w_names \
-height 10 \
}
if {$local_cnt > 0} {
- ${NS}::label $w.colorlbl -foreground blue \
+ ttk::label $w.colorlbl -foreground blue \
-text [mc "(Blue denotes repository-local tools)"]
pack $w.colorlbl -fill x -pady 5 -padx 5
}
field argstr {}; # arguments
constructor dialog {fullname} {
- global M1B use_ttk NS
+ global M1B use_ttk
set title [get_config "guitool.$fullname.title"]
if {$title eq {}} {
set prompt [mc "Run Command: %s" $command]
}
- ${NS}::label $w.header -text $prompt -font font_uibold -anchor center
+ ttk::label $w.header -text $prompt -font font_uibold -anchor center
pack $w.header -side top -fill x
set argprompt [get_config "guitool.$fullname.argprompt"]
set argprompt [mc "Arguments"]
}
- ${NS}::labelframe $w.arg -text $argprompt
+ ttk::labelframe $w.arg -text $argprompt
set w_args $w.arg.txt
- ${NS}::entry $w_args \
+ ttk::entry $w_args \
-width 40 \
-textvariable @argstr
pack $w_args -padx 5 -pady 5 -fill both
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
}
- ${NS}::frame $w.buttons
+ ttk::frame $w.buttons
if {$is_ask_revs} {
- ${NS}::button $w.buttons.visualize \
+ ttk::button $w.buttons.visualize \
-text [mc Visualize] \
-command [cb _visualize]
pack $w.buttons.visualize -side left
}
- ${NS}::button $w.buttons.ok \
+ ttk::button $w.buttons.ok \
-text [mc OK] \
-command [cb _start]
pack $w.buttons.ok -side right
- ${NS}::button $w.buttons.cancel \
+ ttk::button $w.buttons.cancel \
-text [mc "Cancel"] \
-command [cb _cancel]
pack $w.buttons.cancel -side right -padx 5
proc do_push_anywhere {} {
global all_remotes current_branch
global push_urltype push_remote push_url push_thin push_tags
- global push_force use_ttk NS
+ global push_force use_ttk
set w .push_setup
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
pave_toplevel $w
- ${NS}::label $w.header -text [mc "Push Branches"] \
+ ttk::label $w.header -text [mc "Push Branches"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x
- ${NS}::frame $w.buttons
- ${NS}::button $w.buttons.create -text [mc Push] \
+ ttk::frame $w.buttons
+ ttk::button $w.buttons.create -text [mc Push] \
-default active \
-command [list start_push_anywhere_action $w]
pack $w.buttons.create -side right
- ${NS}::button $w.buttons.cancel -text [mc "Cancel"] \
+ ttk::button $w.buttons.cancel -text [mc "Cancel"] \
-default normal \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- ${NS}::labelframe $w.source -text [mc "Source Branches"]
+ ttk::labelframe $w.source -text [mc "Source Branches"]
slistbox $w.source.l \
-height 10 \
-width 70 \
pack $w.source.l -side left -fill both -expand 1
pack $w.source -fill both -expand 1 -pady 5 -padx 5
- ${NS}::labelframe $w.dest -text [mc "Destination Repository"]
+ ttk::labelframe $w.dest -text [mc "Destination Repository"]
if {$all_remotes ne {}} {
- ${NS}::radiobutton $w.dest.remote_r \
+ ttk::radiobutton $w.dest.remote_r \
-text [mc "Remote:"] \
-value remote \
-variable push_urltype
} else {
set push_urltype url
}
- ${NS}::radiobutton $w.dest.url_r \
+ ttk::radiobutton $w.dest.url_r \
-text [mc "Arbitrary Location:"] \
-value url \
-variable push_urltype
- ${NS}::entry $w.dest.url_t \
+ ttk::entry $w.dest.url_t \
-width 50 \
-textvariable push_url \
-validate key \
grid columnconfigure $w.dest 1 -weight 1
pack $w.dest -anchor nw -fill x -pady 5 -padx 5
- ${NS}::labelframe $w.options -text [mc "Transfer Options"]
- ${NS}::checkbutton $w.options.force \
+ ttk::labelframe $w.options -text [mc "Transfer Options"]
+ ttk::checkbutton $w.options.force \
-text [mc "Force overwrite existing branch (may discard changes)"] \
-variable push_force
grid $w.options.force -columnspan 2 -sticky w
- ${NS}::checkbutton $w.options.thin \
+ ttk::checkbutton $w.options.thin \
-text [mc "Use thin pack (for slow network connections)"] \
-variable push_thin
grid $w.options.thin -columnspan 2 -sticky w
- ${NS}::checkbutton $w.options.tags \
+ ttk::checkbutton $w.options.tags \
-text [mc "Include tags"] \
-variable push_tags
grid $w.options.tags -columnspan 2 -sticky w