Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ on __revIDEDeveloperExtensionDoCreateTestStack pPath, tRectsA, pDetailsA
create stack "LiveCode Extension Test Window"
if tRectsA["rect"] is not empty then
set the rect of stack "LiveCode Extension Test Window" to tRectsA["rect"]
else
else if tRectsA["loc"] is not empty then
set the loc of stack "LiveCode Extension Test Window" to tRectsA["loc"]
end if
set the destroyStack of stack "LiveCode Extension Test Window" to true
Expand Down
87 changes: 15 additions & 72 deletions Toolset/libraries/revideextensionlibrary.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -362,59 +362,27 @@ private command __extensionDownloadVerify pCacheIndex
set the itemdel to "."
if the last item of tExtensionPath is not "lce" then return __extensionError(pCacheIndex,"Could not install extension. The package extension '"&the last item of tExtensionPath&"' Is not valid. Must be 'lce'.")

# Get initial manifest data needed for loading
local tManifestData, tManifestXMLTree
put __extensionManifestData(pCacheIndex) into tManifestData
put revXMLCreateTree(tManifestData,true,true,false) into tManifestXMLTree

# Check the manifest contains a name
local tExtensionName
put __extensionManifestValueFromTree(tManifestXMLTree, "name") into tExtensionName
# Ensure the zip contains the things we expect
local tManifestDataA
extensionValidateLCEPackage tExtensionPath, tManifestDataA
if the result is not empty then
return __extensionError(pCacheIndex,"Could not install extension. The package manifest must contain a valid name (com.livecode.extensions.<developer_ID>.<extension_name>)")
end if
__extensionPropertySet pCacheIndex, "name", tExtensionName

# Check the manifest contains a version
local tExtensionVersion
put __extensionManifestValueFromTree(tManifestXMLTree, "version") into tExtensionVersion
if the result is not empty then
return __extensionError(pCacheIndex,"Could not install extension. The package manifest must contain a valid version number (1.2.3 - major,minor,maintenance)")
end if
__extensionPropertySet pCacheIndex, "version", tExtensionVersion

# Check the manifest contains an author
local tExtensionAuthor
put __extensionManifestValueFromTree(tManifestXMLTree, "author") into tExtensionAuthor
if the result is not empty then
return __extensionError(pCacheIndex,"Could not install extension. The package manifest must contain an author")
end if
__extensionPropertySet pCacheIndex, "author", tExtensionAuthor

# Check the manifest contains an type
local tExtensionType
put __extensionManifestValueFromTree(tManifestXMLTree, "type") into tExtensionType
if the result is not empty then
return __extensionError(pCacheIndex,"Could not install extension. The package manifest must contain a type")
end if
__extensionPropertySet pCacheIndex, "type", tExtensionType

# Check the manifest contains an title
local tExtensionTitle
put __extensionManifestValueFromTree(tManifestXMLTree, "title") into tExtensionTitle
if the result is not empty then
return __extensionError(pCacheIndex,"Could not install extension. The package manifest must contain a title")
return the result
end if
__extensionPropertySet pCacheIndex, "title", tExtensionTitle

revXMLDeleteTree tManifestXMLTree
repeat for each key tKey in tManifestDataA
__extensionPropertySet pCacheIndex, tKey, tManifestDataA[tKey]
end repeat

# Build the type ID from the name and version
__extensionPropertySet pCacheIndex, "type_id", tExtensionName & "." & tExtensionVersion
__extensionPropertySet pCacheIndex, "type_id", \
tManifestDataA["name"] & "." & tManifestDataA["version"]
end __extensionDownloadVerify

private command __extensionInstall pCacheIndex, pPackage, pFromStore
__extensionDownloadVerify pCacheIndex
if the result is not empty then
throw "Error installing extension" && pPackage & return & the result
end if

local tName, tTypeId, tInstallPath
put __extensionPropertyGet(pCacheIndex, "name") into tName
Expand Down Expand Up @@ -497,6 +465,9 @@ end __extensionInstallCopyInterfaceFile
private command __extensionInstallLoad pCacheIndex, pName, pInstallFolder, pProgress
local tFolderData
extensionFindInFolder pInstallFolder, true, false, tFolderData
if tFolderData is empty then
throw "extension missing from" && pInstallFolder
end if

