Added compatibility for lua events API change 6.2.1.

This commit is contained in:
wpferguson
2021-02-01 18:27:20 -05:00
parent da0235ab27
commit ade7008127
32 changed files with 109 additions and 56 deletions

View File

@@ -30,6 +30,7 @@ local du = require "lib/dtutils"
local gettext = dt.gettext
du.check_min_api_version("3.0.0", "copy_paste_metadata")
local CURR_API_STRING = dt.configuration.api_version_string
-- set this to "false" if you don't want to overwrite metadata fields
-- (title, description, creator, publisher and rights) that are already set
@@ -125,13 +126,13 @@ dt.gui.libs.image.register_action(
)
dt.register_event(
"shortcut",
CURR_API_STRING >= "6.2.1" and "capmd1", "shortcut" or "shortcut" ,
function(event, shortcut) copy(dt.gui.action_images[1]) end,
"copy metadata"
)
dt.register_event(
"shortcut",
CURR_API_STRING >= "6.2.1" and "capmd2", "shortcut" or "shortcut" ,
function(event, shortcut) paste(dt.gui.action_images) end,
"paste metadata"
)