more compact code

This commit is contained in:
U-DESKTOP-HQME86J\marco
2021-02-24 19:21:32 +01:00
parent abd8bf4a60
commit 931e448ebd

View File

@@ -338,39 +338,28 @@ local function export2collection(storage, image_table, extra_data)
-- install the module in the UI ----------------------------------------------- -- install the module in the UI -----------------------------------------------
local function install_module(dr) local function install_module(dr)
local views = {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}}
if dr then
views = {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100},
[dt.gui.views.darkroom] = {"DT_UI_CONTAINER_PANEL_LEFT_CENTER", 100}}
end
if not ee.module_installed then if not ee.module_installed then
if dr then -- register new module "external editors" in lighttable and darkroom ----
-- register new module "external editors" in lighttable and darkroom ---- dt.register_lib(
dt.register_lib( MODULE_NAME,
MODULE_NAME, _("external editors"),
_("external editors"), true, -- expandable
true, -- expandable false, -- resetable
false, -- resetable views,
{[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 100}, dt.new_widget("box") {
[dt.gui.views.darkroom] = {"DT_UI_CONTAINER_PANEL_LEFT_CENTER", 100}}, orientation = "vertical",
dt.new_widget("box") { table.unpack(ee.widgets),
orientation = "vertical", },
table.unpack(ee.widgets), nil, -- view_enter
}, nil -- view_leave
nil, -- view_enter )
nil -- view_leave
)
else
-- register new module "external editors" in lighttable only ------------
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",
table.unpack(ee.widgets),
},
nil, -- view_enter
nil -- view_leave
)
end
ee.module_installed = true ee.module_installed = true
end end
end end