eric6/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.py

changeset 7396
c6399bce2c0b
parent 7360
9190402e4505
child 7414
d02ed92ef3b2
equal deleted inserted replaced
7395:dd50d0f4c588 7396:c6399bce2c0b
18 18
19 class HgImportDialog(QDialog, Ui_HgImportDialog): 19 class HgImportDialog(QDialog, Ui_HgImportDialog):
20 """ 20 """
21 Class implementing a dialog to enter data for the Mercurial import command. 21 Class implementing a dialog to enter data for the Mercurial import command.
22 """ 22 """
23 def __init__(self, parent=None): 23 def __init__(self, vcs, parent=None):
24 """ 24 """
25 Constructor 25 Constructor
26 26
27 @param parent reference to the parent widget (QWidget) 27 @param vcs reference to the VCS object
28 @type Hg
29 @param parent reference to the parent widget
30 @type QWidget
28 """ 31 """
29 super(HgImportDialog, self).__init__(parent) 32 super(HgImportDialog, self).__init__(parent)
30 self.setupUi(self) 33 self.setupUi(self)
31 34
32 self.patchFilePicker.setMode(E5PathPickerModes.OpenFileMode) 35 self.patchFilePicker.setMode(E5PathPickerModes.OpenFileMode)
33 self.patchFilePicker.setFilters(self.tr( 36 self.patchFilePicker.setFilters(self.tr(
34 "Patch Files (*.diff *.patch);;All Files (*)")) 37 "Patch Files (*.diff *.patch);;All Files (*)"))
38
39 self.secretCheckBox.setEnabled(vcs.version >= (5, 3, 0))
35 40
36 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 41 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
37 42
38 self.__initDateTime = QDateTime.currentDateTime() 43 self.__initDateTime = QDateTime.currentDateTime()
39 self.dateEdit.setDateTime(self.__initDateTime) 44 self.dateEdit.setDateTime(self.__initDateTime)
60 def getParameters(self): 65 def getParameters(self):
61 """ 66 """
62 Public method to retrieve the import data. 67 Public method to retrieve the import data.
63 68
64 @return tuple naming the patch file, a flag indicating to not commit, 69 @return tuple naming the patch file, a flag indicating to not commit,
65 a commit message, a commit date, a commit user, a strip count and 70 a commit message, a commit date, a commit user, a flag indicating
66 a flag indicating to enforce the import 71 to commit with the secret phase, a strip count and a flag
67 (string, boolean, string, string, string, integer, boolean) 72 indicating to enforce the import
73 @type tuple of (str, bool, str, str, str, bool, int, bool)
68 """ 74 """
69 if self.dateEdit.dateTime() != self.__initDateTime: 75 if self.dateEdit.dateTime() != self.__initDateTime:
70 date = self.dateEdit.dateTime().toString("yyyy-MM-dd hh:mm") 76 date = self.dateEdit.dateTime().toString("yyyy-MM-dd hh:mm")
71 else: 77 else:
72 date = "" 78 date = ""
73 79
74 return (self.patchFilePicker.text(), self.noCommitCheckBox.isChecked(), 80 return (self.patchFilePicker.text(), self.noCommitCheckBox.isChecked(),
75 self.messageEdit.toPlainText(), date, self.userEdit.text(), 81 self.messageEdit.toPlainText(), date, self.userEdit.text(),
76 self.stripSpinBox.value(), self.forceCheckBox.isChecked()) 82 self.secretCheckBox.isChecked(), self.stripSpinBox.value(),
83 self.forceCheckBox.isChecked())

eric ide

mercurial