fix builds and start
MODIFY
src/PharoLauncher-Spec2/PhLImageDetailPresenter.class.st
src/PharoLauncher-Spec2/PhLImageDetailPresenter.class.st
@@ -24,39 +24,23 @@ Class {
{ #category : #specs }
PhLImageDetailPresenter class >> defaultSpec [
- ^ SpBoxLayout newVertical
- add: #imageLabel
- withConstraints: [ :constraints | constraints height: self labelHeight * 1.5 ];
- add:
- (SpBoxLayout newHorizontal
- add: 'description:' withConstraints: self labelConstraintsBlock;
- add: #description;
- yourself);
- add:
- (SpBoxLayout newHorizontal
- add: 'Origin template:' withConstraints: self labelConstraintsBlock;
- add: #template;
- yourself)
- height: self labelHeight;
- add:
- (SpBoxLayout newHorizontal
- add: '' withConstraints: self labelConstraintsBlock;
- add: #templateUrl;
- yourself)
- height: self labelHeight;
- add:
- (SpBoxLayout newHorizontal
- add: 'Initialization script:' withConstraints: self labelConstraintsBlock;
+
+ ^ SpBoxLayout newTopToBottom
+ add: #imageLabel expand: false;
+ add: (SpGridLayout new
+ beRowNotHomogeneous;
+ beColumnNotHomogeneous;
+ column: 1 withConstraints: [ :c | c beNotExpand; vAlignStart ];
+ column: 2 withConstraints: [ :c | c beExpand ];
+ add: 'Description' at: 1@1; add: #description at: 2@1;
+ add: 'Origin template' at: 1@2; add: #template at: 2@2;
+ add: #templateUrl at: 2@3;
+ add: 'Initialization script' at: 1@4; add: (SpBoxLayout newLeftToRight
add: #initializationScript expand: false;
add: #shouldRunInitializationScript expand: false;
- yourself)
- height: self labelHeight;
- add:
- (SpBoxLayout newHorizontal
- add: 'Location:' withConstraints: self labelConstraintsBlock;
- add: #location;
- yourself)
- height: self labelHeight;
+ yourself) at: 2@4;
+ add: 'Location' at: 1@5; add: #location at: 2@5;
+ yourself);
yourself
]

MODIFY
src/PharoLauncher-Spec2/PhLImagesPresenter.class.st
src/PharoLauncher-Spec2/PhLImagesPresenter.class.st
@@ -94,15 +94,7 @@ PhLImagesPresenter class >> buildToolbarGroup [
{ #category : #specs }
PhLImagesPresenter class >> defaultSpec [
- ^ SpBoxLayout newVertical
- add: #toolbar expand: false;
- add: #imageFilter expand: false;
- add: (SpPanedLayout newVertical
- positionOfSlider: 65 percent;
- add: #imageTable;
- add: #descriptionPanel;
- yourself);
- yourself
+ ^ nil
]
{ #category : #'api - actions' }
@@ -118,6 +110,52 @@ PhLImagesPresenter >> actionLaunch [
cmd execute
]
+{ #category : #initialization }
+PhLImagesPresenter >> buildDescriptionPanel [
+
+ ^ self
+ instantiate: PhLImageDetailPresenter
+ on: PhLNullImage new
+]
+
+{ #category : #initialization }
+PhLImagesPresenter >> buildImageFilter [
+
+ ^ self newTextInput
+ placeholder: 'Enter image name filter ...';
+ whenTextChangedDo: [ :filterString | self filter: filterString asLowercase ];
+ yourself
+]
+
+{ #category : #initialization }
+PhLImagesPresenter >> buildImageTable [
+
+ ^ self newTable
+ items: self imageRepository images;
+ sortingBlock: #lastModification descending;
+ whenActivatedDo: [ self actionLaunch ];
+ bindKeyCombination: Character cr asShortcut toAction: [ self actionLaunch ];
+ "whenBuiltDo: [ :tree | tree widget alternateRowsColor ];"
+ addColumn: ((SpStringTableColumn title: 'Name' evaluated: #name)
+ width: 350;
+ yourself);
+ addColumn: ((SpStringTableColumn title: 'Architecture' evaluated: #architecture)
+ width: 80;
+ yourself);
+ addColumn: ((SpStringTableColumn title: 'Pharo Version' evaluated: #pharoVersion)
+ width: 80;
+ yourself);
+ addColumn: ((SpStringTableColumn
+ title: 'Last modified'
+ evaluated: [ :image | self readableDateFor: image lastModification ])
+ sortFunction: #lastModification descending;
+ yourself);
+ contextMenuFromCommandsGroup: [ self rootCommandsGroup / 'Context Menu' ];
+ beResizable;
+ beMultipleSelection;
+ yourself
+]
+
{ #category : #initialization }
PhLImagesPresenter >> buildToolbar [
| toolbarGroup |
@@ -140,9 +178,7 @@ PhLImagesPresenter >> buildToolbar [
{ #category : #initialization }
PhLImagesPresenter >> connectPresenters [
- super connectPresenters.
-
- imageTable whenSelectionChangedDo: [ :selection |
+ imageTable transmitDo: [ :image |
self
refreshLaunchConfigurationList;
updateToolbarCommandsAvailability ].
@@ -196,52 +232,28 @@ PhLImagesPresenter >> imageRepository [
PhLImagesPresenter >> initializePresenters [
toolbar := self buildToolbar.
- imageFilter := self newTextInput
- placeholder: 'Enter image name filter ...';
- whenTextChangedDo: [ :filterString | self filter: filterString asLowercase ];
- yourself.
- imageTable := self newTable
- items: self imageRepository images;
- sortingBlock: #lastModification descending;
- whenActivatedDo: [ self actionLaunch ];
- bindKeyCombination: Character cr asShortcut toAction: [ self actionLaunch ];
- "whenBuiltDo: [ :tree | tree widget alternateRowsColor ];"
- addColumn:
- ((SpStringTableColumn title: 'Name' evaluated: #name)
- width: 350;
- yourself);
- addColumn:
- ((SpStringTableColumn title: 'Architecture' evaluated: #architecture)
- width: 80;
- yourself);
- addColumn:
- ((SpStringTableColumn title: 'Pharo Version' evaluated: #pharoVersion)
- width: 80;
+ imageFilter := self buildImageFilter.
+ imageTable := self buildImageTable.
+ descriptionPanel := self buildDescriptionPanel.
+
+ self layout: (SpBoxLayout newTopToBottom
+ add: toolbar expand: false;
+ add: imageFilter expand: false;
+ add: (SpPanedLayout newTopToBottom
+ positionOfSlider: 60 percent;
+ add: imageTable;
+ add: descriptionPanel;
yourself);
- addColumn:
- ((SpStringTableColumn
- title: 'Last modified'
- evaluated: [ :image | self readableDateFor: image lastModification ])
- sortFunction: #lastModification descending;
- yourself);
- contextMenuFromCommandsGroup: [ self rootCommandsGroup / 'Context Menu' ];
- beResizable;
- beMultipleSelection;
- yourself.
- descriptionPanel := self
- instantiate: PhLImageDetailPresenter
- on: PhLNullImage new.
- self imageRepository whenChangedSend: #refresh to: self.
- self whenDisplayDo:
- [ self imageRepository hasImages
- ifTrue: [ self selectImageAt: 1 ] ].
+ yourself).
+
+ self imageRepository whenChangedSend: #refresh to: self
]
{ #category : #initialization }
PhLImagesPresenter >> initializeWindow: aWindowPresenter [
aWindowPresenter
title: 'Pharo Launcher';
- initialExtent: 700 @ 500;
+ initialExtent: 700 @ 550;
centered;
whenClosedDo: [ self imageRepository unsubscribe: self ].
self rootCommandsGroup installShortcutsIn: aWindowPresenter.
@@ -265,6 +277,7 @@ PhLImagesPresenter >> readableDateFor: aDateAndTime [
{ #category : #updating }
PhLImagesPresenter >> refresh [
+
imageTable items: self imageRepository images.
self refreshLaunchConfigurationList
]
@@ -368,6 +381,14 @@ PhLImagesPresenter >> toolbarGroup [
^ self rootCommandsGroup / 'Toolbar'
]
+{ #category : #initialization }
+PhLImagesPresenter >> updatePresenter [
+
+ self imageRepository hasImages
+ ifTrue: [ imageTable selectFirst ]
+
+]
+
{ #category : #updating }
PhLImagesPresenter >> updateToolbarCommandsAvailability [
self withToolbarDo: [ :toolbar |

MODIFY
src/PharoLauncher-Spec2/PharoLauncherApplication.class.st
src/PharoLauncher-Spec2/PharoLauncherApplication.class.st
@@ -286,16 +286,23 @@ PharoLauncherApplication >> scriptsDirectory: aFileReference [
{ #category : #running }
PharoLauncherApplication >> start [
- | presenterClass |
self initializeImagesPresenter.
- presenterClass := openAsWorld
- ifTrue: [ SpWorldPresenter ]
- ifFalse: [ imagesPresenter defaultWindowPresenterClass ].
+
+ openAsWorld ifTrue: [
+ self startFull.
+ ^ self ].
+
+ imagesPresenter openWithSpec
+]
+
+{ #category : #running }
+PharoLauncherApplication >> startFull [
+
self
open: imagesPresenter
withSpecLayout: imagesPresenter defaultSpec
- using: presenterClass
+ using: SpWorldPresenter
]
{ #category : #accessing }

MODIFY
src/PharoLauncher-Tests-Commands/PhLTestImagesPresenter.class.st
src/PharoLauncher-Tests-Commands/PhLTestImagesPresenter.class.st
@@ -93,6 +93,7 @@ PhLTestImagesPresenter >> newRequest [
{ #category : #updating }
PhLTestImagesPresenter >> refreshLaunchConfigurationList [
+
launchConfigurationList ifNotNil: [ super refreshLaunchConfigurationList ]
]

fix builds and start