Skip to content

Commit

Permalink
Merge 17406af
Browse files Browse the repository at this point in the history
  • Loading branch information
chisandrei committed Nov 6, 2024
2 parents 0767a9d + 17406af commit c410b9e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
24 changes: 13 additions & 11 deletions src/GToolkit-Inspector/AbstractFileReference.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -409,21 +409,23 @@ AbstractFileReference >> gtPharoScriptFor: aView [
aptitude: BrGlamorousButtonWithIconAptitude;
label: 'Save';
icon: BrGlamorousVectorIcons accept;
action: [
| newContents |
newContents := tab viewContentElement children first children first children first textualCoderViewModel styledText asString.
(self fullName, '.backup') asFileReference ensureDelete.
self copyTo: (self fullName, '.backup') asFileReference.
self ensureDelete; writeStreamDo: [ :s | s nextPutAll: newContents ] ] ]
action: [ | newContents |
newContents := tab viewContentElement children
first children
first children first
textualCoderViewModel styledText asString.
self gtSaveContents: newContents ] ]
]

{ #category : #'*GToolkit-Inspector' }
AbstractFileReference >> gtSaveContents: newContents [
(self fullName , '.backup') asFileReference ensureDelete.
self copyTo: (self fullName , '.backup') asFileReference.
^ self
ensureDelete;
writeStreamDo: [ :s | s nextPutAll: newContents ]
| newFile |
newFile := self , 'new'.
newFile ensureDelete.
newFile writeStreamDo: [ :stream | stream nextPutAll: newContents ].
self ensureDelete.
newFile renameTo: self basename.
^ newFile
]

{ #category : #'*GToolkit-Inspector' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ GtInspectorElementLiveViewContainer >> isReadyForLiveView [
Do not display it as live."
^ false ].

"The element am not displayed (used) anywhere, display it live."
"The element is not displayed (used) anywhere, display it live."
^ true
]

Expand Down Expand Up @@ -161,6 +161,20 @@ GtInspectorElementLiveViewContainer >> onAddedToSceneGraph [
self updateElementLiveView
]

{ #category : #'hooks - children' }
GtInspectorElementLiveViewContainer >> onChildAdded: anElement [
super onChildAdded: anElement.

anElement id = GtInspectorElementPreviewContainerId asBlocElementId
ifTrue: [ ^ self ].

"In case someone uses code like
`anElement parent replaceChild: anElement with: aNewElement`,
we establish the new provided child as a new inspected element."
(self childrenCount = 1 and: [ (anElement == self element) not ]) ifTrue: [
element := anElement ]
]

{ #category : #'private - event handling' }
GtInspectorElementLiveViewContainer >> onElementRemovedFromSceneGraphEvent: anEvent [
self updateElementLiveView
Expand Down
2 changes: 1 addition & 1 deletion src/GToolkit-Inspector/MemoryLogger.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ MemoryLogger >> gtStartActionFor: anAction [
MemoryLogger >> gtStopActionFor: anAction [
<gtAction>
^ anAction button
icon: BrGlamorousVectorIcons cancel;
icon: BrGlamorousVectorIcons stop;
tooltip: 'Stop Logger';
priority: 2;
action: [ :aButton | self stop ]
Expand Down

0 comments on commit c410b9e

Please sign in to comment.