mercurial/HGCommitDialog.st
changeset 152 9068fe7a5795
parent 151 527a1e85aef8
child 157 fb7a41a9cf92
--- a/mercurial/HGCommitDialog.st	Mon Dec 10 02:49:43 2012 +0000
+++ b/mercurial/HGCommitDialog.st	Mon Dec 10 03:43:12 2012 +0000
@@ -1,7 +1,8 @@
 "{ Package: 'stx:libscm/mercurial' }"
 
 SCMAbstractCommitDialog subclass:#HGCommitDialog
-	instanceVariableNames:'remoteHolder remoteListHolder remotePushHolder'
+	instanceVariableNames:'remoteHolder remoteListHolder remotePushHolder branchCreateHolder
+		branchHolder'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SCM-Mercurial-StX-Interface'
@@ -107,27 +108,51 @@
                              )
                            
                           )
-                          extent: (Point 698 267)
+                          extent: (Point 698 239)
                         )
                        (ViewSpec
-                          name: 'PushCheckbox'
+                          name: 'BranchBox'
                           component: 
                          (SpecCollection
                             collection: (
+                             (InputFieldSpec
+                                name: 'EntryField1'
+                                layout: (LayoutFrame 215 0 0 0 0 1 0 1)
+                                visibilityChannel: branchCreateHolder
+                                model: branchHolder
+                                emptyFieldReplacementText: 'Branch name'
+                              )
+                             (CheckBoxSpec
+                                label: 'Commit into new branch'
+                                name: 'BranchCheckBox'
+                                layout: (LayoutFrame 0 0 2 0 215 0 25 0)
+                                model: branchCreateHolder
+                                translateLabel: true
+                              )
+                             )
+                           
+                          )
+                          extent: (Point 698 25)
+                        )
+                       (ViewSpec
+                          name: 'PushBox'
+                          component: 
+                         (SpecCollection
+                            collection: (
+                             (CheckBoxSpec
+                                label: 'Push to upstream repository'
+                                name: 'CheckBox1'
+                                layout: (LayoutFrame 0 0 2 0 215 0 25 0)
+                                model: remotePushHolder
+                                translateLabel: true
+                              )
                              (ComboListSpec
-                                name: 'ComboList1'
-                                layout: (LayoutFrame 250 0 0 0 0 1 0 1)
+                                name: 'ComboList2'
+                                layout: (LayoutFrame 215 0 0 0 0 1 0 1)
                                 visibilityChannel: remotePushHolder
                                 model: remoteHolder
                                 comboList: remoteListHolder
                               )
-                             (CheckBoxSpec
-                                label: 'Push to upstream repository'
-                                name: 'UpstreamRepositoryCheckBox'
-                                layout: (LayoutFrame 0 0 2 0 250 0 25 0)
-                                model: remotePushHolder
-                                translateLabel: true
-                              )
                              )
                            
                           )
@@ -263,11 +288,12 @@
 !HGCommitDialog methodsFor:'actions'!
 
 doAccept
-    self remotePushHolder value ifTrue:[
-        self task remote: self remoteHolder
-    ] ifFalse:[
-        self task remote: nil.
-    ].
+    self remotePushHolder value 
+        ifTrue:[self task remote: self remoteHolder value] 
+        ifFalse:[self task remote: nil].
+    self branchCreateHolder value 
+        ifTrue:[self task branch: self branchHolder value] 
+        ifFalse:[self task branch: nil].
     [
         super doAccept.
     ] on: HGPushWouldCreateNewHeadError do:[:ex|
@@ -280,6 +306,7 @@
     ]
 
     "Created: / 10-12-2012 / 01:46:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 10-12-2012 / 02:56:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doEditUserConfig
@@ -351,6 +378,46 @@
 
 !HGCommitDialog methodsFor:'aspects'!
 
+branchCreateHolder
+    <resource: #uiAspect>
+
+    "automatically generated by UIPainter ..."
+
+    "*** the code below creates a default model when invoked."
+    "*** (which may not be the one you wanted)"
+    "*** Please change as required and accept it in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    branchCreateHolder isNil ifTrue:[
+        branchCreateHolder := false asValue.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/       branchCreateHolder addDependent:self.
+"/       branchCreateHolder onChangeSend:#branchCreateHolderChanged to:self.
+    ].
+    ^ branchCreateHolder.
+
+    "Modified: / 10-12-2012 / 02:54:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+branchHolder
+    <resource: #uiAspect>
+
+    "automatically generated by UIPainter ..."
+
+    "*** the code below creates a default model when invoked."
+    "*** (which may not be the one you wanted)"
+    "*** Please change as required and accept it in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    branchHolder isNil ifTrue:[
+        branchHolder := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/       branchHolder addDependent:self.
+"/       branchHolder onChangeSend:#branchHolderChanged to:self.
+    ].
+    ^ branchHolder.
+!
+
 remoteHolder
     <resource: #uiAspect>