Tools__CheckinInfoDialog.st
changeset 6979 048fb7930a28
parent 6799 587271967bde
child 6990 deb2eb9ba97b
equal deleted inserted replaced
6978:6d2a2365dde8 6979:048fb7930a28
    13 "{ Package: 'stx:libtool' }"
    13 "{ Package: 'stx:libtool' }"
    14 
    14 
    15 "{ NameSpace: Tools }"
    15 "{ NameSpace: Tools }"
    16 
    16 
    17 SimpleDialog subclass:#CheckinInfoDialog
    17 SimpleDialog subclass:#CheckinInfoDialog
    18 	instanceVariableNames:'descriptionHolder logMessageHolder isStableHolder'
    18 	instanceVariableNames:'descriptionHolder logMessageHolder isStableHolder tagHolder
       
    19 		tagItHolder quickCheckInHolder quickCheckInVisibleHolder'
    19 	classVariableNames:'LastSourceLogMessage'
    20 	classVariableNames:'LastSourceLogMessage'
    20 	poolDictionaries:''
    21 	poolDictionaries:''
    21 	category:'System-SourceCodeManagement'
    22 	category:'System-SourceCodeManagement'
    22 !
    23 !
    23 
    24 
    61 
    62 
    62     "Do not manually edit this!! If it is corrupted,
    63     "Do not manually edit this!! If it is corrupted,
    63      the UIPainter may not be able to read the specification."
    64      the UIPainter may not be able to read the specification."
    64 
    65 
    65     "
    66     "
    66      UIPainter new openOnClass:SourceCodeManagerUtilities::CheckinInfoDialog andSelector:#windowSpec
    67      UIPainter new openOnClass:Tools::CheckinInfoDialog andSelector:#windowSpec
    67      SourceCodeManagerUtilities::CheckinInfoDialog new openInterface:#windowSpec
    68      Tools::CheckinInfoDialog new openInterface:#windowSpec
    68      SourceCodeManagerUtilities::CheckinInfoDialog open
    69      Tools::CheckinInfoDialog open
    69     "
    70     "
    70 
    71 
    71     <resource: #canvas>
    72     <resource: #canvas>
    72 
    73 
    73     ^ 
    74     ^ 
    76         window: 
    77         window: 
    77        (WindowSpec
    78        (WindowSpec
    78           label: 'Enter Log Message'
    79           label: 'Enter Log Message'
    79           name: 'Enter Log Message'
    80           name: 'Enter Log Message'
    80           min: (Point 10 10)
    81           min: (Point 10 10)
    81           bounds: (Rectangle 0 0 563 290)
    82           bounds: (Rectangle 0 0 563 327)
    82         )
    83         )
    83         component: 
    84         component: 
    84        (SpecCollection
    85        (SpecCollection
    85           collection: (
    86           collection: (
    86            (HorizontalPanelViewSpec
    87            (HorizontalPanelViewSpec
    87               name: 'HorizontalPanel2'
    88               name: 'HorizontalPanel2'
    88               layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
    89               layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
    89               horizontalLayout: left
    90               horizontalLayout: left
    90               verticalLayout: center
    91               verticalLayout: center
    91               horizontalSpace: 3
    92               horizontalSpace: 0
    92               verticalSpace: 3
    93               verticalSpace: 3
    93               component: 
    94               component: 
    94              (SpecCollection
    95              (SpecCollection
    95                 collection: (
    96                 collection: (
    96                  (LabelSpec
    97                  (LabelSpec
    97                     label: 'Enter log message for: '
    98                     label: 'Enter checkIn log-message for: '
    98                     name: 'Label1'
    99                     name: 'Label1'
    99                     translateLabel: true
   100                     translateLabel: true
   100                     resizeForLabel: true
   101                     resizeForLabel: true
   101                     useDefaultExtent: true
   102                     useDefaultExtent: true
   102                   )
   103                   )
   110                
   111                
   111               )
   112               )
   112             )
   113             )
   113            (TextEditorSpec
   114            (TextEditorSpec
   114               name: 'TextEditor1'
   115               name: 'TextEditor1'
   115               layout: (LayoutFrame 2 0.0 38 0 -2 1 -76 1)
   116               layout: (LayoutFrame 2 0.0 38 0 -2 1 -119 1)
   116               model: logMessageHolder
   117               model: logMessageHolder
   117               hasHorizontalScrollBar: true
   118               hasHorizontalScrollBar: true
   118               hasVerticalScrollBar: true
   119               hasVerticalScrollBar: true
   119             )
   120             )
   120            (CheckBoxSpec
   121            (CheckBoxSpec
   121               label: 'Mark as stable'
   122               label: 'Quick Checkin (Only Classes in ChangeSet)'
   122               name: 'CheckBox1'
   123               name: 'CheckInChangedOnlyCheckbox'
   123               layout: (AlignmentOrigin 3 0 -65 1 0 0)
   124               layout: (LayoutFrame 3 0 -114 1 -3 1 -92 1)
       
   125               visibilityChannel: quickCheckInVisibleHolder
       
   126               model: quickCheckInHolder
       
   127               translateLabel: true
       
   128             )
       
   129            (CheckBoxSpec
       
   130               label: 'Mark as Stable'
       
   131               name: 'MarkStableCheckBox'
       
   132               layout: (LayoutFrame 3 0 -87 1 -3 1 -65 1)
   124               model: isStableHolder
   133               model: isStableHolder
   125               translateLabel: true
   134               translateLabel: true
   126             )
   135             )
       
   136            (CheckBoxSpec
       
   137               label: 'Tag It'
       
   138               name: 'TagItCheckBox'
       
   139               layout: (LayoutFrame 3 0 -60 1 0 0.5 -38 1)
       
   140               model: tagItHolder
       
   141               translateLabel: true
       
   142             )
       
   143            (LabelSpec
       
   144               label: 'Tag:'
       
   145               name: 'TagLabel'
       
   146               layout: (LayoutFrame 1 0.25 265 0 0 0.5 287 0)
       
   147               translateLabel: true
       
   148               adjust: right
       
   149             )
       
   150            (InputFieldSpec
       
   151               name: 'TagEntryField'
       
   152               layout: (LayoutFrame 0 0.5 265 0 -3 1 287 0)
       
   153               enableChannel: tagItInHolder
       
   154               model: tagHolder
       
   155               acceptOnReturn: true
       
   156               acceptOnTab: true
       
   157               acceptOnLostFocus: true
       
   158               acceptOnPointerLeave: false
       
   159             )
   127            (HorizontalPanelViewSpec
   160            (HorizontalPanelViewSpec
   128               name: 'HorizontalPanel1'
   161               name: 'HorizontalPanel1'
   129               layout: (LayoutFrame 0 0.0 -42 1 0 1.0 0 1.0)
   162               layout: (LayoutFrame 0 0.0 -40 1 0 1.0 0 1.0)
   130               horizontalLayout: fitSpace
   163               horizontalLayout: fitSpace
   131               verticalLayout: center
   164               verticalLayout: center
   132               horizontalSpace: 3
   165               horizontalSpace: 3
   133               verticalSpace: 3
   166               verticalSpace: 2
   134               component: 
   167               component: 
   135              (SpecCollection
   168              (SpecCollection
   136                 collection: (
   169                 collection: (
   137                  (ActionButtonSpec
   170                  (ActionButtonSpec
   138                     label: 'OK'
   171                     label: 'OK'
   159 ! !
   192 ! !
   160 
   193 
   161 !CheckinInfoDialog class methodsFor:'opening'!
   194 !CheckinInfoDialog class methodsFor:'opening'!
   162 
   195 
   163 getCheckinInfoFor:aString initialAnswer:initialAnswer
   196 getCheckinInfoFor:aString initialAnswer:initialAnswer
       
   197     ^ self getCheckinInfoFor:aString initialAnswer:initialAnswer withQuickOption:false
       
   198 
       
   199     "
       
   200       self getCheckinInfoFor:'hello' initialAnswer:'bla'
       
   201     "
       
   202 !
       
   203 
       
   204 getCheckinInfoFor:aString initialAnswer:initialAnswer withQuickOption:withQuickOption
   164     |dialog|
   205     |dialog|
   165 
   206 
   166     dialog := self new.
   207     dialog := self new.
   167     dialog description:aString; logMessage:initialAnswer.
   208     dialog 
       
   209         description:aString; 
       
   210         logMessage:initialAnswer;
       
   211         withQuickOption:withQuickOption.
   168 
   212 
   169     dialog open.
   213     dialog open.
   170     dialog accepted ifFalse:[
   214     dialog accepted ifFalse:[
   171         ^ nil.
   215         ^ nil.
   172     ].
   216     ].
   201     ^ self logMessageHolder value
   245     ^ self logMessageHolder value
   202 !
   246 !
   203 
   247 
   204 logMessage:aString
   248 logMessage:aString
   205     self logMessageHolder value:aString
   249     self logMessageHolder value:aString
       
   250 !
       
   251 
       
   252 quickCheckIn
       
   253     ^ self quickCheckInHolder value
       
   254 !
       
   255 
       
   256 quickCheckIn:aBoolean
       
   257     self quickCheckInHolder value:aBoolean
       
   258 !
       
   259 
       
   260 tag
       
   261     ^ self tagHolder value
       
   262 !
       
   263 
       
   264 tag:aString
       
   265     self tagHolder value:aString
       
   266 !
       
   267 
       
   268 tagIt
       
   269     ^ self tagItHolder value
       
   270 !
       
   271 
       
   272 tagIt:aBoolean
       
   273     self tagItHolder value:aBoolean
       
   274 !
       
   275 
       
   276 withQuickOption:aBoolean
       
   277     ^ self quickCheckInVisibleHolder value:aBoolean
   206 ! !
   278 ! !
   207 
   279 
   208 !CheckinInfoDialog methodsFor:'aspects'!
   280 !CheckinInfoDialog methodsFor:'aspects'!
   209 
   281 
   210 descriptionHolder
   282 descriptionHolder
   211     "return/create the 'descriptionHolder' value holder (automatically generated)"
       
   212 
       
   213     descriptionHolder isNil ifTrue:[
   283     descriptionHolder isNil ifTrue:[
   214         descriptionHolder := ValueHolder new.
   284         descriptionHolder := ValueHolder new.
   215     ].
   285     ].
   216     ^ descriptionHolder
   286     ^ descriptionHolder
   217 !
   287 !
   226 logMessageHolder
   296 logMessageHolder
   227     logMessageHolder isNil ifTrue:[
   297     logMessageHolder isNil ifTrue:[
   228         logMessageHolder := LastSourceLogMessage asValue.
   298         logMessageHolder := LastSourceLogMessage asValue.
   229     ].
   299     ].
   230     ^ logMessageHolder.
   300     ^ logMessageHolder.
       
   301 !
       
   302 
       
   303 quickCheckInHolder
       
   304     quickCheckInHolder isNil ifTrue:[
       
   305         quickCheckInHolder := true asValue.
       
   306     ].
       
   307     ^ quickCheckInHolder
       
   308 !
       
   309 
       
   310 quickCheckInVisibleHolder
       
   311     quickCheckInVisibleHolder isNil ifTrue:[
       
   312         quickCheckInVisibleHolder := false asValue.
       
   313     ].
       
   314     ^ quickCheckInVisibleHolder
       
   315 !
       
   316 
       
   317 tagHolder
       
   318     tagHolder isNil ifTrue:[
       
   319         tagHolder := '' asValue.
       
   320     ].
       
   321     ^ tagHolder
       
   322 !
       
   323 
       
   324 tagItHolder
       
   325     tagItHolder isNil ifTrue:[
       
   326         tagItHolder := false asValue.
       
   327     ].
       
   328     ^ tagItHolder
   231 ! !
   329 ! !
   232 
   330 
   233 !CheckinInfoDialog class methodsFor:'documentation'!
   331 !CheckinInfoDialog class methodsFor:'documentation'!
   234 
   332 
   235 version
   333 version
   236     ^ '$Header: /cvs/stx/stx/libtool/Tools__CheckinInfoDialog.st,v 1.1 2006-06-22 10:52:35 cg Exp $'
   334     ^ '$Header: /cvs/stx/stx/libtool/Tools__CheckinInfoDialog.st,v 1.2 2006-08-24 21:13:16 cg Exp $'
   237 ! !
   335 ! !