git-gui: Start file status display refactoring.
I'm going to refactor the way file status information gets displayed so it more closely aligns with the way 'git-runstatus' displays the differences between HEAD<->index and index<->working directory. To that end the other file list is going to be changed to be the working directory difference. So this change renames it. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 20, 2007 at 22:06 UTC
0812665e578cf8ac1fe9a69b5557e3781be2d8ff
1 file changed
+27
-27
git-gui.sh
+27
-27
@@ -337,7 +337,7 @@ proc PARENT {} {
337
338
proc rescan {after} {
339
global HEAD PARENT MERGE_HEAD commit_type
340
- global ui_index ui_other ui_status_value ui_comm
340
+ global ui_index ui_workdir ui_status_value ui_comm
341
global rescan_active file_states
342
global repo_config
343
@@ -561,7 +561,7 @@ proc prune_selection {} {
561
## diff
562
563
proc clear_diff {} {
564
- global ui_diff current_diff ui_index ui_other
564
+ global ui_diff current_diff ui_index ui_workdir
565
566
$ui_diff conf -state normal
567
$ui_diff delete 0.0 end
@@ -570,7 +570,7 @@ proc clear_diff {} {
570
set current_diff {}
571
572
$ui_index tag remove in_diff 0.0 end
573
- $ui_other tag remove in_diff 0.0 end
573
+ $ui_workdir tag remove in_diff 0.0 end
574
}
575
576
proc reshow_diff {} {
@@ -1231,11 +1231,11 @@ proc push_to {remote} {
1231
## ui helpers
1232
1233
proc mapcol {state path} {
1234
- global all_cols ui_other
1234
+ global all_cols ui_workdir
1235
1236
if {[catch {set r $all_cols($state)}]} {
1237
puts "error: no column for state={$state} $path"
1238
- return $ui_other
1238
+ return $ui_workdir
1239
}
1240
return $r
1241
}
@@ -1368,19 +1368,19 @@ proc display_file {path state} {
1368
}
1369
1370
proc display_all_files {} {
1371
- global ui_index ui_other
1371
+ global ui_index ui_workdir
1372
global file_states file_lists
1373
global last_clicked selected_paths
1374
1375
$ui_index conf -state normal
1376
- $ui_other conf -state normal
1376
+ $ui_workdir conf -state normal
1377
1378
$ui_index delete 0.0 end
1379
- $ui_other delete 0.0 end
1379
+ $ui_workdir delete 0.0 end
1380
set last_clicked {}
1381
1382
set file_lists($ui_index) [list]
1383
- set file_lists($ui_other) [list]
1383
+ set file_lists($ui_workdir) [list]
1384
1385
foreach path [lsort [array names file_states]] {
1386
set s $file_states($path)
@@ -1402,7 +1402,7 @@ proc display_all_files {} {
1402
}
1403
1404
$ui_index conf -state disabled
1405
- $ui_other conf -state disabled
1405
+ $ui_workdir conf -state disabled
1406
}
1407
1408
proc update_indexinfo {msg pathList after} {
@@ -1960,7 +1960,7 @@ static unsigned char file_merge_bits[] = {
1960
} -maskdata $filemask
1961
1962
set ui_index .vpane.files.index.list
1963
-set ui_other .vpane.files.other.list
1963
+set ui_workdir .vpane.files.workdir.list
1964
set max_status_desc 0
1965
foreach i {
1966
{__ i plain "Unmodified"}
@@ -1990,7 +1990,7 @@ foreach i {
1990
if {[lindex $i 1] eq {i}} {
1991
set all_cols([lindex $i 0]) $ui_index
1992
} else {
1993
- set all_cols([lindex $i 0]) $ui_other
1993
+ set all_cols([lindex $i 0]) $ui_workdir
1994
}
1995
set all_icons([lindex $i 0]) file_[lindex $i 2]
1996
set all_descs([lindex $i 0]) [lindex $i 3]
@@ -2858,7 +2858,7 @@ proc do_macosx_app {} {
2858
}
2859
2860
proc toggle_or_diff {w x y} {
2861
- global file_states file_lists current_diff ui_index ui_other
2861
+ global file_states file_lists current_diff ui_index ui_workdir
2862
global last_clicked selected_paths
2863
2864
set pos [split [$w index @$x,$y] .]
@@ -2873,7 +2873,7 @@ proc toggle_or_diff {w x y} {
2873
set last_clicked [list $w $lno]
2874
array unset selected_paths
2875
$ui_index tag remove in_sel 0.0 end
2876
- $ui_other tag remove in_sel 0.0 end
2876
+ $ui_workdir tag remove in_sel 0.0 end
2877
2878
if {$col == 0} {
2879
if {$current_diff eq $path} {
@@ -3317,25 +3317,25 @@ pack .vpane.files.index.sb -side right -fill y
3317
pack $ui_index -side left -fill both -expand 1
3318
.vpane.files add .vpane.files.index -sticky nsew
3319
3320
-# -- Other (Add) File List
3320
+# -- Working Directory File List
3321
#
3322
-frame .vpane.files.other -height 100 -width 100
3323
-label .vpane.files.other.title -text {Untracked Files} \
3322
+frame .vpane.files.workdir -height 100 -width 100
3323
+label .vpane.files.workdir.title -text {Untracked Files} \
3324
-background red \
3325
-font font_ui
3326
-text $ui_other -background white -borderwidth 0 \
3326
+text $ui_workdir -background white -borderwidth 0 \
3327
-width 40 -height 10 \
3328
-font font_ui \
3329
-cursor $cursor_ptr \
3330
- -yscrollcommand {.vpane.files.other.sb set} \
3330
+ -yscrollcommand {.vpane.files.workdir.sb set} \
3331
-state disabled
3332
-scrollbar .vpane.files.other.sb -command [list $ui_other yview]
3333
-pack .vpane.files.other.title -side top -fill x
3334
-pack .vpane.files.other.sb -side right -fill y
3335
-pack $ui_other -side left -fill both -expand 1
3336
-.vpane.files add .vpane.files.other -sticky nsew
3332
+scrollbar .vpane.files.workdir.sb -command [list $ui_workdir yview]
3333
+pack .vpane.files.workdir.title -side top -fill x
3334
+pack .vpane.files.workdir.sb -side right -fill y
3335
+pack $ui_workdir -side left -fill both -expand 1
3336
+.vpane.files add .vpane.files.workdir -sticky nsew
3337
3338
-foreach i [list $ui_index $ui_other] {
3338
+foreach i [list $ui_index $ui_workdir] {
3339
$i tag conf in_diff -font font_uibold
3340
$i tag conf in_sel \
3341
-background [$i cget -foreground] \
@@ -3703,7 +3703,7 @@ bind all <$M1B-Key-q> do_quit
3703
bind all <$M1B-Key-Q> do_quit
3704
bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
3705
bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
3706
-foreach i [list $ui_index $ui_other] {
3706
+foreach i [list $ui_index $ui_workdir] {
3707
bind $i <Button-1> "toggle_or_diff $i %x %y; break"
3708
bind $i <$M1B-Button-1> "add_one_to_selection $i %x %y; break"
3709
bind $i <Shift-Button-1> "add_range_to_selection $i %x %y; break"
@@ -3711,7 +3711,7 @@ foreach i [list $ui_index $ui_other] {
3711
unset i
3712
3713
set file_lists($ui_index) [list]
3714
-set file_lists($ui_other) [list]
3714
+set file_lists($ui_workdir) [list]
3715
3716
set HEAD {}
3717
set PARENT {}