diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.py --- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgImportDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -20,10 +20,11 @@ """ Class implementing a dialog to enter data for the Mercurial import command. """ + def __init__(self, vcs, parent=None): """ Constructor - + @param vcs reference to the VCS object @type Hg @param parent reference to the parent widget @@ -31,25 +32,24 @@ """ super().__init__(parent) self.setupUi(self) - + self.patchFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) - self.patchFilePicker.setFilters(self.tr( - "Patch Files (*.diff *.patch);;All Files (*)")) - + self.patchFilePicker.setFilters( + self.tr("Patch Files (*.diff *.patch);;All Files (*)") + ) + self.secretCheckBox.setEnabled(vcs.version >= (5, 3, 0)) - - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(False) - + + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False) + project = ericApp().getObject("Project") pwl, pel = project.getProjectDictionaries() language = project.getProjectSpellLanguage() - self.messageEdit.setLanguageWithPWL( - language, pwl or None, pel or None) - + self.messageEdit.setLanguageWithPWL(language, pwl or None, pel or None) + self.__initDateTime = QDateTime.currentDateTime() self.dateEdit.setDateTime(self.__initDateTime) - + def __updateOK(self): """ Private slot to update the OK button. @@ -57,23 +57,22 @@ enabled = True if self.patchFilePicker.text() == "": enabled = False - - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) - + + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) + @pyqtSlot(str) def on_patchFilePicker_textChanged(self, txt): """ Private slot to react on changes of the patch file edit. - + @param txt contents of the line edit (string) """ self.__updateOK() - + def getParameters(self): """ Public method to retrieve the import data. - + @return tuple naming the patch file, a flag indicating to not commit, a commit message, a commit date, a commit user, a flag indicating to commit with the secret phase, a strip count and a flag @@ -82,11 +81,17 @@ """ date = ( self.dateEdit.dateTime().toString("yyyy-MM-dd hh:mm") - if self.dateEdit.dateTime() != self.__initDateTime else - "" + if self.dateEdit.dateTime() != self.__initDateTime + else "" ) - - return (self.patchFilePicker.text(), self.noCommitCheckBox.isChecked(), - self.messageEdit.toPlainText(), date, self.userEdit.text(), - self.secretCheckBox.isChecked(), self.stripSpinBox.value(), - self.forceCheckBox.isChecked()) + + return ( + self.patchFilePicker.text(), + self.noCommitCheckBox.isChecked(), + self.messageEdit.toPlainText(), + date, + self.userEdit.text(), + self.secretCheckBox.isChecked(), + self.stripSpinBox.value(), + self.forceCheckBox.isChecked(), + )