mirror of
https://github.com/chenx-dust/EZ4Connect.git
synced 2026-09-20 10:23:33 +08:00
feat: Support detecting client set up error
This commit is contained in:
@@ -87,6 +87,7 @@ private:
|
||||
bool isZjuConnectLoginError;
|
||||
bool isZjuConnectAccessDenied;
|
||||
bool isZjuConnectListenFailed;
|
||||
bool isZjuConnectSetupError;
|
||||
bool isSystemProxySet;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@ ZjuConnectController::ZjuConnectController()
|
||||
{
|
||||
emit listenFailed();
|
||||
}
|
||||
else if (output.contains("client setup error"))
|
||||
{
|
||||
emit setupError();
|
||||
}
|
||||
});
|
||||
|
||||
connect(zjuConnectProcess, &QProcess::readyReadStandardError, this, [&]()
|
||||
@@ -43,6 +47,10 @@ ZjuConnectController::ZjuConnectController()
|
||||
{
|
||||
emit listenFailed();
|
||||
}
|
||||
else if (output.contains("client setup error"))
|
||||
{
|
||||
emit setupError();
|
||||
}
|
||||
});
|
||||
|
||||
connect(zjuConnectProcess, &QProcess::finished, this, [&]()
|
||||
|
||||
@@ -41,6 +41,8 @@ signals:
|
||||
|
||||
void listenFailed();
|
||||
|
||||
void setupError();
|
||||
|
||||
void outputRead(const QString &output);
|
||||
|
||||
void finished();
|
||||
|
||||
@@ -49,6 +49,11 @@ void MainWindow::setModeToZjuConnect()
|
||||
isZjuConnectListenFailed = true;
|
||||
});
|
||||
|
||||
connect(zjuConnectController, &ZjuConnectController::setupError, this, [&]()
|
||||
{
|
||||
isZjuConnectSetupError = true;
|
||||
});
|
||||
|
||||
connect(zjuConnectController, &ZjuConnectController::finished, this, [&]()
|
||||
{
|
||||
if (
|
||||
@@ -92,6 +97,11 @@ void MainWindow::setModeToZjuConnect()
|
||||
isZjuConnectListenFailed = false;
|
||||
QMessageBox::critical(this, "错误", "监听失败!\n请关闭占用端口的程序(如残留的 zju-connect.exe),或者监听其它端口");
|
||||
}
|
||||
else if (isZjuConnectSetupError)
|
||||
{
|
||||
isZjuConnectSetupError = false;
|
||||
QMessageBox::critical(this, "错误", "连接失败!\n请检查网络和服务器设置是否正确");
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->pushButton1, &QPushButton::clicked,
|
||||
|
||||
Reference in New Issue
Block a user