From c0f3b50b0ba357c255d07a95b4e6f2877cbaac0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= Date: Thu, 21 May 2015 14:54:48 +0200 Subject: [PATCH] new script : add image path to the ui --- official/image_path_in_ui.lua | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 official/image_path_in_ui.lua diff --git a/official/image_path_in_ui.lua b/official/image_path_in_ui.lua new file mode 100644 index 0000000..8ef9d13 --- /dev/null +++ b/official/image_path_in_ui.lua @@ -0,0 +1,59 @@ +--[[ + This file is part of darktable, + copyright (c) 2014 Jérémy Rosen + + darktable 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. + + darktable 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 darktable. If not, see . +]] +--[[ +IMAGE_PATH_IN_UI +Add a widget with the path of the selected images for easy copy/past +Simple shortcuts to have multiple selection bufers + + +USAGE +* require this file from your main lua config file: + +This plugin will add a widget at the bottom of the left column in lighttable mode + + +]] +local dt = require "darktable" +dt.configuration.check_version(...,{2,0,0}) + +local main_label = dt.new_widget("label"){selectable = true} + +local function reset_widget() + local selection = dt.gui.selection() + local result = "" + local array = {} + for _,img in pairs(selection) do + array[img.path] = true + end + for path in pairs(array) do + result = result.."\n"..path + end + main_label.label = result +end + +main_label.reset_callback = reset_widget + +dt.register_lib("image_path_no_ui","Selected Images path",true,{ + [dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_LEFT_CENTER",300} + }, main_label + ); + +dt.register_event("mouse-over-image-changed",reset_widget); + + -- +-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua