Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 2841
1f79e88f18b7
parent 2838
0f1423054184
child 2847
1843ef6e2656
child 2848
15c84f1f745a
equal deleted inserted replaced
2840:10a133f3a5e8 2841:1f79e88f18b7
39 AuthorColumn = 4 39 AuthorColumn = 4
40 DateColumn = 5 40 DateColumn = 5
41 MessageColumn = 6 41 MessageColumn = 6
42 TagsColumn = 7 42 TagsColumn = 7
43 43
44 def __init__(self, vcs, mode="log", bundle=None, parent=None): 44 def __init__(self, vcs, mode="log", bundle=None, isFile=False, parent=None):
45 """ 45 """
46 Constructor 46 Constructor
47 47
48 @param vcs reference to the vcs object 48 @param vcs reference to the vcs object
49 @param mode mode of the dialog (string; one of log, incoming, outgoing) 49 @param mode mode of the dialog (string; one of log, incoming, outgoing)
50 @param bundle name of a bundle file (string) 50 @param bundle name of a bundle file (string)
51 @param isFile flag indicating log for a file is to be shown (boolean)
51 @param parent parent widget (QWidget) 52 @param parent parent widget (QWidget)
52 """ 53 """
53 super().__init__(parent) 54 super().__init__(parent)
54 self.setupUi(self) 55 self.setupUi(self)
55 56
69 self.refreshButton = \ 70 self.refreshButton = \
70 self.buttonBox.addButton(self.trUtf8("&Refresh"), QDialogButtonBox.ActionRole) 71 self.buttonBox.addButton(self.trUtf8("&Refresh"), QDialogButtonBox.ActionRole)
71 self.refreshButton.setToolTip( 72 self.refreshButton.setToolTip(
72 self.trUtf8("Press to refresh the list of changesets")) 73 self.trUtf8("Press to refresh the list of changesets"))
73 self.refreshButton.setEnabled(False) 74 self.refreshButton.setEnabled(False)
75
76 self.sbsCheckBox.setEnabled(isFile)
74 77
75 self.vcs = vcs 78 self.vcs = vcs
76 if mode in ("log", "incoming", "outgoing"): 79 if mode in ("log", "incoming", "outgoing"):
77 self.commandMode = mode 80 self.commandMode = mode
78 self.initialCommandMode = mode 81 self.initialCommandMode = mode
951 Private method to do a diff of two revisions. 954 Private method to do a diff of two revisions.
952 955
953 @param rev1 first revision number (integer) 956 @param rev1 first revision number (integer)
954 @param rev2 second revision number (integer) 957 @param rev2 second revision number (integer)
955 """ 958 """
956 # TODO: add SBS option (file mode only) 959 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked():
957 if self.diff is None: 960 self.vcs.hgSbsDiff(self.filename, revisions=(str(rev1), str(rev2)))
958 from .HgDiffDialog import HgDiffDialog 961 else:
959 self.diff = HgDiffDialog(self.vcs) 962 if self.diff is None:
960 self.diff.show() 963 from .HgDiffDialog import HgDiffDialog
961 self.diff.raise_() 964 self.diff = HgDiffDialog(self.vcs)
962 self.diff.start(self.filename, [rev1, rev2], self.bundle) 965 self.diff.show()
966 self.diff.raise_()
967 self.diff.start(self.filename, [rev1, rev2], self.bundle)
963 968
964 def on_buttonBox_clicked(self, button): 969 def on_buttonBox_clicked(self, button):
965 """ 970 """
966 Private slot called by a button of the button box clicked. 971 Private slot called by a button of the button box clicked.
967 972

eric ide

mercurial