summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pica-client/dialogs/registeraccountdialog.cpp14
-rw-r--r--pica-client/dialogs/registeraccountdialog.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/pica-client/dialogs/registeraccountdialog.cpp b/pica-client/dialogs/registeraccountdialog.cpp
index 1ce1cdb..bc723f7 100644
--- a/pica-client/dialogs/registeraccountdialog.cpp
+++ b/pica-client/dialogs/registeraccountdialog.cpp
@@ -96,9 +96,10 @@ void RegisterAccountDialog::stageConnect(int retval,QProcess::ExitStatus)
lbStatus->setText(tr("3) Connecting to server..."));
- sock.connectToHost(registrar_hosts[(registrar_index++)%(sizeof(registrar_hosts)/sizeof(char*))], 2299);
-
connect(&sock, SIGNAL(connected()), this, SLOT(stageGetCert()));
+ connect(&sock, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(showError()));
+
+ sock.connectToHost(registrar_hosts[(registrar_index++)%(sizeof(registrar_hosts)/sizeof(char*))], 2299);
}
void RegisterAccountDialog::stageGetCert()
@@ -124,6 +125,8 @@ void RegisterAccountDialog::stageReadCert()
if (cert_buf.contains("-----END CERTIFICATE-----") || cert_buf.contains("-----END X509 CERTIFICATE-----"))
{
+ disconnect(&sock, SIGNAL(error(QAbstractSocket::SocketError)), 0, 0);
+
QFile cert(config_dir + QDir::separator() + "cert.pem");
cert.open(QIODevice::WriteOnly | QIODevice::Truncate);
cert.write(cert_buf.data(),cert_buf.size());
@@ -147,3 +150,10 @@ QString RegisterAccountDialog::GetPkeyFilename()
{
return PkeyFilename_;
}
+
+void RegisterAccountDialog::showError()
+{
+ QMessageBox mbx;
+ mbx.setText(sock.errorString());
+ mbx.exec();
+}
diff --git a/pica-client/dialogs/registeraccountdialog.h b/pica-client/dialogs/registeraccountdialog.h
index 696f1ee..38f23c9 100644
--- a/pica-client/dialogs/registeraccountdialog.h
+++ b/pica-client/dialogs/registeraccountdialog.h
@@ -41,6 +41,7 @@ public slots:
void stageConnect(int,QProcess::ExitStatus);
void stageGetCert();
void stageReadCert();
+ void showError();
};
#endif // REGISTERACCOUNTDIALOG_H