Merge branch 'dev' into feature/download-native-wireguard-config-on-
connect
This commit is contained in:
commit
f97e270c3a
30 changed files with 594 additions and 237 deletions
|
|
@ -1,7 +1,6 @@
|
|||
#include <QBuffer>
|
||||
#include <QImage>
|
||||
#include <QDataStream>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "qrcodegen.hpp"
|
||||
|
||||
|
|
@ -68,8 +67,8 @@ void ShareConnectionLogic::onPushButtonShareAmneziaGenerateClicked()
|
|||
set_shareAmneziaQrCodeTextSeriesLength(0);
|
||||
|
||||
QJsonObject serverConfig;
|
||||
int serverIndex = uiLogic()->selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->selectedDockerContainer;
|
||||
int serverIndex = uiLogic()->m_selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->m_selectedDockerContainer;
|
||||
|
||||
// Full access
|
||||
if (shareFullAccess()) {
|
||||
|
|
@ -127,8 +126,8 @@ void ShareConnectionLogic::onPushButtonShareAmneziaGenerateClicked()
|
|||
|
||||
void ShareConnectionLogic::onPushButtonShareOpenVpnGenerateClicked()
|
||||
{
|
||||
int serverIndex = uiLogic()->selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->selectedDockerContainer;
|
||||
int serverIndex = uiLogic()->m_selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->m_selectedDockerContainer;
|
||||
ServerCredentials credentials = m_settings->serverCredentials(serverIndex);
|
||||
|
||||
const QJsonObject &containerConfig = m_settings->containerConfig(serverIndex, container);
|
||||
|
|
@ -142,8 +141,8 @@ void ShareConnectionLogic::onPushButtonShareOpenVpnGenerateClicked()
|
|||
|
||||
void ShareConnectionLogic::onPushButtonShareShadowSocksGenerateClicked()
|
||||
{
|
||||
int serverIndex = uiLogic()->selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->selectedDockerContainer;
|
||||
int serverIndex = uiLogic()->m_selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->m_selectedDockerContainer;
|
||||
ServerCredentials credentials = m_settings->serverCredentials(serverIndex);
|
||||
|
||||
QJsonObject protoConfig = m_settings->protocolConfig(serverIndex, container, Proto::ShadowSocks);
|
||||
|
|
@ -186,8 +185,8 @@ void ShareConnectionLogic::onPushButtonShareShadowSocksGenerateClicked()
|
|||
|
||||
void ShareConnectionLogic::onPushButtonShareCloakGenerateClicked()
|
||||
{
|
||||
int serverIndex = uiLogic()->selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->selectedDockerContainer;
|
||||
int serverIndex = uiLogic()->m_selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->m_selectedDockerContainer;
|
||||
ServerCredentials credentials = m_settings->serverCredentials(serverIndex);
|
||||
|
||||
QJsonObject protoConfig = m_settings->protocolConfig(serverIndex, container, Proto::Cloak);
|
||||
|
|
@ -209,18 +208,18 @@ void ShareConnectionLogic::onPushButtonShareCloakGenerateClicked()
|
|||
|
||||
void ShareConnectionLogic::onPushButtonShareWireGuardGenerateClicked()
|
||||
{
|
||||
int serverIndex = uiLogic()->selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->selectedDockerContainer;
|
||||
int serverIndex = uiLogic()->m_selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->m_selectedDockerContainer;
|
||||
ServerCredentials credentials = m_settings->serverCredentials(serverIndex);
|
||||
|
||||
const QJsonObject &containerConfig = m_settings->containerConfig(serverIndex, container);
|
||||
|
||||
ErrorCode errorCode = ErrorCode::NoError;
|
||||
QString cfg = m_configurator->wireguardConfigurator->genWireguardConfig(credentials, container, containerConfig, errorCode);
|
||||
if (errorCode) {
|
||||
QMessageBox::warning(nullptr, APPLICATION_NAME,
|
||||
tr("Error occurred while configuring server.") + "\n" +
|
||||
errorString(errorCode));
|
||||
ErrorCode e = ErrorCode::NoError;
|
||||
QString cfg = m_configurator->wireguardConfigurator->genWireguardConfig(credentials, container, containerConfig, e);
|
||||
if (e) {
|
||||
emit uiLogic()->showWarningMessage(tr("Error occurred while generating the config.") + "\n" +
|
||||
tr("Error message: ") + errorString(e) + "\n" +
|
||||
tr("See logs for details."));
|
||||
return;
|
||||
}
|
||||
cfg = m_configurator->processConfigWithExportSettings(serverIndex, container, Proto::WireGuard, cfg);
|
||||
|
|
@ -236,8 +235,8 @@ void ShareConnectionLogic::onPushButtonShareWireGuardGenerateClicked()
|
|||
|
||||
void ShareConnectionLogic::onPushButtonShareIkev2GenerateClicked()
|
||||
{
|
||||
int serverIndex = uiLogic()->selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->selectedDockerContainer;
|
||||
int serverIndex = uiLogic()->m_selectedServerIndex;
|
||||
DockerContainer container = uiLogic()->m_selectedDockerContainer;
|
||||
ServerCredentials credentials = m_settings->serverCredentials(serverIndex);
|
||||
|
||||
ErrorCode errorCode = ErrorCode::NoError;
|
||||
|
|
@ -260,8 +259,8 @@ void ShareConnectionLogic::onPushButtonShareIkev2GenerateClicked()
|
|||
|
||||
void ShareConnectionLogic::updateSharingPage(int serverIndex, DockerContainer container)
|
||||
{
|
||||
uiLogic()->selectedDockerContainer = container;
|
||||
uiLogic()->selectedServerIndex = serverIndex;
|
||||
uiLogic()->m_selectedDockerContainer = container;
|
||||
uiLogic()->m_selectedServerIndex = serverIndex;
|
||||
set_shareFullAccess(container == DockerContainer::None);
|
||||
|
||||
m_shareAmneziaQrCodeTextSeries.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue