- set viewfiles($n) $files
- catch {destroy $newviewtop}
- unset newviewtop
- .bar.view add radiobutton -label $viewname($n) \
- -command [list showview $n] -variable selectedview -value $n
- after idle showview $n
-}
-
-proc newviewcan {} {
- global newviewtop
-
- catch {destroy $newviewtop}
- unset newviewtop
+ if {![info exists viewfiles($n)]} {
+ # creating a new view
+ incr nextviewnum
+ set viewname($n) $newviewname($n)
+ set viewperm($n) $newviewperm($n)
+ set viewfiles($n) $files
+ .bar.view add radiobutton -label $viewname($n) \
+ -command [list showview $n] -variable selectedview -value $n
+ after idle showview $n
+ } else {
+ # editing an existing view
+ set viewperm($n) $newviewperm($n)
+ if {$newviewname($n) ne $viewname($n)} {
+ set viewname($n) $newviewname($n)
+ set i [viewmenuitem $n]
+ if {$i ne {}} {
+ .bar.view entryconf $i -label $viewname($n)
+ }
+ }
+ if {$files ne $viewfiles($n)} {
+ set viewfiles($n) $files
+ if {$curview == $n} {
+ after idle updatecommits
+ }
+ }
+ }
+ catch {destroy $top}