mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 22:55:41 +08:00
fixes "unable to login", discovered during #780,
* fixed bootstrap file * improved timeout of connect, now in single static function * some minor tweaks
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
"url": "http://crashreports.swift-project.org/crash_upload"
|
"url": "http://crashreports.swift-project.org/crash_upload"
|
||||||
},
|
},
|
||||||
"dbDebugFlag": false,
|
"dbDebugFlag": false,
|
||||||
"dbHttpPort": 5080,
|
"dbHttpPort": 80,
|
||||||
"dbHttpsPort": 50443,
|
"dbHttpsPort": 443,
|
||||||
"dbRootDirectoryUrl": {
|
"dbRootDirectoryUrl": {
|
||||||
"url": "https://datastore.swift-project.org"
|
"url": "https://datastore.swift-project.org"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ namespace BlackCore
|
|||||||
|
|
||||||
if (this->m_shutdown) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "Shutdown in progress")); return msgs; }
|
if (this->m_shutdown) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "Shutdown in progress")); return msgs; }
|
||||||
|
|
||||||
QString un(username.trimmed());
|
const QString un(username.trimmed());
|
||||||
QString pw(password.trimmed());
|
const QString pw(password.trimmed());
|
||||||
if (un.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No user name/id")); }
|
if (un.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No user name/id")); }
|
||||||
if (pw.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No password")); }
|
if (pw.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No password")); }
|
||||||
if (!msgs.isEmpty()) { return msgs; }
|
if (!msgs.isEmpty()) { return msgs; }
|
||||||
|
|||||||
@@ -90,9 +90,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDbLoginComponent::ps_onLoginClicked()
|
void CDbLoginComponent::ps_onLoginClicked()
|
||||||
{
|
{
|
||||||
QString un(ui->le_Username->text().trimmed());
|
const QString un(ui->le_Username->text().trimmed());
|
||||||
QString pw(ui->le_Password->text().trimmed());
|
const QString pw(ui->le_Password->text().trimmed());
|
||||||
CStatusMessageList msgs = m_loginService.login(un, pw);
|
const CStatusMessageList msgs = m_loginService.login(un, pw);
|
||||||
|
|
||||||
if (msgs.hasWarningOrErrorMessages())
|
if (msgs.hasWarningOrErrorMessages())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
namespace Network
|
namespace Network
|
||||||
{
|
{
|
||||||
|
int CNetworkUtils::getTimeoutMs()
|
||||||
|
{
|
||||||
|
return 2000;
|
||||||
|
}
|
||||||
|
|
||||||
bool CNetworkUtils::hasConnectedInterface(bool withDebugOutput)
|
bool CNetworkUtils::hasConnectedInterface(bool withDebugOutput)
|
||||||
{
|
{
|
||||||
// http://stackoverflow.com/questions/2475266/verfiying-the-network-connection-using-qt-4-4
|
// http://stackoverflow.com/questions/2475266/verfiying-the-network-connection-using-qt-4-4
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ namespace BlackMisc
|
|||||||
Multipart
|
Multipart
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Default for timeout
|
||||||
|
static int getTimeoutMs();
|
||||||
|
|
||||||
//! Is a connected interface available?
|
//! Is a connected interface available?
|
||||||
//! \param withDebugOutput enables some debugging output
|
//! \param withDebugOutput enables some debugging output
|
||||||
//! \return
|
//! \return
|
||||||
@@ -58,29 +61,29 @@ namespace BlackMisc
|
|||||||
//! \param timeoutMs
|
//! \param timeoutMs
|
||||||
//! \param message human readable message
|
//! \param message human readable message
|
||||||
//! \return
|
//! \return
|
||||||
static bool canConnect(const QString &hostAddress, int port, QString &message, int timeoutMs = 1500);
|
static bool canConnect(const QString &hostAddress, int port, QString &message, int timeoutMs = getTimeoutMs());
|
||||||
|
|
||||||
//! Can connect to server?
|
//! Can connect to server?
|
||||||
//! \param server
|
//! \param server
|
||||||
//! \param message human readable message
|
//! \param message human readable message
|
||||||
//! \param timeoutMs
|
//! \param timeoutMs
|
||||||
//! \return
|
//! \return
|
||||||
static bool canConnect(const BlackMisc::Network::CServer &server, QString &message, int timeoutMs = 1500);
|
static bool canConnect(const BlackMisc::Network::CServer &server, QString &message, int timeoutMs = getTimeoutMs());
|
||||||
|
|
||||||
//! Can connect to URL?
|
//! Can connect to URL?
|
||||||
static bool canConnect(const QString &url, QString &message, int timeoutMs = 1500);
|
static bool canConnect(const QString &url, QString &message, int timeoutMs = getTimeoutMs());
|
||||||
|
|
||||||
//! Can connect to URL?
|
//! Can connect to URL?
|
||||||
static bool canConnect(const QUrl &url, QString &message, int timeoutMs = 1500);
|
static bool canConnect(const QUrl &url, QString &message, int timeoutMs = getTimeoutMs());
|
||||||
|
|
||||||
//! Can connect to URL?
|
//! Can connect to URL?
|
||||||
static bool canConnect(const QUrl &url, int timeoutMs = 1500);
|
static bool canConnect(const QUrl &url, int timeoutMs = getTimeoutMs());
|
||||||
|
|
||||||
//! Can connect to URL?
|
//! Can connect to URL?
|
||||||
static bool canConnect(const BlackMisc::Network::CUrl &url, QString &message, int timeoutMs = 1500);
|
static bool canConnect(const BlackMisc::Network::CUrl &url, QString &message, int timeoutMs = getTimeoutMs());
|
||||||
|
|
||||||
//! Can connect to URL?
|
//! Can connect to URL?
|
||||||
static bool canConnect(const BlackMisc::Network::CUrl &url, int timeoutMs = 1500);
|
static bool canConnect(const BlackMisc::Network::CUrl &url, int timeoutMs = getTimeoutMs());
|
||||||
|
|
||||||
//! Find out my IPv4 address, empty if not possible
|
//! Find out my IPv4 address, empty if not possible
|
||||||
static QStringList getKnownIpAddresses();
|
static QStringList getKnownIpAddresses();
|
||||||
|
|||||||
Reference in New Issue
Block a user