1103 lines
48 KiB
Diff
1103 lines
48 KiB
Diff
From 391a0f856549f6f6e74ee9eeff1db8361fa641ad Mon Sep 17 00:00:00 2001
|
||
From: luoqing <luoqing@kylinsec.com.cn>
|
||
Date: Tue, 6 Sep 2022 18:57:13 +0800
|
||
Subject: [PATCH] fix(network):fix the self-test defect v-p-n
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: 8bit
|
||
|
||
- 修复v-p-n的自测缺陷
|
||
---
|
||
plugins/network/src/connection-lists.cpp | 4 +-
|
||
.../src/plugin/manager/vpn-manager.cpp | 146 ++++++++++------
|
||
.../network/src/plugin/manager/vpn-manager.h | 7 +-
|
||
.../plugin/setting-widget/vpn/vpn-ipsec.cpp | 43 ++++-
|
||
.../src/plugin/setting-widget/vpn/vpn-ipsec.h | 9 +-
|
||
.../plugin/setting-widget/vpn/vpn-ipsec.ui | 45 +++--
|
||
.../plugin/setting-widget/vpn/vpn-widget.cpp | 52 +++++-
|
||
.../plugin/setting-widget/vpn/vpn-widget.h | 3 +
|
||
.../plugin/setting-widget/vpn/vpn-widget.ui | 2 +-
|
||
.../plugin/settings/vpn/vpn-l2tp-setting.cpp | 4 +
|
||
.../kiran-cpanel-network.zh_CN.ts | 161 ++++++++----------
|
||
11 files changed, 310 insertions(+), 166 deletions(-)
|
||
|
||
diff --git a/plugins/network/src/connection-lists.cpp b/plugins/network/src/connection-lists.cpp
|
||
index 1772379..5745953 100644
|
||
--- a/plugins/network/src/connection-lists.cpp
|
||
+++ b/plugins/network/src/connection-lists.cpp
|
||
@@ -177,6 +177,7 @@ void ConnectionLists::showConnectionLists(ConnectionSettings::ConnectionType typ
|
||
}
|
||
|
||
// TODO:优化代码
|
||
+// Note:vpn connection 的devicePath目前暂时置为空
|
||
void ConnectionLists::addConnectionToLists(Connection::Ptr ptr, const QString& devicePath)
|
||
{
|
||
if (ptr == nullptr)
|
||
@@ -213,7 +214,8 @@ void ConnectionLists::addConnectionToLists(Connection::Ptr ptr, const QString& d
|
||
for (ActiveConnection::Ptr activeConnection : activeConnectionList)
|
||
{
|
||
QStringList deviceList = activeConnection->devices();
|
||
- if (activeConnection->uuid() == ptr->uuid() && deviceList.contains(devicePath))
|
||
+ if (activeConnection->uuid() == ptr->uuid() &&
|
||
+ (deviceList.contains(devicePath) || devicePath.isEmpty()))
|
||
{
|
||
connectionInfo.activeConnectionPath = activeConnection->path();
|
||
switch (activeConnection->state())
|
||
diff --git a/plugins/network/src/plugin/manager/vpn-manager.cpp b/plugins/network/src/plugin/manager/vpn-manager.cpp
|
||
index 8573610..40a3b56 100644
|
||
--- a/plugins/network/src/plugin/manager/vpn-manager.cpp
|
||
+++ b/plugins/network/src/plugin/manager/vpn-manager.cpp
|
||
@@ -91,37 +91,9 @@ void VpnManager::initConnection()
|
||
connect(ui->l2tpSetting, &VpnL2tpSetting::returnPreviousPage, this, &VpnManager::handleReturnPreviousPage);
|
||
connect(ui->pptpSetting, &VpnPptpSetting::returnPreviousPage, this, &VpnManager::handleReturnPreviousPage);
|
||
|
||
- connect(ui->saveButton, &QPushButton::clicked, this, [this]()
|
||
- {
|
||
- int index = ui->vpnTypeStacked->currentIndex();
|
||
- switch (index)
|
||
- {
|
||
- case VPN_TYPE_L2TP:
|
||
- if(ui->l2tpSetting->isInputValid())
|
||
- {
|
||
- ui->l2tpSetting->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Vpn);
|
||
- handleReturnPreviousPage();
|
||
- }
|
||
- break;
|
||
- case VPN_TYPE_PPTP:
|
||
- if(ui->pptpSetting->isInputValid())
|
||
- {
|
||
- ui->pptpSetting->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Vpn);
|
||
- handleReturnPreviousPage();
|
||
- }
|
||
- break;
|
||
- default:
|
||
- break;
|
||
- } });
|
||
-
|
||
- connect(ui->connectionShowPage, &ConnectionShowPage::connectionUpdated, this, [this](const QString &path)
|
||
- {
|
||
- KLOG_DEBUG() << "Connection::updated:" << path;
|
||
- //移除后再加载进来以更新信息
|
||
- ui->connectionShowPage->removeConnectionFromLists(path);
|
||
- Connection::Ptr updateConnection = findConnection(path);
|
||
- ui->connectionShowPage->addConnectionToLists(updateConnection,"");
|
||
- handleReturnPreviousPage(); });
|
||
+ connect(ui->saveButton, &QPushButton::clicked, this, &VpnManager::handleSaveButtonClicked);
|
||
+
|
||
+ connect(ui->connectionShowPage, &ConnectionShowPage::connectionUpdated, this, &VpnManager::handleConnectionUpdated);
|
||
|
||
initNotifierConnection();
|
||
}
|
||
@@ -143,7 +115,7 @@ void VpnManager::handleRequestEditConnection(const QString &uuid, QString active
|
||
ui->l2tpSetting->setConnectionSettings(connectionSettings);
|
||
|
||
ui->l2tpSetting->initSettingPage();
|
||
- ui->l2tpSetting->showSettingPage();
|
||
+ ui->l2tpSetting->showSettingPage(activeConnectionPath);
|
||
}
|
||
else if (serviceType.contains("pptp"))
|
||
{
|
||
@@ -152,7 +124,7 @@ void VpnManager::handleRequestEditConnection(const QString &uuid, QString active
|
||
ui->pptpSetting->setConnectionSettings(connectionSettings);
|
||
|
||
ui->pptpSetting->initSettingPage();
|
||
- ui->pptpSetting->showSettingPage();
|
||
+ ui->pptpSetting->showSettingPage(activeConnectionPath);
|
||
}
|
||
else
|
||
{
|
||
@@ -164,7 +136,32 @@ void VpnManager::handleRequestEditConnection(const QString &uuid, QString active
|
||
ui->stackedWidget->setCurrentIndex(PAGE_SETTING);
|
||
}
|
||
|
||
+void VpnManager::handleSaveButtonClicked()
|
||
+{
|
||
+ int index = ui->vpnTypeStacked->currentIndex();
|
||
+ switch (index)
|
||
+ {
|
||
+ case VPN_TYPE_L2TP:
|
||
+ if (ui->l2tpSetting->isInputValid())
|
||
+ {
|
||
+ ui->l2tpSetting->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Vpn);
|
||
+ handleReturnPreviousPage();
|
||
+ }
|
||
+ break;
|
||
+ case VPN_TYPE_PPTP:
|
||
+ if (ui->pptpSetting->isInputValid())
|
||
+ {
|
||
+ ui->pptpSetting->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Vpn);
|
||
+ handleReturnPreviousPage();
|
||
+ }
|
||
+ break;
|
||
+ default:
|
||
+ break;
|
||
+ }
|
||
+}
|
||
+
|
||
//考虑弹窗输入密码的情况
|
||
+// TODO: AgentOwned的作用
|
||
void VpnManager::handleRequestActivateConnection(const QString &connectionPath, const QString &connectionParameter)
|
||
{
|
||
Connection::Ptr connection = findConnection(connectionPath);
|
||
@@ -173,16 +170,25 @@ void VpnManager::handleRequestActivateConnection(const QString &connectionPath,
|
||
NMStringMap dataMap = vpnSetting->data();
|
||
|
||
int passwordFlags = dataMap.value("password-flags").toInt();
|
||
- if (passwordFlags == Setting::SecretFlagType::None)
|
||
+ /**
|
||
+ * None - 已保存的 Save password for all users
|
||
+ * NotRequired - 不要求
|
||
+ * NotSaved - 总是询问
|
||
+ * AgentOwned - 暂时不使用,Save password for this user
|
||
+ */
|
||
+ if (passwordFlags == Setting::SecretFlagType::None || passwordFlags == Setting::SecretFlagType::AgentOwned)
|
||
{
|
||
activateVPNConnection(connectionPath, connectionParameter);
|
||
+ KLOG_DEBUG() << "passwordFlags None";
|
||
}
|
||
else if (passwordFlags == Setting::SecretFlagType::NotRequired)
|
||
{
|
||
activateVPNConnection(connectionPath, connectionParameter);
|
||
+ KLOG_DEBUG() << "passwordFlags NotRequired";
|
||
}
|
||
else if (passwordFlags == Setting::SecretFlagType::NotSaved)
|
||
{
|
||
+ KLOG_DEBUG() << "passwordFlags NotSaved";
|
||
TextInputDialog inputDialog;
|
||
inputDialog.setTitle(tr("Tips"));
|
||
QString tips = QString(tr("Password required to connect to %1.")).arg(settings->id());
|
||
@@ -246,12 +252,13 @@ void VpnManager::handleActiveConnectionAdded(const QString &activePath)
|
||
QString uuid = vpnConnection->uuid();
|
||
KLOG_DEBUG() << "vpn uuid:" << uuid;
|
||
QListWidgetItem *activeItem = ui->connectionShowPage->findItemByUuid(uuid);
|
||
- ui->connectionShowPage->updateItemActivatedPath(activeItem, activePath);
|
||
- connect(vpnConnection.data(), &VpnConnection::stateChanged, [=](VpnConnection::State state, VpnConnection::StateChangeReason reason)
|
||
- { handleVpnConnectionStateChanged(state, reason, activePath); });
|
||
- //加载等待动画
|
||
- auto item = ui->connectionShowPage->findItemByActivatedPath(activePath);
|
||
- ui->connectionShowPage->updateItemActivatingStatus(item);
|
||
+ KLOG_DEBUG() << "-----------activeItem:" << activeItem;
|
||
+ if (activeItem != nullptr)
|
||
+ {
|
||
+ KLOG_DEBUG() << "---------vpn updateItemActivatedPath";
|
||
+ ui->connectionShowPage->updateItemActivatedPath(activeItem, activePath);
|
||
+ }
|
||
+ connect(vpnConnection.data(), &VpnConnection::stateChanged, this, &VpnManager::handleVpnConnectionStateChanged, Qt::UniqueConnection);
|
||
}
|
||
}
|
||
|
||
@@ -260,13 +267,17 @@ void VpnManager::handleActiveConnectionRemoved(const QString &activePath)
|
||
}
|
||
|
||
// TODO:若没有安装VPN插件则需要提示
|
||
-void VpnManager::handleVpnConnectionStateChanged(VpnConnection::State state, VpnConnection::StateChangeReason reason, const QString &activePath)
|
||
+void VpnManager::handleVpnConnectionStateChanged(VpnConnection::State state, VpnConnection::StateChangeReason reason)
|
||
{
|
||
- auto activeConnection = findActiveConnection(activePath);
|
||
- KLOG_DEBUG() << " activeConnection->id():" << activeConnection->id();
|
||
+ // auto activeConnection = findActiveConnection(activePath);
|
||
+ // auto activeConnection = qobject_cast<ActiveConnection *>(sender());
|
||
+
|
||
+ auto activeVpnConnection = qobject_cast<VpnConnection *>(sender());
|
||
+ QString activePath = activeVpnConnection->path();
|
||
+ KLOG_DEBUG() << " activeConnection->id():" << activeVpnConnection->id();
|
||
QString id = "";
|
||
- if (activeConnection != nullptr)
|
||
- id = activeConnection->id();
|
||
+ if (activeVpnConnection != nullptr)
|
||
+ id = activeVpnConnection->id();
|
||
switch (state)
|
||
{
|
||
case VpnConnection::State::Unknown:
|
||
@@ -279,6 +290,7 @@ void VpnManager::handleVpnConnectionStateChanged(VpnConnection::State state, Vpn
|
||
KLOG_DEBUG() << "VpnConnection::State::NeedAuth";
|
||
break;
|
||
case VpnConnection::State::Connecting:
|
||
+ handleStateActivating(activePath);
|
||
KLOG_DEBUG() << "VpnConnection::State::Connecting";
|
||
break;
|
||
case VpnConnection::State::GettingIpConfig:
|
||
@@ -356,10 +368,30 @@ void VpnManager::handleVpnStateActivated(const QString &activePath)
|
||
{
|
||
ui->connectionShowPage->updateItemActivatedStatus(activePath);
|
||
auto item = ui->connectionShowPage->findItemByActivatedPath(activePath);
|
||
- NetworkConnectionInfo connectionInfo = item->data(Qt::UserRole).value<NetworkConnectionInfo>();
|
||
- StatusNotification::ActiveConnectionActivatedNotify(connectionInfo);
|
||
+ if (item != nullptr)
|
||
+ {
|
||
+ NetworkConnectionInfo connectionInfo = item->data(Qt::UserRole).value<NetworkConnectionInfo>();
|
||
+ StatusNotification::ActiveConnectionActivatedNotify(connectionInfo);
|
||
+ ui->connectionShowPage->update();
|
||
+ }
|
||
+ }
|
||
+}
|
||
+
|
||
+void VpnManager::handleStateActivating(const QString &activatedPath)
|
||
+{
|
||
+ ActiveConnection::Ptr activatedConnection = findActiveConnection(activatedPath);
|
||
+ if (activatedConnection.isNull())
|
||
+ return;
|
||
|
||
- ui->connectionShowPage->update();
|
||
+ if (activatedConnection->type() == ConnectionSettings::ConnectionType::Vpn)
|
||
+ {
|
||
+ // 加载等待动画
|
||
+ auto item = ui->connectionShowPage->findItemByActivatedPath(activatedPath);
|
||
+ KLOG_DEBUG() << "item:" << item;
|
||
+ if (item != nullptr)
|
||
+ {
|
||
+ ui->connectionShowPage->updateItemActivatingStatus(item);
|
||
+ }
|
||
}
|
||
}
|
||
|
||
@@ -394,3 +426,21 @@ void VpnManager::clearVpnSetting()
|
||
break;
|
||
}
|
||
}
|
||
+
|
||
+// TODO:更新列表逻辑需要修改
|
||
+void VpnManager::handleConnectionUpdated(const QString &path)
|
||
+{
|
||
+ KLOG_DEBUG() << "Connection::updated:" << path;
|
||
+ Connection::Ptr updateConnection = findConnection(path);
|
||
+ if (updateConnection->settings()->connectionType() == ConnectionSettings::Vpn)
|
||
+ {
|
||
+ //移除后再加载进来以更新信息
|
||
+ ui->connectionShowPage->removeConnectionFromLists(path);
|
||
+ ui->connectionShowPage->addConnectionToLists(updateConnection, "");
|
||
+ if (ui->stackedWidget->currentIndex() == PAGE_SETTING)
|
||
+ {
|
||
+ }
|
||
+ else
|
||
+ handleReturnPreviousPage();
|
||
+ }
|
||
+}
|
||
diff --git a/plugins/network/src/plugin/manager/vpn-manager.h b/plugins/network/src/plugin/manager/vpn-manager.h
|
||
index e3fd096..93e209b 100644
|
||
--- a/plugins/network/src/plugin/manager/vpn-manager.h
|
||
+++ b/plugins/network/src/plugin/manager/vpn-manager.h
|
||
@@ -48,13 +48,18 @@ public slots:
|
||
void handleActiveConnectionAdded(const QString &activePath) override;
|
||
void handleActiveConnectionRemoved(const QString &activePath) override;
|
||
|
||
- void handleVpnConnectionStateChanged(NetworkManager::VpnConnection::State state, NetworkManager::VpnConnection::StateChangeReason reason, const QString &activePath);
|
||
+ void handleVpnConnectionStateChanged(NetworkManager::VpnConnection::State state, NetworkManager::VpnConnection::StateChangeReason reason);
|
||
void handleVpnStateActivated(const QString &activePath);
|
||
+ void handleStateActivating(const QString &activatedPath) override;
|
||
+
|
||
void handleVpnStateDisconnected(const QString &activePath);
|
||
void handleVpnStateFailed(const QString &activePath);
|
||
|
||
void handleReturnPreviousPage();
|
||
|
||
+ void handleConnectionUpdated(const QString &path);
|
||
+ void handleSaveButtonClicked();
|
||
+
|
||
private:
|
||
Ui::VpnManager *ui;
|
||
};
|
||
diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.cpp b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.cpp
|
||
index d51d9d5..b936014 100644
|
||
--- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.cpp
|
||
+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.cpp
|
||
@@ -37,12 +37,16 @@ void VpnIPsec::initUI()
|
||
ui->enableIPsecLayout->addWidget(m_enableIPsec);
|
||
m_enableIPsec->setChecked(false);
|
||
ui->IPsecWidget->setVisible(false);
|
||
+ ui->preSharedKey->setEchoMode(QLineEdit::Password);
|
||
+ ui->passwordVisual->setVisible(true);
|
||
}
|
||
|
||
void VpnIPsec::initConnection()
|
||
{
|
||
- connect(m_enableIPsec, &QAbstractButton::toggled, [=](bool checked)
|
||
+ connect(m_enableIPsec, &QAbstractButton::toggled, this, [this](bool checked)
|
||
{ ui->IPsecWidget->setVisible(checked); });
|
||
+
|
||
+ connect(ui->passwordVisual, &QPushButton::clicked, this, &VpnIPsec::enablePasswordVisual);
|
||
}
|
||
|
||
void VpnIPsec::setVpnSetting(const VpnSetting::Ptr &vpnSetting)
|
||
@@ -50,6 +54,11 @@ void VpnIPsec::setVpnSetting(const VpnSetting::Ptr &vpnSetting)
|
||
m_vpnSetting = vpnSetting;
|
||
}
|
||
|
||
+void VpnIPsec::setConnectionPtr(const Connection::Ptr &connection)
|
||
+{
|
||
+ m_connection = connection;
|
||
+}
|
||
+
|
||
void VpnIPsec::saveSettings()
|
||
{
|
||
m_dataMap = m_vpnSetting->data();
|
||
@@ -87,9 +96,27 @@ void VpnIPsec::showSettings()
|
||
|
||
ui->groupName->setText(dataMap.value("ipsec-group-name"));
|
||
ui->groupId->setText(dataMap.value("ipsec-gateway-id"));
|
||
- ui->preSharedKey->setText(dataMap.value("ipsec-psk"));
|
||
+ // ui->preSharedKey->setText(dataMap.value("ipsec-psk"));
|
||
ui->ipsecIKE->setText(dataMap.value("ipsec-ike"));
|
||
ui->ipsecESP->setText(dataMap.value("ipsec-esp"));
|
||
+
|
||
+ // XXX:调用m_connection->secrets,会触发Connection::update,有待更改
|
||
+ QDBusPendingReply<NMVariantMapMap> reply = m_connection->secrets("vpn");
|
||
+ reply.waitForFinished();
|
||
+ if (reply.isError() || !reply.isValid())
|
||
+ {
|
||
+ qDebug() << "get secrets error for connection:" << reply.error();
|
||
+ }
|
||
+ NMVariantMapMap NMVariantMap = reply.value();
|
||
+ QVariantMap variantMap = NMVariantMap.value("vpn");
|
||
+ QVariant secretsValue = variantMap.value("secrets");
|
||
+
|
||
+ auto dbusArg = secretsValue.value<QDBusArgument>();
|
||
+ KLOG_DEBUG() << dbusArg.currentType() << dbusArg.currentSignature();
|
||
+
|
||
+ NMStringMap dbusMap = qdbus_cast<NMStringMap>(dbusArg);
|
||
+ KLOG_DEBUG() << "dbusMap " << dbusMap;
|
||
+ ui->preSharedKey->setText(dbusMap.value("ipsec-psk"));
|
||
}
|
||
else
|
||
resetSettings();
|
||
@@ -110,3 +137,15 @@ void VpnIPsec::clearPtr()
|
||
{
|
||
m_vpnSetting.clear();
|
||
}
|
||
+
|
||
+void VpnIPsec::enablePasswordVisual()
|
||
+{
|
||
+ if (ui->preSharedKey->echoMode() == QLineEdit::Password)
|
||
+ {
|
||
+ ui->preSharedKey->setEchoMode(QLineEdit::Normal);
|
||
+ }
|
||
+ else
|
||
+ {
|
||
+ ui->preSharedKey->setEchoMode(QLineEdit::Password);
|
||
+ }
|
||
+}
|
||
diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.h b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.h
|
||
index 35e90c3..5fcf5f5 100644
|
||
--- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.h
|
||
+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.h
|
||
@@ -15,8 +15,9 @@
|
||
#ifndef KIRAN_CPANEL_NETWORK_VPN_IPSEC_H
|
||
#define KIRAN_CPANEL_NETWORK_VPN_IPSEC_H
|
||
|
||
-#include <QWidget>
|
||
+#include <NetworkManagerQt/Connection>
|
||
#include <NetworkManagerQt/VpnSetting>
|
||
+#include <QWidget>
|
||
QT_BEGIN_NAMESPACE
|
||
namespace Ui
|
||
{
|
||
@@ -24,7 +25,6 @@ class VpnIPsec;
|
||
}
|
||
QT_END_NAMESPACE
|
||
|
||
-
|
||
class KiranSwitchButton;
|
||
class VpnIPsec : public QWidget
|
||
{
|
||
@@ -37,18 +37,21 @@ public:
|
||
void initUI();
|
||
void initConnection();
|
||
void setVpnSetting(const NetworkManager::VpnSetting::Ptr &vpnSetting);
|
||
+ void setConnectionPtr(const NetworkManager::Connection::Ptr &connection);
|
||
|
||
public slots:
|
||
void saveSettings();
|
||
void showSettings();
|
||
void resetSettings();
|
||
void clearPtr();
|
||
+ void enablePasswordVisual();
|
||
|
||
private:
|
||
Ui::VpnIPsec *ui;
|
||
NetworkManager::VpnSetting::Ptr m_vpnSetting;
|
||
+ NetworkManager::Connection::Ptr m_connection;
|
||
NMStringMap m_dataMap;
|
||
KiranSwitchButton *m_enableIPsec;
|
||
};
|
||
|
||
-#endif //KIRAN_CPANEL_NETWORK_VPN_IPSEC_H
|
||
+#endif // KIRAN_CPANEL_NETWORK_VPN_IPSEC_H
|
||
diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.ui b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.ui
|
||
index a789a33..915abef 100644
|
||
--- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.ui
|
||
+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.ui
|
||
@@ -156,23 +156,34 @@
|
||
</widget>
|
||
</item>
|
||
<item>
|
||
- <widget class="QLineEdit" name="preSharedKey">
|
||
- <property name="minimumSize">
|
||
- <size>
|
||
- <width>0</width>
|
||
- <height>36</height>
|
||
- </size>
|
||
- </property>
|
||
- <property name="maximumSize">
|
||
- <size>
|
||
- <width>16777215</width>
|
||
- <height>36</height>
|
||
- </size>
|
||
- </property>
|
||
- <property name="accessibleName">
|
||
- <string>EditPreSharedKey</string>
|
||
- </property>
|
||
- </widget>
|
||
+ <layout class="QHBoxLayout" name="horizontalLayout">
|
||
+ <item>
|
||
+ <widget class="QLineEdit" name="preSharedKey">
|
||
+ <property name="minimumSize">
|
||
+ <size>
|
||
+ <width>0</width>
|
||
+ <height>36</height>
|
||
+ </size>
|
||
+ </property>
|
||
+ <property name="maximumSize">
|
||
+ <size>
|
||
+ <width>16777215</width>
|
||
+ <height>36</height>
|
||
+ </size>
|
||
+ </property>
|
||
+ <property name="accessibleName">
|
||
+ <string>EditPreSharedKey</string>
|
||
+ </property>
|
||
+ </widget>
|
||
+ </item>
|
||
+ <item>
|
||
+ <widget class="QPushButton" name="passwordVisual">
|
||
+ <property name="text">
|
||
+ <string>Show Password</string>
|
||
+ </property>
|
||
+ </widget>
|
||
+ </item>
|
||
+ </layout>
|
||
</item>
|
||
</layout>
|
||
</item>
|
||
diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp
|
||
index 56eb802..b1b2306 100644
|
||
--- a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp
|
||
+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp
|
||
@@ -43,7 +43,7 @@ void VpnWidget::initUI()
|
||
|
||
ui->passwordOptions->setFocusPolicy(Qt::NoFocus);
|
||
ui->password->setEchoMode(QLineEdit::Password);
|
||
- ui->passwordVisual->setVisible(false);
|
||
+ ui->passwordVisual->setVisible(true);
|
||
}
|
||
|
||
void VpnWidget::initConnection()
|
||
@@ -57,6 +57,11 @@ void VpnWidget::setVpnSetting(const VpnSetting::Ptr &vpnSetting)
|
||
m_vpnSetting = vpnSetting;
|
||
}
|
||
|
||
+void VpnWidget::setConnectionPtr(const Connection::Ptr &connection)
|
||
+{
|
||
+ m_connection = connection;
|
||
+}
|
||
+
|
||
void VpnWidget::setErrorTips(KiranTips *errorTips)
|
||
{
|
||
m_errorTip = errorTips;
|
||
@@ -69,6 +74,9 @@ void VpnWidget::handlePasswordOptionsChanged(Setting::SecretFlagType secretFlagT
|
||
case Setting::SecretFlagType::None:
|
||
ui->passwordWidget->setVisible(true);
|
||
break;
|
||
+ case Setting::SecretFlagType::AgentOwned:
|
||
+ ui->passwordWidget->setVisible(true);
|
||
+ break;
|
||
case Setting::SecretFlagType::NotSaved:
|
||
ui->passwordWidget->setVisible(false);
|
||
break;
|
||
@@ -123,17 +131,49 @@ void VpnWidget::showSettings()
|
||
if (m_vpnSetting != nullptr)
|
||
{
|
||
NMStringMap dataMap = m_vpnSetting->data();
|
||
- NMStringMap secretMap = m_vpnSetting->secrets();
|
||
+
|
||
ui->gateway->setText(dataMap.value("gateway"));
|
||
ui->userName->setText(dataMap.value("user"));
|
||
-
|
||
KLOG_DEBUG() << "password-flags:" << dataMap.value("password-flags");
|
||
int index = ui->passwordOptions->findData(dataMap.value("password-flags"));
|
||
- ui->passwordOptions->setCurrentIndex(index);
|
||
+ if (index == -1)
|
||
+ {
|
||
+ // 代表password-flags为Setting::SecretFlagType::AgentOwned (0x01)
|
||
+ // XXX:暂时不使用AgentOwned,统一改为None
|
||
+ if (dataMap.value("password-flags") == 1)
|
||
+ {
|
||
+ int newIndex = ui->passwordOptions->findData(Setting::SecretFlagType::None);
|
||
+ ui->passwordOptions->setCurrentIndex(newIndex);
|
||
+ }
|
||
+ }
|
||
+ else
|
||
+ ui->passwordOptions->setCurrentIndex(index);
|
||
+
|
||
+ // 通过m_vpnSetting->secrets()获取到的map为空
|
||
+ // NMStringMap secretMap = m_vpnSetting->secrets();
|
||
+ // KLOG_DEBUG() << "vpn secretMap:" << secretMap;
|
||
+ // KLOG_DEBUG() << "password:" << secretMap.value("password");
|
||
+ // ui->password->setText(secretMap.value("password"));
|
||
|
||
- KLOG_DEBUG() << "password:" << secretMap.value("password");
|
||
- ui->password->setText(secretMap.value("password"));
|
||
ui->ntDomain->setText(dataMap.value("domain"));
|
||
+
|
||
+ // XXX:调用m_connection->secrets,会触发Connection::update,有待更改
|
||
+ QDBusPendingReply<NMVariantMapMap> reply = m_connection->secrets("vpn");
|
||
+ reply.waitForFinished();
|
||
+ if (reply.isError() || !reply.isValid())
|
||
+ {
|
||
+ qDebug() << "get secrets error for connection:" << reply.error();
|
||
+ }
|
||
+ NMVariantMapMap NMVariantMap = reply.value();
|
||
+ QVariantMap variantMap = NMVariantMap.value("vpn");
|
||
+ QVariant secretsValue = variantMap.value("secrets");
|
||
+
|
||
+ auto dbusArg = secretsValue.value<QDBusArgument>();
|
||
+ KLOG_DEBUG() << dbusArg.currentType() << dbusArg.currentSignature();
|
||
+
|
||
+ NMStringMap dbusMap = qdbus_cast<NMStringMap>(dbusArg);
|
||
+ KLOG_DEBUG() << "dbusMap " << dbusMap;
|
||
+ ui->password->setText(dbusMap.value("password"));
|
||
}
|
||
else
|
||
resetSettings();
|
||
diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.h b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.h
|
||
index 73c7494..8efb301 100644
|
||
--- a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.h
|
||
+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.h
|
||
@@ -14,6 +14,7 @@
|
||
#ifndef KIRAN_CPANEL_NETWORK_VPN_WIDGET_H
|
||
#define KIRAN_CPANEL_NETWORK_VPN_WIDGET_H
|
||
|
||
+#include <NetworkManagerQt/Connection>
|
||
#include <NetworkManagerQt/VpnSetting>
|
||
#include <QWidget>
|
||
QT_BEGIN_NAMESPACE
|
||
@@ -36,6 +37,7 @@ public:
|
||
void initUI();
|
||
void initConnection();
|
||
void setVpnSetting(const NetworkManager::VpnSetting::Ptr &vpnSetting);
|
||
+ void setConnectionPtr(const NetworkManager::Connection::Ptr &connection);
|
||
void setErrorTips(KiranTips *errorTips);
|
||
bool isIpv4AddressValid(const QString &address);
|
||
|
||
@@ -52,6 +54,7 @@ public slots:
|
||
private:
|
||
Ui::VpnWidget *ui;
|
||
NetworkManager::VpnSetting::Ptr m_vpnSetting;
|
||
+ NetworkManager::Connection::Ptr m_connection;
|
||
NMStringMap m_dataMap;
|
||
NMStringMap m_secretMap;
|
||
KiranTips *m_errorTip = nullptr;
|
||
diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.ui b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.ui
|
||
index e9c9298..8d9a319 100644
|
||
--- a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.ui
|
||
+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.ui
|
||
@@ -195,7 +195,7 @@
|
||
<string>ButtonPasswordVisual</string>
|
||
</property>
|
||
<property name="text">
|
||
- <string>PushButton</string>
|
||
+ <string>Show Password</string>
|
||
</property>
|
||
</widget>
|
||
</item>
|
||
diff --git a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp
|
||
index 2e31ad8..e6679ac 100644
|
||
--- a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp
|
||
+++ b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp
|
||
@@ -63,6 +63,10 @@ void VpnL2tpSetting::initSpecificSettings()
|
||
ui->vpnIPsec->setVpnSetting(m_vpnSetting);
|
||
ui->vpnIpvx->setIpv4Setting(m_ipv4Setting);
|
||
ui->disconnectAndDeleteWidget->setConnectionPtr(m_connection);
|
||
+
|
||
+ // XXX:暂时转入ConnectionPtr,之后优化
|
||
+ ui->vpnWidget->setConnectionPtr(m_connection);
|
||
+ ui->vpnIPsec->setConnectionPtr(m_connection);
|
||
}
|
||
|
||
void VpnL2tpSetting::showSettingPage(QString activeConnectionPath)
|
||
diff --git a/plugins/network/translations/kiran-cpanel-network.zh_CN.ts b/plugins/network/translations/kiran-cpanel-network.zh_CN.ts
|
||
index 0949f19..0f8503a 100644
|
||
--- a/plugins/network/translations/kiran-cpanel-network.zh_CN.ts
|
||
+++ b/plugins/network/translations/kiran-cpanel-network.zh_CN.ts
|
||
@@ -176,8 +176,8 @@
|
||
<translation>请输入网络名称</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/connection-lists.cpp" line="456"/>
|
||
- <location filename="../src/connection-lists.cpp" line="464"/>
|
||
+ <location filename="../src/connection-lists.cpp" line="458"/>
|
||
+ <location filename="../src/connection-lists.cpp" line="466"/>
|
||
<source>Other WiFi networks</source>
|
||
<translation>其它WIFI网络</translation>
|
||
</message>
|
||
@@ -205,50 +205,49 @@
|
||
<translation>自动连接</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="42"/>
|
||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="43"/>
|
||
<source>Required</source>
|
||
<translation>必填</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="78"/>
|
||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="84"/>
|
||
<source>Wired Connection %1</source>
|
||
<translation>有线网络%1</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="117"/>
|
||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="123"/>
|
||
<source>VPN L2TP %1</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="120"/>
|
||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="126"/>
|
||
<source>VPN PPTP %1</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="181"/>
|
||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="187"/>
|
||
<source>Connection name can not be empty</source>
|
||
<translation>网络名称不能为空</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="182"/>
|
||
<source>Error</source>
|
||
- <translation>错误</translation>
|
||
+ <translation type="vanished">错误</translation>
|
||
</message>
|
||
</context>
|
||
<context>
|
||
<name>ConnectionShowPage</name>
|
||
<message>
|
||
- <location filename="../src/connection-show-page.ui" line="14"/>
|
||
+ <location filename="../src/plugin/connection-show-page.ui" line="14"/>
|
||
<source>ConnectionShowPage</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/connection-show-page.ui" line="62"/>
|
||
+ <location filename="../src/plugin/connection-show-page.ui" line="62"/>
|
||
<source>TextLabel</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/connection-show-page.ui" line="118"/>
|
||
+ <location filename="../src/plugin/connection-show-page.ui" line="118"/>
|
||
<source>ButtonCreateConnection</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
@@ -420,14 +419,13 @@
|
||
<translation>不指定设备</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ethernet-widget.cpp" line="140"/>
|
||
+ <location filename="../src/plugin/setting-widget/ethernet-widget.cpp" line="145"/>
|
||
<source>Clone Mac invalid</source>
|
||
<translation>无效的克隆MAC地址</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ethernet-widget.cpp" line="141"/>
|
||
<source>Error</source>
|
||
- <translation>错误</translation>
|
||
+ <translation type="vanished">错误</translation>
|
||
</message>
|
||
</context>
|
||
<context>
|
||
@@ -498,44 +496,37 @@
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="36"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="37"/>
|
||
<source>Auto</source>
|
||
<translation>自动</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="37"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="38"/>
|
||
<source>Manual</source>
|
||
<translation>手动</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="39"/>
|
||
<location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="40"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="41"/>
|
||
<source>Required</source>
|
||
<translation>必填</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="213"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="217"/>
|
||
<source>Ipv4 address can not be empty</source>
|
||
<translation>Ipv4地址不能为空</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="214"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="226"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="237"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="248"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="261"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="276"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="290"/>
|
||
<source>Error</source>
|
||
- <translation>错误</translation>
|
||
+ <translation type="vanished">错误</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="225"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="227"/>
|
||
<source>Ipv4 Address invalid</source>
|
||
<translation>无效的Ipv4地址</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="236"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="237"/>
|
||
<source>NetMask can not be empty</source>
|
||
<translation>子网掩码不能为空</translation>
|
||
</message>
|
||
@@ -545,17 +536,17 @@
|
||
<translation>无效的子网掩码</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="260"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="259"/>
|
||
<source>Ipv4 Gateway invalid</source>
|
||
<translation>无效的Ipv4网关</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="275"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="272"/>
|
||
<source>Ipv4 Preferred DNS invalid</source>
|
||
<translation>无效的Ipv4首选DNS</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="289"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="285"/>
|
||
<source>Ipv4 Alternate DNS invalid</source>
|
||
<translation>无效的Ipv4备选DNS</translation>
|
||
</message>
|
||
@@ -628,56 +619,51 @@
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="35"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="36"/>
|
||
<source>Auto</source>
|
||
<translation>自动</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="36"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="37"/>
|
||
<source>Manual</source>
|
||
<translation>手动</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="37"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="38"/>
|
||
<source>Ignored</source>
|
||
<translation>忽略</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="39"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="40"/>
|
||
<source>Required</source>
|
||
<translation>必填</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="194"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="200"/>
|
||
<source>Ipv6 address can not be empty</source>
|
||
<translation>Ipv6地址不能为空</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="195"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="207"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="221"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="236"/>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="250"/>
|
||
<source>Error</source>
|
||
- <translation>错误</translation>
|
||
+ <translation type="vanished">错误</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="206"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="211"/>
|
||
<source>Ipv6 address invalid</source>
|
||
<translation>无效的Ipv6地址</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="220"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="224"/>
|
||
<source>Ipv6 Gateway invalid</source>
|
||
<translation>无效的Ipv6网关</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="235"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="238"/>
|
||
<source>Ipv6 Preferred DNS invalid</source>
|
||
<translation>无效的Ipv6首选DNS</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="249"/>
|
||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="251"/>
|
||
<source>Ipv6 Alternate DNS invalid</source>
|
||
<translation>无效的Ipv6备选DNS</translation>
|
||
</message>
|
||
@@ -692,7 +678,7 @@
|
||
<context>
|
||
<name>NetworkTray</name>
|
||
<message>
|
||
- <location filename="../src/tray/network-tray.cpp" line="166"/>
|
||
+ <location filename="../src/tray/network-tray.cpp" line="167"/>
|
||
<source>Network settings</source>
|
||
<translation>网络设置</translation>
|
||
</message>
|
||
@@ -780,64 +766,64 @@
|
||
<context>
|
||
<name>TrayItemWidget</name>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.ui" line="32"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="32"/>
|
||
<source>TrayItemWidget</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.ui" line="92"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="92"/>
|
||
<source>Icon</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.ui" line="99"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="99"/>
|
||
<source>Name</source>
|
||
<translation>名称</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.ui" line="187"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="187"/>
|
||
<source>Status</source>
|
||
<translation>状态</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.ui" line="263"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="263"/>
|
||
<source>Ignore</source>
|
||
<translation>忽略</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.ui" line="288"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="288"/>
|
||
<source>Disconnect</source>
|
||
<translation>断开</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.ui" line="355"/>
|
||
- <location filename="../src/tray-itemwidget.ui" line="477"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="355"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="477"/>
|
||
<source>Cancel</source>
|
||
<translation>取消</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.ui" line="380"/>
|
||
- <location filename="../src/tray-itemwidget.ui" line="502"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="380"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.ui" line="502"/>
|
||
<source>Connect</source>
|
||
<translation>连接</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.cpp" line="144"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.cpp" line="144"/>
|
||
<source>Connected</source>
|
||
<translation>已连接</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.cpp" line="155"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.cpp" line="155"/>
|
||
<source>Unconnected</source>
|
||
<translation>未连接</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.cpp" line="189"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.cpp" line="189"/>
|
||
<source>Please input password</source>
|
||
<translation>请输入密码</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/tray-itemwidget.cpp" line="198"/>
|
||
+ <location filename="../src/tray/tray-itemwidget.cpp" line="198"/>
|
||
<source>Please input a network name</source>
|
||
<translation>请输入网络名称</translation>
|
||
</message>
|
||
@@ -903,27 +889,32 @@
|
||
<translation>预共享密钥</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="173"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="175"/>
|
||
<source>EditPreSharedKey</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="187"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="182"/>
|
||
+ <source>Show Password</source>
|
||
+ <translation>显示密码</translation>
|
||
+ </message>
|
||
+ <message>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="198"/>
|
||
<source>Internet Key Exchange Protocol</source>
|
||
<translation>密钥交换协议</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="206"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="217"/>
|
||
<source>EditIpsecIKE</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="220"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="231"/>
|
||
<source>Encapsulating Security Payload</source>
|
||
<translation>安全封装协议</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="239"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-ipsec.ui" line="250"/>
|
||
<source>EditIpsecESP</source>
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
@@ -984,7 +975,7 @@
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/settings/vpn/vpn-l2tp-setting.cpp" line="25"/>
|
||
+ <location filename="../src/plugin/settings/vpn/vpn-l2tp-setting.cpp" line="27"/>
|
||
<source>VPN name</source>
|
||
<translation>VPN名称</translation>
|
||
</message>
|
||
@@ -1023,12 +1014,12 @@
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/manager/vpn-manager.cpp" line="187"/>
|
||
+ <location filename="../src/plugin/manager/vpn-manager.cpp" line="193"/>
|
||
<source>Tips</source>
|
||
<translation>提示</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/manager/vpn-manager.cpp" line="188"/>
|
||
+ <location filename="../src/plugin/manager/vpn-manager.cpp" line="194"/>
|
||
<source>Password required to connect to %1.</source>
|
||
<translation>连接网络 "%1" 需要密码</translation>
|
||
</message>
|
||
@@ -1139,7 +1130,7 @@
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/settings/vpn/vpn-pptp-setting.cpp" line="24"/>
|
||
+ <location filename="../src/plugin/settings/vpn/vpn-pptp-setting.cpp" line="26"/>
|
||
<source>VPN name</source>
|
||
<translation>VPN名称</translation>
|
||
</message>
|
||
@@ -1198,8 +1189,8 @@
|
||
</message>
|
||
<message>
|
||
<location filename="../src/plugin/setting-widget/vpn/vpn-widget.ui" line="198"/>
|
||
- <source>PushButton</source>
|
||
- <translation type="unfinished"></translation>
|
||
+ <source>Show Password</source>
|
||
+ <translation>显示密码</translation>
|
||
</message>
|
||
<message>
|
||
<location filename="../src/plugin/setting-widget/vpn/vpn-widget.ui" line="212"/>
|
||
@@ -1212,52 +1203,48 @@
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="27"/>
|
||
<location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="28"/>
|
||
<location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="29"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="30"/>
|
||
<source>Required</source>
|
||
<translation>必填</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="39"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="40"/>
|
||
<source>Saved</source>
|
||
<translation>已保存的</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="40"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="41"/>
|
||
<source>Ask</source>
|
||
<translation>总是询问</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="41"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="42"/>
|
||
<source>Not required</source>
|
||
<translation>不要求</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="157"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="203"/>
|
||
<source>Gateway can not be empty</source>
|
||
<translation>网关不能为空</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="158"/>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="169"/>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="180"/>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="192"/>
|
||
<source>Error</source>
|
||
- <translation>错误</translation>
|
||
+ <translation type="vanished">错误</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="168"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="213"/>
|
||
<source>Gateway invalid</source>
|
||
<translation>无效的网关</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="179"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="223"/>
|
||
<source>user name can not be empty</source>
|
||
<translation>用户名不能为空</translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="191"/>
|
||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="233"/>
|
||
<source>password can not be empty</source>
|
||
<translation>密码不能为空</translation>
|
||
</message>
|
||
@@ -1308,7 +1295,7 @@
|
||
<translation type="unfinished"></translation>
|
||
</message>
|
||
<message>
|
||
- <location filename="../src/plugin/settings/wired-setting-page.cpp" line="67"/>
|
||
+ <location filename="../src/plugin/settings/wired-setting-page.cpp" line="75"/>
|
||
<source>Network name</source>
|
||
<translation>网络名称</translation>
|
||
</message>
|
||
--
|
||
2.33.0
|
||
|