-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move image hash and moved image handling to class side
- Loading branch information
Showing
14 changed files
with
47 additions
and
33 deletions.
There are no files selected for viewing
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
src/Squot.package/SqueakWorkingCopy.class/class/handleMovedImageFrom.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
image-hash | ||
handleMovedImageFrom: oldHash to: newHash | ||
| doMove | | ||
doMove := (UIManager default | ||
chooseFrom: {'I copied it.'. 'I moved it.'} | ||
title: | ||
'The image is not where it used to be. Did you move or copy it?', String cr, | ||
'If in doubt, choose copy.') | ||
= 2. | ||
self allInstancesDo: [:each | each handleMovedImageFrom: oldHash to: newHash doMove: doMove]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
image-hash | ||
imageHash | ||
| hash lastHash | | ||
hash := self basicImageHash. | ||
lastHash := self lastImageHash. | ||
self lastImageHash: hash. | ||
hash ~= lastHash ifTrue: [ | ||
self handleMovedImageFrom: lastHash to: hash]. | ||
^ hash |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/SqueakWorkingCopy.class/class/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class initialization | ||
initialize | ||
self initializeLastImageHash. |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
src/Squot.package/SqueakWorkingCopy.class/class/lastImageHash..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
image-hash | ||
lastImageHash: aString | ||
LastImageHash := aString |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/SqueakWorkingCopy.class/class/lastImageHash.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
image-hash | ||
lastImageHash | ||
^ LastImageHash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
src/Squot.package/SqueakWorkingCopy.class/instance/imageHash.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
image-hash | ||
imageHash | ||
| hash lastHash | | ||
hash := self basicImageHash. | ||
lastHash := self lastImageHash. | ||
self lastImageHash: hash. | ||
hash ~= lastHash ifTrue: [ | ||
self handleMovedImageFrom: lastHash to: hash]. | ||
^ hash | ||
^ self class imageHash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
src/Squot.package/SqueakWorkingCopy.class/instance/lastImageHash..st
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
src/Squot.package/SqueakWorkingCopy.class/instance/lastImageHash.st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters