start moving out of direct access to UI
MODIFY
src/PharoLauncher-Core/PhLError.class.st
src/PharoLauncher-Core/PhLError.class.st
@@ -4,7 +4,7 @@ I represent an error as can be signaled by any code of Pharo Launcher.
Class {
#name : #PhLError,
#superclass : #Error,
- #category : 'PharoLauncher-Core-Exceptions'
+ #category : #'PharoLauncher-Core-Exceptions'
}
{ #category : #accessing }
@@ -19,8 +19,6 @@ PhLError >> name [
{ #category : #ui }
PhLError >> uiAlert [
- UIManager default
- alert: self longDescription
- title: self name
- configure: [ :morph | (morph findDeeplyA: TextMorph) unlock ]
+
+ PharoLauncherApplication default showError: self
]

MODIFY
src/PharoLauncher-Core/PhLImage.class.st
src/PharoLauncher-Core/PhLImage.class.st
@@ -360,12 +360,11 @@ PhLImage >> launchWithConfiguration: aPhLLaunchConfiguration [
on: PhLImageVersionDeterminationError
do: [ :error | error uiAlert ] ]
on: PhLArchitectureMismatchWarning
- do: [ :warning | | |
- (PhLLaunchImageCommand warnOnArchMismatch and: [ architectureWarningEnabled ])
- ifTrue: [
+ do: [ :warning |
+ architectureWarningEnabled ifTrue: [
architectureWarningEnabled := false. "only raise one warning"
- continue := YesNoDialogWithTickBoxWindow confirm: warning longDescription label: warning name. ].
- continue ifTrue: [ warning resume ]. ]
+ continue := self showWarning: warning ].
+ continue ifTrue: [ warning resume ] ]
]
{ #category : #accessing }
@@ -468,6 +467,21 @@ PhLImage >> showNativeFolder [
PhLFileBrowser openOn: file
]
+{ #category : #'private ui' }
+PhLImage >> showWarning: warning [
+ | continue |
+
+ continue := true.
+ (PhLLaunchImageCommand warnOnArchMismatch)
+ ifTrue: [
+ continue := (PharoLauncherApplication default newConfirm
+ title: warning name ;
+ message: warning longDescription;
+ openModalWithSpecParent: PharoLauncherApplication default topWindow) ].
+
+ ^ continue
+]
+
{ #category : #accessing }
PhLImage >> sourcesFile [
^ self file parent files

DELETE
src/PharoLauncher-Spec2/YesNoDialogWithTickBoxWindow.class.st
-"
-Yes - No Dialog window with a tick box used to disable warnings by example.
-
-self confirm: 'Is this widget fine?' label: 'Title'
-"
-Class {
- #name : #YesNoDialogWithTickBoxWindow,
- #superclass : #QuestionWithoutCancelDialogWindow,
- #category : #'PharoLauncher-Spec2'
-}
-
-{ #category : #'ui requests' }
-YesNoDialogWithTickBoxWindow class >> confirm: description label: title [
-
- ^ (PharoLauncherApplication default newConfirm
- title: title;
- message: description;
- openModalWithSpecParent: PharoLauncherApplication default topWindow)
- isOk
-]
-
-{ #category : #accessing }
-YesNoDialogWithTickBoxWindow >> checkBoxBallonText [
- ^ PhLLaunchImageCommand archMismatchSettingDescription
-]
-
-{ #category : #accessing }
-YesNoDialogWithTickBoxWindow >> checkBoxLabel [
- ^ PhLLaunchImageCommand archMismatchSettingLabel
-]
-
-{ #category : #accessing }
-YesNoDialogWithTickBoxWindow >> checkBoxSelector [
- ^ #warnOnArchMismatch
-]
-
-{ #category : #accessing }
-YesNoDialogWithTickBoxWindow >> checkBoxSetterSelector [
- ^ #warnOnArchMismatch:
-]
-
-{ #category : #'instance creation' }
-YesNoDialogWithTickBoxWindow >> newMainPanel [
- | panel |
- panel := super newMainPanel.
- self newTickBoxRow ifNotNil: [:m | panel addMorphBack: m ].
- ^ panel
-]
-
-{ #category : #'instance creation' }
-YesNoDialogWithTickBoxWindow >> newTickBoxRow [
- "Answer a new tick box row."
-
- | row checkBox |
- checkBox := CheckboxMorph
- on: PhLLaunchImageCommand
- selected: self checkBoxSelector
- changeSelected: self checkBoxSetterSelector.
- checkBox
- label: self checkBoxLabel;
- vResizing: #shrinkWrap;
- hResizing: #shrinkWrap;
- setBalloonText: self checkBoxBallonText.
- row := Morph new
- color: Color transparent;
- changeTableLayout;
- cellInset: 8;
- listDirection: #rightToLeft;
- listCentering: #bottomRight;
- hResizing: #spaceFill;
- vResizing: #shrinkWrap.
- row addMorphBack: checkBox.
- ^ row
-]

start moving out of direct access to UI