eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.py

branch
eric7
changeset 9028
b3a7f0368163
parent 8881
54e42bc2437a
equal deleted inserted replaced
9027:f259edcf185a 9028:b3a7f0368163
44 self.tagCombo.addItems(sorted(tagsList)) 44 self.tagCombo.addItems(sorted(tagsList))
45 self.branchCombo.addItems(["default"] + sorted(branchesList)) 45 self.branchCombo.addItems(["default"] + sorted(branchesList))
46 if bookmarksList is not None: 46 if bookmarksList is not None:
47 self.bookmarkCombo.addItems(sorted(bookmarksList)) 47 self.bookmarkCombo.addItems(sorted(bookmarksList))
48 48
49 # connect various radio buttons and input fields
50 self.defaultButton.toggled.connect(self.__updateOK)
51 self.outgoingButton.toggled.connect(self.__updateOK)
52 self.revisionButton.toggled.connect(self.__updateOK)
53 self.idButton.toggled.connect(self.__updateOK)
54 self.tagButton.toggled.connect(self.__updateOK)
55 self.branchButton.toggled.connect(self.__updateOK)
56 self.bookmarkButton.toggled.connect(self.__updateOK)
57 self.expressionButton.toggled.connect(self.__updateOK)
58
59 self.idEdit.textChanged.connect(self.__updateOK)
60 self.expressionEdit.textChanged.connect(self.__updateOK)
61
62 self.tagCombo.editTextChanged.connect(self.__updateOK)
63 self.branchCombo.editTextChanged.connect(self.__updateOK)
64 self.bookmarkCombo.editTextChanged.connect(self.__updateOK)
65
66 self.numberSpinBox.valueChanged.connect(self.__updateOK)
67
49 self.idEdit.setText(rev) 68 self.idEdit.setText(rev)
50 if rev: 69 if rev:
51 self.revisionButton.setChecked(True) 70 self.revisionButton.setChecked(True)
52 else: 71 else:
53 self.defaultButton.setChecked(True) 72 self.defaultButton.setChecked(True)
55 msh = self.minimumSizeHint() 74 msh = self.minimumSizeHint()
56 self.resize(max(self.width(), msh.width()), msh.height()) 75 self.resize(max(self.width(), msh.width()), msh.height())
57 76
58 self.__updateOK() 77 self.__updateOK()
59 78
79 @pyqtSlot()
60 def __updateOK(self): 80 def __updateOK(self):
61 """ 81 """
62 Private slot to update the OK button. 82 Private slot to update the OK button.
63 """ 83 """
64 enabled = True 84 enabled = True
70 enabled = enabled and bool(self.tagCombo.currentText()) 90 enabled = enabled and bool(self.tagCombo.currentText())
71 elif self.branchButton.isChecked(): 91 elif self.branchButton.isChecked():
72 enabled = enabled and bool(self.branchCombo.currentText()) 92 enabled = enabled and bool(self.branchCombo.currentText())
73 elif self.bookmarkButton.isChecked(): 93 elif self.bookmarkButton.isChecked():
74 enabled = enabled and bool(self.bookmarkCombo.currentText()) 94 enabled = enabled and bool(self.bookmarkCombo.currentText())
95 elif self.expressionButton.isChecked():
96 enabled = enabled and bool(self.expressionEdit.text())
75 97
76 self.buttonBox.button( 98 self.buttonBox.button(
77 QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) 99 QDialogButtonBox.StandardButton.Ok).setEnabled(enabled)
78
79 @pyqtSlot(bool)
80 def on_defaultButton_toggled(self, checked):
81 """
82 Private slot to handle changes of the Default select button.
83
84 @param checked state of the button
85 @type bool
86 """
87 self.__updateOK()
88
89 @pyqtSlot(bool)
90 def on_outgoingButton_toggled(self, checked):
91 """
92 Private slot to handle changes of the Outgoing select button.
93
94 @param checked state of the button
95 @type bool
96 """
97 self.__updateOK()
98
99 @pyqtSlot(bool)
100 def on_revisionButton_toggled(self, checked):
101 """
102 Private slot to handle changes of the Revision select button.
103
104 @param checked state of the button
105 @type bool
106 """
107 self.__updateOK()
108
109 @pyqtSlot(bool)
110 def on_idButton_toggled(self, checked):
111 """
112 Private slot to handle changes of the ID select button.
113
114 @param checked state of the button (boolean)
115 """
116 self.__updateOK()
117
118 @pyqtSlot(bool)
119 def on_tagButton_toggled(self, checked):
120 """
121 Private slot to handle changes of the Tag select button.
122
123 @param checked state of the button (boolean)
124 """
125 self.__updateOK()
126
127 @pyqtSlot(bool)
128 def on_branch1Button_toggled(self, checked):
129 """
130 Private slot to handle changes of the Branch select button.
131
132 @param checked state of the button (boolean)
133 """
134 self.__updateOK()
135
136 @pyqtSlot(bool)
137 def on_bookmarkButton_toggled(self, checked):
138 """
139 Private slot to handle changes of the Bookmark select button.
140
141 @param checked state of the button (boolean)
142 """
143 self.__updateOK()
144
145 @pyqtSlot(int)
146 def on_numberSpinBox_valueChanged(self, val):
147 """
148 Private slot to handle changes of the Number spin box.
149
150 @param val value of the spin box
151 @type int
152 """
153 self.__updateOK()
154
155 @pyqtSlot(str)
156 def on_idEdit_textChanged(self, txt):
157 """
158 Private slot to handle changes of the ID edit.
159
160 @param txt text of the edit
161 @type str
162 """
163 self.__updateOK()
164
165 @pyqtSlot(str)
166 def on_tagCombo_editTextChanged(self, txt):
167 """
168 Private slot to handle changes of the Tag combo.
169
170 @param txt text of the combo
171 @type str
172 """
173 self.__updateOK()
174
175 @pyqtSlot(str)
176 def on_branchCombo_editTextChanged(self, txt):
177 """
178 Private slot to handle changes of the Branch combo.
179
180 @param txt text of the combo
181 @type str
182 """
183 self.__updateOK()
184
185 @pyqtSlot(str)
186 def on_bookmarkCombo_editTextChanged(self, txt):
187 """
188 Private slot to handle changes of the Bookmark combo.
189
190 @param txt text of the combo
191 @type str
192 """
193 self.__updateOK()
194 100
195 def __getRevision(self): 101 def __getRevision(self):
196 """ 102 """
197 Private method to generate the revision. 103 Private method to generate the revision.
198 104
212 return self.tagCombo.currentText() 118 return self.tagCombo.currentText()
213 elif self.branchButton.isChecked(): 119 elif self.branchButton.isChecked():
214 return self.branchCombo.currentText() 120 return self.branchCombo.currentText()
215 elif self.bookmarkButton.isChecked(): 121 elif self.bookmarkButton.isChecked():
216 return self.bookmarkCombo.currentText() 122 return self.bookmarkCombo.currentText()
123 elif self.expressionButton.isChecked():
124 return self.expressionEdit.text()
217 125
218 return "" 126 return ""
219 127
220 def getData(self): 128 def getData(self):
221 """ 129 """

eric ide

mercurial