Skip to content

Commit

Permalink
getting a context to execute the action
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm committed Oct 19, 2023
1 parent c0d141f commit 5ee31c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Iceberg-TipUI/IceTipCommitBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ IceTipCommitBrowser >> initialize [

super initialize.
saveAction := IceTipSaveImageAction new
context: self;
yourself
]

{ #category : 'initialization' }
Expand Down
17 changes: 16 additions & 1 deletion Iceberg-TipUI/IceTipSaveImageAction.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,29 @@ I'm used by the presenter that prepares the commit.
Class {
#name : 'IceTipSaveImageAction',
#superclass : 'Object',
#instVars : [
'context'
],
#category : 'Iceberg-TipUI-Commands',
#package : 'Iceberg-TipUI',
#tag : 'Commands'
}

{ #category : 'accessing' }
IceTipSaveImageAction >> context [

^ context
]

{ #category : 'accessing' }
IceTipSaveImageAction >> context: anObject [

context := anObject
]

{ #category : 'execution' }
IceTipSaveImageAction >> execute [

Smalltalk saveSession.
SpApplication defaultApplication newInform title: 'Image automatically saved'; openModal
self context inform: 'Image automatically saved'
]

0 comments on commit 5ee31c2

Please sign in to comment.