Skip to content

Instantly share code, notes, and snippets.

@tinchodias
Created July 22, 2015 11:06
Show Gist options
  • Save tinchodias/8be031b15692cd72bb78 to your computer and use it in GitHub Desktop.
Save tinchodias/8be031b15692cd72bb78 to your computer and use it in GitHub Desktop.
(Smalltalk globals
at: #StartupPreferencesLoader
ifAbsent: [ StartupLoader ]) default executeAtomicItems: {
StartupAction
name: 'EpiceaTaskClustererValidation'
code: [
| button total shouldLoad |
(Smalltalk isInteractive
and: [ (Smalltalk globals hasClassNamed: #EpVoter) not
and: [ SystemVersion current major >= 4 ]]) ifTrue: [
"Give a change to cancel load..."
total := 3.
shouldLoad := true.
button := ButtonModel new.
(button
label: 'Cancel';
extent: 500@100;
action: [
shouldLoad := false.
button window close ];
openWithSpec)
centered.
0 to: total do: [ :n |
[ button window title: 'Epicea Task Clusterer: Load starting in ', ((total - n) asString, ' seconds') ]
valueAfterWaiting: n seconds ].
[
button window isClosed ifFalse: [ button window close ].
"Finally, start load."
shouldLoad ifTrue: [
| loadingTime |
self inform: 'Epicea Task Clusterer: Load started'.
loadingTime := [
[
Metacello new
configuration: #EpiceaSorter;
smalltalkhubUser: 'MartinDias' project: 'EpiceaTaskClusterer';
load.
] asJob title: 'Epicea Task Clusterer: Load started'; run ] timeToRun.
self inform: 'Epicea Task Clusterer: Load finished (', loadingTime asSeconds asString, ' seconds)'.
self inform: 'Epicea Task Clusterer: Validation started'. ]
] valueAfterWaiting: total seconds
] ]
runOnce: true.
}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment