@@ -65,24 +65,6 @@ local os_path_seperator = '/'
65
65
if dt .configuration .running_os == ' windows' then os_path_seperator = ' \\ ' end
66
66
67
67
du .check_min_api_version (" 5.0.0" , " enfuseAdvanced" )
68
- dt .preferences .register (" executable_paths" , " align_image_stack" , -- name
69
- " file" , -- type
70
- ' enfuseAdvanced: Align Image Stack Location' , -- label
71
- ' Install location of align_image_stack. Requires restart to take effect.' , -- tooltip
72
- " align_image_stack" -- default
73
- )
74
- dt .preferences .register (" executable_paths" , " enfuse" , -- name
75
- " file" , -- type
76
- ' enfuseAdvanced: enfuse Location' , -- label
77
- ' Install location of enfuse. Requires restart to take effect.' , -- tooltip
78
- ' enfuse'
79
- )
80
- dt .preferences .register (" executable_paths" , " exiftool" , -- name
81
- " file" , -- type
82
- ' enfuseAdvanced: exiftool Location' , -- label
83
- ' Install location of exiftool. Requires restart to take effect.' , -- tooltip
84
- " exiftool" -- default
85
- )
86
68
87
69
-- INITS --
88
70
local AIS = {
@@ -172,6 +154,12 @@ local GUI = {
172
154
save = {};
173
155
variants = {};
174
156
variants_type = {}},
157
+ exes = {
158
+ align_image_stack = {},
159
+ enfuse = {},
160
+ exiftool = {},
161
+ update = {}
162
+ },
175
163
align = {},
176
164
options_contain = {},
177
165
show_options = {}
@@ -228,12 +216,41 @@ local function PreCall(prog_tbls) --looks to see if this is the first call, if s
228
216
prog .bin = df .check_if_bin_exists (prog .name )
229
217
if not prog .bin then
230
218
prog .install_error = true
219
+ dt .preferences .write (mod , ' bin_exists' , ' bool' , false )
231
220
else
232
221
prog .bin = CleanSpaces (prog .bin )
233
222
end
234
223
prog .first_run = false
235
224
end
236
225
end
226
+ if not dt .preferences .read (mod , ' bin_exists' , ' bool' ) then
227
+ GUI .options_contain .active = 4
228
+ GUI .show_options .sensitive = false
229
+ dt .print (' please update your binary locations' )
230
+ end
231
+ end
232
+
233
+ local function ExeUpdate (prog_tbl ) -- updates executable paths and verifies them
234
+ dt .preferences .write (mod , ' bin_exists' , ' bool' , true )
235
+ for _ ,prog in pairs (prog_tbl ) do
236
+ dt .preferences .write (' executable_paths' , prog .name , ' string' , GUI .exes [prog .name ].value )
237
+ prog .bin = df .check_if_bin_exists (prog .name )
238
+ if not prog .bin then
239
+ prog .install_error = true
240
+ dt .preferences .write (mod , ' bin_exists' , ' bool' , false )
241
+ dt .print (' issue with ' .. prog .name .. ' executable' )
242
+ else
243
+ prog .bin = CleanSpaces (prog .bin )
244
+ end
245
+ prog .first_run = false
246
+ end
247
+ if dt .preferences .read (mod , ' bin_exists' , ' bool' ) then
248
+ GUI .options_contain .active = 2
249
+ GUI .show_options .sensitive = true
250
+ dt .print (' update successful' )
251
+ else
252
+ dt .print (' update unsuccessful, please try again' )
253
+ end
237
254
end
238
255
239
256
local function GetArgsFromPreference (prog_table , prefix ) -- for each arg in a program table reads in the associated value in the active preference (which is continually updated via clicked/changed callback in GUI elements
@@ -958,6 +975,35 @@ GUI.Presets.variants_type = dt.new_widget('combobox'){
958
975
end
959
976
}
960
977
GUI .Presets .variants_type .sensitive = GUI .Presets .variants .value
978
+ temp = df .get_executable_path_preference (AIS .name )
979
+ GUI .exes .align_image_stack = dt .new_widget (' file_chooser_button' ){
980
+ title = ' AIS binary path' ,
981
+ value = temp ,
982
+ tooltip = temp ,
983
+ is_directory = false ,
984
+ changed_callback = function (self ) self .tooltip = self .value end
985
+ }
986
+ temp = df .get_executable_path_preference (ENF .name )
987
+ GUI .exes .enfuse = dt .new_widget (' file_chooser_button' ){
988
+ title = ' enfuse binary path' ,
989
+ value = temp ,
990
+ tooltip = temp ,
991
+ is_directory = false ,
992
+ changed_callback = function (self ) self .tooltip = self .value end
993
+ }
994
+ temp = df .get_executable_path_preference (EXF .name )
995
+ GUI .exes .exiftool = dt .new_widget (' file_chooser_button' ){
996
+ title = ' Exiftool binary path' ,
997
+ value = temp ,
998
+ tooltip = temp ,
999
+ is_directory = false ,
1000
+ changed_callback = function (self ) self .tooltip = self .value end
1001
+ }
1002
+ GUI .exes .update = dt .new_widget (' button' ){
1003
+ label = ' update' ,
1004
+ tooltip = ' update the binary paths with current values' ,
1005
+ clicked_callback = function () ExeUpdate ({AIS ,ENF ,EXF }) end
1006
+ }
961
1007
temp = GUI .Target .format .value
962
1008
if temp == ' tif' then temp = 1
963
1009
elseif temp == ' jpg' then temp = 2
@@ -1020,16 +1066,23 @@ local box_Target = dt.new_widget('box'){
1020
1066
GUI .Target .copy_tags ,
1021
1067
GUI .Target .add_tags
1022
1068
}
1069
+ local box_exes = dt .new_widget (' box' ){
1070
+ orientation = ' vertical' ,
1071
+ GUI .exes .align_image_stack ,
1072
+ GUI .exes .enfuse ,
1073
+ GUI .exes .exiftool ,
1074
+ GUI .exes .update
1075
+ }
1023
1076
GUI .options_contain = dt .new_widget (' stack' ){
1024
- active = 2 ,
1025
1077
box_AIS ,
1026
1078
box_ENF ,
1027
- box_Target
1079
+ box_Target ,
1080
+ box_exes
1028
1081
}
1029
1082
GUI .show_options = dt .new_widget (' combobox' ){
1030
1083
label = " show options" ,
1031
1084
tooltip = " show options for specified aspect of output" ,
1032
- selected = 1 ,
1085
+ selected = 2 ,
1033
1086
' align image stack' , ' enfuse/enblend' , ' target file' ,
1034
1087
changed_callback = function (self )
1035
1088
GUI .options_contain .active = self .selected
@@ -1040,7 +1093,13 @@ GUI.show_options = dt.new_widget('combobox'){
1040
1093
dt .preferences .write (mod , ' active_current_preset_ind' , ' integer' , self .selected )
1041
1094
end
1042
1095
}
1043
-
1096
+ if dt .preferences .read (mod , ' bin_exists' , ' bool' ) then
1097
+ GUI .options_contain .active = 2
1098
+ GUI .show_options .sensitive = true
1099
+ else
1100
+ GUI .options_contain .active = 4
1101
+ GUI .show_options .sensitive = false
1102
+ end
1044
1103
local storage_widget = dt .new_widget (" box" ) {
1045
1104
orientation = " vertical" ,
1046
1105
GUI .show_options ,
0 commit comments