Skip to content

Commit

Permalink
Merge pull request pharo-vcs#1734 from Ducasse/ModelsToPresenters
Browse files Browse the repository at this point in the history
Renamed all the xModel into xPresenter same for xDialog into xDialogP…
  • Loading branch information
Ducasse authored Sep 9, 2023
2 parents ada5d05 + d1dec4f commit 4dd8b89
Show file tree
Hide file tree
Showing 61 changed files with 406 additions and 406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ IceFiletreeToTonelCommand >> canBeExecuted [
{ #category : #executing }
IceFiletreeToTonelCommand >> execute [

(IceTipFiletreeToTonelDialog on: self repository) openDialog
(IceTipFiletreeToTonelDialogPresenter on: self repository) openDialog
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ I'm a dialog validate and perform a migration of sources from filetree to tonel.
"
Class {
#name : #IceTipFiletreeToTonelDialog,
#superclass : #IceTipDialog,
#name : #IceTipFiletreeToTonelDialogPresenter,
#superclass : #IceTipDialogPresenter,
#instVars : [
'iconPanel',
'confirmLabel',
Expand All @@ -16,7 +16,7 @@ Class {
}

{ #category : #actions }
IceTipFiletreeToTonelDialog >> accept [
IceTipFiletreeToTonelDialogPresenter >> accept [

IceTipStandardAction new
repository: self repository;
Expand All @@ -28,25 +28,25 @@ IceTipFiletreeToTonelDialog >> accept [
]

{ #category : #accessing }
IceTipFiletreeToTonelDialog >> branchBaseName [
IceTipFiletreeToTonelDialogPresenter >> branchBaseName [

^ 'migrate-sources-to-tonel'
]

{ #category : #accessing }
IceTipFiletreeToTonelDialog >> branchName [
IceTipFiletreeToTonelDialogPresenter >> branchName [

^ branchName ifNil: [ branchName := self obtainBranchName ]
]

{ #category : #'accessing - ui' }
IceTipFiletreeToTonelDialog >> confirmLabel [
IceTipFiletreeToTonelDialogPresenter >> confirmLabel [

^ confirmLabel
]

{ #category : #accessing }
IceTipFiletreeToTonelDialog >> confirmMessage [
IceTipFiletreeToTonelDialogPresenter >> confirmMessage [

^ 'Convert repository {1} sources from filetree format to tonel.
This process will use a new branch named {2}.
Expand All @@ -56,7 +56,7 @@ ARE YOU SURE?'
]

{ #category : #layout }
IceTipFiletreeToTonelDialog >> defaultLayout [
IceTipFiletreeToTonelDialogPresenter >> defaultLayout [

^ SpBoxLayout newLeftToRight
borderWidth: 5;
Expand All @@ -70,7 +70,7 @@ IceTipFiletreeToTonelDialog >> defaultLayout [
]

{ #category : #actions }
IceTipFiletreeToTonelDialog >> doAccept [
IceTipFiletreeToTonelDialogPresenter >> doAccept [

IceConvertFormatAction new
repository: self repository;
Expand All @@ -81,21 +81,21 @@ IceTipFiletreeToTonelDialog >> doAccept [
]

{ #category : #'accessing - ui' }
IceTipFiletreeToTonelDialog >> iconPanel [
IceTipFiletreeToTonelDialogPresenter >> iconPanel [

^ iconPanel
]

{ #category : #initialization }
IceTipFiletreeToTonelDialog >> initialExtentForWindow [
IceTipFiletreeToTonelDialogPresenter >> initialExtentForWindow [

^ (500
@ (self class inputTextHeight * 5 + self class buttonHeight + 50))
scaledByDisplayScaleFactor
]

{ #category : #initialization }
IceTipFiletreeToTonelDialog >> initializePresenters [
IceTipFiletreeToTonelDialogPresenter >> initializePresenters [

super initializePresenters.
iconPanel := self newImage
Expand All @@ -114,13 +114,13 @@ IceTipFiletreeToTonelDialog >> initializePresenters [
]

{ #category : #'accessing - ui' }
IceTipFiletreeToTonelDialog >> mergeWithMasterCheckbox [
IceTipFiletreeToTonelDialogPresenter >> mergeWithMasterCheckbox [

^ mergeWithMasterCheckbox
]

{ #category : #private }
IceTipFiletreeToTonelDialog >> obtainBranchName [
IceTipFiletreeToTonelDialogPresenter >> obtainBranchName [

| baseName suffix count |
count := 0.
Expand All @@ -135,19 +135,19 @@ IceTipFiletreeToTonelDialog >> obtainBranchName [
]

{ #category : #accessing }
IceTipFiletreeToTonelDialog >> repository [
IceTipFiletreeToTonelDialogPresenter >> repository [

^ repository
]

{ #category : #initialization }
IceTipFiletreeToTonelDialog >> setModelBeforeInitialization: anObject [
IceTipFiletreeToTonelDialogPresenter >> setModelBeforeInitialization: anObject [

repository := anObject
]

{ #category : #initialization }
IceTipFiletreeToTonelDialog >> titleForWindow [
IceTipFiletreeToTonelDialogPresenter >> titleForWindow [

^ 'Convert sources to tonel'
]
6 changes: 3 additions & 3 deletions Iceberg-TipUI/IcePlaintextCredentials.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ Extension { #name : #IcePlaintextCredentials }

{ #category : #'*Iceberg-TipUI' }
IcePlaintextCredentials >> askForModelClass [
^ IceTipAskForPlaintextCredentialsModel
^ IceTipAskForPlaintextCredentialsPresenter
]

{ #category : #'*Iceberg-TipUI' }
IcePlaintextCredentials >> askForModelClassOn: aString [

^ (aString includesSubstring: 'github.com' caseSensitive: false)
ifTrue: [ IceTipAskGithubForPlaintextCredentialsModel ]
ifTrue: [ IceTipAskGithubForPlaintextCredentialsPresenter ]
ifFalse: [ self askForModelClass ]
]

{ #category : #'*Iceberg-TipUI' }
IcePlaintextCredentials >> editModelClass [
^ IceTipEditPlaintextCredentialsModel
^ IceTipEditPlaintextCredentialsPresenter
]
2 changes: 1 addition & 1 deletion Iceberg-TipUI/IcePlaintextOtpCredentials.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Extension { #name : #IcePlaintextOtpCredentials }

{ #category : #'*Iceberg-TipUI' }
IcePlaintextOtpCredentials >> askForModelClass [
^ IceTipAskForPlaintextOtpCredentialsModel
^ IceTipAskForPlaintextOtpCredentialsPresenter
]
2 changes: 1 addition & 1 deletion Iceberg-TipUI/IceSshCredentials.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ IceSshCredentials >> askForModelClass [

{ #category : #'*Iceberg-TipUI' }
IceSshCredentials >> editModelClass [
^ IceTipEditSSHCredentialsModel
^ IceTipEditSSHCredentialsPresenter
]
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ to ask / add / edit credentials.
There are subclasses to each of the actions and the types of keys.
"
Class {
#name : #IceTipAbstractCredentialsModel,
#superclass : #IceTipDialog,
#name : #IceTipAbstractCredentialsPresenter,
#superclass : #IceTipDialogPresenter,
#instVars : [
'storeCheckbox',
'credentialStore',
Expand All @@ -19,7 +19,7 @@ Class {
}

{ #category : #actions }
IceTipAbstractCredentialsModel >> acceptAddAction [
IceTipAbstractCredentialsPresenter >> acceptAddAction [

credentials := self newCredentials.

Expand All @@ -32,7 +32,7 @@ IceTipAbstractCredentialsModel >> acceptAddAction [
]

{ #category : #actions }
IceTipAbstractCredentialsModel >> acceptAskAction [
IceTipAbstractCredentialsPresenter >> acceptAskAction [

credentials := self newCredentials.

Expand All @@ -46,7 +46,7 @@ IceTipAbstractCredentialsModel >> acceptAskAction [
]

{ #category : #actions }
IceTipAbstractCredentialsModel >> acceptEditAction [
IceTipAbstractCredentialsPresenter >> acceptEditAction [

self refreshCredentialsFromPresenter.
credentialStore storeCredential: self credentials.
Expand All @@ -56,63 +56,63 @@ IceTipAbstractCredentialsModel >> acceptEditAction [
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> askingHostname: aString [
IceTipAbstractCredentialsPresenter >> askingHostname: aString [

askingHostname := aString

]

{ #category : #actions }
IceTipAbstractCredentialsModel >> cancelAction [
IceTipAbstractCredentialsPresenter >> cancelAction [
"Action to execute on cancel."
]

{ #category : #actions }
IceTipAbstractCredentialsModel >> cancelAskAction [
IceTipAbstractCredentialsPresenter >> cancelAskAction [

accepted := true.
self closeWindow.
LGitNoCredentialsProvided signal
]

{ #category : #actions }
IceTipAbstractCredentialsModel >> closeAction [
IceTipAbstractCredentialsPresenter >> closeAction [

accepted ifFalse: [ self cancelAction ]
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> credentialStore: aStore [
IceTipAbstractCredentialsPresenter >> credentialStore: aStore [
credentialStore := aStore
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> credentials [
IceTipAbstractCredentialsPresenter >> credentials [
^ credentials
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> credentials: anIceCredentials [
IceTipAbstractCredentialsPresenter >> credentials: anIceCredentials [

credentials := anIceCredentials.
self refreshPresenterFromCredentials
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> hostnameFromInput [
IceTipAbstractCredentialsPresenter >> hostnameFromInput [
"Answer the remoote hostname for the credentials."

^ self subclassResponsibility
]

{ #category : #initialization }
IceTipAbstractCredentialsModel >> initialize [
IceTipAbstractCredentialsPresenter >> initialize [
super initialize.
accepted := false
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> initializeDialogWindow: aDialogWindowPresenter [
IceTipAbstractCredentialsPresenter >> initializeDialogWindow: aDialogWindowPresenter [

super initializeDialogWindow: aDialogWindowPresenter.
self updateOkButton.
Expand All @@ -122,7 +122,7 @@ IceTipAbstractCredentialsModel >> initializeDialogWindow: aDialogWindowPresenter
]

{ #category : #initialization }
IceTipAbstractCredentialsModel >> initializePresenters [
IceTipAbstractCredentialsPresenter >> initializePresenters [

storeCheckbox := self newCheckBox
label: 'Do you want this credentials to be stored for future use?';
Expand All @@ -132,64 +132,64 @@ IceTipAbstractCredentialsModel >> initializePresenters [
]

{ #category : #testing }
IceTipAbstractCredentialsModel >> isOkEnabled [
IceTipAbstractCredentialsPresenter >> isOkEnabled [
"Determite if the user should be enabled to press on the accept button."

^ self subclassResponsibility
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> newCredentials [
IceTipAbstractCredentialsPresenter >> newCredentials [
"Answer a new instance of the credentials using the form inputs."

^ self subclassResponsibility
]

{ #category : #updating }
IceTipAbstractCredentialsModel >> okButton [
IceTipAbstractCredentialsPresenter >> okButton [

^ self window buttons first
]

{ #category : #'API - opening' }
IceTipAbstractCredentialsModel >> open [
IceTipAbstractCredentialsPresenter >> open [

self openModal.

^ self credentials
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> refreshCredentialsFromPresenter [
IceTipAbstractCredentialsPresenter >> refreshCredentialsFromPresenter [
"Hook to update the credentials object from the presenter inputs."
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> refreshPresenterFromCredentials [
IceTipAbstractCredentialsPresenter >> refreshPresenterFromCredentials [
"Hook to update the presenter input fields from the credentials object."
]

{ #category : #testing }
IceTipAbstractCredentialsModel >> shouldStoreCredentials [
IceTipAbstractCredentialsPresenter >> shouldStoreCredentials [

^ storeCheckbox state
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> storeCheckbox [
IceTipAbstractCredentialsPresenter >> storeCheckbox [

^ storeCheckbox
]

{ #category : #accessing }
IceTipAbstractCredentialsModel >> tool: aBrowser [
IceTipAbstractCredentialsPresenter >> tool: aBrowser [
"Set the tool that triggered this dialog, and therefore might need a #refresh after the users accepts the dialog and it produces an effect on the system."

tool := aBrowser
]

{ #category : #updating }
IceTipAbstractCredentialsModel >> updateOkButton [
IceTipAbstractCredentialsPresenter >> updateOkButton [

self window ifNil: [ ^ self ].
self okButton enabled: self isOkEnabled
Expand Down
Loading

0 comments on commit 4dd8b89

Please sign in to comment.