Skip to content

Commit

Permalink
give application and parentWindow when using spec backend
Browse files Browse the repository at this point in the history
  • Loading branch information
demarey committed Jul 5, 2024
1 parent c04e675 commit e110364
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/Interactions-Tests/SpAbstractMessageDialog.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : 'SpAbstractMessageDialog' }

{ #category : '*Interactions-Tests' }
SpAbstractMessageDialog >> label [
^ label text
]
2 changes: 1 addition & 1 deletion src/Interactions-Widgets/SpConfirmDialog.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Extension { #name : 'SpConfirmDialog' }
{ #category : '*Interactions-Widgets' }
SpConfirmDialog class >> for: aConfirmation [

^ self new
^ (self newApplication: aConfirmation application owner: aConfirmation parentWindow)
title: aConfirmation title;
label: aConfirmation message;
acceptLabel: aConfirmation yesLabel;
Expand Down
2 changes: 1 addition & 1 deletion src/Interactions-Widgets/SpInformDialog.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Extension { #name : 'SpInformDialog' }
{ #category : '*Interactions-Widgets' }
SpInformDialog class >> for: anITInformation [

^ self new
^ (self newApplication: anITInformation application owner: anITInformation parentWindow)
title: anITInformation title;
label: anITInformation message;
yourself
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ StFileSystemPresenter >> doInteraction [
{ #category : '*Interactions-Widgets' }
StFileSystemPresenter class >> for: aFileRequest [

^ self new
^ (self new"Application: aFileRequest application owner: aFileRequest parentWindow model: StFileSystemModel new")
title: aFileRequest title;
yourself
]
8 changes: 7 additions & 1 deletion src/Interactions/ITFileRequest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ Class {
#package : 'Interactions'
}

{ #category : 'configuring' }
{ #category : 'private' }
ITFileRequest >> beForFolderOpening [

isForFileOpening := false
]

{ #category : 'running' }
ITFileRequest >> chooseDirectory [
self beForFolderOpening.
^ self chooseFile
]

{ #category : 'running' }
ITFileRequest >> chooseFile [

Expand Down
31 changes: 30 additions & 1 deletion src/Interactions/ITUserInteraction.class.st
Original file line number Diff line number Diff line change
@@ -1,22 +1,51 @@
"
I'm an abstraction of a user interaction.
I may hold a reference to the application that triggered the interaction.
I may hold a reference to a parent window when intended to be used on a GUI backend.
"
Class {
#name : 'ITUserInteraction',
#superclass : 'Object',
#instVars : [
'title'
'title',
'application',
'parentWindow'
],
#category : 'Interactions',
#package : 'Interactions'
}

{ #category : 'accessing' }
ITUserInteraction >> application [

^ application
]

{ #category : 'accessing' }
ITUserInteraction >> application: anObject [

application := anObject
]

{ #category : 'private' }
ITUserInteraction >> backend [

^ SpecInteraction default
]

{ #category : 'accessing' }
ITUserInteraction >> parentWindow [

^ parentWindow
]

{ #category : 'accessing' }
ITUserInteraction >> parentWindow: anObject [

parentWindow := anObject
]

{ #category : 'accessing' }
ITUserInteraction >> title [
^ title
Expand Down

0 comments on commit e110364

Please sign in to comment.