Merge branch 'dev' into ios-wireguard

This commit is contained in:
pokamest 2021-12-04 05:24:11 -08:00
commit 40791a9cd4
2 changed files with 31 additions and 0 deletions

View file

@ -136,3 +136,32 @@ Proto ContainerProps::defaultProtocol(DockerContainer c)
} }
} }
bool ContainerProps::isWorkingOnPlatform(DockerContainer c)
{
#ifdef Q_OS_WINDOWS
return true;
#elif defined (Q_OS_IOS)
switch (c) {
case DockerContainer::WireGuard: return true;
case DockerContainer::OpenVpn: return true;
default: return false;
}
#elif defined (Q_OS_MAC)
return false;
#elif defined (Q_OS_ANDROID)
switch (c) {
case DockerContainer::WireGuard: return true;
case DockerContainer::OpenVpn: return true;
default: return false;
}
#elif defined (Q_OS_LINUX)
return false;
#else
return false;
#endif
}

View file

@ -53,6 +53,8 @@ public:
// binding between Docker container and main protocol of given container // binding between Docker container and main protocol of given container
// it may be changed fot future containers :) // it may be changed fot future containers :)
Q_INVOKABLE static Proto defaultProtocol(DockerContainer c); Q_INVOKABLE static Proto defaultProtocol(DockerContainer c);
Q_INVOKABLE static bool isWorkingOnPlatform(DockerContainer c);
}; };