diff --git a/app/backend/computermanager.cpp b/app/backend/computermanager.cpp index 96f11969..0f91e018 100644 --- a/app/backend/computermanager.cpp +++ b/app/backend/computermanager.cpp @@ -607,7 +607,7 @@ public: } signals: - void computerAddCompleted(QVariant success); + void computerAddCompleted(QVariant success, QVariant detectedPortBlocking); void computerStateChanged(NvComputer* computer); @@ -637,7 +637,11 @@ private: return serverInfo; } catch (...) { if (!m_Mdns) { - emit computerAddCompleted(false); + // We failed to connect to the specified PC. Let's test to make sure this network + // isn't blocking Moonlight, so we can tell the user about it. + int portTestResult = LiTestClientConnectivity("qt.conntest.moonlight-stream.org", 443, + ML_PORT_FLAG_TCP_47984 | ML_PORT_FLAG_TCP_47989); + emit computerAddCompleted(false, portTestResult != 0 && portTestResult != ML_TEST_RESULT_INCONCLUSIVE); } return QString(); } @@ -729,7 +733,7 @@ private: // For non-mDNS clients, let them know it succeeded if (!m_Mdns) { - emit computerAddCompleted(true); + emit computerAddCompleted(true, false); } // Tell our client if something changed @@ -750,7 +754,7 @@ private: // For non-mDNS clients, let them know it succeeded if (!m_Mdns) { - emit computerAddCompleted(true); + emit computerAddCompleted(true, false); } // Tell our client about this new PC diff --git a/app/backend/computermanager.h b/app/backend/computermanager.h index 08675669..57593632 100644 --- a/app/backend/computermanager.h +++ b/app/backend/computermanager.h @@ -188,7 +188,7 @@ signals: void pairingCompleted(NvComputer* computer, QString error); - void computerAddCompleted(QVariant success); + void computerAddCompleted(QVariant success, QVariant detectedPortBlocking); void quitAppCompleted(QVariant error); diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index bb4568dc..14861277 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -58,11 +58,18 @@ CenteredGridView { } } - function addComplete(success) + function addComplete(success, detectedPortBlocking) { if (!success) { errorDialog.text = "Unable to connect to the specified PC." - errorDialog.helpText = "Click the Help button for possible solutions." + + if (detectedPortBlocking) { + errorDialog.text += "\n\nThis PC's Internet connection is blocking Moonlight. Streaming over the Internet may not work while connected to this network." + } + else { + errorDialog.helpText = "Click the Help button for possible solutions." + } + errorDialog.open() } }