From 4d374581b5b0b5f22b0886b71b7f18b85ff32d09 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 4 Dec 2021 16:13:34 +0300 Subject: [PATCH] isWorkingOnPlatform function added --- client/containers/containers_defs.cpp | 26 ++++++++++++++++++++++++++ client/containers/containers_defs.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index d1efda53..f6f3415c 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -136,3 +136,29 @@ Protocol ContainerProps::defaultProtocol(DockerContainer c) } } +bool ContainerProps::isWorkingOnPlatform(DockerContainer c) +{ +#ifdef Q_OS_WINDOWS + return true; +#elif defined (Q_OS_MAC) + +#elif defined (Q_OS_IOS) + switch (c) { + case DockerContainer::WireGuard: return true; + case DockerContainer::OpenVpn: return true; + default: 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) + +#else +return false; +#endif +} + diff --git a/client/containers/containers_defs.h b/client/containers/containers_defs.h index 25f2dfc7..eced3c32 100644 --- a/client/containers/containers_defs.h +++ b/client/containers/containers_defs.h @@ -53,6 +53,8 @@ public: // binding between Docker container and main protocol of given container // it may be changed fot future containers :) Q_INVOKABLE static Protocol defaultProtocol(DockerContainer c); + + Q_INVOKABLE static bool isWorkingOnPlatform(DockerContainer c); };