52 |
|
tga-bw tga-8 tga-16 tga-24 TIFF-bw TIFF-24} |
53 |
|
set conv(typ) tga-24 |
54 |
|
|
55 |
+ |
proc testappend {flst tf} { # test if tf exists and append to flst if so |
56 |
+ |
upvar $flst mylist |
57 |
+ |
if [file exists $tf] { |
58 |
+ |
lappend mylist $tf |
59 |
+ |
} |
60 |
+ |
} |
61 |
+ |
|
62 |
|
proc list_views {} { # List finished and unfinished pictures |
63 |
< |
global radvar fvwbox ufvwbox |
63 |
> |
global radvar fvwbox ufvwbox alldone rawfroot |
64 |
|
set fpics {} |
65 |
|
set ufpics {} |
66 |
|
foreach vw $radvar(view) { |
67 |
< |
set fnr $radvar(PICTURE)_[lindex $vw 0] |
61 |
< |
if [file exists $fnr.raw] { |
67 |
> |
if [file exists ${rawfroot}_[lindex $vw 0].unf] { |
68 |
|
lappend ufpics [lindex $vw 0] |
69 |
< |
} elseif {[file exists $fnr.pic]} { |
69 |
> |
} elseif {[file exists $radvar(PICTURE)_[lindex $vw 0].pic]} { |
70 |
|
lappend fpics [lindex $vw 0] |
71 |
|
} |
72 |
|
} |
74 |
|
eval $fvwbox insert end $fpics |
75 |
|
$ufvwbox delete 0 end |
76 |
|
eval $ufvwbox insert end $ufpics |
77 |
+ |
set alldone [expr [llength $fpics] == [llength $radvar(view)]] |
78 |
|
} |
79 |
|
|
80 |
|
proc delpic {} { # Delete selected pictures |
81 |
< |
global curmess alldone |
82 |
< |
set selected_pics [get_selpics] |
83 |
< |
if {"$selected_pics" == {}} { |
81 |
> |
global curmess |
82 |
> |
set selected_pics [get_selpics 1] |
83 |
> |
if {$selected_pics == {}} { |
84 |
|
set curmess "No pictures selected." |
85 |
|
return |
86 |
|
} |
87 |
|
if [tk_dialog .dlg {Verification} \ |
88 |
< |
"Really delete picture file(s) $selected_pics?" \ |
88 |
> |
"Really delete file(s) $selected_pics?" \ |
89 |
|
questhead 0 {Delete} {Cancel}] { |
90 |
|
return |
91 |
|
} |
93 |
|
set curmess "Deleted [llength $selected_pics] file(s)." |
94 |
|
} |
95 |
|
list_views |
89 |
– |
set alldone 0 |
96 |
|
} |
97 |
|
|
98 |
< |
proc get_selpics {} { # return selected pictures |
99 |
< |
global fvwbox ufvwbox radvar |
98 |
> |
proc get_selpics {{getall 0}} { # return selected pictures |
99 |
> |
global fvwbox ufvwbox radvar rawfroot |
100 |
|
set sl {} |
101 |
|
foreach i [$fvwbox curselection] { |
102 |
< |
lappend sl $radvar(PICTURE)_[$fvwbox get $i].pic |
102 |
> |
testappend sl $radvar(PICTURE)_[$fvwbox get $i].pic |
103 |
> |
if {$getall && $rawfroot != $radvar(PICTURE)} { |
104 |
> |
testappend sl ${rawfroot}_[$fvwbox get $i].pic |
105 |
> |
} |
106 |
> |
if {$getall && $radvar(ZFILE) != {}} { |
107 |
> |
testappend sl $radvar(ZFILE)_[$fvwbox get $i].zbf |
108 |
> |
} |
109 |
|
} |
110 |
|
foreach i [$ufvwbox curselection] { |
111 |
< |
lappend sl $radvar(PICTURE)_[$ufvwbox get $i].raw |
111 |
> |
testappend sl ${rawfroot}_[$ufvwbox get $i].unf |
112 |
> |
if {$getall && $radvar(ZFILE) != {}} { |
113 |
> |
testappend sl $radvar(ZFILE)_[$ufvwbox get $i].zbf |
114 |
> |
} |
115 |
|
} |
116 |
|
return $sl |
117 |
|
} |
119 |
|
proc dsppic {} { # Display selected pictures |
120 |
|
global curmess dispcom radvar |
121 |
|
set selected_pics [get_selpics] |
122 |
< |
if {"$selected_pics" == {}} { |
122 |
> |
if {$selected_pics == {}} { |
123 |
|
set curmess "No pictures selected." |
124 |
|
return |
125 |
|
} |
126 |
< |
if {"$radvar(EXPOSURE)" == {}} { |
126 |
> |
if {$radvar(EXPOSURE) == {}} { |
127 |
|
set ev 0 |
128 |
|
} else { |
129 |
|
if [regexp {^[+-]} $radvar(EXPOSURE)] { |
138 |
|
} |
139 |
|
} |
140 |
|
foreach p $selected_pics { |
141 |
< |
if [string match *.raw $p] { |
141 |
> |
if {[string match *.unf $p] || |
142 |
> |
$radvar(PICTURE) == "$radvar(RAWFILE)"} { |
143 |
|
set dc [format $dispcom $ev $p] |
144 |
|
} else { |
145 |
|
set dc [format $dispcom 0 $p] |
179 |
|
} |
180 |
|
|
181 |
|
proc do_results w { # Results screen |
182 |
< |
global radvar curmess fvwbox ufvwbox dispcom prntcom conv convdest |
182 |
> |
global radvar curmess fvwbox ufvwbox dispcom prntcom conv \ |
183 |
> |
rawfroot convdest |
184 |
|
if {"$w" == "done"} { |
185 |
< |
unset fvwbox ufvwbox convdest |
185 |
> |
unset fvwbox ufvwbox convdest rawfroot |
186 |
|
return |
187 |
|
} |
188 |
|
frame $w |
262 |
|
place $w.prte -relwidth .5714 -relheight .0610 -relx .3571 -rely .8537 |
263 |
|
helplink $w.prte trad results printcommand |
264 |
|
# Fill in views |
265 |
+ |
if {$radvar(RAWFILE) != {}} { |
266 |
+ |
set rawfroot $radvar(RAWFILE) |
267 |
+ |
} else { |
268 |
+ |
set rawfroot $radvar(PICTURE) |
269 |
+ |
} |
270 |
|
list_views |
271 |
|
} |