contrib/rename_images - make sure the renamed image, or first renamed

image of a group is visible after renaming.
This commit is contained in:
Bill Ferguson
2024-06-19 11:41:54 -04:00
parent 5727b2d251
commit 94f41db6fc

View File

@@ -214,6 +214,7 @@ end
local function do_rename(images)
if #images > 0 then
local first_image = images[1]
local pattern = rename.widgets.pattern.text
dt.preferences.write(MODULE_NAME, "pattern", "string", pattern)
dt.print_log("pattern is " .. pattern)
@@ -256,6 +257,7 @@ local function do_rename(images)
stop_job(job)
local collect_rules = dt.gui.libs.collect.filter()
dt.gui.libs.collect.filter(collect_rules)
dt.gui.views.lighttable.set_image_visible(first_image)
dt.print(string.format(_("renamed %d images"), #images))
else -- pattern length
dt.print_error("no pattern supplied, returning...")