* 'master' of https://github.com/j6t/gitk: gitk: offer "Copy commit ID to X11 selection" only on X11 gitk: support auto-copy comit ID to primary clipboard gitk: prefs dialog: refine Auto-select UI gitk: UI text: change "SHA1 ID" to "Commit ID" gitk: add text wrapping preferences gitk: make headings of preferences bold gitk: check main window visibility before waiting for it to show gitk: sv.po: Update Swedish translation (323t)
This commit is contained in:
@ -1969,6 +1969,10 @@ proc confirm_popup {msg {owner .}} {
|
|||||||
return $confirm_ok
|
return $confirm_ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc haveselectionclipboard {} {
|
||||||
|
return [expr {[tk windowingsystem] eq "x11"}]
|
||||||
|
}
|
||||||
|
|
||||||
proc setoptions {} {
|
proc setoptions {} {
|
||||||
global use_ttk
|
global use_ttk
|
||||||
|
|
||||||
@ -2089,7 +2093,7 @@ proc makewindow {} {
|
|||||||
global diffcontextstring diffcontext
|
global diffcontextstring diffcontext
|
||||||
global ignorespace
|
global ignorespace
|
||||||
global maincursor textcursor curtextcursor
|
global maincursor textcursor curtextcursor
|
||||||
global rowctxmenu fakerowmenu mergemax wrapcomment
|
global rowctxmenu fakerowmenu mergemax wrapcomment wrapdefault
|
||||||
global highlight_files gdttype
|
global highlight_files gdttype
|
||||||
global searchstring sstring
|
global searchstring sstring
|
||||||
global bgcolor fgcolor bglist fglist diffcolors diffbgcolors selectbgcolor
|
global bgcolor fgcolor bglist fglist diffcolors diffbgcolors selectbgcolor
|
||||||
@ -2223,7 +2227,7 @@ proc makewindow {} {
|
|||||||
set sha1entry .tf.bar.sha1
|
set sha1entry .tf.bar.sha1
|
||||||
set entries $sha1entry
|
set entries $sha1entry
|
||||||
set sha1but .tf.bar.sha1label
|
set sha1but .tf.bar.sha1label
|
||||||
button $sha1but -text "[mc "SHA1 ID:"] " -state disabled -relief flat \
|
button $sha1but -text "[mc "Commit ID:"] " -state disabled -relief flat \
|
||||||
-command gotocommit -width 8
|
-command gotocommit -width 8
|
||||||
$sha1but conf -disabledforeground [$sha1but cget -foreground]
|
$sha1but conf -disabledforeground [$sha1but cget -foreground]
|
||||||
pack .tf.bar.sha1label -side left
|
pack .tf.bar.sha1label -side left
|
||||||
@ -2431,7 +2435,7 @@ proc makewindow {} {
|
|||||||
set ctext .bleft.bottom.ctext
|
set ctext .bleft.bottom.ctext
|
||||||
text $ctext -background $bgcolor -foreground $fgcolor \
|
text $ctext -background $bgcolor -foreground $fgcolor \
|
||||||
-state disabled -undo 0 -font textfont \
|
-state disabled -undo 0 -font textfont \
|
||||||
-yscrollcommand scrolltext -wrap none \
|
-yscrollcommand scrolltext -wrap $wrapdefault \
|
||||||
-xscrollcommand ".bleft.bottom.sbhorizontal set"
|
-xscrollcommand ".bleft.bottom.sbhorizontal set"
|
||||||
if {$have_tk85} {
|
if {$have_tk85} {
|
||||||
$ctext conf -tabstyle wordprocessor
|
$ctext conf -tabstyle wordprocessor
|
||||||
@ -7344,7 +7348,7 @@ proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
|
|||||||
global mergemax numcommits pending_select
|
global mergemax numcommits pending_select
|
||||||
global cmitmode showneartags allcommits
|
global cmitmode showneartags allcommits
|
||||||
global targetrow targetid lastscrollrows
|
global targetrow targetid lastscrollrows
|
||||||
global autoselect autosellen jump_to_here
|
global autocopy autoselect autosellen jump_to_here
|
||||||
global vinlinediff
|
global vinlinediff
|
||||||
|
|
||||||
unset -nocomplain pending_select
|
unset -nocomplain pending_select
|
||||||
@ -7410,9 +7414,13 @@ proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
|
|||||||
|
|
||||||
$sha1entry delete 0 end
|
$sha1entry delete 0 end
|
||||||
$sha1entry insert 0 $id
|
$sha1entry insert 0 $id
|
||||||
if {$autoselect} {
|
if {$autoselect && [haveselectionclipboard]} {
|
||||||
$sha1entry selection range 0 $autosellen
|
$sha1entry selection range 0 $autosellen
|
||||||
}
|
}
|
||||||
|
if {$autocopy} {
|
||||||
|
clipboard clear
|
||||||
|
clipboard append [string range $id 0 [expr $autosellen - 1]]
|
||||||
|
}
|
||||||
rhighlight_sel $id
|
rhighlight_sel $id
|
||||||
|
|
||||||
$ctext conf -state normal
|
$ctext conf -state normal
|
||||||
@ -8756,7 +8764,7 @@ proc sha1change {n1 n2 op} {
|
|||||||
if {$state == "normal"} {
|
if {$state == "normal"} {
|
||||||
$sha1but conf -state normal -relief raised -text "[mc "Goto:"] "
|
$sha1but conf -state normal -relief raised -text "[mc "Goto:"] "
|
||||||
} else {
|
} else {
|
||||||
$sha1but conf -state disabled -relief flat -text "[mc "SHA1 ID:"] "
|
$sha1but conf -state disabled -relief flat -text "[mc "Commit ID:"] "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8775,7 +8783,7 @@ proc gotocommit {} {
|
|||||||
set matches [longid $id]
|
set matches [longid $id]
|
||||||
if {$matches ne {}} {
|
if {$matches ne {}} {
|
||||||
if {[llength $matches] > 1} {
|
if {[llength $matches] > 1} {
|
||||||
error_popup [mc "Short SHA1 id %s is ambiguous" $id]
|
error_popup [mc "Short commit ID %s is ambiguous" $id]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set id [lindex $matches 0]
|
set id [lindex $matches 0]
|
||||||
@ -8792,7 +8800,7 @@ proc gotocommit {} {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string]} {
|
if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string]} {
|
||||||
set msg [mc "SHA1 id %s is not known" $sha1string]
|
set msg [mc "Commit ID %s is not known" $sha1string]
|
||||||
} else {
|
} else {
|
||||||
set msg [mc "Revision %s is not in the current view" $sha1string]
|
set msg [mc "Revision %s is not in the current view" $sha1string]
|
||||||
}
|
}
|
||||||
@ -11576,12 +11584,13 @@ proc create_prefs_page {w} {
|
|||||||
|
|
||||||
proc prefspage_general {notebook} {
|
proc prefspage_general {notebook} {
|
||||||
global NS maxwidth maxgraphpct showneartags showlocalchanges
|
global NS maxwidth maxgraphpct showneartags showlocalchanges
|
||||||
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
|
global tabstop wrapcomment wrapdefault limitdiffs
|
||||||
|
global autocopy autoselect autosellen extdifftool perfile_attrs
|
||||||
global hideremotes want_ttk have_ttk maxrefs web_browser
|
global hideremotes want_ttk have_ttk maxrefs web_browser
|
||||||
|
|
||||||
set page [create_prefs_page $notebook.general]
|
set page [create_prefs_page $notebook.general]
|
||||||
|
|
||||||
${NS}::label $page.ldisp -text [mc "Commit list display options"]
|
${NS}::label $page.ldisp -text [mc "Commit list display options"] -font mainfontbold
|
||||||
grid $page.ldisp - -sticky w -pady 10
|
grid $page.ldisp - -sticky w -pady 10
|
||||||
${NS}::label $page.spacer -text " "
|
${NS}::label $page.spacer -text " "
|
||||||
${NS}::label $page.maxwidthl -text [mc "Maximum graph width (lines)"]
|
${NS}::label $page.maxwidthl -text [mc "Maximum graph width (lines)"]
|
||||||
@ -11594,19 +11603,38 @@ proc prefspage_general {notebook} {
|
|||||||
${NS}::checkbutton $page.showlocal -text [mc "Show local changes"] \
|
${NS}::checkbutton $page.showlocal -text [mc "Show local changes"] \
|
||||||
-variable showlocalchanges
|
-variable showlocalchanges
|
||||||
grid x $page.showlocal -sticky w
|
grid x $page.showlocal -sticky w
|
||||||
${NS}::checkbutton $page.autoselect -text [mc "Auto-select SHA1 (length)"] \
|
|
||||||
-variable autoselect
|
|
||||||
spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
|
|
||||||
grid x $page.autoselect $page.autosellen -sticky w
|
|
||||||
${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \
|
${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \
|
||||||
-variable hideremotes
|
-variable hideremotes
|
||||||
grid x $page.hideremotes -sticky w
|
grid x $page.hideremotes -sticky w
|
||||||
|
|
||||||
${NS}::label $page.ddisp -text [mc "Diff display options"]
|
${NS}::checkbutton $page.autocopy -text [mc "Copy commit ID to clipboard"] \
|
||||||
|
-variable autocopy
|
||||||
|
grid x $page.autocopy -sticky w
|
||||||
|
if {[haveselectionclipboard]} {
|
||||||
|
${NS}::checkbutton $page.autoselect -text [mc "Copy commit ID to X11 selection"] \
|
||||||
|
-variable autoselect
|
||||||
|
grid x $page.autoselect -sticky w
|
||||||
|
}
|
||||||
|
spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
|
||||||
|
${NS}::label $page.autosellenl -text [mc "Length of commit ID to copy"]
|
||||||
|
grid x $page.autosellenl $page.autosellen -sticky w
|
||||||
|
|
||||||
|
${NS}::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold
|
||||||
grid $page.ddisp - -sticky w -pady 10
|
grid $page.ddisp - -sticky w -pady 10
|
||||||
${NS}::label $page.tabstopl -text [mc "Tab spacing"]
|
${NS}::label $page.tabstopl -text [mc "Tab spacing"]
|
||||||
spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
|
spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
|
||||||
grid x $page.tabstopl $page.tabstop -sticky w
|
grid x $page.tabstopl $page.tabstop -sticky w
|
||||||
|
|
||||||
|
${NS}::label $page.wrapcommentl -text [mc "Wrap comment text"]
|
||||||
|
${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \
|
||||||
|
-textvariable wrapcomment
|
||||||
|
grid x $page.wrapcommentl $page.wrapcomment -sticky w
|
||||||
|
|
||||||
|
${NS}::label $page.wrapdefaultl -text [mc "Wrap other text"]
|
||||||
|
${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \
|
||||||
|
-textvariable wrapdefault
|
||||||
|
grid x $page.wrapdefaultl $page.wrapdefault -sticky w
|
||||||
|
|
||||||
${NS}::checkbutton $page.ntag -text [mc "Display nearby tags/heads"] \
|
${NS}::checkbutton $page.ntag -text [mc "Display nearby tags/heads"] \
|
||||||
-variable showneartags
|
-variable showneartags
|
||||||
grid x $page.ntag -sticky w
|
grid x $page.ntag -sticky w
|
||||||
@ -11635,7 +11663,7 @@ proc prefspage_general {notebook} {
|
|||||||
pack configure $page.webbrowserf.l -padx 10
|
pack configure $page.webbrowserf.l -padx 10
|
||||||
grid x $page.webbrowserf $page.webbrowser -sticky ew
|
grid x $page.webbrowserf $page.webbrowser -sticky ew
|
||||||
|
|
||||||
${NS}::label $page.lgen -text [mc "General options"]
|
${NS}::label $page.lgen -text [mc "General options"] -font mainfontbold
|
||||||
grid $page.lgen - -sticky w -pady 10
|
grid $page.lgen - -sticky w -pady 10
|
||||||
${NS}::checkbutton $page.want_ttk -variable want_ttk \
|
${NS}::checkbutton $page.want_ttk -variable want_ttk \
|
||||||
-text [mc "Use themed widgets"]
|
-text [mc "Use themed widgets"]
|
||||||
@ -11654,7 +11682,7 @@ proc prefspage_colors {notebook} {
|
|||||||
|
|
||||||
set page [create_prefs_page $notebook.colors]
|
set page [create_prefs_page $notebook.colors]
|
||||||
|
|
||||||
${NS}::label $page.cdisp -text [mc "Colors: press to choose"]
|
${NS}::label $page.cdisp -text [mc "Colors: press to choose"] -font mainfontbold
|
||||||
grid $page.cdisp - -sticky w -pady 10
|
grid $page.cdisp - -sticky w -pady 10
|
||||||
label $page.ui -padx 40 -relief sunk -background $uicolor
|
label $page.ui -padx 40 -relief sunk -background $uicolor
|
||||||
${NS}::button $page.uibut -text [mc "Interface"] \
|
${NS}::button $page.uibut -text [mc "Interface"] \
|
||||||
@ -11712,7 +11740,7 @@ proc prefspage_colors {notebook} {
|
|||||||
proc prefspage_fonts {notebook} {
|
proc prefspage_fonts {notebook} {
|
||||||
global NS
|
global NS
|
||||||
set page [create_prefs_page $notebook.fonts]
|
set page [create_prefs_page $notebook.fonts]
|
||||||
${NS}::label $page.cfont -text [mc "Fonts: press to choose"]
|
${NS}::label $page.cfont -text [mc "Fonts: press to choose"] -font mainfontbold
|
||||||
grid $page.cfont - -sticky w -pady 10
|
grid $page.cfont - -sticky w -pady 10
|
||||||
mkfontdisp mainfont $page [mc "Main font"]
|
mkfontdisp mainfont $page [mc "Main font"]
|
||||||
mkfontdisp textfont $page [mc "Diff display font"]
|
mkfontdisp textfont $page [mc "Diff display font"]
|
||||||
@ -11725,7 +11753,7 @@ proc doprefs {} {
|
|||||||
global oldprefs prefstop showneartags showlocalchanges
|
global oldprefs prefstop showneartags showlocalchanges
|
||||||
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
|
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
|
||||||
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
|
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
|
||||||
global hideremotes want_ttk have_ttk
|
global hideremotes want_ttk have_ttk wrapcomment wrapdefault
|
||||||
|
|
||||||
set top .gitkprefs
|
set top .gitkprefs
|
||||||
set prefstop $top
|
set prefstop $top
|
||||||
@ -11734,7 +11762,7 @@ proc doprefs {} {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
|
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
|
||||||
limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
|
limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
|
||||||
set oldprefs($v) [set $v]
|
set oldprefs($v) [set $v]
|
||||||
}
|
}
|
||||||
ttk_toplevel $top
|
ttk_toplevel $top
|
||||||
@ -11860,7 +11888,7 @@ proc prefscan {} {
|
|||||||
global oldprefs prefstop
|
global oldprefs prefstop
|
||||||
|
|
||||||
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
|
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
|
||||||
limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
|
limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
|
||||||
global $v
|
global $v
|
||||||
set $v $oldprefs($v)
|
set $v $oldprefs($v)
|
||||||
}
|
}
|
||||||
@ -11874,7 +11902,8 @@ proc prefsok {} {
|
|||||||
global oldprefs prefstop showneartags showlocalchanges
|
global oldprefs prefstop showneartags showlocalchanges
|
||||||
global fontpref mainfont textfont uifont
|
global fontpref mainfont textfont uifont
|
||||||
global limitdiffs treediffs perfile_attrs
|
global limitdiffs treediffs perfile_attrs
|
||||||
global hideremotes
|
global hideremotes wrapcomment wrapdefault
|
||||||
|
global ctext
|
||||||
|
|
||||||
catch {destroy $prefstop}
|
catch {destroy $prefstop}
|
||||||
unset prefstop
|
unset prefstop
|
||||||
@ -11923,6 +11952,12 @@ proc prefsok {} {
|
|||||||
if {$hideremotes != $oldprefs(hideremotes)} {
|
if {$hideremotes != $oldprefs(hideremotes)} {
|
||||||
rereadrefs
|
rereadrefs
|
||||||
}
|
}
|
||||||
|
if {$wrapcomment != $oldprefs(wrapcomment)} {
|
||||||
|
$ctext tag conf comment -wrap $wrapcomment
|
||||||
|
}
|
||||||
|
if {$wrapdefault != $oldprefs(wrapdefault)} {
|
||||||
|
$ctext configure -wrap $wrapdefault
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc formatdate {d} {
|
proc formatdate {d} {
|
||||||
@ -12392,6 +12427,7 @@ set downarrowlen 5
|
|||||||
set mingaplen 100
|
set mingaplen 100
|
||||||
set cmitmode "patch"
|
set cmitmode "patch"
|
||||||
set wrapcomment "none"
|
set wrapcomment "none"
|
||||||
|
set wrapdefault "none"
|
||||||
set showneartags 1
|
set showneartags 1
|
||||||
set hideremotes 0
|
set hideremotes 0
|
||||||
set maxrefs 20
|
set maxrefs 20
|
||||||
@ -12400,6 +12436,7 @@ set maxlinelen 200
|
|||||||
set showlocalchanges 1
|
set showlocalchanges 1
|
||||||
set limitdiffs 1
|
set limitdiffs 1
|
||||||
set datetimeformat "%Y-%m-%d %H:%M:%S"
|
set datetimeformat "%Y-%m-%d %H:%M:%S"
|
||||||
|
set autocopy 0
|
||||||
set autoselect 1
|
set autoselect 1
|
||||||
set autosellen 40
|
set autosellen 40
|
||||||
set perfile_attrs 0
|
set perfile_attrs 0
|
||||||
@ -12497,7 +12534,8 @@ config_check_tmp_exists 50
|
|||||||
|
|
||||||
set config_variables {
|
set config_variables {
|
||||||
mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth
|
mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth
|
||||||
cmitmode wrapcomment autoselect autosellen showneartags maxrefs visiblerefs
|
cmitmode wrapcomment wrapdefault autocopy autoselect autosellen
|
||||||
|
showneartags maxrefs visiblerefs
|
||||||
hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk
|
hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk
|
||||||
bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors
|
bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors
|
||||||
markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor
|
markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor
|
||||||
@ -12687,7 +12725,7 @@ catch {
|
|||||||
wm iconphoto . -default gitlogo gitlogo32
|
wm iconphoto . -default gitlogo gitlogo32
|
||||||
}
|
}
|
||||||
# wait for the window to become visible
|
# wait for the window to become visible
|
||||||
tkwait visibility .
|
if {![winfo viewable .]} {tkwait visibility .}
|
||||||
set_window_title
|
set_window_title
|
||||||
update
|
update
|
||||||
readrefs
|
readrefs
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user