--- a/MqttMonitor/MqttConnectionOptionsDialog.py Sun May 30 17:40:40 2021 +0200 +++ b/MqttMonitor/MqttConnectionOptionsDialog.py Sun May 30 18:21:40 2021 +0200 @@ -7,11 +7,11 @@ Module implementing a dialog to enter MQTT connection options. """ -from PyQt5.QtCore import pyqtSlot, QUuid -from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton +from PyQt6.QtCore import pyqtSlot, QUuid +from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton -from E5Gui import E5MessageBox -from E5Gui.E5PathPicker import E5PathPickerModes +from EricWidgets import EricMessageBox +from EricWidgets.EricPathPicker import EricPathPickerModes from .Ui_MqttConnectionOptionsDialog import Ui_MqttConnectionOptionsDialog @@ -42,7 +42,7 @@ self.__client = client - self.tlsCertsFilePicker.setMode(E5PathPickerModes.OpenFileMode) + self.tlsCertsFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) self.tlsCertsFilePicker.setFilters( self.tr("Certificate Files (*.crt *.pem);;All Files (*)")) @@ -59,14 +59,15 @@ not self.cleanSessionCheckBox.isChecked() ): enable = False - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Invalid Connection Parameters"), self.tr("""An empty Client ID requires a clean session.""")) else: enable = True - self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Ok).setEnabled(enable) @pyqtSlot() def on_generateIdButton_clicked(self): @@ -74,7 +75,8 @@ Private slot to generate a client ID. """ uuid = QUuid.createUuid() - self.clientIdEdit.setText(uuid.toString(QUuid.WithoutBraces)) + self.clientIdEdit.setText( + uuid.toString(QUuid.StringFormat.WithoutBraces)) @pyqtSlot(QAbstractButton) def on_buttonBox_clicked(self, button): @@ -84,7 +86,9 @@ @param button button that has been pressed @type QAbstractButton """ - if button == self.buttonBox.button(QDialogButtonBox.RestoreDefaults): + if button == self.buttonBox.button( + QDialogButtonBox.StandardButton.RestoreDefaults + ): self.__populateDefaults(options=None) def __populateDefaults(self, options=None): @@ -132,7 +136,7 @@ "ClientId", "Keepalive", "CleanSession", "Username", "Password", "WillTopic", "WillMessage", "WillQos", "WillRetain", "TlsEnable", "TlsCaCert", "ConnectionTimeout". - @rtype tuple of (int, dict) + @rtype dict """ return { "ClientId": self.clientIdEdit.text(),