Wed, 02 Jan 2013 10:31:48 +0100
Updated copyright for 2013.
1274
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

1  # * coding: utf8 * 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

2  
2302
f29e9405c851
Updated copyright for 2013.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
1509
diff
changeset

3  # Copyright (c) 2011  2013 Detlev Offenbach <detlev@dieoffenbachs.de> 
1274
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

4  # 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

5  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

6  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

7  Module implementing a dialog to select revisions. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

8  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

9  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

10  from PyQt4.QtCore import pyqtSlot 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

11  from PyQt4.QtGui import QDialog, QDialogButtonBox 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

12  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

13  from .Ui_HgMultiRevisionSelectionDialog import Ui_HgMultiRevisionSelectionDialog 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

14  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

15  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

16  class HgMultiRevisionSelectionDialog(QDialog, Ui_HgMultiRevisionSelectionDialog): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

17  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

18  Class implementing a dialog to select revisions. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

19  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

20  def __init__(self, tagsList, branchesList, bookmarksList=None, emptyRevsOk=False, 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

21  showLimit=False, limitDefault=100, parent=None): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

22  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

23  Constructor 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

24  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

25  @param tagsList list of tags (list of strings) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

26  @param branchesList list of branches (list of strings) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

27  @param bookmarksList list of bookmarks (list of strings) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

28  @param emptyRevsOk flag indicating that it is ok to not enter revisions (boolean) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

29  @param showLimit flag indicating to show the limit entry (boolean) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

30  @param limitDefault default value for the limit (integer) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

31  @param parent parent widget (QWidget) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

32  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

33  super().__init__(parent) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

34  self.setupUi(self) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

35  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

36  self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

37  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

38  self.__emptyRevsOk = emptyRevsOk 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

39  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

40  self.tagCombo.addItems(sorted(tagsList)) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

41  self.branchCombo.addItems(["default"] + sorted(branchesList)) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

42  if bookmarksList is not None: 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

43  self.bookmarkCombo.addItems(sorted(bookmarksList)) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

44  else: 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

45  self.bookmarkButton.setHidden(True) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

46  self.bookmarkCombo.setHidden(True) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

47  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

48  self.limitSpinBox.setValue(limitDefault) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

49  self.limitGroup.setVisible(showLimit) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

50  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

51  def __updateOK(self): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

52  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

53  Private slot to update the OK button. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

54  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

55  enabled = True 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

56  if self.changesetsButton.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

57  enabled = self.changesetsEdit.toPlainText() != "" 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

58  elif self.tagButton.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

59  enabled = self.tagCombo.currentText() != "" 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

60  elif self.branchButton.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

61  enabled = self.branchCombo.currentText() != "" 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

62  elif self.bookmarkButton.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

63  enabled = self.bookmarkCombo.currentText() != "" 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

64  if not enabled and self.__emptyRevsOk: 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

65  enabled = self.limitGroup.isChecked() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

66  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

67  self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enabled) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

68  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

69  @pyqtSlot(bool) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

70  def on_changesetsButton_toggled(self, checked): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

71  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

72  Private slot to handle changes of the Changesets select button. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

73  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

74  @param checked state of the button (boolean) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

75  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

76  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

77  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

78  @pyqtSlot(bool) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

79  def on_tagButton_toggled(self, checked): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

80  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

81  Private slot to handle changes of the Tag select button. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

82  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

83  @param checked state of the button (boolean) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

84  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

85  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

86  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

87  @pyqtSlot(bool) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

88  def on_branchButton_toggled(self, checked): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

89  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

90  Private slot to handle changes of the Branch select button. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

91  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

92  @param checked state of the button (boolean) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

93  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

94  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

95  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

96  @pyqtSlot(bool) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

97  def on_bookmarkButton_toggled(self, checked): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

98  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

99  Private slot to handle changes of the Bookmark select button. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

100  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

101  @param checked state of the button (boolean) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

102  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

103  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

104  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

105  @pyqtSlot() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

106  def on_changesetsEdit_textChanged(self): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

107  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

108  Private slot to handle changes of the Changesets edit. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

109  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

110  @param txt text of the edit (string) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

111  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

112  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

113  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

114  @pyqtSlot(str) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

115  def on_tagCombo_editTextChanged(self, txt): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

116  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

117  Private slot to handle changes of the Tag combo. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

118  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

119  @param txt text of the combo (string) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

120  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

121  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

122  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

123  @pyqtSlot(str) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

124  def on_branchCombo_editTextChanged(self, txt): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

125  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

126  Private slot to handle changes of the Branch combo. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

127  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

128  @param txt text of the combo (string) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

129  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

130  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

131  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

132  @pyqtSlot(str) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

133  def on_bookmarkCombo_editTextChanged(self, txt): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

134  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

135  Private slot to handle changes of the Bookmark combo. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

136  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

137  @param txt text of the combo (string) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

138  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

139  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

140  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

141  @pyqtSlot(bool) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

142  def on_limitGroup_toggled(self, checked): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

143  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

144  Private slot to handle changes of the Limit Results group status. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

145  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

146  @param checked state of the group (boolean) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

147  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

148  self.__updateOK() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

149  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

150  def getRevisions(self): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

151  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

152  Public method to retrieve the selected revisions. 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

153  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

154  @return tuple of selected revisions (list of strings) and number 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

155  of entries to be shown (integer) 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

156  """ 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

157  if self.changesetsButton.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

158  revs = self.changesetsEdit.toPlainText().strip().splitlines() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

159  elif self.tagButton.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

160  revs = [self.tagCombo.currentText()] 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

161  elif self.branchButton.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

162  revs = [self.branchCombo.currentText()] 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

163  elif self.bookmarkButton.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

164  revs = [self.bookmarkCombo.currentText()] 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

165  else: 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

166  revs = [] 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

167  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

168  if self.limitGroup.isChecked(): 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

169  limit = self.limitSpinBox.value() 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

170  else: 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

171  limit = 0 
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

172  
442c748018c5
Added code to the Mercurial plugin to support multiple revisions where appropriate.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

173  return revs, limit 