Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 2dbfa67

Browse files
committed
Merge git://ozlabs.org/~paulus/gitk
* 'master' of git://ozlabs.org/~paulus/gitk: gitk: Indent word-wrapped lines in commit display header gitk: Comply with XDG base directory specification gitk: Replace "next" and "prev" buttons with down and up arrows gitk: chmod +x po2msg.sh gitk: Update copyright dates gitk: Add Bulgarian translation (304t) gitk: Fix mistype
2 parents f21e1c5 + 76d64ca commit 2dbfa67

File tree

3 files changed

+1396
-11
lines changed

3 files changed

+1396
-11
lines changed

gitk-git/gitk

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Tcl ignores the next line -*- tcl -*- \
33
exec wish "$0" -- "$@"
44

5-
# Copyright © 2005-2011 Paul Mackerras. All rights reserved.
5+
# Copyright © 2005-2014 Paul Mackerras. All rights reserved.
66
# This program is free software; it may be used, copied, modified
77
# and distributed under the terms of the GNU General Public Licence,
88
# either version 2, or (at your option) any later version.
@@ -2263,9 +2263,35 @@ proc makewindow {} {
22632263

22642264
# build up the bottom bar of upper window
22652265
${NS}::label .tf.lbar.flabel -text "[mc "Find"] "
2266-
${NS}::button .tf.lbar.fnext -text [mc "next"] -command {dofind 1 1}
2267-
${NS}::button .tf.lbar.fprev -text [mc "prev"] -command {dofind -1 1}
2266+
2267+
set bm_down_data {
2268+
#define down_width 16
2269+
#define down_height 16
2270+
static unsigned char down_bits[] = {
2271+
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
2272+
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
2273+
0x87, 0xe1, 0x8e, 0x71, 0x9c, 0x39, 0xb8, 0x1d,
2274+
0xf0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01};
2275+
}
2276+
image create bitmap bm-down -data $bm_down_data -foreground $uifgcolor
2277+
${NS}::button .tf.lbar.fnext -width 26 -command {dofind 1 1}
2278+
.tf.lbar.fnext configure -image bm-down
2279+
2280+
set bm_up_data {
2281+
#define up_width 16
2282+
#define up_height 16
2283+
static unsigned char up_bits[] = {
2284+
0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f,
2285+
0xb8, 0x1d, 0x9c, 0x39, 0x8e, 0x71, 0x87, 0xe1,
2286+
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
2287+
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01};
2288+
}
2289+
image create bitmap bm-up -data $bm_up_data -foreground $uifgcolor
2290+
${NS}::button .tf.lbar.fprev -width 26 -command {dofind -1 1}
2291+
.tf.lbar.fprev configure -image bm-up
2292+
22682293
${NS}::label .tf.lbar.flab2 -text " [mc "commit"] "
2294+
22692295
pack .tf.lbar.flabel .tf.lbar.fnext .tf.lbar.fprev .tf.lbar.flab2 \
22702296
-side left -fill y
22712297
set gdttype [mc "containing:"]
@@ -2403,7 +2429,7 @@ proc makewindow {} {
24032429
$ctext tag conf msep -font textfontbold
24042430
$ctext tag conf found -back $foundbgcolor
24052431
$ctext tag conf currentsearchhit -back $currentsearchhitbgcolor
2406-
$ctext tag conf wwrap -wrap word
2432+
$ctext tag conf wwrap -wrap word -lmargin2 1c
24072433
$ctext tag conf bold -font textfontbold
24082434

24092435
.pwbottom add .bleft
@@ -2761,14 +2787,17 @@ proc savestuff {w} {
27612787
global linkfgcolor circleoutlinecolor
27622788
global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk
27632789
global hideremotes want_ttk maxrefs
2790+
global config_file config_file_tmp
27642791

27652792
if {$stuffsaved} return
27662793
if {![winfo viewable .]} return
27672794
catch {
2768-
if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
2769-
set f [open "~/.gitk-new" w]
2795+
if {[file exists $config_file_tmp]} {
2796+
file delete -force $config_file_tmp
2797+
}
2798+
set f [open $config_file_tmp w]
27702799
if {$::tcl_platform(platform) eq {windows}} {
2771-
file attributes "~/.gitk-new" -hidden true
2800+
file attributes $config_file_tmp -hidden true
27722801
}
27732802
puts $f [list set mainfont $mainfont]
27742803
puts $f [list set textfont $textfont]
@@ -2845,7 +2874,7 @@ proc savestuff {w} {
28452874
}
28462875
puts $f "}"
28472876
close $f
2848-
file rename -force "~/.gitk-new" "~/.gitk"
2877+
file rename -force $config_file_tmp $config_file
28492878
}
28502879
set stuffsaved 1
28512880
}
@@ -2947,7 +2976,7 @@ proc about {} {
29472976
message $w.m -text [mc "
29482977
Gitk - a commit viewer for git
29492978
2950-
Copyright \u00a9 2005-2011 Paul Mackerras
2979+
Copyright \u00a9 2005-2014 Paul Mackerras
29512980
29522981
Use and redistribute under the terms of the GNU General Public License"] \
29532982
-justify center -aspect 400 -border 2 -bg white -relief groove
@@ -7922,7 +7951,7 @@ proc blobdiffmaybeseehere {ateof} {
79227951
if {$diffseehere >= 0} {
79237952
mark_ctext_line [lindex [split $diffseehere .] 0]
79247953
}
7925-
maybe_scroll_ctext ateof
7954+
maybe_scroll_ctext $ateof
79267955
}
79277956

79287957
proc getblobdiffline {bdf ids} {
@@ -12058,7 +12087,29 @@ namespace import ::msgcat::mc
1205812087
## And eventually load the actual message catalog
1205912088
::msgcat::mcload $gitk_msgsdir
1206012089

12061-
catch {source ~/.gitk}
12090+
catch {
12091+
# follow the XDG base directory specification by default. See
12092+
# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
12093+
if {[info exists env(XDG_CONFIG_HOME)] && $env(XDG_CONFIG_HOME) ne ""} {
12094+
# XDG_CONFIG_HOME environment variable is set
12095+
set config_file [file join $env(XDG_CONFIG_HOME) git gitk]
12096+
set config_file_tmp [file join $env(XDG_CONFIG_HOME) git gitk-tmp]
12097+
} else {
12098+
# default XDG_CONFIG_HOME
12099+
set config_file "~/.config/git/gitk"
12100+
set config_file_tmp "~/.config/git/gitk-tmp"
12101+
}
12102+
if {![file exists $config_file]} {
12103+
# for backward compatibility use the old config file if it exists
12104+
if {[file exists "~/.gitk"]} {
12105+
set config_file "~/.gitk"
12106+
set config_file_tmp "~/.gitk-tmp"
12107+
} elseif {![file exists [file dirname $config_file]]} {
12108+
file mkdir [file dirname $config_file]
12109+
}
12110+
}
12111+
source $config_file
12112+
}
1206212113

1206312114
parsefont mainfont $mainfont
1206412115
eval font create mainfont [fontflags mainfont]

0 commit comments

Comments
 (0)