Skip to content

Commit 9b61e47

Browse files
authored
Merge pull request darktable-org#410 from darktable-org/script_manager_running_script
script_manager darktable shortcut integration
2 parents 800cbee + 75a19e7 commit 9b61e47

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

tools/script_manager.lua

+18-2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ dt.preferences.register(MODULE, "check_update", "bool",
104104

105105
local check_for_updates = dt.preferences.read(MODULE, "check_update", "bool")
106106

107+
-- - - - - - - - - - - - - - - - - - - - - - - -
108+
-- P R E F E R E N C E S
109+
-- - - - - - - - - - - - - - - - - - - - - - - -
110+
111+
dt.preferences.register(MODULE, "check_update", "bool",
112+
"check for updated scripts on start up",
113+
"automatically update scripts to correct version",
114+
true)
115+
116+
local check_for_updates = dt.preferences.read(MODULE, "check_update", "bool")
117+
107118
-- - - - - - - - - - - - - - - - - - - - - - - -
108119
-- L O G L E V E L
109120
-- - - - - - - - - - - - - - - - - - - - - - - -
@@ -334,8 +345,10 @@ local function activate(script)
334345
local err = nil -- error message returned if module doesn't start
335346
log.msg(log.info, "activating " .. script.name)
336347
if script.running == false then
348+
script_manager_running_script = script.name
337349
status, err = du.prequire(script.path)
338350
log.msg(log.debug, "prequire returned " .. tostring(status) .. " and for err " .. tostring(err))
351+
script_manager_running_script = nil
339352
if status then
340353
pref_write(script.script_name, "bool", true)
341354
log.msg(log.screen, _("Loaded ") .. script.script_name)
@@ -868,6 +881,10 @@ end
868881
-- M A I N P R O G R A M
869882
-- - - - - - - - - - - - - - - - - - - - - - - -
870883

884+
-- ensure shortcuts module knows widgets belong to script_manager
885+
886+
script_manager_running_script = "script_manager"
887+
871888
if check_for_updates then
872889
local repo_data = get_repo_status(LUA_DIR)
873890
local current_branch = get_current_repo_branch(LUA_DIR)
@@ -935,7 +952,6 @@ scan_scripts(LUA_DIR)
935952
log.msg(log.debug, "finished processing scripts")
936953

937954

938-
939955
-- - - - - - - - - - - - - - - - - - - - - - - -
940956
-- U S E R I N T E R F A C E
941957
-- - - - - - - - - - - - - - - - - - - - - - - -
@@ -1147,7 +1163,7 @@ sm.widgets.main_box = dt.new_widget("box"){
11471163
sm.widgets.main_stack
11481164
}
11491165

1150-
1166+
script_manager_running_script = nil
11511167
-- - - - - - - - - - - - - - - - - - - - - - - -
11521168
-- D A R K T A B L E I N T E G R A T I O N
11531169
-- - - - - - - - - - - - - - - - - - - - - - - -

0 commit comments

Comments
 (0)