mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
Merge branch 'feature/new-gui' of github.com:amnezia-vpn/amnezia-client into feature/new-gui
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "fileUtilites.h"
|
||||
#include "platforms/ios/MobileUtils.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QStandardPaths>
|
||||
@@ -38,6 +39,13 @@ void FileUtilites::saveFile(QString fileName, const QString &data)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
QStringList filesToSend;
|
||||
filesToSend.append(fileUrl.toString());
|
||||
MobileUtils::shareText(filesToSend);
|
||||
return;
|
||||
#endif
|
||||
|
||||
QFileInfo fi(fileUrl.toLocalFile());
|
||||
QDesktopServices::openUrl(fi.absoluteDir().absolutePath());
|
||||
}
|
||||
|
||||
@@ -30,22 +30,22 @@ const char* MessageKey::host = "host";
|
||||
const char* MessageKey::port = "port";
|
||||
const char* MessageKey::isOnDemand = "is-on-demand";
|
||||
|
||||
VpnProtocol::VpnConnectionState iosStatusToState(NEVPNStatus status) {
|
||||
Vpn::ConnectionState iosStatusToState(NEVPNStatus status) {
|
||||
switch (status) {
|
||||
case NEVPNStatusInvalid:
|
||||
return VpnProtocol::VpnConnectionState::Unknown;
|
||||
return Vpn::ConnectionState::Unknown;
|
||||
case NEVPNStatusDisconnected:
|
||||
return VpnProtocol::VpnConnectionState::Disconnected;
|
||||
return Vpn::ConnectionState::Disconnected;
|
||||
case NEVPNStatusConnecting:
|
||||
return VpnProtocol::VpnConnectionState::Connecting;
|
||||
return Vpn::ConnectionState::Connecting;
|
||||
case NEVPNStatusConnected:
|
||||
return VpnProtocol::VpnConnectionState::Connected;
|
||||
return Vpn::ConnectionState::Connected;
|
||||
case NEVPNStatusReasserting:
|
||||
return VpnProtocol::VpnConnectionState::Connecting;
|
||||
return Vpn::ConnectionState::Connecting;
|
||||
case NEVPNStatusDisconnecting:
|
||||
return VpnProtocol::VpnConnectionState::Disconnecting;
|
||||
return Vpn::ConnectionState::Disconnecting;
|
||||
default:
|
||||
return VpnProtocol::VpnConnectionState::Unknown;
|
||||
return Vpn::ConnectionState::Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ bool IosController::initialize()
|
||||
@try {
|
||||
if (error) {
|
||||
qDebug() << "IosController::initialize : Error:" << [error.localizedDescription UTF8String];
|
||||
emit connectionStateChanged(VpnProtocol::VpnConnectionState::Error);
|
||||
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
||||
ok = false;
|
||||
return;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configur
|
||||
@try {
|
||||
if (error) {
|
||||
qDebug() << "IosController::connectVpn : Error:" << [error.localizedDescription UTF8String];
|
||||
emit connectionStateChanged(VpnProtocol::VpnConnectionState::Error);
|
||||
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
||||
ok = false;
|
||||
return;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configur
|
||||
m_currentTunnel = manager;
|
||||
qDebug() << "IosController::connectVpn : Using existing tunnel";
|
||||
if (manager.connection.status == NEVPNStatusConnected) {
|
||||
emit connectionStateChanged(VpnProtocol::VpnConnectionState::Connected);
|
||||
emit connectionStateChanged(Vpn::ConnectionState::Connected);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ void IosController::startTunnel()
|
||||
|
||||
if (saveError) {
|
||||
qDebug() << "IosController::startOpenVPN : Connect OpenVPN Tunnel Save Error" << saveError.localizedDescription.UTF8String;
|
||||
emit connectionStateChanged(VpnProtocol::VpnConnectionState::Error);
|
||||
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ void IosController::startTunnel()
|
||||
|
||||
if (loadError) {
|
||||
qDebug() << "IosController::startOpenVPN : Connect OpenVPN Tunnel Load Error" << loadError.localizedDescription.UTF8String;
|
||||
emit connectionStateChanged(VpnProtocol::VpnConnectionState::Error);
|
||||
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ void IosController::startTunnel()
|
||||
if (!started || startError) {
|
||||
qDebug() << "IosController::startOpenVPN : Connect OpenVPN Tunnel Start Error"
|
||||
<< (startError ? startError.localizedDescription.UTF8String : "");
|
||||
emit connectionStateChanged(VpnProtocol::VpnConnectionState::Error);
|
||||
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
||||
} else {
|
||||
qDebug() << "IosController::startOpenVPN : Starting the tunnel succeeded";
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
#include <QStandardPaths>
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
#include "fileUtilites.h"
|
||||
#include "logger.h"
|
||||
#include "ui/qautostart.h"
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
#include <QHostInfo>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
#include "fileUtilites.h"
|
||||
#include "utilities.h"
|
||||
|
||||
|
||||
@@ -96,7 +96,9 @@ It's okay as long as it's from someone you trust.")
|
||||
|
||||
clickedFunction: function() {
|
||||
ImportController.startDecodingQr()
|
||||
goToPage(PageEnum.PageSetupWizardQrReader)
|
||||
if (Qt.platform.os === "ios") {
|
||||
goToPage(PageEnum.PageSetupWizardQrReader)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user