Tools__CheckinInfoDialog.st
changeset 18131 9e7156478039
parent 18130 64f823c2b648
child 18211 628466ff92d9
equal deleted inserted replaced
18130:64f823c2b648 18131:9e7156478039
   537 
   537 
   538 getCheckinInfoFor:infoString initialAnswer:initialAnswer 
   538 getCheckinInfoFor:infoString initialAnswer:initialAnswer 
   539                 withQuickOption:withQuickOption 
   539                 withQuickOption:withQuickOption 
   540                 logHistory:logHistoryArg 
   540                 logHistory:logHistoryArg 
   541                 withValidateConsistencyOption:withValidateConsistencyOption
   541                 withValidateConsistencyOption:withValidateConsistencyOption
   542     ^ self
   542     ^ self new
   543         getCheckinInfoFor:infoString 
   543         getCheckinInfoFor:infoString initialAnswer:initialAnswer 
   544         initialAnswer:initialAnswer 
       
   545         withQuickOption:withQuickOption 
   544         withQuickOption:withQuickOption 
   546         logHistory:logHistoryArg 
   545         logHistory:logHistoryArg 
   547         withValidateConsistencyOption:withValidateConsistencyOption
   546         withValidateConsistencyOption:withValidateConsistencyOption
   548         initialReason:(LastReason ? self reasonBugfix)
       
   549 
   547 
   550     "
   548     "
   551      self getCheckinInfoFor:'hello' initialAnswer:'bla'
   549      self getCheckinInfoFor:'hello' initialAnswer:'bla'
   552     "
   550     "
   553 
   551 
   559             withQuickOption:withQuickOption 
   557             withQuickOption:withQuickOption 
   560             logHistory:logHistoryArg 
   558             logHistory:logHistoryArg 
   561             withValidateConsistencyOption:withValidateConsistencyOption
   559             withValidateConsistencyOption:withValidateConsistencyOption
   562             initialReason:defaultReason
   560             initialReason:defaultReason
   563 
   561 
   564     |dialog warnMessage|
   562     ^ self new
   565 
   563         getCheckinInfoFor:infoString initialAnswer:initialAnswer 
   566     warnMessage := nil.
   564         withQuickOption:withQuickOption 
   567     [
   565         logHistory:logHistoryArg 
   568         |lines infoString1 repositoryInfo branchInfo|
   566         withValidateConsistencyOption:withValidateConsistencyOption
   569 
   567         initialReason:defaultReason
   570         dialog := self new.
       
   571 
       
   572         infoString1 := infoString.
       
   573         lines := infoString asStringCollection.
       
   574         lines size > 1 ifTrue:[
       
   575             repositoryInfo := lines second string.
       
   576             dialog repositoryInfo:repositoryInfo.
       
   577             lines size > 2 ifTrue:[
       
   578                 branchInfo := lines third string.
       
   579                 dialog branchInfo:branchInfo.
       
   580             ].    
       
   581             infoString1 := lines first.
       
   582         ].
       
   583         
       
   584         dialog 
       
   585             description:infoString1; 
       
   586             logMessage:initialAnswer;
       
   587             withQuickOption:withQuickOption;
       
   588             withValidateConsistencyOption:withValidateConsistencyOption;
       
   589             logHistory:logHistoryArg;
       
   590             checkinReason:defaultReason.
       
   591 
       
   592         dialog warningMessageHolder value:warnMessage.
       
   593         dialog open.
       
   594         dialog accepted ifFalse:[ ^ nil ].
       
   595     ] doUntil:[
       
   596         |stopAsking|
       
   597 
       
   598         stopAsking := dialog allowEmptyLogMessage 
       
   599                       or:[ (dialog logMessage) withoutSeparators notEmptyOrNil ].
       
   600         stopAsking ifFalse:[
       
   601             warnMessage := (self resources string:'Please enter a description of your changes!!') 
       
   602                                 withColor:Color red.
       
   603         ].
       
   604         stopAsking
       
   605     ].
       
   606     LastReason := dialog checkinReason.
       
   607     ^ dialog    
       
   608 
   568 
   609 
   569 
   610     "
   570     "
   611      self getCheckinInfoFor:'hello' initialAnswer:'bla'
   571      self getCheckinInfoFor:'hello' initialAnswer:'bla'
   612     "
   572     "
   876     ^ warningMessageHolder.
   836     ^ warningMessageHolder.
   877 
   837 
   878     "Created: / 06-07-2010 / 11:30:29 / cg"
   838     "Created: / 06-07-2010 / 11:30:29 / cg"
   879 ! !
   839 ! !
   880 
   840 
       
   841 !CheckinInfoDialog methodsFor:'opening'!
       
   842 
       
   843 getCheckinInfoFor:infoString initialAnswer:initialAnswer 
       
   844                 withQuickOption:withQuickOption 
       
   845                 logHistory:logHistoryArg 
       
   846                 withValidateConsistencyOption:withValidateConsistencyOption
       
   847     ^ self
       
   848         getCheckinInfoFor:infoString 
       
   849         initialAnswer:initialAnswer 
       
   850         withQuickOption:withQuickOption 
       
   851         logHistory:logHistoryArg 
       
   852         withValidateConsistencyOption:withValidateConsistencyOption
       
   853         initialReason:(LastReason ? self class reasonBugfix)
       
   854 !
       
   855 
       
   856 getCheckinInfoFor:infoString initialAnswer:initialAnswer 
       
   857             withQuickOption:withQuickOption 
       
   858             logHistory:logHistoryArg 
       
   859             withValidateConsistencyOption:withValidateConsistencyOption
       
   860             initialReason:defaultReason
       
   861 
       
   862     |warnMessage|
       
   863 
       
   864     warnMessage := nil.
       
   865     [
       
   866         |lines infoString1 repositoryInfo branchInfo|
       
   867 
       
   868         infoString1 := infoString.
       
   869         lines := infoString asStringCollection.
       
   870         lines size > 1 ifTrue:[
       
   871             repositoryInfo := lines second string.
       
   872             self repositoryInfo:repositoryInfo.
       
   873             lines size > 2 ifTrue:[
       
   874                 branchInfo := lines third string.
       
   875                 self branchInfo:branchInfo.
       
   876             ].    
       
   877             infoString1 := lines first.
       
   878         ].
       
   879 
       
   880         self
       
   881             description:infoString1; 
       
   882             logMessage:initialAnswer;
       
   883             withQuickOption:withQuickOption;
       
   884             withValidateConsistencyOption:withValidateConsistencyOption;
       
   885             logHistory:logHistoryArg;
       
   886             checkinReason:defaultReason.
       
   887 
       
   888         self warningMessageHolder value:warnMessage.
       
   889         self open.
       
   890         self accepted ifFalse:[ ^ nil ].
       
   891     ] doUntil:[
       
   892         |stopAsking|
       
   893 
       
   894         stopAsking := self allowEmptyLogMessage 
       
   895                       or:[ (self logMessage) withoutSeparators notEmptyOrNil ].
       
   896         stopAsking ifFalse:[
       
   897             warnMessage := (self resources string:'Please enter a description of your changes!!') 
       
   898                                 withColor:Color red.
       
   899         ].
       
   900         stopAsking
       
   901     ].
       
   902     LastReason := self checkinReason.
       
   903     ^ self    
       
   904 
       
   905     "
       
   906      self getCheckinInfoFor:'hello' initialAnswer:'bla'
       
   907     "
       
   908 
       
   909     "Created: / 12-03-2012 / 12:36:26 / cg"
       
   910     "Modified: / 05-12-2017 / 23:07:06 / cg"
       
   911 ! !
       
   912 
   881 !CheckinInfoDialog class methodsFor:'documentation'!
   913 !CheckinInfoDialog class methodsFor:'documentation'!
   882 
   914 
   883 version
   915 version
   884     ^ '$Header$'
   916     ^ '$Header$'
   885 !
   917 !