eric6/Plugins/VcsPlugins/vcsPySvn/SvnMergeDialog.py

changeset 7775
4a1db75550bd
parent 7360
9190402e4505
child 7923
91e843545d9a
equal deleted inserted replaced
7774:9eed155411f0 7775:4a1db75550bd
5 5
6 """ 6 """
7 Module implementing a dialog to enter the data for a merge operation. 7 Module implementing a dialog to enter the data for a merge operation.
8 """ 8 """
9 9
10 import re
10 11
11 from PyQt5.QtCore import QRegExp
12 from PyQt5.QtWidgets import QDialog, QDialogButtonBox 12 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
13 13
14 from .Ui_SvnMergeDialog import Ui_SvnMergeDialog 14 from .Ui_SvnMergeDialog import Ui_SvnMergeDialog
15 15
16 16
37 self.forceCheckBox.setChecked(force) 37 self.forceCheckBox.setChecked(force)
38 38
39 self.okButton = self.buttonBox.button(QDialogButtonBox.Ok) 39 self.okButton = self.buttonBox.button(QDialogButtonBox.Ok)
40 self.okButton.setEnabled(False) 40 self.okButton.setEnabled(False)
41 41
42 self.rx_url = QRegExp('(?:file:|svn:|svn+ssh:|http:|https:)//.+') 42 self.rx_url = re.compile('(?:file:|svn:|svn+ssh:|http:|https:)//.+')
43 self.rx_rev = QRegExp('\\d+') 43 self.rx_rev = re.compile('\\d+')
44 44
45 self.tag1Combo.clear() 45 self.tag1Combo.clear()
46 self.tag1Combo.addItems(mergelist1) 46 self.tag1Combo.addItems(mergelist1)
47 self.tag2Combo.clear() 47 self.tag2Combo.clear()
48 self.tag2Combo.addItems(mergelist2) 48 self.tag2Combo.addItems(mergelist2)
57 Private method used to enable/disable the OK-button. 57 Private method used to enable/disable the OK-button.
58 """ 58 """
59 self.okButton.setDisabled( 59 self.okButton.setDisabled(
60 self.tag1Combo.currentText() == "" or 60 self.tag1Combo.currentText() == "" or
61 self.tag2Combo.currentText() == "" or 61 self.tag2Combo.currentText() == "" or
62 not ((self.rx_url.exactMatch(self.tag1Combo.currentText()) and 62 not (
63 self.rx_url.exactMatch(self.tag2Combo.currentText())) or 63 (bool(self.rx_url.fullmatch(self.tag1Combo.currentText())) and
64 (self.rx_rev.exactMatch(self.tag1Combo.currentText()) and 64 bool(self.rx_url.fullmatch(self.tag2Combo.currentText()))) or
65 self.rx_rev.exactMatch(self.tag2Combo.currentText())) 65 (bool(self.rx_rev.fullmatch(self.tag1Combo.currentText())) and
66 ) 66 bool(self.rx_rev.fullmatch(self.tag2Combo.currentText())))
67 )
67 ) 68 )
68 69
69 def on_tag1Combo_editTextChanged(self, text): 70 def on_tag1Combo_editTextChanged(self, text):
70 """ 71 """
71 Private slot to handle the tag1Combo editTextChanged signal. 72 Private slot to handle the tag1Combo editTextChanged signal.

eric ide

mercurial