diff --git a/src/Pyramid-Bloc/PyramidSavePlugin.class.st b/src/Pyramid-Bloc/PyramidSavePlugin.class.st index 7c1307a1..0516fdea 100644 --- a/src/Pyramid-Bloc/PyramidSavePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSavePlugin.class.st @@ -27,7 +27,7 @@ PyramidSavePlugin class >> openOn: aCollectionOfBlElement saveModel: aSaveModel savePlugin := savePlugin asArray first. editor projectModel roots addAll: aCollectionOfBlElement. savePlugin openOn: aSaveModel. - editor window open + editor open ] { #category : #adding } diff --git a/src/Pyramid-Bloc/PyramidSpaceBuilder.class.st b/src/Pyramid-Bloc/PyramidSpaceBuilder.class.st index 271dbe6f..47d173dc 100644 --- a/src/Pyramid-Bloc/PyramidSpaceBuilder.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceBuilder.class.st @@ -89,6 +89,7 @@ PyramidSpaceBuilder >> addOverlayNamed: aString [ PyramidSpaceBuilder >> build [ self space: BlSpace new. + self space userData at: #isPyramidEditor put: true. self overlays ifEmpty: [ ^ self space ]. diff --git a/src/Pyramid-Tests/PyramidEditorTest.class.st b/src/Pyramid-Tests/PyramidEditorTest.class.st index 4403ae5a..e21904e9 100644 --- a/src/Pyramid-Tests/PyramidEditorTest.class.st +++ b/src/Pyramid-Tests/PyramidEditorTest.class.st @@ -22,7 +22,7 @@ PyramidEditorTest >> openFromBlSpace [ self assert: (editor projectModel roots includes: element). self deny: (space root children includes: element). - editor window close. + editor close. (Duration milliSeconds: 10) wait. self assert: editor window isClosed. @@ -35,13 +35,15 @@ PyramidEditorTest >> openNewEditor [ | editor spec | editor := PyramidEditor buildEditor. - spec := editor window open. + editor open. + + spec := editor window spec. (Duration milliSeconds: 10) wait. self currentWorld doOneCycle. self assert: editor window isOpen. self assert: spec window isInWorld. - editor window close. + editor close. (Duration milliSeconds: 10) wait. self currentWorld doOneCycle. self assert: editor window isClosed. diff --git a/src/Pyramid-Tests/PyramidPluginEditOnRunningTest.class.st b/src/Pyramid-Tests/PyramidPluginEditOnRunningTest.class.st index c79e5636..bff39076 100644 --- a/src/Pyramid-Tests/PyramidPluginEditOnRunningTest.class.st +++ b/src/Pyramid-Tests/PyramidPluginEditOnRunningTest.class.st @@ -54,6 +54,21 @@ PyramidPluginEditOnRunningTest >> testBlSpaceShortcutAddAndRemove [ self closeSpace: space. ] +{ #category : #tests } +PyramidPluginEditOnRunningTest >> testCannotEditTheEditor [ + | space editor | + + PyramidPluginEditOnRunning editOnRunning: true. + + editor := PyramidEditor buildEditor. + "get the space of the editor" + space := (editor getPlugin: PyramidSpacePlugin) builder space. + + "check than the shortcut is not installed" + self deny: (PyramidPluginEditOnRunning spaceIds includes: space id). + self deny: (space root shortcuts includes: (PyramidPluginEditOnRunning shortcut)). +] + { #category : #tests } PyramidPluginEditOnRunningTest >> testEditOnRunning [ @@ -71,23 +86,6 @@ PyramidPluginEditOnRunningTest >> testKeyCombination [ ] -{ #category : #tests } -PyramidPluginEditOnRunningTest >> testNotEditEditor [ - | space | - - PyramidPluginEditOnRunning editOnRunning: true. - - space := PyramidEditor new. - self deny: (PyramidPluginEditOnRunning spaceIds includes: space id). - self deny: (space root shortcuts includes: (PyramidPluginEditOnRunning shortcut)). - - space show. - self assert: (PyramidPluginEditOnRunning spaceIds includes: space id). - self assert: (space root shortcuts includes: (PyramidPluginEditOnRunning shortcut)). - - self closeSpace: space. -] - { #category : #tests } PyramidPluginEditOnRunningTest >> testShortcut [ diff --git a/src/Pyramid/PyramidEditor.class.st b/src/Pyramid/PyramidEditor.class.st index 0c7cc60b..5c749c6b 100644 --- a/src/Pyramid/PyramidEditor.class.st +++ b/src/Pyramid/PyramidEditor.class.st @@ -20,7 +20,21 @@ PyramidEditor class >> buildEditor [ PyramidEditor class >> open [