Plugins/VcsPlugins/vcsMercurial/HgMergeDialog.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3366
6084bb3c3911
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
17 17
18 class HgMergeDialog(QDialog, Ui_HgMergeDialog): 18 class HgMergeDialog(QDialog, Ui_HgMergeDialog):
19 """ 19 """
20 Class implementing a dialog to enter the data for a merge operation. 20 Class implementing a dialog to enter the data for a merge operation.
21 """ 21 """
22 def __init__(self, force, tagsList, branchesList, bookmarksList=None, 22 def __init__(self, tagsList, branchesList, bookmarksList=None,
23 parent=None): 23 parent=None):
24 """ 24 """
25 Constructor 25 Constructor
26 26
27 @param force flag indicating a forced merge (boolean)
28 @param tagsList list of tags (list of strings) 27 @param tagsList list of tags (list of strings)
29 @param branchesList list of branches (list of strings) 28 @param branchesList list of branches (list of strings)
30 @param bookmarksList list of bookmarks (list of strings) 29 @param bookmarksList list of bookmarks (list of strings)
31 @param parent parent widget (QWidget) 30 @param parent parent widget (QWidget)
32 """ 31 """
33 super(HgMergeDialog, self).__init__(parent) 32 super(HgMergeDialog, self).__init__(parent)
34 self.setupUi(self) 33 self.setupUi(self)
35 34
36 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 35 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
37 36
38 self.forceCheckBox.setChecked(force)
39 self.tagCombo.addItems(sorted(tagsList)) 37 self.tagCombo.addItems(sorted(tagsList))
40 self.branchCombo.addItems(["default"] + sorted(branchesList)) 38 self.branchCombo.addItems(["default"] + sorted(branchesList))
41 if bookmarksList is not None: 39 if bookmarksList is not None:
42 self.bookmarkCombo.addItems(sorted(bookmarksList)) 40 self.bookmarkCombo.addItems(sorted(bookmarksList))
43 else: 41 else:
44 self.bookmarkButton.setHidden(True) 42 self.bookmarkButton.setHidden(True)
45 self.bookmarkCombo.setHidden(True) 43 self.bookmarkCombo.setHidden(True)
44
45 msh = self.minimumSizeHint()
46 self.resize(max(self.width(), msh.width()), msh.height())
46 47
47 def __updateOK(self): 48 def __updateOK(self):
48 """ 49 """
49 Private slot to update the OK button. 50 Private slot to update the OK button.
50 """ 51 """
138 139
139 @return tuple naming the revision and a flag indicating a 140 @return tuple naming the revision and a flag indicating a
140 forced merge (string, boolean) 141 forced merge (string, boolean)
141 """ 142 """
142 if self.numberButton.isChecked(): 143 if self.numberButton.isChecked():
143 rev = str(self.numberSpinBox.value()) 144 rev = "rev({0})".format(self.numberSpinBox.value())
144 elif self.idButton.isChecked(): 145 elif self.idButton.isChecked():
145 rev = self.idEdit.text() 146 rev = "id({0})".format(self.idEdit.text())
146 elif self.tagButton.isChecked(): 147 elif self.tagButton.isChecked():
147 rev = self.tagCombo.currentText() 148 rev = self.tagCombo.currentText()
148 elif self.branchButton.isChecked(): 149 elif self.branchButton.isChecked():
149 rev = self.branchCombo.currentText() 150 rev = self.branchCombo.currentText()
150 elif self.bookmarkButton.isChecked(): 151 elif self.bookmarkButton.isChecked():

eric ide

mercurial