From a2850cac6b156f5f2522ce95af70de6f0000e7f8 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-HQME86J\\marco" Date: Mon, 30 Dec 2019 14:07:42 +0100 Subject: [PATCH 1/3] contrib/ext_editor v2 --- contrib/ext_editor.lua | 422 +++++++++++++++++++++++++ locale/it_IT/LC_MESSAGES/ext_editor.mo | Bin 0 -> 2185 bytes locale/it_IT/LC_MESSAGES/ext_editor.po | 119 +++++++ 3 files changed, 541 insertions(+) create mode 100644 contrib/ext_editor.lua create mode 100644 locale/it_IT/LC_MESSAGES/ext_editor.mo create mode 100644 locale/it_IT/LC_MESSAGES/ext_editor.po diff --git a/contrib/ext_editor.lua b/contrib/ext_editor.lua new file mode 100644 index 0000000..9a9c834 --- /dev/null +++ b/contrib/ext_editor.lua @@ -0,0 +1,422 @@ +--[[ + + DESCRIPTION + ext_editor.lua - edit images with external editors + + This script provides helpers to edit image files with programs external to darktable. + It adds: + - a new target storage "collection". Image exported will be reimported to collection for + further edit with external programs + - a new lighttable module "external editors", to select a program from a list of up to + - 9 external editors and run it on a selected image + - a set of lua preferences in order to configure name and path of up to 9 external editors + - a set of lua shortcuts in order to quick launch the external editors + + USAGE + * require this script from main lua file + + -- setup -- + * in "preferences/lua options" configure name and path/command of external programs + * note that if a program name is left empty, that and all following entries will be ignored + * in "preferences/shortcuts/lua" configure shortcuts for external programs (optional) + * whenever programs preferences are changed, in lighttable/external editors, press "update list" + + -- use -- + * in the export dialog choose "collection" and select the format and bit depth for the + exported image + * press "export" + * the exported image will be imported into collection and grouped with the original image + + * select an image for editing with en external program, and: + * in lighttable/external editors, select program and press "edit" + * edit the image with the external editor, overwite the file, quit the external program + * the selected image will be updated + or + * in lighttable/external editors, select program and press "edit a copy" + * edit the image with the external editor, overwite the file, quit the external program + * a copy of the selected image will be created and updated + or + * in lighttable select target storage "collection" + * enter in darkroom + * to create an export or a copy press CRTL+E + * use the shortcut to edit the current image with the corresponding external editor + * overwite the file, quit the external program + * the darkroom view will be updated + + * warning: mouseover on lighttable/filmstrip will prevail on current image + * this is the default DT behavior, not a bug of this script + + CAVEATS + * MAC compatibility not tested + + TODO + * send multiple images to the same program, maybe + + BUGS, COMMENTS, SUGGESTIONS + * send to Marco Carrarini, marco.carrarini@gmail.com + + CHANGES + * 20191224 - initial version + * 20191227 - added button "update list", better error handling, fixed bug with groups/tags in "edit" + +]] + + +local dt = require "darktable" +local du = require "lib/dtutils" +local df = require "lib/dtutils.file" +local dtsys = require "lib/dtutils.system" + + +-- module name +local MODULE_NAME = "ext_editor" + + +-- check API version +du.check_min_api_version("5.0.2", MODULE_NAME) -- darktable 3.0 + + +-- OS compatibility +local PS = dt.configuration.running_os == "windows" and "\\" or "/" + + +-- translation +local gettext = dt.gettext +gettext.bindtextdomain(MODULE_NAME, dt.configuration.config_dir..PS.."lua"..PS.."locale"..PS) + +local function _(msgid) + return gettext.dgettext(MODULE_NAME, msgid) +end + + +-- number of valid entries in the list of external programs +local n_entries = 0 + + +-- last used editor initialization +if not dt.preferences.read(MODULE_NAME,"initialized", "bool") then + dt.preferences.write(MODULE_NAME,"lastchoice", "integer", 1) + dt.preferences.write(MODULE_NAME,"initialized", "bool", true) + end +local lastchoice = 1 + + +-- update lists of program names and paths, as well as combobox --------------- +local function UpdateProgramList(combobox, button_pressed) + + -- initialize lists + program_names = {} + program_paths = {} + + -- build lists from preferences + local name + local last = false + for i = 1, 9 do + name = dt.preferences.read(MODULE_NAME,"program_name_"..i, "string") + if (name == "" or name == nil) then last = true end + if last then + if combobox[n_entries + 1] then combobox[n_entries + 1] = nil end -- remove extra combobox entries + else + combobox[i] = i..": "..name + program_names[i] = name + program_paths[i] = df.sanitize_filename(dt.preferences.read(MODULE_NAME, "program_path_"..i, "string")) + n_entries = i + end + end + lastchoice = dt.preferences.read(MODULE_NAME, "lastchoice", "integer") + if lastchoice > n_entries then + lastchoice = 1 + dt.preferences.write(MODULE_NAME, "lastchoice", "integer", lastchoice) + end + combobox.value = lastchoice + if button_pressed then dt.print(_("list updated")) end + end + + +-- shows export progress ------------------------------------------------------ +local function show_status(storage, image, format, filename, number, total, high_quality, extra_data) + + dt.print(_("exporting image ").. number.." / "..total.." ...") + end + + +-- callback for buttons "edit" and "edit a copy" ------------------------------ +local function OpenWith(images, choice, copy) + + -- check choice is valid, return if not + if choice > n_entries then + dt.print(_("not a valid choice")) + return + end + + -- check if one image is selected, return if not + if #images ~= 1 then + dt.print(_("please select one image")) + return + end + + local bin = program_paths[choice] + local friendly_name = program_names[choice] + + -- check if external program executable exists, return if not + if not df.check_if_bin_exists(bin) then + dt.print(friendly_name.._(" not found")) + return + end + + -- image to be edited + local image + i, image = next(images) + local name = image.path..PS..image.filename + + -- check if image is raw, return if is + if image.is_raw then + dt.print(_("RAW not allowed")) + return + end + + -- save image tags, rating and color + local tags = {} + for i, tag in ipairs(dt.tags.get_tags(image)) do + if not (string.sub(tag.name, 1, 9) == "darktable") then table.insert(tags, tag) end + end + local rating = image.rating + local red = image.red + local blue = image.blue + local green = image.green + local yellow = image.yellow + local purple = image.purple + + -- new image + local new_name = name + local new_image = image + + if copy then + + -- create unique filename + while true do -- dirty solution to workaround issue in lib function check_if_file_exists() + if dt.configuration.running_os == "windows" then + if not df.check_if_file_exists(df.sanitize_filename(new_name)) then break end + else + if not df.check_if_file_exists(new_name) then break end + end + new_name = df.filename_increment(new_name) + -- limit to 50 more exports of the original export + if string.match(df.get_basename(new_name), "_%d%d$") == "_50" then break end + end + + -- physical copy, check result, return if error + local copy_success = df.file_copy(name, new_name) + if not copy_success then + dt.print(_("error copying file ")..name) + return + end + end + + -- launch the external editor, check result, return if error + local run_cmd = bin.." "..df.sanitize_filename(new_name) + dt.print(_("launching ")..friendly_name.."...") + local result = dtsys.external_command(run_cmd) + if result ~= 0 then + dt.print(_("error launching ")..friendly_name) + return + end + + if copy then + -- import in database and group + new_image = dt.database.import(new_name) + new_image:group_with(image) + else + -- refresh the image view + -- note that only image:drop_cache() is not enough to refresh view in darkroom mode + -- therefore image must be deleted and reimported to force refresh + + -- find the grouping status + local image_leader = image.group_leader + local group_members = image:get_group_members() + local new_leader + local index = nil + local found = false + + -- membership status, three different cases + if image_leader == image then + if #group_members > 1 then + -- case 1: image is leader in a group with more members + while not found do + index, new_leader = next(group_members, index) + if new_leader ~= image_leader then found = true end + end + new_leader:make_group_leader() + image:delete() + new_image = dt.database.import(name) + new_image:group_with(new_leader) + new_image:make_group_leader() + else + -- case 2: image is the only member in group + image:delete() + new_image = dt.database.import(name) + new_image:group_with() + end + else + -- case 3: image is in a group but is not leader + image:delete() + new_image = dt.database.import(name) + new_image:group_with(image_leader) + end + -- refresh darkroom view + if dt.gui.current_view() == dt.gui.views.darkroom then + dt.gui.views.darkroom.display_image(new_image) + end + end + + -- restore image tags, rating and color, must be put after refresh darkroom view + for i, tag in ipairs(tags) do dt.tags.attach(tag, new_image) end + new_image.rating = rating + new_image.red = red + new_image.blue = blue + new_image.green = green + new_image.yellow = yellow + new_image.purple = purple + + -- select the new image + local selection = {} + table.insert(selection, new_image) + dt.gui.selection (selection) + + -- remember the last editor used + dt.preferences.write(MODULE_NAME, "lastchoice", "integer", choice) + end + + +-- callback function for shortcuts -------------------------------------------- +local function program_shortcut(event, shortcut) + OpenWith(dt.gui.action_images, tonumber(string.sub(shortcut, -1)), false) + end + + +-- export images and reimport in collection ----------------------------------- +local function export2collection(storage, image_table, extra_data) + + local new_name, new_image, result + + for image, temp_name in pairs(image_table) do + + -- images are first exported in temp folder then moved to collection folder + + -- create unique filename + new_name = image.path..PS..df.get_filename(temp_name) + while true do -- dirty solution to workaround issue in lib function check_if_file_exists() + if dt.configuration.running_os == "windows" then + if not df.check_if_file_exists(df.sanitize_filename(new_name)) then break end + else + if not df.check_if_file_exists(new_name) then break end + end + new_name = df.filename_increment(new_name) + -- limit to 50 more exports of the original export + if string.match(df.get_basename(new_name), "_%d%d$") == "_50" then break end + end + + -- move image to collection folder, check result, return if error + move_success = df.file_move(temp_name, new_name) + if not move_success then + dt.print(_("error moving file ")..temp_name) + return + end + + -- import in database and group + new_image = dt.database.import(new_name) + new_image:group_with(image.group_leader) + end + end + + +-- register new storage ------------------------------------------------------- +-- note that placing this declaration later makes the export selected module +-- not to remember the choice "collection" when restarting DT, don't know why +dt.register_storage("exp2coll", _("collection"), show_status, export2collection) + + +-- combobox, with variable number of entries ---------------------------------- +local combobox = dt.new_widget("combobox") { + label = _("choose program"), + tooltip = _("select the external editor from the list"), + value = 1, + "" + } +UpdateProgramList(combobox, false) -- initialize list of programs and combobox + + +-- button edit ---------------------------------------------------------------- +local button1 = dt.new_widget("button") { + label = _("edit"), + tooltip = _("open the selected image in external editor"), + clicked_callback = function() + OpenWith(dt.gui.action_images, combobox.selected, false) + end + } + + +-- button edit a copy --------------------------------------------------------- +local button2 = dt.new_widget("button") { + label = _("edit a copy"), + tooltip = _("create a copy of the selected image and open it in external editor"), + clicked_callback = function() + OpenWith(dt.gui.action_images, combobox.selected, true) + end + } + + +-- button update list --------------------------------------------------------- +local button3 = dt.new_widget("button") { + label = _("update list"), + tooltip = _("update list of programs if lua preferences are changed"), + clicked_callback = function() + UpdateProgramList(combobox, true) + end + } + + +-- box for the buttons -------------------------------------------------------- +-- it doesn't seem there is a way to make the buttons equal in size +local box1 = dt.new_widget("box") { + orientation = "horizontal", + button1, + button2, + button3 + } + + +-- register new module "external editors" in lighttable ------------------------ +dt.register_lib( + MODULE_NAME, + _("external editors"), + true, -- expandable + false, -- resetable + {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}}, + dt.new_widget("box") { + orientation = "vertical", + combobox, + box1 + }, + nil, -- view_enter + nil -- view_leave + ) + + +-- register the new preferences ----------------------------------------------- +for i = 9, 1, -1 do + dt.preferences.register(MODULE_NAME, "program_path_"..i, "string", _("command for external editor ")..i, _("command for external editor, including full path if needed"), "") + dt.preferences.register(MODULE_NAME, "program_name_"..i, "string", _("name of external editor ")..i, _("friendly name of external editor"), "") + end + + +-- register the new shortcuts ------------------------------------------------- +for i = 1, 9 do + dt.register_event("shortcut", program_shortcut, _("edit with program ")..i) + end + + +-- end of script -------------------------------------------------------------- + +-- vim: shiftwidth=4 expandtab tabstop=4 cindent syntax=lua +-- kate: hl Lua; diff --git a/locale/it_IT/LC_MESSAGES/ext_editor.mo b/locale/it_IT/LC_MESSAGES/ext_editor.mo new file mode 100644 index 0000000000000000000000000000000000000000..1447df4a2e78a42b80e20157b2babd7c4d12b262 GIT binary patch literal 2185 zcmb7^y>A>v7{&)MUk3?bz7Z&|3z87Bw(k^BSjPy*9B@($j%|UEkYKVqx1MNrW;HYG z!~rBKL`8u_K}Erzkd}gmih?#(S{j5zK}7-2ySqL+7ZZuq?frIUXXbt0ue~`t^R2-3 z9Pa0F|Bm}b+&|uhKV0i~3(*5Ff{%b7fk#2p&3_8=zAwQP`~f@<-UMgBxqF0o2s{qX zf&=hza0osMe%Q@l?#7>Y{2C;@{~l!fKY2uv=H17tN9 z$C!2U^(6n1b&H_4Mf2C4(mr3&u+uq0LU|9NY@-pPjoOl3X$nto>2x^M>0pQ$CrYOK7nnF=Jmf?8<{ zxVG-yWh5{e<;nZX2h>l>Mn7)rrMICtsL5I=be^2Ai;!%&lzQv$B^zo-^YY|PgeaxK zV*jt+N~fa!h?m%NNtzcQ6E%X zUfEn7jrP~ECIloI+RSmqr*!rbPF^>)mnM13`7)$rt7aIM2TRmGE}yhCw@m$)mU`Tr zmZEn%aII@ki@LP|LeOktGgF1pdzmPuSmhqQhL|Zla*H~ulqYkdYfcroSsmT+?P-`O zkG8~yMn#8eLcb!*0g-h=VkOnK=~*o)SH_&s_&gLE)y8$ka%7a)gEzP8 z5Nn9cSZ8wbz+I_t8QOjKNDR4iQChr+#!cgPQ%2fM!?A7{Di, 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: ext_editor\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-12-29 15:33+0100\n" +"PO-Revision-Date: 2019-12-28 21:45+0100\n" +"Last-Translator: marco \n" +"Language-Team: Italian\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ext_editor.lua:132 +msgid "list updated" +msgstr "Lista aggiornata" + +#: ext_editor.lua:139 +msgid "exporting image " +msgstr "Esportazione immagine " + +#: ext_editor.lua:148 +msgid "not a valid choice" +msgstr "Scelta non valida" + +#: ext_editor.lua:154 +msgid "please select one image" +msgstr "Selezionare un'immagine" + +#: ext_editor.lua:163 +msgid " not found" +msgstr " non trovato" + +#: ext_editor.lua:174 +msgid "RAW not allowed" +msgstr "RAW non consentito" + +#: ext_editor.lua:211 +msgid "error copying file " +msgstr "Errore copia file " + +#: ext_editor.lua:218 +msgid "launching " +msgstr "Lancio " + +#: ext_editor.lua:221 +msgid "error launching " +msgstr "Errore lancio " + +#: ext_editor.lua:322 +msgid "error moving file " +msgstr "Errore spostamento file " + +#: ext_editor.lua:336 +msgid "collection" +msgstr "Collezione" + +#: ext_editor.lua:341 +msgid "choose program" +msgstr "Scegli programma" + +#: ext_editor.lua:342 +msgid "select the external editor from the list" +msgstr "Seleziona l'editor esterno dalla lista" + +#: ext_editor.lua:351 +msgid "edit" +msgstr "Modifica" + +#: ext_editor.lua:352 +msgid "open the selected image in external editor" +msgstr "Apre l'immagine selezionata nell'editor esterno" + +#: ext_editor.lua:361 +msgid "edit a copy" +msgstr "Modifica copia" + +#: ext_editor.lua:362 +msgid "create a copy of the selected image and open it in external editor" +msgstr "apre una copia dell'immagine selezionata nell'editor esterno" + +#: ext_editor.lua:371 +msgid "update list" +msgstr "Aggiorna lista" + +#: ext_editor.lua:372 +msgid "update list of programs if lua preferences are changed" +msgstr "Aggiorna la lista dei programmi se le preferenze di lua sono cambiate" + +#: ext_editor.lua:392 +msgid "external editors" +msgstr "Editor esterni" + +#: ext_editor.lua:408 +msgid "command for external editor " +msgstr "Comando per l'editor esterno " + +#: ext_editor.lua:408 +msgid "command for external editor, including full path if needed" +msgstr "" +"Comando per l'editor esterno, compreso il percorso completo se necessario" + +#: ext_editor.lua:409 +msgid "name of external editor " +msgstr "Nome dell'editor esterno " + +#: ext_editor.lua:409 +msgid "friendly name of external editor" +msgstr "Nome comune dell'editor esterno" + +#: ext_editor.lua:415 +msgid "edit with program " +msgstr "Modifica con programma " From 5116d645db45d3220f60c4a2aea488b3b9ec8ccf Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-HQME86J\\marco" Date: Wed, 1 Jan 2020 19:27:41 +0100 Subject: [PATCH 2/3] further improvements --- contrib/ext_editor.lua | 71 +++++++++++++++------ locale/it_IT/LC_MESSAGES/ext_editor.mo | Bin 2185 -> 2180 bytes locale/it_IT/LC_MESSAGES/ext_editor.po | 85 +++++++++++++------------ 3 files changed, 94 insertions(+), 62 deletions(-) diff --git a/contrib/ext_editor.lua b/contrib/ext_editor.lua index 9a9c834..d9b4f0e 100644 --- a/contrib/ext_editor.lua +++ b/contrib/ext_editor.lua @@ -83,26 +83,29 @@ local PS = dt.configuration.running_os == "windows" and "\\" or "/" -- translation local gettext = dt.gettext gettext.bindtextdomain(MODULE_NAME, dt.configuration.config_dir..PS.."lua"..PS.."locale"..PS) - local function _(msgid) return gettext.dgettext(MODULE_NAME, msgid) end -- number of valid entries in the list of external programs -local n_entries = 0 +local n_entries + + +-- allowed file extensions, to exclude RAW, which cannot be edited externally +local allowed_file_types = {"JPG", "jpg", "JPEG", "jpeg", "TIF", "tif", "TIFF", "tiff", "EXR", "exr"} -- last used editor initialization if not dt.preferences.read(MODULE_NAME,"initialized", "bool") then - dt.preferences.write(MODULE_NAME,"lastchoice", "integer", 1) + dt.preferences.write(MODULE_NAME,"lastchoice", "integer", 0) dt.preferences.write(MODULE_NAME,"initialized", "bool", true) end -local lastchoice = 1 +local lastchoice = 0 -- update lists of program names and paths, as well as combobox --------------- -local function UpdateProgramList(combobox, button_pressed) +local function UpdateProgramList(combobox, button1, button2, update_button_pressed) -- initialize lists program_names = {} @@ -111,6 +114,7 @@ local function UpdateProgramList(combobox, button_pressed) -- build lists from preferences local name local last = false + n_entries = 0 for i = 1, 9 do name = dt.preferences.read(MODULE_NAME,"program_name_"..i, "string") if (name == "" or name == nil) then last = true end @@ -123,13 +127,20 @@ local function UpdateProgramList(combobox, button_pressed) n_entries = i end end + lastchoice = dt.preferences.read(MODULE_NAME, "lastchoice", "integer") - if lastchoice > n_entries then - lastchoice = 1 - dt.preferences.write(MODULE_NAME, "lastchoice", "integer", lastchoice) - end - combobox.value = lastchoice - if button_pressed then dt.print(_("list updated")) end + if lastchoice == 0 and n_entries > 0 then lastchoice = 1 end + if lastchoice > n_entries then lastchoice = n_entries end + dt.preferences.write(MODULE_NAME, "lastchoice", "integer", lastchoice) + + -- widgets enabled if there is at least one program configured + combobox.selected = lastchoice + local active = n_entries > 0 + combobox.sensitive = active + button1.sensitive = active + button2.sensitive = active + + if update_button_pressed then dt.print(n_entries.._(" editors configured")) end end @@ -169,9 +180,19 @@ local function OpenWith(images, choice, copy) i, image = next(images) local name = image.path..PS..image.filename - -- check if image is raw, return if is - if image.is_raw then - dt.print(_("RAW not allowed")) + -- check if image is raw, return if it is + -- please note that the image property image.is_raw fails when filepath contains spaces + -- so as a workaround we allow only TIF, JPG and EXR + local file_ext = df.get_filetype (image.filename) + local allowed = false + for i,v in pairs(allowed_file_types) do + if v == file_ext then + allowed = true + break + end + end + if not allowed then + dt.print(_("file type not allowed")) return end @@ -283,8 +304,6 @@ local function OpenWith(images, choice, copy) table.insert(selection, new_image) dt.gui.selection (selection) - -- remember the last editor used - dt.preferences.write(MODULE_NAME, "lastchoice", "integer", choice) end @@ -340,16 +359,18 @@ dt.register_storage("exp2coll", _("collection"), show_status, export2collection) local combobox = dt.new_widget("combobox") { label = _("choose program"), tooltip = _("select the external editor from the list"), - value = 1, + changed_callback = function(self) + dt.preferences.write(MODULE_NAME, "lastchoice", "integer", self.selected) + end, "" } -UpdateProgramList(combobox, false) -- initialize list of programs and combobox -- button edit ---------------------------------------------------------------- local button1 = dt.new_widget("button") { label = _("edit"), tooltip = _("open the selected image in external editor"), + --sensitive = false, clicked_callback = function() OpenWith(dt.gui.action_images, combobox.selected, false) end @@ -371,7 +392,7 @@ local button3 = dt.new_widget("button") { label = _("update list"), tooltip = _("update list of programs if lua preferences are changed"), clicked_callback = function() - UpdateProgramList(combobox, true) + UpdateProgramList(combobox, button1, button2, true) end } @@ -403,10 +424,18 @@ dt.register_lib( ) +-- initialize list of programs and widgets ------------------------------------ +UpdateProgramList(combobox, button1, button2, false) + + -- register the new preferences ----------------------------------------------- for i = 9, 1, -1 do - dt.preferences.register(MODULE_NAME, "program_path_"..i, "string", _("command for external editor ")..i, _("command for external editor, including full path if needed"), "") - dt.preferences.register(MODULE_NAME, "program_name_"..i, "string", _("name of external editor ")..i, _("friendly name of external editor"), "") + dt.preferences.register(MODULE_NAME, "program_path_"..i, "file", + _("executable for external editor ")..i, + _("select executable for external editor") , _("(None)")) + dt.preferences.register(MODULE_NAME, "program_name_"..i, "string", + _("name of external editor ")..i, + _("friendly name of external editor"), "") end diff --git a/locale/it_IT/LC_MESSAGES/ext_editor.mo b/locale/it_IT/LC_MESSAGES/ext_editor.mo index 1447df4a2e78a42b80e20157b2babd7c4d12b262..3d4925d33e1df8e424f4371e15b1ed3340aa46bf 100644 GIT binary patch delta 1077 zcmaLUKTH#07{~FKwonvNfhr0WUyXz!X&gw5QDf9Z-EeSn8lxoSEDl#L3mfMO<85jDzlepQC^d@}}>7dT)F0`+J^y(09MDwc1~JtQf=0 zGV>R6l=-oP3u8K`)BrlT9TV)rySNjV+Urm7Jom4#fZwnOzhgiCM%kx3uhecVBkL_y z<;y`9&bEJ;Zaas2SYJeqPf-HA#eMi5W#cb+6o29%4s*H`Fo_ksiV|cIkK-deNpUMU z!1-A@JD@~a+wc%d!U>cEPva@Pgxz=#rSgX;2R=s$vfN((fD-T%j^Gd6i@n9Q=Z>Is zdlHA_{L6gdqpoo&VTgUWgcJA-Wy2MeidJz9i=>et$M6E4L3wKueuzm!loYm~*~^qe zWyoIZqb2V|(#hcY?A>NJTxb*;xHfvYN0HZbGq^;|jqntNF`vq|jC_(s=ksLeub!ocy{d!)DX zqa}~u;+svA?cw;oy#yx9dRlTr)H}2^{|4^c?LP-*>dvXgGB*Fgh~6x#iiwiCGME`mXEFu&F2BjHGND zD#(i0CXzyIdZJjV#9q^C*V8rmj~q;6A``@PNln>?;l7cucRE)b?93L@*Tu2c|IYmP e1a)OSQ9JhfV`?KRVYY~A>v7{&)MUk3?bz7Z&|3z87Bw(k^BSjPy*9B@($j%|UEkYKVqx1MNrW;HYG z!~rBKL`8u_K}Erzkd}gmih?#(S{j5zK}7-2ySqL+7ZZuq?frIUXXbt0ue~`t^R2-3 z9Pa0F|Bm}b+&|uhKV0i~3(*5Ff{%b7fk#2p&3_8=zAwQP`~f@<-UMgBxqF0o2s{qX zf&=hza0osMe%Q@l?#7>Y{2C;@{~l!fKY2uv=H17tN9 z$C!2U^(6n1b&H_4Mf2C4(mr3&u+uq0LU|9NY@-pPjoOl3X$nto>2x^M>0pQ$CrYOK7nnF=Jmf?8<{ zxVG-yWh5{e<;nZX2h>l>Mn7)rrMICtsL5I=be^2Ai;!%&lzQv$B^zo-^YY|PgeaxK zV*jt+N~fa!h?m%NNtzcQ6E%X zUfEn7jrP~ECIloI+RSmqr*!rbPF^>)mnM13`7)$rt7aIM2TRmGE}yhCw@m$)mU`Tr zmZEn%aII@ki@LP|LeOktGgF1pdzmPuSmhqQhL|Zla*H~ulqYkdYfcroSsmT+?P-`O zkG8~yMn#8eLcb!*0g-h=VkOnK=~*o)SH_&s_&gLE)y8$ka%7a)gEzP8 z5Nn9cSZ8wbz+I_t8QOjKNDR4iQChr+#!cgPQ%2fM!?A7{Di\n" "Language-Team: Italian\n" @@ -17,103 +17,106 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ext_editor.lua:132 -msgid "list updated" -msgstr "Lista aggiornata" +#: ext_editor.lua:143 +msgid " editors configured" +msgstr " editor configurati" -#: ext_editor.lua:139 +#: ext_editor.lua:150 msgid "exporting image " msgstr "Esportazione immagine " -#: ext_editor.lua:148 +#: ext_editor.lua:159 msgid "not a valid choice" msgstr "Scelta non valida" -#: ext_editor.lua:154 +#: ext_editor.lua:165 msgid "please select one image" -msgstr "Selezionare un'immagine" +msgstr "Selezionare una immagine" -#: ext_editor.lua:163 +#: ext_editor.lua:174 msgid " not found" msgstr " non trovato" -#: ext_editor.lua:174 -msgid "RAW not allowed" -msgstr "RAW non consentito" +#: ext_editor.lua:195 +msgid "file type not allowed" +msgstr "tipo di file non consentito" -#: ext_editor.lua:211 +#: ext_editor.lua:232 msgid "error copying file " msgstr "Errore copia file " -#: ext_editor.lua:218 +#: ext_editor.lua:239 msgid "launching " msgstr "Lancio " -#: ext_editor.lua:221 +#: ext_editor.lua:242 msgid "error launching " msgstr "Errore lancio " -#: ext_editor.lua:322 +#: ext_editor.lua:341 msgid "error moving file " msgstr "Errore spostamento file " -#: ext_editor.lua:336 +#: ext_editor.lua:355 msgid "collection" msgstr "Collezione" -#: ext_editor.lua:341 +#: ext_editor.lua:360 msgid "choose program" msgstr "Scegli programma" -#: ext_editor.lua:342 +#: ext_editor.lua:361 msgid "select the external editor from the list" -msgstr "Seleziona l'editor esterno dalla lista" +msgstr "Seleziona un editor esterno dalla lista" -#: ext_editor.lua:351 +#: ext_editor.lua:371 msgid "edit" msgstr "Modifica" -#: ext_editor.lua:352 +#: ext_editor.lua:372 msgid "open the selected image in external editor" -msgstr "Apre l'immagine selezionata nell'editor esterno" +msgstr "Apre immagine selezionata in editor esterno" -#: ext_editor.lua:361 +#: ext_editor.lua:382 msgid "edit a copy" msgstr "Modifica copia" -#: ext_editor.lua:362 +#: ext_editor.lua:383 msgid "create a copy of the selected image and open it in external editor" -msgstr "apre una copia dell'immagine selezionata nell'editor esterno" +msgstr "Apre una copia della immagine selezionata in editor esterno" -#: ext_editor.lua:371 +#: ext_editor.lua:392 msgid "update list" msgstr "Aggiorna lista" -#: ext_editor.lua:372 +#: ext_editor.lua:393 msgid "update list of programs if lua preferences are changed" msgstr "Aggiorna la lista dei programmi se le preferenze di lua sono cambiate" -#: ext_editor.lua:392 +#: ext_editor.lua:413 msgid "external editors" msgstr "Editor esterni" -#: ext_editor.lua:408 -msgid "command for external editor " -msgstr "Comando per l'editor esterno " +#: ext_editor.lua:434 +msgid "executable for external editor " +msgstr "Eseguibile per editor esterno " -#: ext_editor.lua:408 -msgid "command for external editor, including full path if needed" -msgstr "" -"Comando per l'editor esterno, compreso il percorso completo se necessario" +#: ext_editor.lua:435 +msgid "select executable for external editor" +msgstr "seleziona eseguibile per editor esterno " -#: ext_editor.lua:409 +#: ext_editor.lua:435 +msgid "(None)" +msgstr "(Nessuno)" + +#: ext_editor.lua:437 msgid "name of external editor " -msgstr "Nome dell'editor esterno " +msgstr "Nome editor esterno " -#: ext_editor.lua:409 +#: ext_editor.lua:438 msgid "friendly name of external editor" -msgstr "Nome comune dell'editor esterno" +msgstr "Nome comune editor esterno" -#: ext_editor.lua:415 +#: ext_editor.lua:444 msgid "edit with program " msgstr "Modifica con programma " From bf8d147ca5f9360864524361b62f83090a71413f Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-HQME86J\\marco" Date: Thu, 2 Jan 2020 19:09:19 +0100 Subject: [PATCH 3/3] requeste changes --- contrib/ext_editor.lua | 22 +++++++++++----------- locale/it_IT/LC_MESSAGES/ext_editor.mo | Bin 2180 -> 0 bytes 2 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 locale/it_IT/LC_MESSAGES/ext_editor.mo diff --git a/contrib/ext_editor.lua b/contrib/ext_editor.lua index d9b4f0e..b5e8eb2 100644 --- a/contrib/ext_editor.lua +++ b/contrib/ext_editor.lua @@ -105,7 +105,7 @@ local lastchoice = 0 -- update lists of program names and paths, as well as combobox --------------- -local function UpdateProgramList(combobox, button1, button2, update_button_pressed) +local function UpdateProgramList(combobox, button_edit, button_edit_copy, update_button_pressed) -- initialize lists program_names = {} @@ -137,8 +137,8 @@ local function UpdateProgramList(combobox, button1, button2, update_button_press combobox.selected = lastchoice local active = n_entries > 0 combobox.sensitive = active - button1.sensitive = active - button2.sensitive = active + button_edit.sensitive = active + button_edit_copy.sensitive = active if update_button_pressed then dt.print(n_entries.._(" editors configured")) end end @@ -367,7 +367,7 @@ local combobox = dt.new_widget("combobox") { -- button edit ---------------------------------------------------------------- -local button1 = dt.new_widget("button") { +local button_edit = dt.new_widget("button") { label = _("edit"), tooltip = _("open the selected image in external editor"), --sensitive = false, @@ -378,7 +378,7 @@ local button1 = dt.new_widget("button") { -- button edit a copy --------------------------------------------------------- -local button2 = dt.new_widget("button") { +local button_edit_copy = dt.new_widget("button") { label = _("edit a copy"), tooltip = _("create a copy of the selected image and open it in external editor"), clicked_callback = function() @@ -388,11 +388,11 @@ local button2 = dt.new_widget("button") { -- button update list --------------------------------------------------------- -local button3 = dt.new_widget("button") { +local button_update_list = dt.new_widget("button") { label = _("update list"), tooltip = _("update list of programs if lua preferences are changed"), clicked_callback = function() - UpdateProgramList(combobox, button1, button2, true) + UpdateProgramList(combobox, button_edit, button_edit_copy, true) end } @@ -401,9 +401,9 @@ local button3 = dt.new_widget("button") { -- it doesn't seem there is a way to make the buttons equal in size local box1 = dt.new_widget("box") { orientation = "horizontal", - button1, - button2, - button3 + button_edit, + button_edit_copy, + button_update_list } @@ -425,7 +425,7 @@ dt.register_lib( -- initialize list of programs and widgets ------------------------------------ -UpdateProgramList(combobox, button1, button2, false) +UpdateProgramList(combobox, button_edit, button_edit_copy, false) -- register the new preferences ----------------------------------------------- diff --git a/locale/it_IT/LC_MESSAGES/ext_editor.mo b/locale/it_IT/LC_MESSAGES/ext_editor.mo deleted file mode 100644 index 3d4925d33e1df8e424f4371e15b1ed3340aa46bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2180 zcma)+&u<(x6vqt|S{BNWQhv6AR|!NyG-);kR3=T;HUzX1X`?1W;zXSp@5GhI9&AsV z^n}Wx7sL$&;>6#;i96-Ql_NcI;et58o$vF`=EqVhteyGHcx}J;zVE%cd+gAc0^=fN}Q!3^)aT z1hOBuz_-CKz#OsN0ofl8=5gRS_$YV^WdCMBws#I(0N)3XfS-XJ_vawn`xazBzVGIL z0@=S`z?Z>4z~{iDhe!Kf1zGDe;7i~Y5I=Dpx8tA(p9XJ(GvGHMpLYl3cGWMO%g&Zla7r~>r*d`A?Ydko9_KgR&r@W>Y+#pZV<4KV1uurTb`}i=f z{R1u~4S0?vD-L^NpV;Tte=H%vGE3T$MwbMIb)iI(=^hf^ zL$<~!iJXkICZuT;g6JmHeIp;QVp9{Y)6ly*rP1gRMcb5|;K^r>xhsc2dPt^~cvnN^ zl`T{t=@nvvMQ2Bte$=T?~qtfeLRh)xtB~-f1F11z2)?H4$)hpRm zwWWD^_AXq=X@0K%PS&5#=Fif6KY#PBnYsSlT<-%JVz%z34Mw7pbE>5;9Gy#;Eu{C- zYpX9*wbW*|aP@g?u~m!8%+{5xa~edXK-%5u9EI9j8LTYtx!a$e>n%AOm4z)7LrxJ9 zoNkQNc7X%+LB++3YfFQ{-a7UPf@I6Ka3yLir?VS4dDXODn(RI2>yVRe(rZ|pU!c+B z;*_ORi`1W9=#ATRw>xFj+@6-AcUuS-4XQ$Dt(z8Wg{q7mC#9BRiM#YBF>kW;* G6aN4N6;u!a