@@ -120,6 +120,7 @@ local COLORSPACE_TO_GUI_ACTION = {
120
120
[DT_COLORSPACE_DISPLAY_P3 ] = 11
121
121
}
122
122
123
+ local UI_SLEEP_MS = 50 -- How many ms to sleep after UI action.
123
124
124
125
local function set_log_level (level )
125
126
local old_log_level = log .log_level ()
@@ -221,9 +222,10 @@ local function set_profile(colorspace)
221
222
local new = COLORSPACE_TO_GUI_ACTION [colorspace ] or colorspace
222
223
log .msg (log .debug , string.format (" Changing export profile from %d to %d" , old , new ))
223
224
dt .gui .action (" lib/export/profile" , 0 , " selection" , " next" , new - old )
225
+ dt .control .sleep (UI_SLEEP_MS )
224
226
return old
225
227
else
226
- -- Old method, timing-dependent
228
+ -- Old method
227
229
return set_combobox (" lib/export/profile" , 0 , " plugins/lighttable/export/icctype" , colorspace )
228
230
end
229
231
end
@@ -238,12 +240,12 @@ local function set_combobox(path, instance, config_name, new_config_value)
238
240
end
239
241
240
242
dt .gui .action (path , 0 , " selection" , " first" , 1.0 )
241
- dt .control .sleep (50 )
243
+ dt .control .sleep (UI_SLEEP_MS )
242
244
local limit , i = 30 , 0 -- in case there is no matching config value in the first n entries of a combobox.
243
245
while i < limit do
244
246
i = i + 1
245
247
dt .gui .action (path , 0 , " selection" , " next" , 1.0 )
246
- dt .control .sleep (50 )
248
+ dt .control .sleep (UI_SLEEP_MS )
247
249
if dt .preferences .read (" darktable" , config_name , " integer" ) == new_config_value then
248
250
log .msg (log .debug , string.format (_ (" Changed %s from %d to %d" ), config_name , pref , new_config_value ))
249
251
return pref
0 commit comments