quick and dirty "fix" for usages of UIManager
for now this is using `PharoLauncherApplication default` access which is also ugly, but the whole application is bad designed (with bad separation of concerns), so for now it will have to work :/
MODIFY
src/PharoLauncher-Core/PhLAbstractTemplateGroup.class.st
src/PharoLauncher-Core/PhLAbstractTemplateGroup.class.st
@@ -16,15 +16,8 @@ Class {
{ #category : #accessing }
PhLAbstractTemplateGroup >> children [
- ^ [ self templatesAndGroups ]
- on: PhLDownloadError
- do: [ :error | | children |
- PhlRetryPresenter new
- explanation: error longDescription;
- retryBlock: [ children := self children ];
- cancelBlock: [ children := #() ];
- openModalWithSpec.
- children ]
+
+ ^ self templatesAndGroups
]
{ #category : #accessing }

MODIFY
src/PharoLauncher-Core/PhLDownloadManager.class.st
src/PharoLauncher-Core/PhLDownloadManager.class.st
@@ -44,14 +44,14 @@ PhLDownloadManager >> basicDownload: url toFile: destinationFile [
PhLDownloadManager >> displayProgressDuring: workBlock [
"Inform user about download progression"
- UIManager default
- informUserDuring: [ :bar |
+ PharoLauncherApplication default newProgressDialog
+ informUserDuring: [ :dialog |
workBlock
on: HTTPProgress
do: [ :progress |
- bar label: progress printString.
+ dialog label: progress printString.
progress isEmpty
- ifFalse: [ bar current: progress percentage ].
+ ifFalse: [ dialog progressPercent: progress percentage ].
progress resume ] ]
]

MODIFY
src/PharoLauncher-Core/PhLOpenNewImageWindowCommand.class.st
src/PharoLauncher-Core/PhLOpenNewImageWindowCommand.class.st
@@ -17,10 +17,10 @@ PhLOpenNewImageWindowCommand >> asSpecCommand [
{ #category : #executing }
PhLOpenNewImageWindowCommand >> execute [
+
^ (PhLTemplatesPresenter
newApplication: self application
model: PhLTemplateGroupRepository default)
- selectCategory: 3; "official category"
openWithSpec;
yourself
]

MODIFY
src/PharoLauncher-Core/PhLVirtualMachineManager.class.st
src/PharoLauncher-Core/PhLVirtualMachineManager.class.st
@@ -106,12 +106,12 @@ PhLVirtualMachineManager class >> isPreSpur: anImageFormatVersion [
{ #category : #unzipping }
PhLVirtualMachineManager class >> pharoUnzip: aZipFileReference to: outputDirectory [
- UIManager default informUserDuring:
- [ :bar |
+
+ PharoLauncherApplication default newProgressDialog
+ informUserDuring: [ :bar |
ZipArchive new
readFrom: aZipFileReference;
extractAllTo: outputDirectory informing: bar overwrite: true ]
-
]
{ #category : #private }
@@ -536,7 +536,8 @@ PhLVirtualMachineManager >> virtualMachines [
{ #category : #querying }
PhLVirtualMachineManager >> vm [
| vm |
- UIManager default
+
+ PharoLauncherApplication default newProgressDialog
informUserDuring: [ :bar |
bar label: 'Determining Image version'.
vm := self availableVirtualMachines
@@ -554,7 +555,7 @@ PhLVirtualMachineManager >> vm [
bar
label: 'Running the image';
current: 100.
- vm ]. ].
+ vm ] ].
^ vm executablePath
]

MODIFY
src/PharoLauncher-Spec2/PhLImageCreationPresenter.class.st
src/PharoLauncher-Spec2/PhLImageCreationPresenter.class.st
@@ -123,6 +123,7 @@ PhLImageCreationPresenter >> initializationScripts [
{ #category : #initialization }
PhLImageCreationPresenter >> initialize [
+
super initialize.
reservedImagesNamesCache := self application imageRepository imageNames collect: #asLowercase
]
@@ -193,15 +194,17 @@ PhLImageCreationPresenter >> refreshInitializationScriptList [
{ #category : #private }
PhLImageCreationPresenter >> showNameError [
+
imageNameCheck
- image: (self iconNamed: #smallError);
+ image: (self application iconNamed: #smallCancel);
help: 'An image with the same name already exists!'
]
{ #category : #private }
PhLImageCreationPresenter >> showNameOk [
+
imageNameCheck
- image: (self iconNamed: #smallOk);
+ image: (self application iconNamed: #smallOk);
help: 'Image name is valid!'
]

MODIFY
src/PharoLauncher-Spec2/PhLImagesPresenter.class.st
src/PharoLauncher-Spec2/PhLImagesPresenter.class.st
@@ -256,7 +256,7 @@ PhLImagesPresenter >> initializeWindow: aWindowPresenter [
aWindowPresenter
title: 'Pharo Launcher';
- initialExtent: 700 @ 550;
+ initialExtent: 850@550;
centered;
whenClosedDo: [ self imageRepository unsubscribe: self ].
self rootCommandsGroup installShortcutsIn: aWindowPresenter.

MODIFY
src/PharoLauncher-Spec2/PhLTemplatesPresenter.class.st
src/PharoLauncher-Spec2/PhLTemplatesPresenter.class.st
@@ -38,7 +38,9 @@ PhLTemplatesPresenter class >> buildContextualMenuGroup [
PhLTemplatesPresenter class >> defaultSpec [
^ SpPanedLayout newHorizontal
+ positionOfSlider: 60 percent;
add: (SpPanedLayout newHorizontal
+ positionOfSlider: 40 percent;
add: (SpBoxLayout newVertical
add: '1. Choose a template category:' expand: false;
add: #categoryTable;
@@ -94,7 +96,7 @@ PhLTemplatesPresenter >> buildTemplateTable [
^ self newTreeTable
hideColumnHeaders;
- children: #children;
+ children: [ :aTemplateGroup | self childrenOf: aTemplateGroup ];
addColumn: (SpStringTableColumn evaluated: #name);
contextMenuFromCommandsGroup: [ self rootCommandsGroup / 'Context Menu' ];
beMultipleSelection; "bulk delete templates for example"
@@ -106,6 +108,21 @@ PhLTemplatesPresenter >> buildTemplateTable [
yourself
]
+{ #category : #private }
+PhLTemplatesPresenter >> childrenOf: aTemplateGroup [
+
+ ^ [ aTemplateGroup children ]
+ on: PhLDownloadError
+ do: [ :error |
+ | children |
+ (PhlRetryPresenter newApplication: self application)
+ explanation: error longDescription;
+ retryBlock: [ children := aTemplateGroup children ];
+ cancelBlock: [ children := #() ];
+ openModalWithSpec.
+ children ]
+]
+
{ #category : #initialization }
PhLTemplatesPresenter >> connectPresenters [
@@ -167,6 +184,14 @@ PhLTemplatesPresenter >> initializationScript [
^ descriptionPanel initializationScript
]
+{ #category : #initialization }
+PhLTemplatesPresenter >> initialize [
+
+ super initialize.
+ self selectCategory: 3
+
+]
+
{ #category : #initialization }
PhLTemplatesPresenter >> initializePresenters [
@@ -223,5 +248,6 @@ PhLTemplatesPresenter >> singleTemplate [
{ #category : #'api - accessing' }
PhLTemplatesPresenter >> templateRepository [
+
^ self model
]

MODIFY
src/PharoLauncher-Spec2/PharoLauncherApplication.class.st
src/PharoLauncher-Spec2/PharoLauncherApplication.class.st
@@ -303,6 +303,14 @@ PharoLauncherApplication >> startFull [
using: SpWorldPresenter
]
+{ #category : #api }
+PharoLauncherApplication >> syntaxHighlightTheme [
+
+ ^ self
+ propertyAt: #syntaxHighlightTheme
+ ifAbsent: [ nil ]
+]
+
{ #category : #accessing }
PharoLauncherApplication >> templateRepository [
^ templateRepository

MODIFY
src/PharoLauncher-Spec2/PhlRetryPresenter.class.st
src/PharoLauncher-Spec2/PhlRetryPresenter.class.st
@@ -41,13 +41,13 @@ PhlRetryPresenter >> explanation: aString [
{ #category : #initialization }
PhlRetryPresenter >> initializeDialogWindow: aWindowPresenter [
+
aWindowPresenter
title: 'Retry?';
initialExtent: 400 @ 120;
addButton: 'Retry' do: [ :presenter | presenter close. retryBlock value. ];
addButton: 'Cancel' do: [ :presenter | presenter beCancel; close. cancelBlock value. ];
- centered.
-
+ centeredRelativeToTopWindow
]
{ #category : #initialization }

MODIFY
src/PharoLauncher-Spec2/YesNoDialogWithTickBoxWindow.class.st
src/PharoLauncher-Spec2/YesNoDialogWithTickBoxWindow.class.st
@@ -11,11 +11,12 @@ Class {
{ #category : #'ui requests' }
YesNoDialogWithTickBoxWindow class >> confirm: description label: title [
- ^ (UIManager default modalMorph openModal: (
- (self newWithTheme: Smalltalk ui theme)
- textFont: Smalltalk ui theme textFont;
+
+ ^ (PharoLauncherApplication default newConfirm
title: title;
- text: description)) answer
+ message: description;
+ openModalWithSpecParent: PharoLauncherApplication default topWindow)
+ isOk
]
{ #category : #accessing }

quick and dirty "fix" for usages of UIManager
for now this is using `PharoLauncherApplication default` access which is also ugly, but the whole application is bad designed (with bad separation of concerns), so for now it will have to work :/