src/eric7/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
37 def __init__(self, vcs, parent=None): 37 def __init__(self, vcs, parent=None):
38 """ 38 """
39 Constructor 39 Constructor
40 40
41 @param vcs reference to the vcs object 41 @param vcs reference to the vcs object
42 @param parent parent widget (QWidget) 42 @type Subversion
43 @param parent parent widget
44 @type QWidget
43 """ 45 """
44 super().__init__(parent) 46 super().__init__(parent)
45 self.setupUi(self) 47 self.setupUi(self)
46 48
47 self.__position = QPoint() 49 self.__position = QPoint()
132 134
133 def closeEvent(self, e): 135 def closeEvent(self, e):
134 """ 136 """
135 Protected slot implementing a close event handler. 137 Protected slot implementing a close event handler.
136 138
137 @param e close event (QCloseEvent) 139 @param e close event
140 @type QCloseEvent
138 """ 141 """
139 if ( 142 if (
140 self.__process is not None 143 self.__process is not None
141 and self.__process.state() != QProcess.ProcessState.NotRunning 144 and self.__process.state() != QProcess.ProcessState.NotRunning
142 ): 145 ):
209 212
210 def __generateLogItem(self, author, date, message, revision, changedPaths): 213 def __generateLogItem(self, author, date, message, revision, changedPaths):
211 """ 214 """
212 Private method to generate a log tree entry. 215 Private method to generate a log tree entry.
213 216
214 @param author author info (string) 217 @param author author info
215 @param date date info (string) 218 @type str
216 @param message text of the log message (list of strings) 219 @param date date info
217 @param revision revision info (string) 220 @type str
221 @param message text of the log message
222 @type list of str
223 @param revision revision info
224 @type str
218 @param changedPaths list of dictionary objects containing 225 @param changedPaths list of dictionary objects containing
219 info about the changed files/directories 226 info about the changed files/directories
220 @return reference to the generated item (QTreeWidgetItem) 227 @type dict
228 @return reference to the generated item
229 @rtype QTreeWidgetItem
221 """ 230 """
222 msg = [] 231 msg = []
223 for line in message: 232 for line in message:
224 msg.append(line.strip()) 233 msg.append(line.strip())
225 234
248 def __generateFileItem(self, action, path, copyFrom, copyRev): 257 def __generateFileItem(self, action, path, copyFrom, copyRev):
249 """ 258 """
250 Private method to generate a changed files tree entry. 259 Private method to generate a changed files tree entry.
251 260
252 @param action indicator for the change action ("A", "D" or "M") 261 @param action indicator for the change action ("A", "D" or "M")
253 @param path path of the file in the repository (string) 262 @type str
254 @param copyFrom path the file was copied from (None, string) 263 @param path path of the file in the repository
255 @param copyRev revision the file was copied from (None, string) 264 @type str
256 @return reference to the generated item (QTreeWidgetItem) 265 @param copyFrom path the file was copied from
266 @type str
267 @param copyRev revision the file was copied from
268 @type str
269 @return reference to the generated item
270 @rtype QTreeWidgetItem
257 """ 271 """
258 itm = QTreeWidgetItem( 272 itm = QTreeWidgetItem(
259 self.filesTree, 273 self.filesTree,
260 [ 274 [
261 self.flags[action], 275 self.flags[action],
271 285
272 def __getLogEntries(self, startRev=None): 286 def __getLogEntries(self, startRev=None):
273 """ 287 """
274 Private method to retrieve log entries from the repository. 288 Private method to retrieve log entries from the repository.
275 289
276 @param startRev revision number to start from (integer, string) 290 @param startRev revision number to start from
291 @type int or str
277 """ 292 """
278 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False) 293 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False)
279 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(True) 294 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(True)
280 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True) 295 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True)
281 QApplication.processEvents() 296 QApplication.processEvents()
322 337
323 def start(self, fn, isFile=False): 338 def start(self, fn, isFile=False):
324 """ 339 """
325 Public slot to start the svn log command. 340 Public slot to start the svn log command.
326 341
327 @param fn filename to show the log for (string) 342 @param fn filename to show the log for
343 @type str
328 @param isFile flag indicating log for a file is to be shown 344 @param isFile flag indicating log for a file is to be shown
329 (boolean) 345 @type bool
330 """ 346 """
331 self.sbsCheckBox.setEnabled(isFile) 347 self.sbsCheckBox.setEnabled(isFile)
332 self.sbsCheckBox.setVisible(isFile) 348 self.sbsCheckBox.setVisible(isFile)
333 349
334 self.errorGroup.hide() 350 self.errorGroup.hide()
349 @pyqtSlot(int, QProcess.ExitStatus) 365 @pyqtSlot(int, QProcess.ExitStatus)
350 def __procFinished(self, exitCode, exitStatus): 366 def __procFinished(self, exitCode, exitStatus):
351 """ 367 """
352 Private slot connected to the finished signal. 368 Private slot connected to the finished signal.
353 369
354 @param exitCode exit code of the process (integer) 370 @param exitCode exit code of the process
355 @param exitStatus exit status of the process (QProcess.ExitStatus) 371 @type int
372 @param exitStatus exit status of the process
373 @type QProcess.ExitStatus
356 """ 374 """
357 self.__processBuffer() 375 self.__processBuffer()
358 self.__finish() 376 self.__finish()
359 377
360 def __finish(self): 378 def __finish(self):
508 526
509 def __diffRevisions(self, rev1, rev2): 527 def __diffRevisions(self, rev1, rev2):
510 """ 528 """
511 Private method to do a diff of two revisions. 529 Private method to do a diff of two revisions.
512 530
513 @param rev1 first revision number (integer) 531 @param rev1 first revision number
514 @param rev2 second revision number (integer) 532 @type int
533 @param rev2 second revision number
534 @type int
515 """ 535 """
516 from .SvnDiffDialog import SvnDiffDialog 536 from .SvnDiffDialog import SvnDiffDialog
517 537
518 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked(): 538 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked():
519 self.vcs.vcsSbsDiff(self.filename, revisions=(str(rev1), str(rev2))) 539 self.vcs.vcsSbsDiff(self.filename, revisions=(str(rev1), str(rev2)))
526 546
527 def on_buttonBox_clicked(self, button): 547 def on_buttonBox_clicked(self, button):
528 """ 548 """
529 Private slot called by a button of the button box clicked. 549 Private slot called by a button of the button box clicked.
530 550
531 @param button button that was clicked (QAbstractButton) 551 @param button button that was clicked
552 @type QAbstractButton
532 """ 553 """
533 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): 554 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close):
534 self.close() 555 self.close()
535 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): 556 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
536 self.cancelled = True 557 self.cancelled = True
539 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) 560 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
540 def on_logTree_currentItemChanged(self, current, previous): 561 def on_logTree_currentItemChanged(self, current, previous):
541 """ 562 """
542 Private slot called, when the current item of the log tree changes. 563 Private slot called, when the current item of the log tree changes.
543 564
544 @param current reference to the new current item (QTreeWidgetItem) 565 @param current reference to the new current item
545 @param previous reference to the old current item (QTreeWidgetItem) 566 @type QTreeWidgetItem
567 @param previous reference to the old current item
568 @type QTreeWidgetItem
546 """ 569 """
547 if current is not None: 570 if current is not None:
548 self.messageEdit.clear() 571 self.messageEdit.clear()
549 for line in current.data(0, self.__messageRole): 572 for line in current.data(0, self.__messageRole):
550 self.messageEdit.append(line.strip()) 573 self.messageEdit.append(line.strip())
629 @pyqtSlot(QDate) 652 @pyqtSlot(QDate)
630 def on_fromDate_dateChanged(self, date): 653 def on_fromDate_dateChanged(self, date):
631 """ 654 """
632 Private slot called, when the from date changes. 655 Private slot called, when the from date changes.
633 656
634 @param date new date (QDate) 657 @param date new date
658 @type QDate
635 """ 659 """
636 self.__filterLogs() 660 self.__filterLogs()
637 661
638 @pyqtSlot(QDate) 662 @pyqtSlot(QDate)
639 def on_toDate_dateChanged(self, date): 663 def on_toDate_dateChanged(self, date):
640 """ 664 """
641 Private slot called, when the from date changes. 665 Private slot called, when the from date changes.
642 666
643 @param date new date (QDate) 667 @param date new date
668 @type QDate
644 """ 669 """
645 self.__filterLogs() 670 self.__filterLogs()
646 671
647 @pyqtSlot(int) 672 @pyqtSlot(int)
648 def on_fieldCombo_activated(self, index): 673 def on_fieldCombo_activated(self, index):
657 @pyqtSlot(str) 682 @pyqtSlot(str)
658 def on_rxEdit_textChanged(self, txt): 683 def on_rxEdit_textChanged(self, txt):
659 """ 684 """
660 Private slot called, when a filter expression is entered. 685 Private slot called, when a filter expression is entered.
661 686
662 @param txt filter expression (string) 687 @param txt filter expression
688 @type str
663 """ 689 """
664 self.__filterLogs() 690 self.__filterLogs()
665 691
666 def __filterLogs(self): 692 def __filterLogs(self):
667 """ 693 """
705 @pyqtSlot(bool) 731 @pyqtSlot(bool)
706 def on_stopCheckBox_clicked(self, checked): 732 def on_stopCheckBox_clicked(self, checked):
707 """ 733 """
708 Private slot called, when the stop on copy/move checkbox is clicked. 734 Private slot called, when the stop on copy/move checkbox is clicked.
709 735
710 @param checked flag indicating the checked state (boolean) 736 @param checked flag indicating the checked state
737 @type bool
711 """ 738 """
712 self.vcs.getPlugin().setPreferences( 739 self.vcs.getPlugin().setPreferences(
713 "StopLogOnCopy", self.stopCheckBox.isChecked() 740 "StopLogOnCopy", self.stopCheckBox.isChecked()
714 ) 741 )
715 self.nextButton.setEnabled(True) 742 self.nextButton.setEnabled(True)
739 766
740 def on_passwordCheckBox_toggled(self, isOn): 767 def on_passwordCheckBox_toggled(self, isOn):
741 """ 768 """
742 Private slot to handle the password checkbox toggled. 769 Private slot to handle the password checkbox toggled.
743 770
744 @param isOn flag indicating the status of the check box (boolean) 771 @param isOn flag indicating the status of the check box
772 @type bool
745 """ 773 """
746 if isOn: 774 if isOn:
747 self.input.setEchoMode(QLineEdit.EchoMode.Password) 775 self.input.setEchoMode(QLineEdit.EchoMode.Password)
748 else: 776 else:
749 self.input.setEchoMode(QLineEdit.EchoMode.Normal) 777 self.input.setEchoMode(QLineEdit.EchoMode.Normal)
778 806
779 def keyPressEvent(self, evt): 807 def keyPressEvent(self, evt):
780 """ 808 """
781 Protected slot to handle a key press event. 809 Protected slot to handle a key press event.
782 810
783 @param evt the key press event (QKeyEvent) 811 @param evt the key press event
812 @type QKeyEvent
784 """ 813 """
785 if self.intercept: 814 if self.intercept:
786 self.intercept = False 815 self.intercept = False
787 evt.accept() 816 evt.accept()
788 return 817 return

eric ide

mercurial