diff --git a/client/ui/pages_logic/VpnLogic.cpp b/client/ui/pages_logic/VpnLogic.cpp index dfd1199e..3449034a 100644 --- a/client/ui/pages_logic/VpnLogic.cpp +++ b/client/ui/pages_logic/VpnLogic.cpp @@ -51,6 +51,14 @@ void VpnLogic::onUpdatePage() DockerContainer selectedContainer = m_settings.defaultContainer(m_settings.defaultServerIndex()); QString selectedContainerName = ContainerProps::containerHumanNames().value(selectedContainer); set_labelCurrentService(selectedContainerName); + + set_isContainerWorkingOnPlatform(ContainerProps::isWorkingOnPlatform(selectedContainer)); + if (!isContainerWorkingOnPlatform()) { + set_labelErrorText(tr("AmneziaVPN not supporting selected protocol on this device. Select another protocol.")); + } + else { + set_labelErrorText(""); + } } diff --git a/client/ui/pages_logic/VpnLogic.h b/client/ui/pages_logic/VpnLogic.h index 176f61c7..3338f22d 100644 --- a/client/ui/pages_logic/VpnLogic.h +++ b/client/ui/pages_logic/VpnLogic.h @@ -19,6 +19,8 @@ class VpnLogic : public PageLogicBase AUTO_PROPERTY(bool, pushButtonConnectEnabled) AUTO_PROPERTY(bool, pushButtonConnectVisible) AUTO_PROPERTY(bool, widgetVpnModeEnabled) + AUTO_PROPERTY(bool, isContainerWorkingOnPlatform) + AUTO_PROPERTY(QString, labelErrorText) AUTO_PROPERTY(bool, radioButtonVpnModeAllSitesChecked) diff --git a/client/ui/qml/Pages/PageVPN.qml b/client/ui/qml/Pages/PageVPN.qml index 6bd0420e..e77302a3 100644 --- a/client/ui/qml/Pages/PageVPN.qml +++ b/client/ui/qml/Pages/PageVPN.qml @@ -61,7 +61,7 @@ PageBase { } contentItem: Item {} antialiasing: true - enabled: VpnLogic.pushButtonConnectEnabled + enabled: VpnLogic.pushButtonConnectEnabled && VpnLogic.isContainerWorkingOnPlatform opacity: VpnLogic.pushButtonConnectVisible ? 1 : 0 // transitions: Transition { @@ -141,11 +141,14 @@ PageBase { id: error_text anchors.top: layout2.bottom anchors.horizontalCenter: parent.horizontalCenter - width: parent.width + anchors.topMargin: 20 + width: parent.width - 20 + height: 21 horizontalAlignment: Text.AlignHCenter wrapMode: Text.Wrap text: VpnLogic.labelErrorText + color: "red" } Item { diff --git a/client/ui/qml/Pages/Share/PageShareProtoWireGuard.qml b/client/ui/qml/Pages/Share/PageShareProtoWireGuard.qml index f934ea4c..71f06dc4 100644 --- a/client/ui/qml/Pages/Share/PageShareProtoWireGuard.qml +++ b/client/ui/qml/Pages/Share/PageShareProtoWireGuard.qml @@ -36,7 +36,7 @@ PageShareProtocolBase { ColumnLayout { id: content enabled: logic.pageEnabled - anchors.top: parent.bottom + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right