summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e8a0c69)
raw | patch | inline | side by side (parent: e8a0c69)
author | Paul Mackerras <paulus@samba.org> | |
Sun, 11 May 2008 12:13:02 +0000 (22:13 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sun, 11 May 2008 12:13:02 +0000 (22:13 +1000) |
This adds a couple of fields in the bar just below the upper panes
that show the row number of the currently selected commit, and how
many rows are displayed in total. The latter increments as commits
are read in, and thus functions to show that progress is being made.
This therefore also removes the code that showed progress using a
green oscillating bar in the progress bar window (which some people
disliked).
Signed-off-by: Paul Mackerras <paulus@samba.org>
that show the row number of the currently selected commit, and how
many rows are displayed in total. The latter increments as commits
are read in, and thus functions to show that progress is being made.
This therefore also removes the code that showed progress using a
green oscillating bar in the progress bar window (which some people
disliked).
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 4b7b019857b48756e7d07337e26a4da98ab9e56a..c352befe893d586a29f5440dd117eb1f88b7d451 100755 (executable)
--- a/gitk
+++ b/gitk
# Start off a git log process and arrange to read its output
proc start_rev_list {view} {
# Start off a git log process and arrange to read its output
proc start_rev_list {view} {
- global startmsecs commitidx viewcomplete
+ global startmsecs commitidx viewcomplete curview
global commfd leftover tclencoding
global viewargs viewargscmd viewfiles vfilelimit
global showlocalchanges commitinterest mainheadid
global commfd leftover tclencoding
global viewargs viewargscmd viewfiles vfilelimit
global showlocalchanges commitinterest mainheadid
- global progressdirn progresscoords proglastnc curview
global viewactive loginstance viewinstances vmergeonly
global pending_select mainheadid
global vcanopt vflags vrevs vorigargs
global viewactive loginstance viewinstances vmergeonly
global pending_select mainheadid
global vcanopt vflags vrevs vorigargs
filerun $fd [list getcommitlines $fd $i $view 0]
nowbusy $view [mc "Reading"]
if {$view == $curview} {
filerun $fd [list getcommitlines $fd $i $view 0]
nowbusy $view [mc "Reading"]
if {$view == $curview} {
- set progressdirn 1
- set progresscoords {0 0}
- set proglastnc 0
set pending_select $mainheadid
}
set viewcomplete($view) 0
set pending_select $mainheadid
}
set viewcomplete($view) 0
proc reloadcommits {} {
global curview viewcomplete selectedline currentid thickerline
global showneartags treediffs commitinterest cached_commitrow
proc reloadcommits {} {
global curview viewcomplete selectedline currentid thickerline
global showneartags treediffs commitinterest cached_commitrow
- global progresscoords targetid
+ global targetid
if {!$viewcomplete($curview)} {
stop_rev_list $curview
if {!$viewcomplete($curview)} {
stop_rev_list $curview
- set progresscoords {0 0}
- adjustprogress
}
resetvarcs $curview
catch {unset selectedline}
}
resetvarcs $curview
catch {unset selectedline}
if {![eof $fd]} {
return 1
}
if {![eof $fd]} {
return 1
}
- global commfd viewcomplete viewactive viewname progresscoords
+ global commfd viewcomplete viewactive viewname
global viewinstances
unset commfd($inst)
set i [lsearch -exact $viewinstances($view) $inst]
global viewinstances
unset commfd($inst)
set i [lsearch -exact $viewinstances($view) $inst]
# appeared in the list
closevarcs $view
notbusy $view
# appeared in the list
closevarcs $view
notbusy $view
- set progresscoords {0 0}
- adjustprogress
}
if {$view == $curview} {
run chewcommits
}
if {$view == $curview} {
run chewcommits
foreach s $scripts {
eval $s
}
foreach s $scripts {
eval $s
}
- if {$view == $curview} {
- # update progress bar
- global progressdirn progresscoords proglastnc
- set inc [expr {($commitidx($view) - $proglastnc) * 0.0002}]
- set proglastnc $commitidx($view)
- set l [lindex $progresscoords 0]
- set r [lindex $progresscoords 1]
- if {$progressdirn} {
- set r [expr {$r + $inc}]
- if {$r >= 1.0} {
- set r 1.0
- set progressdirn 0
- }
- if {$r > 0.2} {
- set l [expr {$r - 0.2}]
- }
- } else {
- set l [expr {$l - $inc}]
- if {$l <= 0.0} {
- set l 0.0
- set progressdirn 1
- }
- set r [expr {$l + 0.2}]
- }
- set progresscoords [list $l $r]
- adjustprogress
- }
}
return 2
}
}
return 2
}
global bgcolor fgcolor bglist fglist diffcolors selectbgcolor
global headctxmenu progresscanv progressitem progresscoords statusw
global fprogitem fprogcoord lastprogupdate progupdatepending
global bgcolor fgcolor bglist fglist diffcolors selectbgcolor
global headctxmenu progresscanv progressitem progresscoords statusw
global fprogitem fprogcoord lastprogupdate progupdatepending
- global rprogitem rprogcoord
+ global rprogitem rprogcoord rownumsel numcommits
global have_tk85
menu .bar
global have_tk85
menu .bar
-state disabled -width 26
pack .tf.bar.rightbut -side left -fill y
-state disabled -width 26
pack .tf.bar.rightbut -side left -fill y
+ label .tf.bar.rowlabel -text [mc "Row"]
+ set rownumsel {}
+ label .tf.bar.rownum -width 7 -font textfont -textvariable rownumsel \
+ -relief sunken -anchor e
+ label .tf.bar.rowlabel2 -text "/"
+ label .tf.bar.numcommits -width 7 -font textfont -textvariable numcommits \
+ -relief sunken -anchor e
+ pack .tf.bar.rowlabel .tf.bar.rownum .tf.bar.rowlabel2 .tf.bar.numcommits \
+ -side left
+ global selectedline
+ trace add variable selectedline {write unset} selectedline_change
+
# Status label and progress bar
set statusw .tf.bar.status
label $statusw -width 15 -relief sunken
# Status label and progress bar
set statusw .tf.bar.status
label $statusw -width 15 -relief sunken
}
}
}
}
+# Update row number label when selectedline changes
+proc selectedline_change {n1 n2 op} {
+ global selectedline rownumsel
+
+ if {$op eq "unset"} {
+ set rownumsel {}
+ } else {
+ set rownumsel [expr {$selectedline + 1}]
+ }
+}
+
# mouse-2 makes all windows scan vertically, but only the one
# the cursor is in scans horizontally
proc canvscan {op w x y} {
# mouse-2 makes all windows scan vertically, but only the one
# the cursor is in scans horizontally
proc canvscan {op w x y} {
set viewargs(0) {}
set viewargscmd(0) {}
set viewargs(0) {}
set viewargscmd(0) {}
+set numcommits 0
set loginstance 0
set cmdlineok 0
set stopped 0
set loginstance 0
set cmdlineok 0
set stopped 0