Added metadata fields to scripts that script_manager can access and

display as a tooltip.

Added script_manager integration to those scripts that didn't have it.
This commit is contained in:
Bill Ferguson
2024-05-15 21:23:13 -04:00
parent ac945b9843
commit 55e68f8cd0
70 changed files with 2311 additions and 1610 deletions

View File

@@ -34,10 +34,25 @@ local cjson = require "cjson"
du.check_min_api_version("2.0.0", "check_for_updates")
local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("check_for_updates", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end
-- return data structure for script_manager
local script_data = {}
script_data.metadata = {
name = "check_for_updates",
purpose = _("check for newer darktable releases"),
author = "Tobias Ellinghaus",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/check_for_updates"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again

View File

@@ -31,10 +31,23 @@ local gettext = dt.gettext.gettext
du.check_min_api_version("7.0.0", "copy_paste_metadata")
dt.gettext.bindtextdomain("copy_paste_metadata", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end
-- return data structure for script_manager
local script_data = {}
script_data.metadata = {
name = "copy_paste_metadata",
purpose = _("adds keyboard shortcuts and buttons to copy/paste metadata between images"),
author = "Tobias Ellinghaus",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/copy_paste_metadata"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
@@ -58,12 +71,6 @@ local publisher = ""
local rights = ""
local tags = {}
gettext.bindtextdomain("copy_paste_metadata", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end
local function copy(image)
if not image then
have_data = false

View File

@@ -33,10 +33,25 @@ local du = require "lib/dtutils"
du.check_min_api_version("2.0.0", "delete_long_tags")
local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("delete_long_tags", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end
-- return data structure for script_manager
local script_data = {}
script_data.metadata = {
name = "delete_long_tags",
purpose = _("delete all tags longer than a set length"),
author = "Tobias Ellinghaus",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/delete_long_tags"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again

View File

@@ -37,10 +37,25 @@ local function destroy()
-- noting to destroy
end
local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("delete_unused_tags", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end
-- return data structure for script_manager
local script_data = {}
script_data.metadata = {
name = "delete_unused_tags",
purpose = _("delete unused tags"),
author = "Tobias Ellinghaus",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/delete_unused_tags"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again

View File

@@ -43,10 +43,23 @@ local gettext = dt.gettext.gettext
du.check_min_api_version("7.0.0", "enfuse")
dt.gettext.bindtextdomain("enfuse", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end
-- return data structure for script_manager
local script_data = {}
script_data.metadata = {
name = "enfuse",
purpose = _("exposure blend images"),
author = "Tobias Ellinghaus",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/enfuse"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
@@ -57,12 +70,6 @@ enf.event_registered = false
enf.module_installed = false
enf.lib_widgets = {}
gettext.bindtextdomain("enfuse", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end
local function install_module()
if not enf.module_installed then
dt.register_lib(

View File

@@ -40,7 +40,7 @@ require "darktable.debug"
local gettext = dt.gettext.gettext
gettext.bindtextdomain("generate_image_txt", dt.configuration.config_dir .."/lua/locale/")
dt.gettext.bindtextdomain("generate_image_txt", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
@@ -52,6 +52,13 @@ du.check_min_api_version("7.0.0", "generate_image_txt")
local script_data = {}
script_data.metadata = {
name = "generate_image_txt",
purpose = _("overlay metadata on the selected image(s)"),
author = "Tobias Ellinghaus",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/generate_image_txt"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again

View File

@@ -33,10 +33,25 @@ local du = require "lib/dtutils"
du.check_min_api_version("7.0.0", "image_path_in_ui")
local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("image_path_in_ui", dt.configuration.config_dir .."/lua/locale/")
local function _(msgid)
return gettext(msgid)
end
-- return data structure for script_manager
local script_data = {}
script_data.metadata = {
name = "image_path_in_ui",
purpose = _("print the image path in the UI"),
author = "Jérémy Rosen",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/image_path_in_ui"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again

View File

@@ -32,14 +32,28 @@ USAGE
local dt = require "darktable"
local gettext = dt.gettext.gettext
local gettext = dt.gettext.gettext
gettext.bindtextdomain("import_filter_manager", dt.configuration.config_dir .."/lua/locale/")
dt.gettext.bindtextdomain("import_filter_manager", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end
local script_data = {}
script_data.metadata = {
name = "import_filter_manager",
purpose = _("manage import filters"),
author = "Tobias Ellinghaus",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/import_filter_manager"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
local import_filter_list = {}
local n_import_filters = 1
@@ -83,6 +97,12 @@ dt.register_import_filter = function(name, callback)
if name == active_filter then filter_dropdown.value = n_import_filters end
end
local function destroy()
--noting to destroy
end
script_data.destroy = destroy
return script_data
-- vim: shiftwidth=2 expandtab tabstop=2 cindent
-- kate: tab-indents: off; indent-width 2; replace-tabs on; remove-trailing-space on;

View File

@@ -30,6 +30,28 @@ USAGE
local dt = require "darktable"
local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("import_filters", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end
local script_data = {}
script_data.metadata = {
name = "import_filters",
purpose = _("import filtering"),
author = "Tobias Ellinghaus & Christian Mandel",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/import_filters"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
script_data.show = nil -- only required for libs since the destroy_method only hides them
-- we get fed a sorted list of filenames. just setting images to ignore to nil is enough
-- ignore jpeg
@@ -88,5 +110,13 @@ dt.register_import_filter("prefer raw over jpeg", function(event, images)
end)
local function destroy()
-- nothing to destroy
end
script_data.destroy = destroy
return script_data
-- vim: shiftwidth=2 expandtab tabstop=2 cindent
-- kate: tab-indents: off; indent-width 2; replace-tabs on; remove-trailing-space on;

View File

@@ -38,9 +38,9 @@ local du = require "lib/dtutils"
du.check_min_api_version("7.0.0", "save_selection")
local gettext = dt.gettext.gettext
local gettext = dt.gettext.gettext
gettext.bindtextdomain("save_selection", dt.configuration.config_dir .."/lua/locale/")
dt.gettext.bindtextdomain("save_selection", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
@@ -50,6 +50,13 @@ end
local script_data = {}
script_data.metadata = {
name = "save_selection",
purpose = _("shortcuts providing multiple selection buffers"),
author = "Jérémy Rosen",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/save_selection"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again

View File

@@ -38,9 +38,9 @@ local du = require "lib/dtutils"
du.check_min_api_version("7.0.0", "selection_to_pdf")
local gettext = dt.gettext.gettext
local gettext = dt.gettext.gettext
gettext.bindtextdomain("selection_to_pdf", dt.configuration.config_dir .."/lua/locale/")
dt.gettext.bindtextdomain("selection_to_pdf", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
@@ -50,6 +50,13 @@ end
local script_data = {}
script_data.metadata = {
name = "selection_to_pdf",
purpose = _("generate a pdf file of selected images"),
author = "Jérémy Rosen & Pascal Obry",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/official/selection_to_pdf"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again