Plugins/VcsPlugins/vcsMercurial/HgMultiRevisionSelectionDialog.py

Fri, 18 Oct 2013 23:00:41 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Fri, 18 Oct 2013 23:00:41 +0200
branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3008
7848489bcb92
child 3060
5883ce99ee12
permissions
-rw-r--r--

Merge with default branch after shorten the code lines to max. 79 characters.

1274
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
2302
f29e9405c851 Updated copyright for 2013.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
3 # Copyright (c) 2011 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
1274
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to select revisions.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
10 from __future__ import unicode_literals # __IGNORE_WARNING__
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
11
1274
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from PyQt4.QtCore import pyqtSlot
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from PyQt4.QtGui import QDialog, QDialogButtonBox
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
15 from .Ui_HgMultiRevisionSelectionDialog import \
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
16 Ui_HgMultiRevisionSelectionDialog
1274
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
19 class HgMultiRevisionSelectionDialog(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
20 QDialog, Ui_HgMultiRevisionSelectionDialog):
1274
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Class implementing a dialog to select revisions.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
24 def __init__(self, tagsList, branchesList, bookmarksList=None,
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
25 emptyRevsOk=False, showLimit=False, limitDefault=100,
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
26 parent=None):
1274
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 Constructor
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @param tagsList list of tags (list of strings)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 @param branchesList list of branches (list of strings)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 @param bookmarksList list of bookmarks (list of strings)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
33 @param emptyRevsOk flag indicating that it is ok to not enter
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
34 revisions (boolean)
1274
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param showLimit flag indicating to show the limit entry (boolean)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 @param limitDefault default value for the limit (integer)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 @param parent parent widget (QWidget)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
39 super(HgMultiRevisionSelectionDialog, self).__init__(parent)
1274
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.setupUi(self)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.__emptyRevsOk = emptyRevsOk
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.tagCombo.addItems(sorted(tagsList))
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.branchCombo.addItems(["default"] + sorted(branchesList))
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 if bookmarksList is not None:
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.bookmarkCombo.addItems(sorted(bookmarksList))
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 else:
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.bookmarkButton.setHidden(True)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.bookmarkCombo.setHidden(True)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.limitSpinBox.setValue(limitDefault)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 self.limitGroup.setVisible(showLimit)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 def __updateOK(self):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 Private slot to update the OK button.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 enabled = True
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 if self.changesetsButton.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 enabled = self.changesetsEdit.toPlainText() != ""
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 elif self.tagButton.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 enabled = self.tagCombo.currentText() != ""
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 elif self.branchButton.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 enabled = self.branchCombo.currentText() != ""
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 elif self.bookmarkButton.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 enabled = self.bookmarkCombo.currentText() != ""
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 if not enabled and self.__emptyRevsOk:
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 enabled = self.limitGroup.isChecked()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enabled)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 @pyqtSlot(bool)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 def on_changesetsButton_toggled(self, checked):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 Private slot to handle changes of the Changesets select button.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 @param checked state of the button (boolean)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 @pyqtSlot(bool)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 def on_tagButton_toggled(self, checked):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 Private slot to handle changes of the Tag select button.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 @param checked state of the button (boolean)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 @pyqtSlot(bool)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 def on_branchButton_toggled(self, checked):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 Private slot to handle changes of the Branch select button.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 @param checked state of the button (boolean)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 @pyqtSlot(bool)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 def on_bookmarkButton_toggled(self, checked):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 Private slot to handle changes of the Bookmark select button.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 @param checked state of the button (boolean)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 @pyqtSlot()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 def on_changesetsEdit_textChanged(self):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 Private slot to handle changes of the Changesets edit.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 @pyqtSlot(str)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 def on_tagCombo_editTextChanged(self, txt):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 Private slot to handle changes of the Tag combo.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 @param txt text of the combo (string)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 @pyqtSlot(str)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 def on_branchCombo_editTextChanged(self, txt):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 Private slot to handle changes of the Branch combo.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 @param txt text of the combo (string)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 @pyqtSlot(str)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 def on_bookmarkCombo_editTextChanged(self, txt):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 Private slot to handle changes of the Bookmark combo.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 @param txt text of the combo (string)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 @pyqtSlot(bool)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 def on_limitGroup_toggled(self, checked):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 Private slot to handle changes of the Limit Results group status.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 @param checked state of the group (boolean)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 self.__updateOK()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 def getRevisions(self):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 Public method to retrieve the selected revisions.
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 @return tuple of selected revisions (list of strings) and number
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 of entries to be shown (integer)
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 if self.changesetsButton.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 revs = self.changesetsEdit.toPlainText().strip().splitlines()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 elif self.tagButton.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 revs = [self.tagCombo.currentText()]
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 elif self.branchButton.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 revs = [self.branchCombo.currentText()]
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 elif self.bookmarkButton.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 revs = [self.bookmarkCombo.currentText()]
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 else:
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 revs = []
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 if self.limitGroup.isChecked():
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 limit = self.limitSpinBox.value()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 else:
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 limit = 0
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 return revs, limit

eric ide

mercurial