Plugins/VcsPlugins/vcsMercurial/HgMultiRevisionSelectionDialog.py

Mon, 25 Mar 2013 03:11:06 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Mon, 25 Mar 2013 03:11:06 +0100
branch
Py2 comp.
changeset 2525
8b507a9a2d40
parent 2302
f29e9405c851
child 3057
10516539f238
permissions
-rw-r--r--

Script changes: Future import added, super calls modified and unicode behavior for str.

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
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from .Ui_HgMultiRevisionSelectionDialog import Ui_HgMultiRevisionSelectionDialog
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
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 class HgMultiRevisionSelectionDialog(QDialog, Ui_HgMultiRevisionSelectionDialog):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 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
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 def __init__(self, tagsList, branchesList, bookmarksList=None, emptyRevsOk=False,
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 showLimit=False, limitDefault=100, parent=None):
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 Constructor
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 @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
28 @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
29 @param bookmarksList list of bookmarks (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
30 @param emptyRevsOk flag indicating that it is ok to not enter revisions (boolean)
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 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
32 @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
33 @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
34 """
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
35 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
36 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
37
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 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
39
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.__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
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.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
43 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
44 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
45 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
46 else:
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.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
48 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
49
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 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
51 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
52
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 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
54 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 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
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 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
58 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
59 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
60 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
61 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
62 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
63 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
64 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
65 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
66 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
67 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
68
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 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
70
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 @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
72 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
73 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 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
75
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 @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
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 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
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 @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
81 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
82 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 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
84
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 @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
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 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
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 @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
90 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
91 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 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
93
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 @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
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 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
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 @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
99 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
100 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 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
102
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 @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
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 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
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 @pyqtSlot()
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 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
109 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 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
111
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 @param txt text of the edit (string)
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 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
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 @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
117 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
118 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 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
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 @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
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 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
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 @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
126 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
127 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 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
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 @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
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 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
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 @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
135 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
136 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 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
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 @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
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 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
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 @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
144 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
145 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 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
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 @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
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 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
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 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
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 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
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 @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
157 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
158 """
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 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
160 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
161 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
162 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
163 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
164 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
165 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
166 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
167 else:
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 = []
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 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
171 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
172 else:
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 = 0
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174
442c748018c5 Added code to the Mercurial plug-in to support multiple revisions where appropriate.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 return revs, limit

eric ide

mercurial