local tDataA
put tFolderData[pName][pInstallFolder] into tDataA["copies"][1]
Expand Down Expand Up @@ -1346,34 +1317,6 @@ private function __extensionManifestValueFromTree pTreeID, pProperty
return tValue for value
end __extensionManifestValueFromTree

private function __extensionManifestData pCacheIndex
# Get the path to the package file
local tExtensionPackageFile
put __extensionPropertyGet(pCacheIndex, "download_package_path") into tExtensionPackageFile

if not there is a file tExtensionPackageFile then return __extensionError(pCacheIndex,"Could not extract manifest because package was not found in downloads folder")

# A zip can come compressed with a base folder or without. So work out what the
# root folder is before trying to extract files
revZipOpenArchive tExtensionPackageFile, "read"

local tZipItems, tZipRoot
put revZipEnumerateItems(tExtensionPackageFile) into tZipItems

if the last char of line 1 of tZipItems is "/" then
put line 1 of tZipItems into tZipRoot
else
put empty into tZipRoot
end if

# Extract the package manfiest to a variable to read key data
local tManifestData, tManifestXMLTree, tValue
revZipExtractItemToVariable tExtensionPackageFile, (tZipRoot & "manifest.xml"), "tManifestData"

revZipCloseArchive tExtensionPackageFile
return tManifestData
end __extensionManifestData

function __extensionSampleStacks pID, pFolder
local tSampleFolder, tSamples, tSampleArray

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10791,7 +10791,7 @@ function DG2_CustomisableControlsGetDefaultEditModeReorderControl
if there is not a group "DG2 Default Edit Mode Reorder Control"of _TemplateControl() then
local tMsgsAreLocked
put the lockMessages into tMsgsAreLocked
lock messages
unlock messages

reset the templateGroup
create invisible group "DG2 Default Edit Mode Reorder Control" in _TemplateControl()
Expand All @@ -10812,7 +10812,7 @@ function DG2_CustomisableControlsGetDefaultEditModeActionSelectControl
if there is not a group "DG2 Default Edit Mode Action Select Control" of _TemplateControl() then
local tMsgsAreLocked
put the lockMessages into tMsgsAreLocked
lock messages
unlock messages

reset the templateGroup
create invisible group "DG2 Default Edit Mode Action Select Control" in _TemplateControl()
Expand All @@ -10836,7 +10836,7 @@ function DG2_CustomisableControlsGetDefaultEditModeActionControl

local tMsgsAreLocked
put the lockMessages into tMsgsAreLocked
lock messages
unlock messages

reset the templateGroup
create invisible group "DG2 Default Action Control" in _TemplateControl()
Expand Down Expand Up @@ -10866,7 +10866,7 @@ private function DG2_CustomisableControlsGetDefaultSwipeControl pName

local tMsgsAreLocked
put the lockMessages into tMsgsAreLocked
lock messages
unlock messages

local tGroup
reset the templateGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ private on nodeCreateVisualizationObject pPathToNode
revMetadataSet the name of stack tStack, "general", "visualizer", true

-- generate variable visualizer UI
local tOldDefaultStack
put the defaultStack into tOldDefaultStack
set the defaultStack to the short name of tStack
reset the templateButton
set the height of the templateButton to 23
Expand All @@ -340,6 +342,7 @@ private on nodeCreateVisualizationObject pPathToNode
reset the templateButton
reset the templateField
set the lockMessages to tOldLock
set the defaultStack to tOldDefaultStack

return tStack
end nodeCreateVisualizationObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ on initialize
set the enabled of group "iOS Settings" to false
end if

relayer button "iOSTabMenu" after group "cards"

updateIosSettingState

local tTipLastShown, tShowTip
Expand Down
1 change: 1 addition & 0 deletions notes/bugfix-21032.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Layer tab button on iOS standalone settings below other controls
1 change: 1 addition & 0 deletions notes/bugfix-21065.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Set loc of extension builder generated test stack correctly on first test
1 change: 1 addition & 0 deletions notes/bugfix-21082.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Notify when attempting to install package that doesn't validate
1 change: 1 addition & 0 deletions notes/bugfix-21090.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ensure project browser updates when DG2 controls are added to the template stack
1 change: 1 addition & 0 deletions notes/bugfix-21100.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ensure the defaultStack does not change after opening revVariableVisualizer stack