Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py

changeset 2845
7e55c6268c35
parent 2771
281c9b30dd91
child 2847
1843ef6e2656
child 2848
15c84f1f745a
equal deleted inserted replaced
2844:a61ee61b1c2c 2845:7e55c6268c35
22 22
23 class SvnLogBrowserDialog(QDialog, Ui_SvnLogBrowserDialog): 23 class SvnLogBrowserDialog(QDialog, Ui_SvnLogBrowserDialog):
24 """ 24 """
25 Class implementing a dialog to browse the log history. 25 Class implementing a dialog to browse the log history.
26 """ 26 """
27 def __init__(self, vcs, parent=None): 27 def __init__(self, vcs, isFile=False, parent=None):
28 """ 28 """
29 Constructor 29 Constructor
30 30
31 @param vcs reference to the vcs object 31 @param vcs reference to the vcs object
32 @param isFile flag indicating log for a file is to be shown (boolean)
32 @param parent parent widget (QWidget) 33 @param parent parent widget (QWidget)
33 """ 34 """
34 super().__init__(parent) 35 super().__init__(parent)
35 self.setupUi(self) 36 self.setupUi(self)
36 37
37 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 38 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
38 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 39 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
39 40
40 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "") 41 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "")
41 self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder) 42 self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder)
43
44 self.sbsCheckBox.setEnabled(isFile)
42 45
43 self.vcs = vcs 46 self.vcs = vcs
44 47
45 self.__maxDate = QDate() 48 self.__maxDate = QDate()
46 self.__minDate = QDate() 49 self.__minDate = QDate()
409 Private method to do a diff of two revisions. 412 Private method to do a diff of two revisions.
410 413
411 @param rev1 first revision number (integer) 414 @param rev1 first revision number (integer)
412 @param rev2 second revision number (integer) 415 @param rev2 second revision number (integer)
413 """ 416 """
414 if self.diff is None: 417 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked():
415 from .SvnDiffDialog import SvnDiffDialog 418 self.vcs.svnSbsDiff(self.filename, revisions=(str(rev1), str(rev2)))
416 self.diff = SvnDiffDialog(self.vcs) 419 else:
417 self.diff.show() 420 if self.diff is None:
418 self.diff.raise_() 421 from .SvnDiffDialog import SvnDiffDialog
419 self.diff.start(self.filename, [rev1, rev2]) 422 self.diff = SvnDiffDialog(self.vcs)
423 self.diff.show()
424 self.diff.raise_()
425 self.diff.start(self.filename, [rev1, rev2])
420 426
421 def on_buttonBox_clicked(self, button): 427 def on_buttonBox_clicked(self, button):
422 """ 428 """
423 Private slot called by a button of the button box clicked. 429 Private slot called by a button of the button box clicked.
424 430

eric ide

mercurial