From b40b1e0b1c57c878df1ea428b17294f22dc89281 Mon Sep 17 00:00:00 2001 From: Tobias Jakobs Date: Mon, 22 Dec 2014 20:41:54 +0100 Subject: [PATCH] darktable script to show the different prefference types that are possible with the Lua --- contrib/preferenceExcamples.lua | 81 +++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 contrib/preferenceExcamples.lua diff --git a/contrib/preferenceExcamples.lua b/contrib/preferenceExcamples.lua new file mode 100644 index 0000000..c6f9ae0 --- /dev/null +++ b/contrib/preferenceExcamples.lua @@ -0,0 +1,81 @@ +--[[ + This file is part of darktable, + Copyright 2014 by Tobias Jakobs. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +]] +--[[ +darktable script to show the different prefference types that are possible with the Lua + +USAGE +* require this script from your main lua file +]] +dt = require "darktable" +dt.configuration.check_version(...,{2,0,1}) + +dt.preferences.register("preferenceExcamples", -- 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. + "preferenceExcamplesString", -- name + "string", -- type + "Excample String", -- label + "Excample String Tooltip", -- tooltip + "String") -- default + +dt.preferences.register("preferenceExcamples", -- 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. + "preferenceExcamplesString", -- name + "bool", -- type + "Excample Boolean", -- label + "Excample Boolean Tooltip", -- tooltip + true) -- default + +dt.preferences.register("preferenceExcamples", -- 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. + "preferenceExcamplesString", -- name + "integer", -- type + "Excample Integer", -- label + "Excample Integer Tooltip", -- tooltip + 2, -- default + 1, -- min + 99) -- max + +dt.preferences.register("preferenceExcamples", -- 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. + "preferenceExcamplesString", -- name + "float", -- type + "Excample Float", -- label + "Excample Float Tooltip", -- tooltip + 1.3, -- default + 1, -- min + 99, -- max + 0.5) -- step + +dt.preferences.register("preferenceExcamples", -- 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. + "preferenceExcamplesString", -- name + "file", -- type + "Excample File", -- label + "Excample File Tooltip", -- tooltip + "") -- default + +dt.preferences.register("preferenceExcamples", -- 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. + "preferenceExcamplesString", -- name + "directory", -- type + "Excample Directory", -- label + "Excample Directory Tooltip", -- tooltip + "") -- default + +dt.preferences.register("preferenceExcamples", -- 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. + "preferenceExcamplesString", -- name + "enum", -- type + "Excample Enum", -- label + "Excample Enum Tooltip", -- tooltip + "Enum 1", -- default + "Enum 1", "Enum 2") -- values +