diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index f6eb762e..b426e6e5 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -432,10 +432,21 @@ class MyForm(QtGui.QMainWindow): "removeInboxRowByMsgid(PyQt_PyObject)"), self.removeInboxRowByMsgid) self.UISignalThread.start() -# Below this point, it would be good if all of the necessary global data -# structures were initialized. + # Below this point, it would be good if all of the necessary global data + # structures were initialized. self.rerenderComboBoxSendFrom() + + # Check to see whether we can connect to namecoin. Hide the 'Fetch Namecoin ID' button if we can't. + options = {} + options["type"] = shared.config.get('bitmessagesettings', 'namecoinrpctype') + options["host"] = shared.config.get('bitmessagesettings', 'namecoinrpchost') + options["port"] = shared.config.get('bitmessagesettings', 'namecoinrpcport') + options["user"] = shared.config.get('bitmessagesettings', 'namecoinrpcuser') + options["password"] = shared.config.get('bitmessagesettings', 'namecoinrpcpassword') + nc = namecoinConnection(options) + if nc.test()[0] == 'failed': + self.ui.pushButtonFetchNamecoinID.hide() # Show or hide the application window after clicking an item within the @@ -3180,6 +3191,8 @@ class settingsDialog(QtGui.QDialog): # Test the namecoin settings specified in the settings dialog. def click_pushButtonNamecoinTest(self): + self.ui.labelNamecoinTestResult.setText(_translate( + "MainWindow", "Testing...")) options = {} options["type"] = self.getNamecoinType() options["host"] = self.ui.lineEditNamecoinHost.text() @@ -3187,8 +3200,10 @@ class settingsDialog(QtGui.QDialog): options["user"] = self.ui.lineEditNamecoinUser.text() options["password"] = self.ui.lineEditNamecoinPassword.text() nc = namecoinConnection(options) - res = nc.test() - self.ui.labelNamecoinTestResult.setText(res) + responseStatus = nc.test()[1] + self.ui.labelNamecoinTestResult.setText(responseStatus) + if nc.test()[0]== 'success': + self.parent.ui.pushButtonFetchNamecoinID.show() class SpecialAddressBehaviorDialog(QtGui.QDialog): diff --git a/src/bitmessageqt/settings.py b/src/bitmessageqt/settings.py index a899ecbe..87e8ba7b 100644 --- a/src/bitmessageqt/settings.py +++ b/src/bitmessageqt/settings.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'settings.ui' # -# Created: Sun Aug 11 22:12:58 2013 -# by: PyQt4 UI code generator 4.10.2 +# Created: Wed Aug 14 18:31:34 2013 +# by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! @@ -26,7 +26,7 @@ except AttributeError: class Ui_settingsDialog(object): def setupUi(self, settingsDialog): settingsDialog.setObjectName(_fromUtf8("settingsDialog")) - settingsDialog.resize(462, 343) + settingsDialog.resize(567, 343) self.gridLayout = QtGui.QGridLayout(settingsDialog) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.buttonBox = QtGui.QDialogButtonBox(settingsDialog) @@ -356,7 +356,7 @@ class Ui_settingsDialog(object): self.label_13.setText(_translate("settingsDialog", "Maximum acceptable total difficulty:", None)) self.label_14.setText(_translate("settingsDialog", "Maximum acceptable small message difficulty:", None)) self.tabWidgetSettings.setTabText(self.tabWidgetSettings.indexOf(self.tab_2), _translate("settingsDialog", "Max acceptable difficulty", None)) - self.label_16.setText(_translate("settingsDialog", "Bitmessage addresses can be fetched automatically from Namecoin identities. You can use either namecoind directly or a running nmcontrol instance.", None)) + self.label_16.setText(_translate("settingsDialog", "
Bitmessage can utilize a different Bitcoin-based program called Namecoin to make addresses human-friendly. For example, instead of having to tell your friend your long Bitmessage address, you can simply tell him to send a message to test.
(Getting your own Bitmessage address into Namecoin is still rather difficult).
Bitmessage can use either namecoind directly or a running nmcontrol instance.
", None)) self.label_17.setText(_translate("settingsDialog", "Host:", None)) self.label_18.setText(_translate("settingsDialog", "Port:", None)) self.labelNamecoinUser.setText(_translate("settingsDialog", "Username:", None)) diff --git a/src/bitmessageqt/settings.ui b/src/bitmessageqt/settings.ui index 90487305..0ca22088 100644 --- a/src/bitmessageqt/settings.ui +++ b/src/bitmessageqt/settings.ui @@ -6,7 +6,7 @@