Merge pull request #78 from wpferguson/dt-2.2-compatibility

Darktable 2.2 compatibility
This commit is contained in:
supertobi
2016-11-08 19:07:41 +01:00
committed by GitHub
26 changed files with 29 additions and 26 deletions

View File

@@ -41,7 +41,7 @@ local darktable = require "darktable"
local autostyle_apply_one_image,autostyle_apply_one_image_event,autostyle_apply,exiftool_attribute,capture
-- Tested it with darktable 1.6.1 and darktable git from 2014-01-25
darktable.configuration.check_version(...,{2,0,2},{2,1,0},{3,0,0})
darktable.configuration.check_version(...,{2,0,2},{2,1,0},{3,0,0},{4,0,0})
-- Receive the event triggered
function autostyle_apply_one_image_event(event,image)

View File

@@ -42,7 +42,7 @@ local gettext = dt.gettext
-- not a number
local NaN = 0/0
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain

View File

@@ -35,7 +35,7 @@ USAGE
local darktable = require "darktable"
-- Tested with darktable 2.0.1
darktable.configuration.check_version(...,{2,0,0},{3,0,0})
darktable.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0})
local queue = {}
local processed_files = {}

View File

@@ -36,7 +36,7 @@ local dt = require "darktable"
require "official/yield"
local gettext = dt.gettext
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("geoJSON_export",dt.configuration.config_dir.."/lua/")

View File

@@ -30,7 +30,7 @@ local dt = require "darktable"
require "official/yield"
local gettext = dt.gettext
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("geo_uri",dt.configuration.config_dir.."/lua/")

View File

@@ -68,7 +68,7 @@ require "official/yield"
local gettext = dt.gettext
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("gimp",dt.configuration.config_dir.."/lua/")

View File

@@ -25,7 +25,7 @@ USAGE
local dt = require "darktable"
local gettext = dt.gettext
dt.configuration.check_version(...,{2,0,1},{3,0,0})
dt.configuration.check_version(...,{2,0,1},{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("gps_select",dt.configuration.config_dir.."/lua/")

View File

@@ -39,7 +39,7 @@ require "official/yield"
local gettext = dt.gettext
-- works with darktable API version 2.0.0 and 3.0.0
dt.configuration.check_version(...,{2,0,0},{3,0,0})
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("hugin",dt.configuration.config_dir.."/lua/")

View File

@@ -40,7 +40,7 @@ local dt = require "darktable"
require "official/yield"
local gettext = dt.gettext
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("kml_export",dt.configuration.config_dir.."/lua/")

View File

@@ -40,6 +40,9 @@
local dt = require "darktable"
-- added version check
dt.configuration.check_version(...,{3,0,0},{4,0,0})
local function apply_rating(rating)
local images = dt.gui.action_images
for _, i in ipairs(images) do
@@ -81,4 +84,4 @@ end, "Rate group 4")
dt.register_event("shortcut",function(event, shortcut)
apply_rating(5)
end, "Rate group 5")
end, "Rate group 5")

View File

@@ -28,7 +28,7 @@ local dt = require "darktable"
require "official/yield"
local gettext = dt.gettext
dt.configuration.check_version(...,{2,0,2},{3,0,0})
dt.configuration.check_version(...,{2,0,2},{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("slideshowMusic",dt.configuration.config_dir.."/lua/")

View File

@@ -33,7 +33,7 @@ USAGE
local dt = require "darktable"
require "official/yield"
dt.configuration.check_version(...,{2,0,1})
dt.configuration.check_version(...,{2,0,1},{3,0,0},{4,0,0})
local function show_status(storage, image, format, filename, number, total, high_quality, extra_data)
dt.print("Export Image "..tostring(number).."/"..tostring(total))

View File

@@ -53,7 +53,7 @@ LUA ERROR Hallo Welt!
]]
local dt = require "darktable"
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- Not translated Text
dt.print_error("Hello World!")

View File

@@ -27,7 +27,7 @@ USAGE
]]
local dt = require "darktable"
dt.configuration.check_version(...,{2,0,0},{3,0,0})
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0})
dt.print("hello, world")

View File

@@ -32,7 +32,7 @@ https://www.darktable.org/lua-api/index.html.php#darktable_new_widget
local dt = require "darktable"
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- add a new lib
local check_button = dt.new_widget("check_button"){label = "MyCheck_button", value = true}

View File

@@ -22,7 +22,7 @@ USAGE
* require this script from your main lua file
]]
local dt = require "darktable"
dt.configuration.check_version(...,{2,0,1},{3,0,0})
dt.configuration.check_version(...,{2,0,1},{3,0,0},{4,0,0})
dt.preferences.register("preferenceExamples", -- script: This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
"preferenceExamplesString", -- name

View File

@@ -32,7 +32,7 @@ local dt = require "darktable"
local log = require "lib/dtutils.log"
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
dtutils.libdoc.functions["split"] = {
Name = [[split]],

View File

@@ -23,7 +23,7 @@ dtutils_file.libdoc = {
local gettext = dt.gettext
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- Tell gettext where to find the .mo file translating messages for a particular domain
gettext.bindtextdomain("dtutils.file",dt.configuration.config_dir.."/lua/locale/")

View File

@@ -31,7 +31,7 @@ local dt = require "darktable"
local https = require "ssl.https"
local cjson = require "cjson"
dt.configuration.check_version(...,{2,0,0},{3,0,0})
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0})
-- compare two version strings of the form "major.minor.patch"
-- returns -1, 0, 1 if the first version is smaller, equal, greater than the second version,

View File

@@ -27,7 +27,7 @@ USAGE
local dt = require "darktable"
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- set this to "false" if you don't want to overwrite metadata fields
-- (title, description, creator, publisher and rights) that are already set

View File

@@ -29,7 +29,7 @@ all tags longer than the given length will be automatically deleted at every res
]]
local dt = require "darktable"
dt.configuration.check_version(...,{2,0,0},{3,0,0})
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0})
dt.preferences.register("delete_long_tags", "length", "integer",
"maximum length of tags to keep",

View File

@@ -36,7 +36,7 @@ local dt = require "darktable"
require "official/yield"
dt.configuration.check_version(...,{3,0,0})
dt.configuration.check_version(...,{3,0,0},{4,0,0})
-- thanks Tobias Jakobs for this function (taken from contrib/hugin.lua)
local function checkIfBinExists(bin)

View File

@@ -38,7 +38,7 @@ local dt = require "darktable"
require "darktable.debug"
require "official/yield"
dt.configuration.check_version(...,{2,1,0},{3,0,0})
dt.configuration.check_version(...,{2,1,0},{3,0,0},{4,0,0})
dt.preferences.register("generate_image_txt",
"enabled",

View File

@@ -29,7 +29,7 @@ This plugin will add a widget at the bottom of the left column in lighttable mod
]]
local dt = require "darktable"
dt.configuration.check_version(...,{2,0,0},{3,0,0})
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0})
local main_label = dt.new_widget("label"){selectable = true, ellipsize = "middle", halign = "start"}

View File

@@ -34,7 +34,7 @@ increase it if you need more temporary selection buffers
]]
local dt = require "darktable"
dt.configuration.check_version(...,{2,0,0},{3,0,0})
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0})
local buffer_count = 5

View File

@@ -36,7 +36,7 @@ Plugin allows you to choose how many thumbnails you need per row
local dt = require "darktable"
require "official/yield"
dt.configuration.check_version(...,{2,0,0},{3,0,0})
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0})
dt.preferences.register
("selection_to_pdf","Open with","string",