Add checking background service before connect (#716)
checking if the service is running for all platforms
This commit is contained in:
parent
d67c378bff
commit
ff348a348c
5 changed files with 20 additions and 4 deletions
|
@ -7,9 +7,11 @@
|
|||
#endif
|
||||
#include <QtConcurrent>
|
||||
|
||||
#include "utilities.h"
|
||||
#include "core/controllers/apiController.h"
|
||||
#include "core/controllers/vpnConfigurationController.h"
|
||||
#include "core/errorstrings.h"
|
||||
#include "version.h"
|
||||
|
||||
ConnectionController::ConnectionController(const QSharedPointer<ServersModel> &serversModel,
|
||||
const QSharedPointer<ContainersModel> &containersModel,
|
||||
|
@ -32,6 +34,14 @@ ConnectionController::ConnectionController(const QSharedPointer<ServersModel> &s
|
|||
|
||||
void ConnectionController::openConnection()
|
||||
{
|
||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||
if (!Utils::processIsRunning(Utils::executable(SERVICE_NAME, false), true))
|
||||
{
|
||||
emit connectionErrorOccurred(errorString(ErrorCode::AmneziaServiceNotRunning));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
int serverIndex = m_serversModel->getDefaultServerIndex();
|
||||
auto serverConfig = m_serversModel->getServerConfig(serverIndex);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue