src/eric7/Plugins/VcsPlugins/vcsGit/GitBranchDialog.py

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
30 self, branchlist, revision=None, branchName=None, branchOp=None, parent=None 30 self, branchlist, revision=None, branchName=None, branchOp=None, parent=None
31 ): 31 ):
32 """ 32 """
33 Constructor 33 Constructor
34 34
35 @param branchlist list of previously entered branches (list of strings) 35 @param branchlist list of previously entered branches
36 @param revision revision to set tag for (string) 36 @type list of str
37 @param branchName name of the branch (string) 37 @param revision revision to set tag for
38 @param branchOp desired branch operation (integer) 38 @type str
39 @param parent parent widget (QWidget) 39 @param branchName name of the branch
40 @type str
41 @param branchOp desired branch operation
42 @type int
43 @param parent parent widget
44 @type QWidget
40 """ 45 """
41 super().__init__(parent) 46 super().__init__(parent)
42 self.setupUi(self) 47 self.setupUi(self)
43 48
44 self.okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) 49 self.okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok)
105 @pyqtSlot(bool) 110 @pyqtSlot(bool)
106 def on_createTrackingButton_toggled(self, checked): 111 def on_createTrackingButton_toggled(self, checked):
107 """ 112 """
108 Private slot to handle the selection of creating a tracking branch. 113 Private slot to handle the selection of creating a tracking branch.
109 114
110 @param checked state of the selection (boolean) 115 @param checked state of the selection
116 @type bool
111 """ 117 """
112 self.branchCombo.setEditable(not checked) 118 self.branchCombo.setEditable(not checked)
113 self.branchCombo.clear() 119 self.branchCombo.clear()
114 if checked: 120 if checked:
115 self.branchCombo.addItems(sorted(self.__remoteBranches)) 121 self.branchCombo.addItems(sorted(self.__remoteBranches))
121 @pyqtSlot(bool) 127 @pyqtSlot(bool)
122 def on_setTrackingButton_toggled(self, checked): 128 def on_setTrackingButton_toggled(self, checked):
123 """ 129 """
124 Private slot to handle the selection of setting a tracking branch. 130 Private slot to handle the selection of setting a tracking branch.
125 131
126 @param checked state of the selection (boolean) 132 @param checked state of the selection
133 @type bool
127 """ 134 """
128 self.__updateOK() 135 self.__updateOK()
129 136
130 @pyqtSlot(bool) 137 @pyqtSlot(bool)
131 def on_unsetTrackingButton_toggled(self, checked): 138 def on_unsetTrackingButton_toggled(self, checked):
132 """ 139 """
133 Private slot to handle the selection of unsetting a tracking branch. 140 Private slot to handle the selection of unsetting a tracking branch.
134 141
135 @param checked state of the selection (boolean) 142 @param checked state of the selection
143 @type bool
136 """ 144 """
137 self.__updateOK() 145 self.__updateOK()
138 146
139 @pyqtSlot(str) 147 @pyqtSlot(str)
140 def on_branchCombo_editTextChanged(self, text): 148 def on_branchCombo_editTextChanged(self, text):
141 """ 149 """
142 Private slot to handle a change of the branch. 150 Private slot to handle a change of the branch.
143 151
144 @param text branch name entered in the combo (string) 152 @param text branch name entered in the combo
153 @type str
145 """ 154 """
146 self.__updateOK() 155 self.__updateOK()
147 156
148 @pyqtSlot(str) 157 @pyqtSlot(str)
149 def on_newBranchNameEdit_textChanged(self, text): 158 def on_newBranchNameEdit_textChanged(self, text):
150 """ 159 """
151 Private slot to handle a change of the new branch. 160 Private slot to handle a change of the new branch.
152 161
153 @param text new branch name entered (string) 162 @param text new branch name entered
163 @type str
154 """ 164 """
155 self.__updateOK() 165 self.__updateOK()
156 166
157 def getParameters(self): 167 def getParameters(self):
158 """ 168 """
159 Public method to retrieve the branch data. 169 Public method to retrieve the branch data.
160 170
161 @return tuple of an int, four strings and a boolean 171 @return tuple containing the branch operation, branch name, revision,
162 (branch operation, branch name, revision, new branch name, 172 new branch name, remote branch name and a flag indicating to enforce
163 remote branch name, enforce operation) 173 the operation
174 @rtype tuple of (int, str, str, str, str, bool)
164 """ 175 """
165 branch = self.branchCombo.currentText().replace(" ", "_") 176 branch = self.branchCombo.currentText().replace(" ", "_")
166 177
167 if self.createBranchButton.isChecked(): 178 if self.createBranchButton.isChecked():
168 branchOp = GitBranchDialog.CreateBranch 179 branchOp = GitBranchDialog.CreateBranch

eric ide

mercurial