1364 hwnet = new HWNewNet(); |
1364 hwnet = new HWNewNet(); |
1365 |
1365 |
1366 GoToPage(ID_PAGE_CONNECTING); |
1366 GoToPage(ID_PAGE_CONNECTING); |
1367 |
1367 |
1368 connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()), Qt::QueuedConnection); |
1368 connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()), Qt::QueuedConnection); |
|
1369 connect(hwnet, SIGNAL(redirected(quint16)), this, SLOT(NetRedirected(quint16)), Qt::QueuedConnection); |
1369 connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection); |
1370 connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection); |
1370 connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection); |
1371 connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection); |
1371 connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection); |
1372 connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection); |
1372 connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()), Qt::QueuedConnection); |
1373 connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()), Qt::QueuedConnection); |
1373 connect(hwnet, SIGNAL(LeftRoom(const QString&)), this, SLOT(NetLeftRoom(const QString&)), Qt::QueuedConnection); |
1374 connect(hwnet, SIGNAL(LeftRoom(const QString&)), this, SLOT(NetLeftRoom(const QString&)), Qt::QueuedConnection); |
1710 |
1711 |
1711 while (ui.Pages->currentIndex() != ID_PAGE_NET |
1712 while (ui.Pages->currentIndex() != ID_PAGE_NET |
1712 && ui.Pages->currentIndex() != ID_PAGE_MAIN) |
1713 && ui.Pages->currentIndex() != ID_PAGE_MAIN) |
1713 { |
1714 { |
1714 GoBack(); |
1715 GoBack(); |
|
1716 } |
|
1717 } |
|
1718 |
|
1719 void HWForm::NetRedirected(quint16 port) |
|
1720 { |
|
1721 QMessageBox questionMsg(this); |
|
1722 questionMsg.setIcon(QMessageBox::Question); |
|
1723 questionMsg.setWindowTitle(QMessageBox::tr("Server redirection")); |
|
1724 questionMsg.setText(QMessageBox::tr("This server supports secure connections on port %1.\nWould you like to reconnect securely?").arg(port)); |
|
1725 questionMsg.setTextFormat(Qt::PlainText); |
|
1726 questionMsg.setWindowModality(Qt::WindowModal); |
|
1727 questionMsg.addButton(QMessageBox::Yes); |
|
1728 questionMsg.addButton(QMessageBox::No); |
|
1729 |
|
1730 if (questionMsg.exec() == QMessageBox::Yes) |
|
1731 { |
|
1732 |
1715 } |
1733 } |
1716 } |
1734 } |
1717 |
1735 |
1718 void HWForm::NetConnected() |
1736 void HWForm::NetConnected() |
1719 { |
1737 { |