Reverted back to dt.control.execute()

This commit is contained in:
elman
2016-04-29 18:59:05 +02:00
parent 6ef06467b6
commit 33417454ed

View File

@@ -30,6 +30,7 @@ WARNING
This script is only tested with Linux This script is only tested with Linux
USAGE USAGE
* require script "official/yield" from your main Lua file in the first line
* require this script from your main Lua file * require this script from your main Lua file
* when choosing file format, pick JPEG or PNG as Google Earth doesn't support other formats * when choosing file format, pick JPEG or PNG as Google Earth doesn't support other formats
@@ -202,7 +203,7 @@ local function create_kml_file(storage, image_table, extra_data)
-- Creates dir if not exsists -- Creates dir if not exsists
imageFoldername = "files/" imageFoldername = "files/"
local mkdirCommand = "mkdir -p "..exportDirectory.."/"..imageFoldername local mkdirCommand = "mkdir -p "..exportDirectory.."/"..imageFoldername
coroutine.yield("RUN_COMMAND", mkdirCommand) dt.control.execute(mkdirCommand)
end end
@@ -222,8 +223,7 @@ local function create_kml_file(storage, image_table, extra_data)
-- profiles that might be present in the input and aren't needed in the thumbnail. -- profiles that might be present in the input and aren't needed in the thumbnail.
local convertToThumbCommand = "convert -size 96x96 "..exported_image.." -resize 92x92 -mattecolor \"#FFFFFF\" -frame 2x2 +profile \"*\" "..exportDirectory.."/"..imageFoldername.."thumb_"..filename..".jpg" local convertToThumbCommand = "convert -size 96x96 "..exported_image.." -resize 92x92 -mattecolor \"#FFFFFF\" -frame 2x2 +profile \"*\" "..exportDirectory.."/"..imageFoldername.."thumb_"..filename..".jpg"
-- USE coroutine.yield. It does not block the UI dt.control.execute(convertToThumbCommand)
coroutine.yield("RUN_COMMAND", convertToThumbCommand)
else else
-- Remove exported image if it has no GPS data -- Remove exported image if it has no GPS data
os.remove(exported_image) os.remove(exported_image)
@@ -341,7 +341,6 @@ local function create_kml_file(storage, image_table, extra_data)
-- Compress the files to create a KMZ file -- Compress the files to create a KMZ file
if ( dt.preferences.read("kml_export","CreateKMZ","bool") == true ) then if ( dt.preferences.read("kml_export","CreateKMZ","bool") == true ) then
exportDirectory = dt.preferences.read("kml_export","ExportDirectory","string") exportDirectory = dt.preferences.read("kml_export","ExportDirectory","string")
-- USE coroutine.yield. It does not block the UI
local createKMZCommand = "zip --test --move --junk-paths " local createKMZCommand = "zip --test --move --junk-paths "
createKMZCommand = createKMZCommand .."\""..exportDirectory.."/"..exportKMZFilename.."\" " -- KMZ filename createKMZCommand = createKMZCommand .."\""..exportDirectory.."/"..exportKMZFilename.."\" " -- KMZ filename
@@ -358,7 +357,7 @@ local function create_kml_file(storage, image_table, extra_data)
end end
end end
coroutine.yield("RUN_COMMAND", createKMZCommand) dt.control.execute(createKMZCommand)
end end
-- Open the file with the standard programm -- Open the file with the standard programm
@@ -370,7 +369,7 @@ local function create_kml_file(storage, image_table, extra_data)
else else
kmlFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportKMLFilename.."\"" kmlFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportKMLFilename.."\""
end end
coroutine.yield("RUN_COMMAND", kmlFileOpenCommand) dt.control.execute(kmlFileOpenCommand)
end end