Skip to content

Commit

Permalink
Add default value for settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchodias committed Feb 4, 2021
1 parent 12c32d8 commit e734664
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions Iceberg/IceTipCommitSettings.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,63 @@ Class {

{ #category : #accessing }
IceTipCommitSettings class >> pushOnCommit [
^ pushOnCommit ifNil: [ pushOnCommit := false ]

^ pushOnCommit ifNil: [
pushOnCommit := self pushOnCommitDefaultValue ]
]

{ #category : #accessing }
IceTipCommitSettings class >> pushOnCommit: aBoolean [
pushOnCommit := aBoolean
]

{ #category : #accessing }
IceTipCommitSettings class >> pushOnCommitDefaultValue [

^ false
]

{ #category : #accessing }
IceTipCommitSettings class >> saveImageOnCommit [
^ saveImageOnCommit ifNil: [ saveImageOnCommit := true ]

^ saveImageOnCommit ifNil: [
saveImageOnCommit := self saveImageOnCommitDefaultValue ]
]

{ #category : #accessing }
IceTipCommitSettings class >> saveImageOnCommit: aBoolean [
saveImageOnCommit := aBoolean
]

{ #category : #accessing }
IceTipCommitSettings class >> saveImageOnCommitDefaultValue [

^ true
]

{ #category : #settings }
IceTipCommitSettings class >> settingsOn: aBuilder [

<systemsettings>
(aBuilder group: #commitPreferences)
parent: #Iceberg;
noOrdering;
target: self;
label: 'Commit action settings';
description: 'Chose the behavior when you commit something';
with: [ (aBuilder setting: #saveImageOnCommit)
with: [
(aBuilder setting: #saveImageOnCommit)
noOrdering;
target: self;
default: self saveImageOnCommitDefaultValue;
label: 'Save the image when commiting';
description: 'Check if you want to save the image each time you commit something'.
description:
'Check if you want to save the image each time you commit something'.
(aBuilder setting: #pushOnCommit)
noOrdering;
target: self;
default: self pushOnCommitDefaultValue;
label: 'Push when commiting';
description:
'Check if you want to push your changes each time you commit something'. ]
'Check if you want to push your changes each time you commit something' ]
]

0 comments on commit e734664

Please sign in to comment.