inline if didn't work. Added intermediate register_event function in transition library

This commit is contained in:
wpferguson
2021-02-10 00:18:48 -05:00
parent 2b28f021ee
commit b1498aa664
33 changed files with 139 additions and 57 deletions

View File

@@ -28,6 +28,7 @@ require "geoToolbox"
local dt = require "darktable"
local du = require "lib/dtutils"
local df = require "lib/dtutils.file"
require "lib/darktable_transition"
local gettext = dt.gettext
du.check_min_api_version("3.0.0", "geoToolbox")
@@ -688,7 +689,7 @@ if dt.gui.current_view().id == "lighttable" then
else
if not gT.event_registered then
dt.register_event(
CURR_API_STRING >= "6.2.1" and "geoToolbox", "view-changed" or "view-chagned",
"geoToolbox", "view-changed",
function(event, old_view, new_view)
if new_view.name == "lighttable" and old_view.name == "darkroom" then
install_module()
@@ -708,14 +709,14 @@ dt.preferences.register("geoToolbox",
'' )
-- Register
dt.register_event(CURR_API_STRING >= "6.2.1" and "geoToolbox_cd", "shortcut" or "shortcut" ,
dt.register_event("geoToolbox_cd", "shortcut",
print_calc_distance, _("Calculate the distance from latitude and longitude in km"))
dt.register_event(CURR_API_STRING >= "6.2.1" and "geoToolbox", "mouse-over-image-changed" or "mouse-over-image-changed" ,
dt.register_event("geoToolbox", "mouse-over-image-changed",
toolbox_calc_distance)
dt.register_event(CURR_API_STRING >= "6.2.1" and "geoToolbox_wg", "shortcut" or "shortcut" ,
dt.register_event("geoToolbox_wg", "shortcut",
select_with_gps, _("Select all images with GPS information"))
dt.register_event(CURR_API_STRING >= "6.2.1" and "geoToolbox_ng", "shortcut" or "shortcut" ,
dt.register_event("geoToolbox_ng", "shortcut",
select_without_gps, _("Select all images without GPS information"))
-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua