diff --git a/repository/OpenPonk-Core/StFileBrowserBookmark.extension.st b/repository/OpenPonk-Core/StFileBrowserBookmark.extension.st new file mode 100644 index 00000000..1bb2d3d7 --- /dev/null +++ b/repository/OpenPonk-Core/StFileBrowserBookmark.extension.st @@ -0,0 +1,40 @@ +Extension { #name : 'StFileBrowserBookmark' } + +{ #category : '*OpenPonk-Core' } +StFileBrowserBookmark class >> defaultBookmarks [ + + | presets | + self flag: 'Remove (let NewTools to replace it) in Pharo 13'. + presets := { + self home. + self workingDirectory. + self desktop. + self documents. + self downloads }. + + ^ OrderedCollection with: (StFileBrowserGroupBookmark + name: 'Bookmarks' + collection: presets + iconName: #book) +] + +{ #category : '*OpenPonk-Core' } +StFileBrowserBookmark class >> root [ + + self flag: 'Remove in Pharo 13'. + ^ self + name: '/' + location: FileLocator root + icon: (self iconNamed: #smallWindow) +] + +{ #category : '*OpenPonk-Core' } +StFileBrowserBookmark class >> windowsDrives [ + + self flag: 'Remove in Pharo 13'. + ^ FileLocator root asFileReference directories collect: [ :each | + self + name: each basename + location: each + icon: (self iconNamed: #smallWindow) ] +] diff --git a/repository/OpenPonk-Core/StFileSystemItemWrapper.extension.st b/repository/OpenPonk-Core/StFileSystemItemWrapper.extension.st new file mode 100644 index 00000000..765b0b2e --- /dev/null +++ b/repository/OpenPonk-Core/StFileSystemItemWrapper.extension.st @@ -0,0 +1,14 @@ +Extension { #name : 'StFileSystemItemWrapper' } + +{ #category : '*OpenPonk-Core' } +StFileSystemItemWrapper class >> roots [ + + self flag: 'Remove (let it be replaced by NewTools version) in Pharo 13'. + ^ Smalltalk os isWindows + ifTrue: [ + FileSystem root directories + select: [ :each | each exists and: [ each isReadable ] ] + thenCollect: [ :each | StRootDriveWrapper on: each ] ] + ifFalse: [ + Array with: (StRootDirectoryWrapper on: FileSystem root) ] +] diff --git a/repository/OpenPonk-Core/StRootDriveWrapper.extension.st b/repository/OpenPonk-Core/StRootDriveWrapper.extension.st deleted file mode 100644 index 2f0fb277..00000000 --- a/repository/OpenPonk-Core/StRootDriveWrapper.extension.st +++ /dev/null @@ -1,13 +0,0 @@ -Extension { #name : 'StRootDriveWrapper' } - -{ #category : '*OpenPonk-Core' } -StRootDriveWrapper >> directories [ - "We catch errors because we might not have the rights on the drives and in that case we will get an error. - This mecanism should probably be generalized." - - ^ [ (fileReference basename , '\') asFileReference directories ] - on: FileSystemError - do: [ - self inform: 'Missing permissions on ' , fileReference basename. - #( ) ] -] diff --git a/repository/OpenPonk-Spec/OPDynamicForm.class.st b/repository/OpenPonk-Spec/OPDynamicForm.class.st index 81ae0b3c..4da2a411 100644 --- a/repository/OpenPonk-Spec/OPDynamicForm.class.st +++ b/repository/OpenPonk-Spec/OPDynamicForm.class.st @@ -124,7 +124,7 @@ OPDynamicForm >> addControl: aControl [ { #category : 'public - adding' } OPDynamicForm >> addDroplist: aName [ | control | - self addLabel: aName. + self addHeadingLabel: aName. control := self newDropList. @@ -136,7 +136,7 @@ OPDynamicForm >> addDroplist: aName [ OPDynamicForm >> addEditableDroplist: aName [ | control | - self addLabel: aName. + self addHeadingLabel: aName. control := self instantiate: OPEditableDropListPresenter. self addControl: control. ^ control @@ -145,20 +145,26 @@ OPDynamicForm >> addEditableDroplist: aName [ { #category : 'public - adding' } OPDynamicForm >> addEntity: aName [ | control | - self addLabel: aName. + self addHeadingLabel: aName. control := self instantiate: SpSelectEntity. self addControl: control. ^ control ] +{ #category : 'public - adding' } +OPDynamicForm >> addHeadingLabel: aLabel [ + + ^ (self addLabel: aLabel) + displayBold: [ true ]; + yourself +] + { #category : 'public - adding' } OPDynamicForm >> addLabel: aLabel [ | control | control := self newLabel. control label: aLabel. - "control addStyle: 'bold'." - self flag: 'implement bold'. self addControl: control. ^ control @@ -167,7 +173,7 @@ OPDynamicForm >> addLabel: aLabel [ { #category : 'public - adding' } OPDynamicForm >> addList: aName [ | control | - self addLabel: aName. + self addHeadingLabel: aName. control := self newList. @@ -179,7 +185,7 @@ OPDynamicForm >> addList: aName [ OPDynamicForm >> addLongText: aName [ | control | - self addLabel: aName. + self addHeadingLabel: aName. control := self instantiate: OPLongTextPresenter. @@ -191,7 +197,7 @@ OPDynamicForm >> addLongText: aName [ OPDynamicForm >> addNumberInput: aName [ | control | - self addLabel: aName. + self addHeadingLabel: aName. control := self newNumberInput. @@ -208,7 +214,7 @@ OPDynamicForm >> addSeparator [ OPDynamicForm >> addText: aName [ | control | - self addLabel: aName. + self addHeadingLabel: aName. control := self newText. @@ -220,7 +226,7 @@ OPDynamicForm >> addText: aName [ OPDynamicForm >> addTextInput: aName [ | control | - self addLabel: aName. + self addHeadingLabel: aName. control := self newTextInput. diff --git a/repository/OpenPonk-Spec/OPDynamicFormMagritteVisitor.class.st b/repository/OpenPonk-Spec/OPDynamicFormMagritteVisitor.class.st index c367bc62..ec2907e0 100644 --- a/repository/OpenPonk-Spec/OPDynamicFormMagritteVisitor.class.st +++ b/repository/OpenPonk-Spec/OPDynamicFormMagritteVisitor.class.st @@ -64,7 +64,7 @@ OPDynamicFormMagritteVisitor >> visitBooleanDescription: aBooleanDescription [ { #category : 'visiting' } OPDynamicFormMagritteVisitor >> visitLabelDescription: aStringDescription [ - form addLabel: aStringDescription label. + form addHeadingLabel: aStringDescription label. form addLabel: (aStringDescription accessor read: controller) ] @@ -102,7 +102,7 @@ OPDynamicFormMagritteVisitor >> visitMultipleOptionDescription: aMultipleOptionD { #category : 'visiting' } OPDynamicFormMagritteVisitor >> visitPriorityContainer: aContainer [ (self shouldIncludeLabelFor: aContainer) - ifTrue: [ form addLabel: aContainer label ]. + ifTrue: [ form addHeadingLabel: aContainer label ]. aContainer children do: [ :each | self visit: each ]. form addSeparator ] @@ -154,6 +154,7 @@ OPDynamicFormMagritteVisitor >> visitStringDescription: aStringDescription [ { #category : 'visiting' } OPDynamicFormMagritteVisitor >> visitToManyRelationDescription: aMAToManyRelationDescription [ - form addLabel: aMAToManyRelationDescription label. + + form addHeadingLabel: aMAToManyRelationDescription label. (form addButton: 'Edit ') action: [ controller maEdit ] ]