diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/Plugins/VcsPlugins/vcsMercurial/HgCopyDialog.py --- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgCopyDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgCopyDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -22,40 +22,40 @@ Class implementing a dialog to enter the data for a copy or rename operation. """ + def __init__(self, source, parent=None, move=False): """ Constructor - + @param source name of the source file/directory (string) @param parent parent widget (QWidget) @param move flag indicating a move operation (boolean) """ super().__init__(parent) self.setupUi(self) - + self.source = source if os.path.isdir(self.source): self.targetPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) else: self.targetPicker.setMode(EricPathPickerModes.SAVE_FILE_MODE) - + if move: - self.setWindowTitle(self.tr('Mercurial Move')) + self.setWindowTitle(self.tr("Mercurial Move")) else: self.forceCheckBox.setEnabled(False) - + self.sourceEdit.setText(source) - - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(False) - + + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False) + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + def getData(self): """ Public method to retrieve the copy data. - + @return the target name (string) and a flag indicating the operation should be enforced (boolean) """ @@ -64,13 +64,14 @@ sourceDir = os.path.dirname(self.sourceEdit.text()) target = os.path.join(sourceDir, target) return target, self.forceCheckBox.isChecked() - + @pyqtSlot(str) def on_targetPicker_textChanged(self, txt): """ Private slot to handle changes of the target. - + @param txt contents of the target edit (string) """ self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( - os.path.isabs(txt) or os.path.dirname(txt) == "") + os.path.isabs(txt) or os.path.dirname(txt) == "" + )