@matheusbsbs / matheus-bagliano / commits / 51530d1722
Fork 0

git-gui: Change the main window progress bar to use status_bar

Now that we have a fancy status bar mega-widget we can reuse that within our main window. This opens the door for implementating future improvements like a progress bar. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Jul 8, 2007 at 22:06 UTC 51530d1722b0a4cccc630043fc4b46d075bf8558
2 files changed +8 -12
git-gui.sh
+4 -10
@@ -438,7 +438,6 @@ set _reponame [lindex [file split \
438 set current_diff_path {}
439 set current_diff_side {}
440 set diff_actions [list]
441 -set ui_status_value {Initializing...}
441
442 set HEAD {}
443 set PARENT {}
@@ -761,13 +760,11 @@ proc mapdesc {state path} {
760 }
761
762 proc ui_status {msg} {
764 - set ::ui_status_value $msg
763 + $::main_status show $msg
764 }
765
766 proc ui_ready {{test {}}} {
768 - if {$test eq {} || $::ui_status_value eq $test} {
769 - ui_status Ready.
770 - }
767 + $::main_status show {Ready.} $test
768 }
769
770 proc escape_path {path} {
@@ -2207,12 +2204,9 @@ unset ui_diff_applyhunk
2204
2205 # -- Status Bar
2206 #
2210 -label .status -textvariable ui_status_value \
2211 - -anchor w \
2212 - -justify left \
2213 - -borderwidth 1 \
2214 - -relief sunken
2207 +set main_status [::status_bar::new .status]
2208 pack .status -anchor w -side bottom -fill x
2209 +$main_status show {Initializing...}
2210
2211 # -- Load geometry
2212 #
lib/status_bar.tcl
+4 -2
@@ -63,8 +63,10 @@ method stop {msg} {
63 set status $msg
64 }
65
66 -method show {msg} {
67 - set status $msg
66 +method show {msg {test {}}} {
67 + if {$test eq {} || $status eq $test} {
68 + set status $msg
69 + }
70 }
71
72 method _delete {current} {