ensure we have an integer for maxoutboundconnections when setting

This commit is contained in:
Justin Ramos 2017-01-11 18:11:16 +00:00
parent 60d489ea16
commit df2d5bce4c

View File

@ -2418,8 +2418,14 @@ class MyForm(settingsmixin.SMainWindow):
QMessageBox.about(self, _translate("MainWindow", "Number needed"), _translate( QMessageBox.about(self, _translate("MainWindow", "Number needed"), _translate(
"MainWindow", "Your maximum download and upload rate must be numbers. Ignoring what you typed.")) "MainWindow", "Your maximum download and upload rate must be numbers. Ignoring what you typed."))
shared.config.set('bitmessagesettings', 'maxoutboundconnections', str( try:
self.settingsDialogInstance.ui.lineEditMaxOutboundConnections.text())) # Ensure we have an integer
shared.config.set('bitmessagesettings', 'maxoutboundconnections', str(
int(float(self.settingsDialogInstance.ui.lineEditMaxOutboundConnections.text()))))
except:
QMessageBox.about(self, _translate("MainWindow", "Number needed"), _translate(
"MainWindow", "Your maximum outbound connections must be a number. Ignoring what you typed."))
shared.config.set('bitmessagesettings', 'namecoinrpctype', shared.config.set('bitmessagesettings', 'namecoinrpctype',
self.settingsDialogInstance.getNamecoinType()) self.settingsDialogInstance.getNamecoinType())
shared.config.set('bitmessagesettings', 'namecoinrpchost', str( shared.config.set('bitmessagesettings', 'namecoinrpchost', str(