304 |
304 |
305 if protocol == MqttProtocols.MQTTv5: |
305 if protocol == MqttProtocols.MQTTv5: |
306 if self.connectPropertiesButton.isChecked(): |
306 if self.connectPropertiesButton.isChecked(): |
307 self.__userProperties["connect"] = self.propertiesWidget.getProperties() |
307 self.__userProperties["connect"] = self.propertiesWidget.getProperties() |
308 else: |
308 else: |
309 self.__userProperties[ |
309 self.__userProperties["disconnect"] = ( |
310 "disconnect" |
310 self.propertiesWidget.getProperties() |
311 ] = self.propertiesWidget.getProperties() |
311 ) |
312 self.__userProperties[ |
312 self.__userProperties["use_connect"] = ( |
313 "use_connect" |
313 self.samePropertiesCheckBox.isChecked() |
314 ] = self.samePropertiesCheckBox.isChecked() |
314 ) |
315 else: |
315 else: |
316 self.__userProperties = {} |
316 self.__userProperties = {} |
317 self.__willProperties = [] |
317 self.__willProperties = [] |
318 |
318 |
319 profileName = self.profileEdit.text() |
319 profileName = self.profileEdit.text() |
340 } |
340 } |
341 if connectionProfile["TlsEnable"]: |
341 if connectionProfile["TlsEnable"]: |
342 if self.tlsCertsFileButton.isChecked(): |
342 if self.tlsCertsFileButton.isChecked(): |
343 connectionProfile["TlsCaCert"] = self.tlsCertsFilePicker.text() |
343 connectionProfile["TlsCaCert"] = self.tlsCertsFilePicker.text() |
344 elif self.tlsSelfSignedCertsButton.isChecked(): |
344 elif self.tlsSelfSignedCertsButton.isChecked(): |
345 connectionProfile[ |
345 connectionProfile["TlsCaCert"] = ( |
346 "TlsCaCert" |
346 self.tlsSelfSignedCertsFilePicker.text() |
347 ] = self.tlsSelfSignedCertsFilePicker.text() |
347 ) |
348 connectionProfile[ |
348 connectionProfile["TlsClientCert"] = ( |
349 "TlsClientCert" |
349 self.tlsSelfSignedClientCertFilePicker.text() |
350 ] = self.tlsSelfSignedClientCertFilePicker.text() |
350 ) |
351 connectionProfile[ |
351 connectionProfile["TlsClientKey"] = ( |
352 "TlsClientKey" |
352 self.tlsSelfSignedClientKeyFilePicker.text() |
353 ] = self.tlsSelfSignedClientKeyFilePicker.text() |
353 ) |
354 |
354 |
355 self.__profiles[profileName] = connectionProfile |
355 self.__profiles[profileName] = connectionProfile |
356 self.__profilesChanged = True |
356 self.__profilesChanged = True |
357 |
357 |
358 return profileName |
358 return profileName |
900 @type bool |
900 @type bool |
901 """ |
901 """ |
902 if checked: |
902 if checked: |
903 # handle the selection only |
903 # handle the selection only |
904 if self.connectPropertiesButton.isChecked(): |
904 if self.connectPropertiesButton.isChecked(): |
905 self.__userProperties[ |
905 self.__userProperties["disconnect"] = ( |
906 "disconnect" |
906 self.propertiesWidget.getProperties() |
907 ] = self.propertiesWidget.getProperties() |
907 ) |
908 self.propertiesWidget.setProperties(self.__userProperties["connect"]) |
908 self.propertiesWidget.setProperties(self.__userProperties["connect"]) |
909 else: |
909 else: |
910 self.__userProperties["connect"] = self.propertiesWidget.getProperties() |
910 self.__userProperties["connect"] = self.propertiesWidget.getProperties() |
911 self.propertiesWidget.setProperties(self.__userProperties["disconnect"]) |
911 self.propertiesWidget.setProperties(self.__userProperties["disconnect"]) |
912 |
912 |