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

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
41 def __init__(self, vcs, parent=None): 41 def __init__(self, vcs, parent=None):
42 """ 42 """
43 Constructor 43 Constructor
44 44
45 @param vcs reference to the vcs object 45 @param vcs reference to the vcs object
46 @param parent reference to the parent widget (QWidget) 46 @type Git
47 @param parent reference to the parent widget
48 @type QWidget
47 """ 49 """
48 super().__init__(parent) 50 super().__init__(parent)
49 self.setupUi(self) 51 self.setupUi(self)
50 52
51 self.__position = QPoint() 53 self.__position = QPoint()
93 95
94 def closeEvent(self, e): 96 def closeEvent(self, e):
95 """ 97 """
96 Protected slot implementing a close event handler. 98 Protected slot implementing a close event handler.
97 99
98 @param e close event (QCloseEvent) 100 @param e close event
101 @type QCloseEvent
99 """ 102 """
100 if ( 103 if (
101 self.__process is not None 104 self.__process is not None
102 and self.__process.state() != QProcess.ProcessState.NotRunning 105 and self.__process.state() != QProcess.ProcessState.NotRunning
103 ): 106 ):
136 139
137 def __generateReflogItem(self, commitId, selector, name, subject): 140 def __generateReflogItem(self, commitId, selector, name, subject):
138 """ 141 """
139 Private method to generate a reflog tree entry. 142 Private method to generate a reflog tree entry.
140 143
141 @param commitId commit id info (string) 144 @param commitId commit id info
142 @param selector selector info (string) 145 @type str
143 @param name name info (string) 146 @param selector selector info
144 @param subject subject of the reflog entry (string) 147 @type str
145 @return reference to the generated item (QTreeWidgetItem) 148 @param name name info
149 @type str
150 @param subject subject of the reflog entry
151 @type str
152 @return reference to the generated item
153 @rtype QTreeWidgetItem
146 """ 154 """
147 try: 155 try:
148 operation, subject = subject.strip().split(": ", 1) 156 operation, subject = subject.strip().split(": ", 1)
149 except ValueError: 157 except ValueError:
150 operation = "" 158 operation = ""
162 170
163 def __getReflogEntries(self, skip=0): 171 def __getReflogEntries(self, skip=0):
164 """ 172 """
165 Private method to retrieve reflog entries from the repository. 173 Private method to retrieve reflog entries from the repository.
166 174
167 @param skip number of reflog entries to skip (integer) 175 @param skip number of reflog entries to skip
176 @type int
168 """ 177 """
169 self.refreshButton.setEnabled(False) 178 self.refreshButton.setEnabled(False)
170 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False) 179 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False)
171 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(True) 180 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(True)
172 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True) 181 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True)
209 218
210 def start(self, projectdir): 219 def start(self, projectdir):
211 """ 220 """
212 Public slot to start the git log command. 221 Public slot to start the git log command.
213 222
214 @param projectdir directory name of the project (string) 223 @param projectdir directory name of the project
224 @type str
215 """ 225 """
216 self.errorGroup.hide() 226 self.errorGroup.hide()
217 QApplication.processEvents() 227 QApplication.processEvents()
218 228
219 self.__initData() 229 self.__initData()
233 @pyqtSlot(int, QProcess.ExitStatus) 243 @pyqtSlot(int, QProcess.ExitStatus)
234 def __procFinished(self, exitCode, exitStatus): 244 def __procFinished(self, exitCode, exitStatus):
235 """ 245 """
236 Private slot connected to the finished signal. 246 Private slot connected to the finished signal.
237 247
238 @param exitCode exit code of the process (integer) 248 @param exitCode exit code of the process
239 @param exitStatus exit status of the process (QProcess.ExitStatus) 249 @type int
250 @param exitStatus exit status of the process
251 @type QProcess.ExitStatus
240 """ 252 """
241 self.__processBuffer() 253 self.__processBuffer()
242 self.__finish() 254 self.__finish()
243 255
244 def __finish(self): 256 def __finish(self):
346 358
347 def __showError(self, out): 359 def __showError(self, out):
348 """ 360 """
349 Private slot to show some error. 361 Private slot to show some error.
350 362
351 @param out error to be shown (string) 363 @param out error to be shown
364 @type str
352 """ 365 """
353 self.errorGroup.show() 366 self.errorGroup.show()
354 self.errors.insertPlainText(out) 367 self.errors.insertPlainText(out)
355 self.errors.ensureCursorVisible() 368 self.errors.ensureCursorVisible()
356 369
357 def on_buttonBox_clicked(self, button): 370 def on_buttonBox_clicked(self, button):
358 """ 371 """
359 Private slot called by a button of the button box clicked. 372 Private slot called by a button of the button box clicked.
360 373
361 @param button button that was clicked (QAbstractButton) 374 @param button button that was clicked
375 @type QAbstractButton
362 """ 376 """
363 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): 377 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close):
364 self.close() 378 self.close()
365 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): 379 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
366 self.cancelled = True 380 self.cancelled = True
384 398
385 def on_passwordCheckBox_toggled(self, isOn): 399 def on_passwordCheckBox_toggled(self, isOn):
386 """ 400 """
387 Private slot to handle the password checkbox toggled. 401 Private slot to handle the password checkbox toggled.
388 402
389 @param isOn flag indicating the status of the check box (boolean) 403 @param isOn flag indicating the status of the check box
404 @type bool
390 """ 405 """
391 if isOn: 406 if isOn:
392 self.input.setEchoMode(QLineEdit.EchoMode.Password) 407 self.input.setEchoMode(QLineEdit.EchoMode.Password)
393 else: 408 else:
394 self.input.setEchoMode(QLineEdit.EchoMode.Normal) 409 self.input.setEchoMode(QLineEdit.EchoMode.Normal)
423 438
424 def keyPressEvent(self, evt): 439 def keyPressEvent(self, evt):
425 """ 440 """
426 Protected slot to handle a key press event. 441 Protected slot to handle a key press event.
427 442
428 @param evt the key press event (QKeyEvent) 443 @param evt the key press event
444 @type QKeyEvent
429 """ 445 """
430 if self.intercept: 446 if self.intercept:
431 self.intercept = False 447 self.intercept = False
432 evt.accept() 448 evt.accept()
433 return 449 return

eric ide

mercurial