Skip to content

Commit

Permalink
fix #240 - command could fail if dialog canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
demarey committed Sep 12, 2018
1 parent 2dc825b commit 5c3fc06
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
@@ -0,0 +1,5 @@
action
executeCommand
[ self execute ]
on: PhLCommandCancellation
do: [ :ex | "Do nothing - user has cancelled the command" ].
@@ -1,4 +1,4 @@
action
executeIfApplicable
self isApplicable ifTrue: [
self validateModelIntegrity ifTrue: [self execute ]]
self validateModelIntegrity ifTrue: [self executeCommand ]]
@@ -0,0 +1 @@
Get notified if a user canceled an operation do not run following operations if any
@@ -0,0 +1,11 @@
{
"commentStamp" : "ChristopheDemarey 9/12/2018 12:27",
"super" : "Notification",
"category" : "PharoLauncher-Core-Model",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "PhLCommandCancellation",
"type" : "normal"
}
Expand Up @@ -2,6 +2,7 @@ action
createTemplate
| name |
name := self newTemplateName.
name ifNil: [ PhLCommandCancellation signal ].
self
ensure: (self model isNewLocalTemplateNameValid: name).
self model templateRepository
Expand Down
Expand Up @@ -2,5 +2,6 @@ action
execute
| name |
name := self newTemplateName.
self ensure: name isEmptyOrNil not.
name ifNil: [ PhLCommandCancellation signal ].
self ensure: name isNotEmpty.
self model templateRepository createLocalTemplateFrom: self model singleImage named: name

0 comments on commit 5c3fc06

Please sign in to comment.