#FEATURE by cg
class: Tools::CheckinInfoDialog
class definition
added:
#description2:
#description2Holder
class: Tools::CheckinInfoDialog class
comment/format in:
#getCheckinInfoFor:initialAnswer:
#getCheckinInfoFor:initialAnswer:withQuickOption:
#getCheckinInfoFor:initialAnswer:withQuickOption:logHistory:
#getCheckinInfoFor:initialAnswer:withQuickOption:logHistory:withValidateConsistencyOption:
changed:
#getCheckinInfoFor:initialAnswer:withQuickOption:logHistory:withValidateConsistencyOption:initialReason:
#windowSpec
"
COPYRIGHT (c) 2005 eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
"{ Package: 'stx:libtool' }"
"{ NameSpace: Tools }"
SimpleDialog subclass:#CheckinInfoDialog
instanceVariableNames:'descriptionHolder logMessageHolder isStableHolder tagHolder
quickCheckInHolder quickCheckInVisibleHolder allowEmptyLogMessage
warningMessageHolder logHistory logHistoryHeadLineSelectionHolder
validateConsistencyHolder validateConsistencyVisibleHolder
checkinReasonHolder validateConsistencyEnabledHolder
quickCheckInEnabledHolder description2Holder'
classVariableNames:'RecentlyUsedTags LastReason'
poolDictionaries:''
category:'System-SourceCodeManagement'
!
!CheckinInfoDialog class methodsFor:'documentation'!
copyright
"
COPYRIGHT (c) 2005 eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
!
documentation
"
checkin-dialog.
used to be private in SourceCodeManagerUtilites.
moved to libtool because libbasic3 should not contain code inheriting from GUI classes.
[author:]
[see also:]
[instance variables:]
[class variables:]
"
! !
!CheckinInfoDialog class methodsFor:'constants'!
possibleReasons
^ #(reasonBugfix reasonDocumentation reasonFeature reasonRefactoring
reasonOther reasonUIEnhancement reasonTuning reasonQuality)
"Created: / 31-03-2016 / 17:53:16 / cg"
!
reasonBugfix
^ #reasonBugfix
!
reasonDocumentation
^ #reasonDocumentation
!
reasonFeature
^ #reasonFeature
!
reasonOther
^ #reasonOther
!
reasonQuality
^ #reasonQuality
"Created: / 31-03-2016 / 17:53:57 / cg"
!
reasonRefactoring
^ #reasonRefactoring
!
reasonTuning
^ #reasonTuning
"Created: / 31-03-2016 / 17:53:26 / cg"
!
reasonUIEnhancement
^ #reasonUIEnhancement
! !
!CheckinInfoDialog class methodsFor:'help specs'!
flyByHelpSpec
"This resource specification was automatically generated
by the UIHelpTool of ST/X."
"Do not manually edit this!! If it is corrupted,
the UIHelpTool may not be able to read the specification."
"
UIHelpTool openOnClass:Tools::CheckinInfoDialog
"
<resource: #help>
^ super flyByHelpSpec addPairsFrom:#(
#logMessage
'This message is added as a check-in log message.
It can later be retrieved via the browser''s revision info menu function'
#markAsStable
'Mark this as a stable version (i.e. give it a "stable" tag)'
#quickCheckin
'Only checkin classes which have been created or changed during this session'
#tag
'Mark this version with a symbolic tag (combo list gives list of recently used tags)'
#validateConsistency
'Perform some consistency checks before checking in.
Especially checks the correctness of the ProjectDefinition vs. the actual set of classes in the image'
#checkinReason
'Adds a keyword to the checkin info, to allow automatic generation of revision information from the log later'
#checkinReasonDocumentation
'Only documentation, comments etc. were added/changed.\Tells others, that there is no need to test/verify/review the changes'
#checkinReasonBugfix
'Some bug was fixed.\Please describe what was changed and\if possible, add a bug identifier (issue-ID) to the checkin info'
#checkinReasonFeature
'A new feature was added.\Please describe what was changed and\if possible, add a requirement identifier (issue-ID) to the checkin info'
#checkinReasonRefactoring
'The code was refactored/improved for better structure or maintainability'
#checkinReasonUIEnhancement
'Some enhancement in a UI which makes it look better or easier to use\(but does not add new functionality).\Please describe in detail what you did in the checkin info'
#checkinReasonQuality
'The change enhanced the quality of the product (debuggability, testability, robustness, etc.)\Use this for test-cases.'
#checkinReasonTuning
'The change enhances the performance.\Be especially careful to always add test cases,\because statistically, many errors are introduced by "optimizations".'
#checkinReasonOther
'Some other change, which does not fit into one of the above.\Please describe in detail what you did in the checkin info'
)
"Modified: / 31-03-2016 / 18:01:42 / cg"
! !
!CheckinInfoDialog class methodsFor:'interface specs'!
windowSpec
"This resource specification was automatically generated
by the UIPainter of ST/X."
"Do not manually edit this!! If it is corrupted,
the UIPainter may not be able to read the specification."
"
UIPainter new openOnClass:Tools::CheckinInfoDialog andSelector:#windowSpec
Tools::CheckinInfoDialog new openInterface:#windowSpec
Tools::CheckinInfoDialog open
"
<resource: #canvas>
^
#(FullSpec
name: windowSpec
uuid: '43687bc0-d941-11e7-8a1e-c42c033b4871'
window:
(WindowSpec
label: 'Enter Log Message'
name: 'Enter Log Message'
uuid: '35292892-d93d-11e7-8a1e-c42c033b4871'
min: (Point 538 387)
bounds: (Rectangle 0 0 592 558)
)
component:
(SpecCollection
collection: (
(HorizontalPanelViewSpec
name: 'HorizontalPanel2'
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
uuid: '35292b58-d93d-11e7-8a1e-c42c033b4871'
horizontalLayout: left
verticalLayout: center
horizontalSpace: 0
verticalSpace: 3
component:
(SpecCollection
collection: (
(LabelSpec
label: 'Enter checkIn log-message for:'
name: 'Label1'
uuid: '35292da6-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
resizeForLabel: true
useDefaultExtent: true
)
(LabelSpec
name: 'Label2'
uuid: '35293008-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
labelChannel: descriptionHolder
useDefaultExtent: true
)
)
)
)
(LabelSpec
label: 'Enter checkIn log-message for:'
name: 'Label7'
layout: (LayoutFrame 0 0 37 0 0 1 63 0)
uuid: '35293166-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
labelChannel: description2Holder
resizeForLabel: true
adjust: right
)
(LabelSpec
label: 'Previous Log Messages:'
name: 'Label5'
layout: (LayoutFrame 0 0 73 0 220 0 103 0)
uuid: '3529329c-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
adjust: right
)
(ComboListSpec
name: 'ComboList1'
layout: (LayoutFrame 220 0.0 73 0 0 1.0 103 0)
uuid: '352933b4-d93d-11e7-8a1e-c42c033b4871'
model: logHistoryHeadLineSelectionHolder
comboList: logHistoryHeadLines
useIndex: true
)
(TextEditorSpec
name: 'TextEditor1'
layout: (LayoutFrame 2 0.0 105 0 -2 1 -300 1)
activeHelpKey: logMessage
uuid: '35293602-d93d-11e7-8a1e-c42c033b4871'
model: logMessageHolder
hasHorizontalScrollBar: true
hasVerticalScrollBar: true
hasKeyboardFocusInitially: false
)
(LabelSpec
name: 'Label4'
layout: (LayoutFrame 0 0.0 -293 1 0 1.0 -271 1)
uuid: '35293828-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
labelChannel: warningMessageHolder
)
(CheckBoxSpec
label: 'Quick Checkin (Only Classes in ChangeSet)'
name: 'CheckInChangedOnlyCheckbox'
layout: (LayoutFrame 3 0 -268 1 -3 1 -246 1)
activeHelpKey: quickCheckin
uuid: '35293954-d93d-11e7-8a1e-c42c033b4871'
visibilityChannel: quickCheckInVisibleHolder
enableChannel: quickCheckInEnabledHolder
model: quickCheckInHolder
translateLabel: true
)
(CheckBoxSpec
label: 'Validate Package Consistency'
name: 'CheckBox1'
layout: (LayoutFrame 3 0 -241 1 -3 1 -219 1)
activeHelpKey: validateConsistency
uuid: '35293b70-d93d-11e7-8a1e-c42c033b4871'
visibilityChannel: validateConsistencyVisibleHolder
enableChannel: validateConsistencyEnabledHolder
model: validateConsistencyHolder
translateLabel: true
)
(CheckBoxSpec
label: 'Mark as Stable'
name: 'MarkStableCheckBox'
layout: (LayoutFrame 3 0 -214 1 -3 1 -192 1)
activeHelpKey: markAsStable
uuid: '35293c9c-d93d-11e7-8a1e-c42c033b4871'
model: isStableHolder
translateLabel: true
)
(LabelSpec
label: 'Tag:'
name: 'Label3'
layout: (LayoutFrame -40 0.5 -213 1 0 0.5 -191 1)
activeHelpKey: tag
uuid: '35293db4-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
adjust: right
)
(ComboBoxSpec
name: 'ComboBox1'
layout: (LayoutFrame 0 0.5 -214 1 -3 1 -192 1)
activeHelpKey: tag
uuid: '35293ee0-d93d-11e7-8a1e-c42c033b4871'
enableChannel: notMarkAsStableHolder
model: tagHolder
acceptOnReturn: true
acceptOnTab: true
acceptOnLostFocus: true
acceptOnPointerLeave: false
comboList: recentTagsList
)
(LabelSpec
label: 'Reason for Checkin:'
name: 'Label6'
layout: (LayoutOrigin 2 0 -179 1)
activeHelpKey: checkinReason
uuid: '35294232-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
resizeForLabel: true
adjust: right
)
(RadioButtonSpec
label: 'Bugfix'
name: 'RadioButton1'
layout: (LayoutFrame 20 0.0 -151 1 300 0 -129 1)
activeHelpKey: checkinReasonBugfix
uuid: '3529437c-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: checkinReasonHolder
isTriggerOnDown: true
select: reasonBugfix
)
(RadioButtonSpec
label: 'Feature / Enhancement'
name: 'RadioButton2'
layout: (LayoutFrame 20 0 -127 1 -279 1 -105 1)
activeHelpKey: checkinReasonFeature
uuid: '35294656-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: checkinReasonHolder
isTriggerOnDown: true
select: reasonFeature
)
(RadioButtonSpec
label: 'Refactoring / Code Cleanup'
name: 'RadioButton3'
layout: (LayoutFrame 9 0.5 -151 1 0 1 -129 1)
activeHelpKey: checkinReasonRefactoring
uuid: '35294840-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: checkinReasonHolder
isTriggerOnDown: true
select: reasonRefactoring
)
(RadioButtonSpec
label: 'UI Enhancement / Beautification'
name: 'RadioButton6'
layout: (LayoutFrame 20 0 -103 1 -279 1 -81 1)
activeHelpKey: checkinReasonUIEnhancement
uuid: '35294a02-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: checkinReasonHolder
isTriggerOnDown: true
select: reasonUIEnhancement
)
(RadioButtonSpec
label: 'Documentation / Comment Only'
name: 'RadioButton5'
layout: (LayoutFrame 9 0.5 -103 1 0 1 -81 1)
activeHelpKey: checkinReasonDocumentation
uuid: '35294bb0-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: checkinReasonHolder
isTriggerOnDown: true
select: reasonDocumentation
)
(RadioButtonSpec
label: 'Tuning'
name: 'RadioButton4a'
layout: (LayoutFrame 20 0 -79 1 -279 1 -57 1)
activeHelpKey: checkinReasonTuning
uuid: '35294d5e-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: checkinReasonHolder
isTriggerOnDown: true
select: reasonTuning
)
(RadioButtonSpec
label: 'Quality (Debuggability / Testability)'
name: 'RadioButton4'
layout: (LayoutFrame 9 0.5 -127 1 0 1 -105 1)
activeHelpKey: checkinReasonQuality
uuid: '35294f0c-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: checkinReasonHolder
isTriggerOnDown: true
select: reasonQuality
)
(RadioButtonSpec
label: 'None of the Above'
name: 'RadioButton7'
layout: (LayoutFrame 9 0.5 -79 1 0 1 -57 1)
activeHelpKey: checkinReasonOther
uuid: '352950ba-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: checkinReasonHolder
isTriggerOnDown: true
select: reasonOther
)
(HorizontalPanelViewSpec
name: 'ButtonPanel1'
layout: (LayoutFrame 0 0.0 -40 1 -16 1.0 0 1.0)
uuid: '35295268-d93d-11e7-8a1e-c42c033b4871'
horizontalLayout: fitSpace
verticalLayout: center
horizontalSpace: 3
verticalSpace: 2
reverseOrderIfOKAtLeft: true
component:
(SpecCollection
collection: (
(ActionButtonSpec
label: 'Cancel'
name: 'Button2'
uuid: '352953a8-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: doCancel
extent: (Point 282 34)
usePreferredHeight: true
)
(ActionButtonSpec
label: 'OK'
name: 'Button1'
uuid: '35295560-d93d-11e7-8a1e-c42c033b4871'
translateLabel: true
model: doAccept
extent: (Point 282 34)
usePreferredHeight: true
)
)
)
keepSpaceForOSXResizeHandleH: true
)
)
)
)
! !
!CheckinInfoDialog class methodsFor:'opening'!
getCheckinInfoFor:infoString initialAnswer:initialAnswer
^ self
getCheckinInfoFor:infoString
initialAnswer:initialAnswer
withQuickOption:false
"
self getCheckinInfoFor:'hello' initialAnswer:'bla'
"
"Modified (format): / 04-12-2017 / 23:08:50 / cg"
!
getCheckinInfoFor:infoString initialAnswer:initialAnswer withQuickOption:withQuickOption
^ self
getCheckinInfoFor:infoString
initialAnswer:initialAnswer
withQuickOption:withQuickOption
logHistory:#()
"
self getCheckinInfoFor:'hello' initialAnswer:'bla'
"
"Modified: / 12-03-2012 / 12:39:00 / cg"
"Modified (format): / 04-12-2017 / 23:08:40 / cg"
!
getCheckinInfoFor:infoString initialAnswer:initialAnswer withQuickOption:withQuickOption logHistory:logHistoryArg
^ self
getCheckinInfoFor:infoString
initialAnswer:initialAnswer
withQuickOption:withQuickOption
logHistory:logHistoryArg
withValidateConsistencyOption:false
"
self getCheckinInfoFor:'hello' initialAnswer:'bla'
self getCheckinInfoFor:'hello' initialAnswer:'bla' withQuickOption:true
self getCheckinInfoFor:'hello' initialAnswer:'bla' withQuickOption:true logHistory:nil withConsistencyCheckOption:true
"
"Created: / 12-03-2012 / 12:36:26 / cg"
"Modified (format): / 04-12-2017 / 23:08:35 / cg"
!
getCheckinInfoFor:infoString initialAnswer:initialAnswer
withQuickOption:withQuickOption
logHistory:logHistoryArg
withValidateConsistencyOption:withValidateConsistencyOption
^ self
getCheckinInfoFor:infoString
initialAnswer:initialAnswer
withQuickOption:withQuickOption
logHistory:logHistoryArg
withValidateConsistencyOption:withValidateConsistencyOption
initialReason:(LastReason ? self reasonBugfix)
"
self getCheckinInfoFor:'hello' initialAnswer:'bla'
"
"Created: / 12-03-2012 / 12:36:26 / cg"
"Modified (format): / 04-12-2017 / 23:07:46 / cg"
!
getCheckinInfoFor:infoString initialAnswer:initialAnswer
withQuickOption:withQuickOption
logHistory:logHistoryArg
withValidateConsistencyOption:withValidateConsistencyOption
initialReason:defaultReason
|dialog warnMessage|
warnMessage := nil.
[
|lines infoString1|
dialog := self new.
infoString1 := infoString.
lines := infoString asStringCollection.
lines size > 1 ifTrue:[
dialog description2:lines second string.
infoString1 := lines first.
].
dialog
description:infoString1;
logMessage:initialAnswer;
withQuickOption:withQuickOption;
withValidateConsistencyOption:withValidateConsistencyOption;
logHistory:logHistoryArg;
checkinReason:defaultReason.
dialog warningMessageHolder value:warnMessage.
dialog open.
dialog accepted ifFalse:[ ^ nil ].
] doUntil:[
|stopAsking|
stopAsking := dialog allowEmptyLogMessage
or:[ (dialog logMessage) withoutSeparators notEmptyOrNil ].
stopAsking ifFalse:[
warnMessage := (self resources string:'Please enter a description of your changes!!')
withColor:Color red.
].
stopAsking
].
LastReason := dialog checkinReason.
^ dialog
"
self getCheckinInfoFor:'hello' initialAnswer:'bla'
"
"Created: / 12-03-2012 / 12:36:26 / cg"
"Modified: / 04-12-2017 / 23:18:31 / cg"
! !
!CheckinInfoDialog methodsFor:'accessing'!
allowEmptyLogMessage
^ allowEmptyLogMessage ? false
"Created: / 06-07-2010 / 11:23:18 / cg"
!
allowEmptyLogMessage:aBoolean
allowEmptyLogMessage := aBoolean
"Created: / 06-07-2010 / 11:23:31 / cg"
!
checkinReason
"returns one of: #(reasonBugfix reasonFeature reasonRefactoring reasonDocumentation reasonOther)"
^ self checkinReasonHolder value
!
checkinReason:aSymbolicReason
self assert:( self class possibleReasons includes:aSymbolicReason).
self checkinReasonHolder value:aSymbolicReason
"Modified: / 31-03-2016 / 17:58:45 / cg"
!
description
^ self descriptionHolder value
!
description2:aString
self description2Holder value:aString
"Created: / 04-12-2017 / 22:51:29 / cg"
!
description:aString
self descriptionHolder value:aString allBold
!
isStable
^ self isStableHolder value
!
isStable:aBoolean
self isStableHolder value:aBoolean
!
logHistory:something
logHistory := something.
!
logMessage
^ self logMessageHolder value ? ''
!
logMessage:aString
self logMessageHolder value:aString
!
quickCheckIn
^ self quickCheckInHolder value
!
quickCheckIn:aBoolean
self quickCheckInHolder value:aBoolean
!
tag
^ (self tagHolder value ? '') withoutSeparators
!
tag:aStringOrNil
self tagHolder value:aStringOrNil
"Modified: / 12-09-2006 / 12:03:50 / cg"
!
tagIt
^ self tag notEmptyOrNil
"Created: / 12-09-2006 / 13:06:49 / cg"
!
validateConsistency
^ self validateConsistencyHolder value
!
withQuickOption:aBoolean
self quickCheckInEnabledHolder value:aBoolean
"/ self quickCheckInVisibleHolder value:aBoolean
!
withValidateConsistencyOption:aBoolean
self validateConsistencyEnabledHolder value:aBoolean
"/ self validateConsistencyVisibleHolder value:aBoolean
! !
!CheckinInfoDialog methodsFor:'aspects'!
checkinReasonHolder
checkinReasonHolder isNil ifTrue:[
checkinReasonHolder := (LastReason ? self class reasonBugfix) asValue.
].
^ checkinReasonHolder
!
description2Holder
description2Holder isNil ifTrue:[
description2Holder := ValueHolder new.
].
^ description2Holder
"Created: / 04-12-2017 / 22:51:14 / cg"
!
descriptionHolder
descriptionHolder isNil ifTrue:[
descriptionHolder := ValueHolder new.
].
^ descriptionHolder
!
isStableHolder
isStableHolder isNil ifTrue:[
isStableHolder := false asValue.
].
^ isStableHolder.
"Modified: / 16-01-2007 / 16:00:26 / cg"
!
logHistoryHeadLineSelectionHolder
logHistoryHeadLineSelectionHolder isNil ifTrue:[
logHistoryHeadLineSelectionHolder := nil asValue.
logHistoryHeadLineSelectionHolder
onChangeEvaluate:
[
self logMessageHolder value:(logHistory at:logHistoryHeadLineSelectionHolder value)
].
].
^ logHistoryHeadLineSelectionHolder
"Created: / 12-03-2012 / 12:40:36 / cg"
!
logHistoryHeadLines
^ (logHistory ? #())
collect:[:msg |
msg withoutLeadingSeparators asCollectionOfLines first , '...'
]
"Created: / 12-03-2012 / 12:39:35 / cg"
!
logMessageHolder
logMessageHolder isNil ifTrue:[
logMessageHolder := '' asValue.
].
^ logMessageHolder.
"Modified: / 12-03-2012 / 12:34:13 / cg"
!
notMarkAsStableHolder
^ BlockValue forLogicalNot:self isStableHolder
!
quickCheckInEnabledHolder
quickCheckInEnabledHolder isNil ifTrue:[
quickCheckInEnabledHolder := false asValue.
].
^ quickCheckInEnabledHolder
!
quickCheckInHolder
quickCheckInHolder isNil ifTrue:[
quickCheckInHolder := true asValue.
].
^ quickCheckInHolder
!
quickCheckInVisibleHolder
quickCheckInVisibleHolder isNil ifTrue:[
quickCheckInVisibleHolder := true asValue.
].
^ quickCheckInVisibleHolder
!
recentTagsList
^ [ CVSSourceCodeManager recentTags ]
!
tagHolder
tagHolder isNil ifTrue:[
tagHolder := ("CVSSourceCodeManager recentTag ?" '') asValue.
].
^ tagHolder
!
validateConsistencyEnabledHolder
validateConsistencyEnabledHolder isNil ifTrue:[
validateConsistencyEnabledHolder := false asValue.
].
^ validateConsistencyEnabledHolder
!
validateConsistencyHolder
validateConsistencyHolder isNil ifTrue:[
validateConsistencyHolder := true asValue.
].
^ validateConsistencyHolder
!
validateConsistencyVisibleHolder
validateConsistencyVisibleHolder isNil ifTrue:[
validateConsistencyVisibleHolder := true asValue.
].
^ validateConsistencyVisibleHolder
!
warningMessageHolder
warningMessageHolder isNil ifTrue:[
warningMessageHolder := nil asValue.
].
^ warningMessageHolder.
"Created: / 06-07-2010 / 11:30:29 / cg"
! !
!CheckinInfoDialog class methodsFor:'documentation'!
version
^ '$Header$'
!
version_CVS
^ '$Header$'
! !