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

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
46 def __init__(self, vcs, parent=None): 46 def __init__(self, vcs, parent=None):
47 """ 47 """
48 Constructor 48 Constructor
49 49
50 @param vcs reference to the vcs object 50 @param vcs reference to the vcs object
51 @param parent reference to the parent widget (QWidget) 51 @type Git
52 @param parent reference to the parent widget
53 @type QWidget
52 """ 54 """
53 super().__init__(parent) 55 super().__init__(parent)
54 self.setupUi(self) 56 self.setupUi(self)
55 57
56 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False) 58 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False)
102 104
103 def closeEvent(self, e): 105 def closeEvent(self, e):
104 """ 106 """
105 Protected slot implementing a close event handler. 107 Protected slot implementing a close event handler.
106 108
107 @param e close event (QCloseEvent) 109 @param e close event
110 @type QCloseEvent
108 """ 111 """
109 if ( 112 if (
110 self.__process is not None 113 self.__process is not None
111 and self.__process.state() != QProcess.ProcessState.NotRunning 114 and self.__process.state() != QProcess.ProcessState.NotRunning
112 ): 115 ):
143 146
144 def __generateStashEntry(self, name, date, message): 147 def __generateStashEntry(self, name, date, message):
145 """ 148 """
146 Private method to generate the stash items. 149 Private method to generate the stash items.
147 150
148 @param name name of the stash (string) 151 @param name name of the stash
149 @param date date the stash was created (string) 152 @type str
150 @param message stash message (string) 153 @param date date the stash was created
154 @type str
155 @param message stash message
156 @type str
151 """ 157 """
152 QTreeWidgetItem(self.stashList, [name, date, message]) 158 QTreeWidgetItem(self.stashList, [name, date, message])
153 159
154 def __getStashEntries(self): 160 def __getStashEntries(self):
155 """ 161 """
194 200
195 def start(self, projectDir): 201 def start(self, projectDir):
196 """ 202 """
197 Public slot to start the git stash command. 203 Public slot to start the git stash command.
198 204
199 @param projectDir name of the project directory (string) 205 @param projectDir name of the project directory
206 @type str
200 """ 207 """
201 self.errorGroup.hide() 208 self.errorGroup.hide()
202 QApplication.processEvents() 209 QApplication.processEvents()
203 210
204 self.__projectDir = projectDir 211 self.__projectDir = projectDir
218 @pyqtSlot(int, QProcess.ExitStatus) 225 @pyqtSlot(int, QProcess.ExitStatus)
219 def __procFinished(self, exitCode, exitStatus): 226 def __procFinished(self, exitCode, exitStatus):
220 """ 227 """
221 Private slot connected to the finished signal. 228 Private slot connected to the finished signal.
222 229
223 @param exitCode exit code of the process (integer) 230 @param exitCode exit code of the process
224 @param exitStatus exit status of the process (QProcess.ExitStatus) 231 @type int
232 @param exitStatus exit status of the process
233 @type QProcess.ExitStatus
225 """ 234 """
226 self.__processBuffer() 235 self.__processBuffer()
227 self.__finish() 236 self.__finish()
228 237
229 def __finish(self): 238 def __finish(self):
291 @pyqtSlot(QAbstractButton) 300 @pyqtSlot(QAbstractButton)
292 def on_buttonBox_clicked(self, button): 301 def on_buttonBox_clicked(self, button):
293 """ 302 """
294 Private slot called by a button of the button box clicked. 303 Private slot called by a button of the button box clicked.
295 304
296 @param button button that was clicked (QAbstractButton) 305 @param button button that was clicked
306 @type QAbstractButton
297 """ 307 """
298 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): 308 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close):
299 self.close() 309 self.close()
300 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): 310 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
301 self.cancelled = True 311 self.cancelled = True
306 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) 316 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
307 def on_stashList_currentItemChanged(self, current, previous): 317 def on_stashList_currentItemChanged(self, current, previous):
308 """ 318 """
309 Private slot called, when the current item of the stash list changes. 319 Private slot called, when the current item of the stash list changes.
310 320
311 @param current reference to the new current item (QTreeWidgetItem) 321 @param current reference to the new current item
312 @param previous reference to the old current item (QTreeWidgetItem) 322 @type QTreeWidgetItem
323 @param previous reference to the old current item
324 @type QTreeWidgetItem
313 """ 325 """
314 self.statisticsList.clear() 326 self.statisticsList.clear()
315 self.filesLabel.setText("") 327 self.filesLabel.setText("")
316 self.insertionsLabel.setText("") 328 self.insertionsLabel.setText("")
317 self.deletionsLabel.setText("") 329 self.deletionsLabel.setText("")
393 @pyqtSlot(QPoint) 405 @pyqtSlot(QPoint)
394 def on_stashList_customContextMenuRequested(self, pos): 406 def on_stashList_customContextMenuRequested(self, pos):
395 """ 407 """
396 Private slot to show the context menu of the stash list. 408 Private slot to show the context menu of the stash list.
397 409
398 @param pos position of the mouse pointer (QPoint) 410 @param pos position of the mouse pointer
411 @type QPoint
399 """ 412 """
400 enable = len(self.stashList.selectedItems()) == 1 413 enable = len(self.stashList.selectedItems()) == 1
401 self.__differencesAct.setEnabled(enable) 414 self.__differencesAct.setEnabled(enable)
402 self.__applyAct.setEnabled(enable) 415 self.__applyAct.setEnabled(enable)
403 self.__popAct.setEnabled(enable) 416 self.__popAct.setEnabled(enable)
446 @pyqtSlot(bool) 459 @pyqtSlot(bool)
447 def on_passwordCheckBox_toggled(self, checked): 460 def on_passwordCheckBox_toggled(self, checked):
448 """ 461 """
449 Private slot to handle the password checkbox toggled. 462 Private slot to handle the password checkbox toggled.
450 463
451 @param checked flag indicating the status of the check box (boolean) 464 @param checked flag indicating the status of the check box
465 @type bool
452 """ 466 """
453 if checked: 467 if checked:
454 self.input.setEchoMode(QLineEdit.EchoMode.Password) 468 self.input.setEchoMode(QLineEdit.EchoMode.Password)
455 else: 469 else:
456 self.input.setEchoMode(QLineEdit.EchoMode.Normal) 470 self.input.setEchoMode(QLineEdit.EchoMode.Normal)
457 471
458 def keyPressEvent(self, evt): 472 def keyPressEvent(self, evt):
459 """ 473 """
460 Protected slot to handle a key press event. 474 Protected slot to handle a key press event.
461 475
462 @param evt the key press event (QKeyEvent) 476 @param evt the key press event
477 @type QKeyEvent
463 """ 478 """
464 if self.intercept: 479 if self.intercept:
465 self.intercept = False 480 self.intercept = False
466 evt.accept() 481 evt.accept()
467 return 482 return

eric ide

mercurial