QTfrontend/hwform.cpp
changeset 14843 bdb47255d7e4
parent 14841 b9437746bffb
child 14870 90cf07c60feb
--- a/QTfrontend/hwform.cpp	Thu Apr 25 21:25:16 2019 +0200
+++ b/QTfrontend/hwform.cpp	Thu Apr 25 23:59:50 2019 +0300
@@ -1366,6 +1366,7 @@
     GoToPage(ID_PAGE_CONNECTING);
 
     connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(redirected(quint16)), this, SLOT(NetRedirected(quint16)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection);
@@ -1715,6 +1716,23 @@
     }
 }
 
+void HWForm::NetRedirected(quint16 port)
+{
+    QMessageBox questionMsg(this);
+    questionMsg.setIcon(QMessageBox::Question);
+    questionMsg.setWindowTitle(QMessageBox::tr("Server redirection"));
+    questionMsg.setText(QMessageBox::tr("This server supports secure connections on port %1.\nWould you like to reconnect securely?").arg(port));
+    questionMsg.setTextFormat(Qt::PlainText);
+    questionMsg.setWindowModality(Qt::WindowModal);
+    questionMsg.addButton(QMessageBox::Yes);
+    questionMsg.addButton(QMessageBox::No);
+
+    if (questionMsg.exec() == QMessageBox::Yes)
+    {
+
+    }
+}
+
 void HWForm::NetConnected()
 {
     GoToPage(ID_PAGE_ROOMSLIST);