--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgRepoConfigDataDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgRepoConfigDataDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -23,10 +23,11 @@ Class implementing a dialog to enter data needed for the initial creation of a repository configuration file (hgrc). """ + def __init__(self, withLargefiles=False, largefilesData=None, parent=None): """ Constructor - + @param withLargefiles flag indicating to configure the largefiles section (boolean) @param largefilesData dictionary with data for the largefiles @@ -35,56 +36,53 @@ """ super().__init__(parent) self.setupUi(self) - - self.defaultShowPasswordButton.setIcon( - UI.PixmapCache.getIcon("showPassword")) + + self.defaultShowPasswordButton.setIcon(UI.PixmapCache.getIcon("showPassword")) self.defaultPushShowPasswordButton.setIcon( - UI.PixmapCache.getIcon("showPassword")) - + UI.PixmapCache.getIcon("showPassword") + ) + self.__withLargefiles = withLargefiles if withLargefiles: if largefilesData is None: largefilesData = getLargefilesDefaults() self.lfFileSizeSpinBox.setValue(largefilesData["minsize"]) - self.lfFilePatternsEdit.setText( - " ".join(largefilesData["pattern"])) + self.lfFilePatternsEdit.setText(" ".join(largefilesData["pattern"])) else: self.largefilesGroup.setVisible(False) - + self.resize(self.width(), self.minimumSizeHint().height()) - + @pyqtSlot(bool) def on_defaultShowPasswordButton_clicked(self, checked): """ Private slot to switch the default password visibility of the default password. - + @param checked state of the push button (boolean) """ if checked: self.defaultPasswordEdit.setEchoMode(QLineEdit.EchoMode.Normal) else: self.defaultPasswordEdit.setEchoMode(QLineEdit.EchoMode.Password) - + @pyqtSlot(bool) def on_defaultPushShowPasswordButton_clicked(self, checked): """ Private slot to switch the default password visibility of the default push password. - + @param checked state of the push button (boolean) """ if checked: - self.defaultPushPasswordEdit.setEchoMode( - QLineEdit.EchoMode.Normal) + self.defaultPushPasswordEdit.setEchoMode(QLineEdit.EchoMode.Normal) else: - self.defaultPushPasswordEdit.setEchoMode( - QLineEdit.EchoMode.Password) - + self.defaultPushPasswordEdit.setEchoMode(QLineEdit.EchoMode.Password) + def getData(self): """ Public method to get the data entered into the dialog. - + @return tuple giving the default and default push URLs (tuple of two strings) """ @@ -96,7 +94,7 @@ if password: defaultUrl.setPassword(password) defaultUrl = defaultUrl.toString() if defaultUrl.isValid() else "" - + defaultPushUrl = QUrl.fromUserInput(self.defaultPushUrlEdit.text()) username = self.defaultPushUserEdit.text() password = self.defaultPushPasswordEdit.text() @@ -104,18 +102,14 @@ defaultPushUrl.setUserName(username) if password: defaultPushUrl.setPassword(password) - defaultPushUrl = ( - defaultPushUrl.toString() - if defaultPushUrl.isValid() else - "" - ) - + defaultPushUrl = defaultPushUrl.toString() if defaultPushUrl.isValid() else "" + return defaultUrl, defaultPushUrl - + def getLargefilesData(self): """ Public method to get the data for the largefiles extension. - + @return tuple with the minimum file size (integer) and file patterns (list of string). None as value denote to use the default value. """ @@ -128,7 +122,7 @@ patterns = self.lfFilePatternsEdit.text().split() if set(patterns) == set(lfDefaults["pattern"]): patterns = None - + return minsize, patterns else: return None, None