do not copy/rename to existing images
ADD
src/Pharo-Launcher-UI.package/PharoLauncher.class/instance/allImages.st
+private
+allImages
+
+ ^imageGroup images
\ No newline at end of file

MODIFY
src/Pharo-Launcher-UI.package/PharoLauncher.class/instance/copyImage.st
src/Pharo-Launcher-UI.package/PharoLauncher.class/instance/copyImage.st
@@ -2,7 +2,8 @@ image action
copyImage
| image newName |
image := self selectedImage.
- newName := UIManager default request: 'New name'.
+ newName := UIManager default request: 'New name' initialAnswer: image name.
newName ifNil: [ ^self ].
+ (self hasAlreadyImageWithName: newName) ifTrue: [ ^UIManager default inform: 'There is already an image with this name' ].
imageGroup copyImage: image to: newName.
self updateImages
\ No newline at end of file

ADD
src/Pharo-Launcher-UI.package/PharoLauncher.class/instance/hasAlreadyImageWithName..st
+private
+hasAlreadyImageWithName: newName
+ "Return true if we already have an image with the given name"
+
+ ^(self allImages select: [:each | each name = newName ]) notEmpty
\ No newline at end of file

MODIFY
src/Pharo-Launcher-UI.package/PharoLauncher.class/instance/renameImage.st
src/Pharo-Launcher-UI.package/PharoLauncher.class/instance/renameImage.st
@@ -2,7 +2,8 @@ image action
renameImage
| image newName |
image := self selectedImage.
- newName := UIManager default request: 'New name'.
+ newName := UIManager default request: 'New name' initialAnswer: image name.
newName ifNil: [ ^self ].
+ (self hasAlreadyImageWithName: newName) ifTrue: [ ^UIManager default inform: 'There is already an image with this name' ].
imageGroup renameImage: image to: newName.
self updateImages
\ No newline at end of file

MODIFY
src/Pharo-Launcher-UI.package/PharoLauncher.class/instance/updateImages.st
src/Pharo-Launcher-UI.package/PharoLauncher.class/instance/updateImages.st
updating
updateImages
| images |
- images := imageGroup images sorted: [ :im1 :im2 | im1 name < im2 name ].
+ images := self allImages sorted: [ :im1 :im2 | im1 name < im2 name ].
imagesModel roots: images
\ No newline at end of file

do not copy/rename to existing images