fix(network):fix the problem of network and details corresponding error,Add error prompt box when saving configuration,fix invalid configuration created for the first time,fix crash and wireless network disable function defects
- 保存配置时,增加错误提示框 修复网络详情页面中网络与详情对应错误 修复初次创建配置失效的问题 修复无线网络禁用的缺陷
This commit is contained in:
parent
665e584573
commit
fd13947a9a
@ -0,0 +1,59 @@
|
||||
From ebd20e32e3f0c0944aebdad0cd5a347694b033e4 Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Fri, 12 Aug 2022 17:27:50 +0800
|
||||
Subject: [PATCH 1/7] feature(network):Add the conf file to overwrite the
|
||||
original configuration of NetworkManager
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 添加conf文件以覆盖NetworkManager原先的配置
|
||||
---
|
||||
plugins/network/CMakeLists.txt | 4 ++++
|
||||
plugins/network/data/00-server.conf.in | 18 ++++++++++++++++++
|
||||
2 files changed, 22 insertions(+)
|
||||
create mode 100644 plugins/network/data/00-server.conf.in
|
||||
|
||||
diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt
|
||||
index 0bdf4f8..02dbe3a 100644
|
||||
--- a/plugins/network/CMakeLists.txt
|
||||
+++ b/plugins/network/CMakeLists.txt
|
||||
@@ -115,6 +115,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kiran-network-status-icon.desktop DEST
|
||||
SET(link_source ${PLUGIN_DESKTOP_INSTALL_DIR}/${TARGET_NAME}.desktop)
|
||||
SET(link_target ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}-link.desktop)
|
||||
|
||||
+set(NETWORK_SERVER_CONF /etc/NetworkManager/conf.d)
|
||||
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/00-server.conf.in ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf @ONLY)
|
||||
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf DESTINATION ${NETWORK_SERVER_CONF}/)
|
||||
+
|
||||
#安装插件和二进制文件
|
||||
install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_INSTALL_DIR}/)
|
||||
install(TARGETS ${TRAY_PROCESS} DESTINATION ${INSTALL_BINDIR})
|
||||
diff --git a/plugins/network/data/00-server.conf.in b/plugins/network/data/00-server.conf.in
|
||||
new file mode 100644
|
||||
index 0000000..e3202b8
|
||||
--- /dev/null
|
||||
+++ b/plugins/network/data/00-server.conf.in
|
||||
@@ -0,0 +1,18 @@
|
||||
+# This configuration file changes NetworkManager's behavior to
|
||||
+# what's expected on "traditional UNIX server" type deployments.
|
||||
+#
|
||||
+# See "man NetworkManager.conf" for more information about these
|
||||
+# and other keys.
|
||||
+
|
||||
+#NetworkManager会先读取/etc/NetworkManager/NetworkManager.conf,然后是/usr/lib/NetworkManager/conf.d/下的配置
|
||||
+#最后读取/etc/NetworkManager/conf.d,后读取的文件将覆盖先读取的同名文件配置
|
||||
+#在/etc/NetworkManager/conf.d目录添加该文件,用以覆盖/usr/lib/NetworkManager/conf.d下的同名文件的配置
|
||||
+#https://gitee.com/src-openeuler/kiran-desktop/issues/I5I0AA
|
||||
+[main]
|
||||
+# Do not do automatic (DHCP/SLAAC) configuration on ethernet devices
|
||||
+# with no other matching connections.
|
||||
+no-auto-default=*
|
||||
+
|
||||
+# Ignore the carrier (cable plugged in) state when attempting to
|
||||
+# activate static-IP connections.
|
||||
+#ignore-carrier=*
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.33.0
|
||||
|
||||
1540
0002-fix-network-fix-crash-and-wireless-network-disable-f.patch
Normal file
1540
0002-fix-network-fix-crash-and-wireless-network-disable-f.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,66 @@
|
||||
From 50c2ccba7af88dfe335a5dfdeff54e4371238316 Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Fri, 19 Aug 2022 15:24:13 +0800
|
||||
Subject: [PATCH 3/7] fix(network):fix the problem of network and details
|
||||
corresponding error
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复网络详情页面中网络与详情对应错误
|
||||
|
||||
Close #I5M0L9
|
||||
---
|
||||
plugins/network/src/plugin/details-page.cpp | 10 ++++++----
|
||||
plugins/network/src/plugin/details-page.h | 2 +-
|
||||
2 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/plugins/network/src/plugin/details-page.cpp b/plugins/network/src/plugin/details-page.cpp
|
||||
index dfee3f6..5ba4d12 100644
|
||||
--- a/plugins/network/src/plugin/details-page.cpp
|
||||
+++ b/plugins/network/src/plugin/details-page.cpp
|
||||
@@ -75,11 +75,11 @@ void DetailsPage::initMultiConnectionDetailsWidget()
|
||||
QWidget *widget = new ConnectionDetailsWidget(device, this);
|
||||
ui->stackedWidget->addWidget(widget);
|
||||
}
|
||||
- connect(ui->activatedConnectionComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
- &DetailsPage::handleActivatedConnectionComboBoxChanged);
|
||||
+ connect(ui->activatedConnectionComboBox, QOverload<int>::of(&QComboBox::activated), this,
|
||||
+ &DetailsPage::handleActivatedConnectionComboBoxActivated, Qt::UniqueConnection);
|
||||
}
|
||||
|
||||
-void DetailsPage::handleActivatedConnectionComboBoxChanged(int index)
|
||||
+void DetailsPage::handleActivatedConnectionComboBoxActivated(int index)
|
||||
{
|
||||
ui->stackedWidget->setCurrentIndex(index);
|
||||
}
|
||||
@@ -131,10 +131,12 @@ void DetailsPage::clear()
|
||||
{
|
||||
m_deviceList.clear();
|
||||
ui->activatedConnectionComboBox->clear();
|
||||
- for (int i = 0; i < ui->stackedWidget->count(); ++i)
|
||||
+ int count = ui->stackedWidget->count();
|
||||
+ for (int i = 0; i < count; i++)
|
||||
{
|
||||
QWidget *widget = ui->stackedWidget->currentWidget();
|
||||
ui->stackedWidget->removeWidget(widget);
|
||||
+ widget->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/plugins/network/src/plugin/details-page.h b/plugins/network/src/plugin/details-page.h
|
||||
index e7cb744..f0cceb1 100644
|
||||
--- a/plugins/network/src/plugin/details-page.h
|
||||
+++ b/plugins/network/src/plugin/details-page.h
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
void reload();
|
||||
|
||||
public slots:
|
||||
- void handleActivatedConnectionComboBoxChanged(int index);
|
||||
+ void handleActivatedConnectionComboBoxActivated(int index);
|
||||
void handleDeviceAdded(const QString &devicePath);
|
||||
void handleDeviceRemoved(const QString &devicePath);
|
||||
void handleActiveConnectionAdded(const QString &activeConnectionPath);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
532
0004-fix-network-Add-error-prompt-box-when-saving-configu.patch
Normal file
532
0004-fix-network-Add-error-prompt-box-when-saving-configu.patch
Normal file
@ -0,0 +1,532 @@
|
||||
From 4b63a44d04c18418076fe7570887e601b499671c Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Tue, 23 Aug 2022 09:19:05 +0800
|
||||
Subject: [PATCH 4/7] fix(network):Add error prompt box when saving
|
||||
configuration
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 保存配置时,增加错误提示框
|
||||
|
||||
Close #I5GYQD
|
||||
---
|
||||
.../src/plugin/manager/wired-manager.cpp | 2 +
|
||||
.../setting-widget/connection-name-widget.cpp | 16 ++-
|
||||
.../plugin/setting-widget/ethernet-widget.cpp | 27 +++--
|
||||
.../src/plugin/setting-widget/ipv4-widget.cpp | 105 ++++++++++++++----
|
||||
.../src/plugin/setting-widget/ipv6-widget.cpp | 62 +++++++++--
|
||||
.../src/plugin/settings/setting-page.cpp | 10 +-
|
||||
.../plugin/settings/wired-setting-page.cpp | 7 +-
|
||||
7 files changed, 180 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/plugins/network/src/plugin/manager/wired-manager.cpp b/plugins/network/src/plugin/manager/wired-manager.cpp
|
||||
index cfd11b2..9ceeb89 100644
|
||||
--- a/plugins/network/src/plugin/manager/wired-manager.cpp
|
||||
+++ b/plugins/network/src/plugin/manager/wired-manager.cpp
|
||||
@@ -180,7 +180,9 @@ void WiredManager::handleSaveButtonClicked()
|
||||
handleReturnPreviousPage();
|
||||
}
|
||||
else
|
||||
+ {
|
||||
KLOG_DEBUG() << "Invalid input exists";
|
||||
+ }
|
||||
}
|
||||
|
||||
void WiredManager::handleConnectionUpdated(const QString &path)
|
||||
diff --git a/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp b/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp
|
||||
index 71b3626..5ee8b62 100644
|
||||
--- a/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp
|
||||
+++ b/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "connection-name-widget.h"
|
||||
+#include <kiran-message-box.h>
|
||||
#include <kiran-switch-button.h>
|
||||
#include <qt5-log-i.h>
|
||||
#include <NetworkManagerQt/Connection>
|
||||
@@ -82,7 +83,7 @@ void ConnectionNameWidget::showSettings(ConnectionSettings::ConnectionType conne
|
||||
}
|
||||
else if (m_connectionType == ConnectionSettings::Wireless)
|
||||
{
|
||||
- if(m_connectionSettings != nullptr)
|
||||
+ if (m_connectionSettings != nullptr)
|
||||
{
|
||||
WirelessSetting::Ptr wirelessSetting = m_connectionSettings->setting(Setting::Wireless).dynamicCast<WirelessSetting>();
|
||||
ui->connectionName->setText(wirelessSetting->ssid());
|
||||
@@ -91,8 +92,8 @@ void ConnectionNameWidget::showSettings(ConnectionSettings::ConnectionType conne
|
||||
}
|
||||
else
|
||||
{
|
||||
-// ui->connectionName->setEnabled(true);
|
||||
-// m_autoConnection->setChecked(true);
|
||||
+ // ui->connectionName->setEnabled(true);
|
||||
+ // m_autoConnection->setChecked(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,11 +174,16 @@ void ConnectionNameWidget::clearPtr()
|
||||
|
||||
bool ConnectionNameWidget::isInputValid()
|
||||
{
|
||||
- bool valid = true;
|
||||
QString nameStr = ui->connectionName->text();
|
||||
if (nameStr.isEmpty())
|
||||
{
|
||||
+ QString error = QString(tr("Connection name can not be empty"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+
|
||||
+ KLOG_DEBUG() << "Connection name cannot be empty";
|
||||
return false;
|
||||
}
|
||||
- return valid;
|
||||
+ return true;
|
||||
}
|
||||
\ No newline at end of file
|
||||
diff --git a/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp b/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp
|
||||
index 55c5cd8..ae43125 100644
|
||||
--- a/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp
|
||||
+++ b/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp
|
||||
@@ -13,11 +13,13 @@
|
||||
*/
|
||||
|
||||
#include "ethernet-widget.h"
|
||||
+#include <kiran-message-box.h>
|
||||
#include <kiran-switch-button.h>
|
||||
#include <qt5-log-i.h>
|
||||
#include <NetworkManagerQt/Manager>
|
||||
#include <NetworkManagerQt/WiredDevice>
|
||||
#include "ui_ethernet-widget.h"
|
||||
+
|
||||
using namespace NetworkManager;
|
||||
|
||||
EthernetWidget::EthernetWidget(QWidget *parent) : QWidget(parent), ui(new Ui::EthernetWidget)
|
||||
@@ -38,7 +40,7 @@ void EthernetWidget::initUI()
|
||||
ui->customMTU->setVisible(false);
|
||||
ui->customMTU->setMinimum(0);
|
||||
ui->customMTU->setMaximum(10000);
|
||||
- //UserData设为空"",为了匹配Mac地址为空的情况
|
||||
+ // UserData设为空"",为了匹配Mac地址为空的情况
|
||||
ui->deviceMac->addItem(tr("No device specified"), "");
|
||||
initEthernetMacComboBox();
|
||||
}
|
||||
@@ -75,7 +77,7 @@ void EthernetWidget::setWiredSetting(const WiredSetting::Ptr &wiredSetting)
|
||||
|
||||
void EthernetWidget::saveSettings()
|
||||
{
|
||||
- if(m_wiredSetting != nullptr)
|
||||
+ if (m_wiredSetting != nullptr)
|
||||
{
|
||||
QString macAddress = ui->deviceMac->currentData().toString();
|
||||
QString cloneMac = ui->cloneDeviceMac->text();
|
||||
@@ -89,7 +91,7 @@ void EthernetWidget::saveSettings()
|
||||
|
||||
void EthernetWidget::showSettings()
|
||||
{
|
||||
- if(m_wiredSetting != nullptr)
|
||||
+ if (m_wiredSetting != nullptr)
|
||||
{
|
||||
QString deviceMac = m_wiredSetting->macAddress().toHex(':').toUpper();
|
||||
QString cloneDeviceMac = m_wiredSetting->clonedMacAddress().toHex(':').toUpper();
|
||||
@@ -132,15 +134,26 @@ void EthernetWidget::clearPtr()
|
||||
|
||||
bool EthernetWidget::isInputValid()
|
||||
{
|
||||
- isCloneMacValid(ui->cloneDeviceMac->text());
|
||||
- return false;
|
||||
+ if (!isCloneMacValid(ui->cloneDeviceMac->text()))
|
||||
+ {
|
||||
+ QString error = QString(tr("Clone Mac invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+
|
||||
+ KLOG_DEBUG() << "Clone Mac invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
}
|
||||
|
||||
bool EthernetWidget::isCloneMacValid(const QString &cloneMac)
|
||||
{
|
||||
- if (cloneMac.isEmpty()) {
|
||||
+ if (cloneMac.isEmpty())
|
||||
+ {
|
||||
return true;
|
||||
}
|
||||
- bool matched = QRegExp("^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$").exactMatch(cloneMac);
|
||||
+ bool matched = QRegExp("^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$").exactMatch(cloneMac);
|
||||
+
|
||||
return matched;
|
||||
}
|
||||
diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
|
||||
index 30f7844..7f28576 100644
|
||||
--- a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
|
||||
+++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "ipv4-widget.h"
|
||||
+#include <kiran-message-box.h>
|
||||
#include <kiran-switch-button.h>
|
||||
#include <qt5-log-i.h>
|
||||
#include "ui_ipv4-widget.h"
|
||||
@@ -65,7 +66,6 @@ void Ipv4Widget::setIpv4Setting(const Ipv4Setting::Ptr &ipv4Setting)
|
||||
m_ipv4Setting = ipv4Setting;
|
||||
}
|
||||
|
||||
-// TODO:错误提示弹窗
|
||||
void Ipv4Widget::saveSettings()
|
||||
{
|
||||
if (m_ipv4Setting != nullptr)
|
||||
@@ -85,7 +85,6 @@ void Ipv4Widget::saveSettings()
|
||||
m_ipv4Setting->setMethod(method);
|
||||
|
||||
ipv4Address.setIp(QHostAddress(ui->ipv4Address->text()));
|
||||
- // XXX:输入合法性检测
|
||||
QString netMask = ui->ipv4Netmask->text();
|
||||
if (!netMask.contains("."))
|
||||
{
|
||||
@@ -134,8 +133,11 @@ void Ipv4Widget::showSettings()
|
||||
{
|
||||
if (m_ipv4Setting != nullptr)
|
||||
{
|
||||
+ KLOG_DEBUG() << "m_ipv4Setting->method():" << m_ipv4Setting->method();
|
||||
+
|
||||
if (m_ipv4Setting->method() == Ipv4Setting::ConfigMethod::Automatic)
|
||||
{
|
||||
+ KLOG_DEBUG() << "Ipv4Setting::ConfigMethod::Automatic";
|
||||
resetSettings();
|
||||
}
|
||||
else if (m_ipv4Setting->method() == Ipv4Setting::ConfigMethod::Manual)
|
||||
@@ -143,11 +145,15 @@ void Ipv4Widget::showSettings()
|
||||
int ipv4MethodIndex = ui->ipv4Method->findData(m_ipv4Setting->method());
|
||||
ui->ipv4Method->setCurrentIndex(ipv4MethodIndex);
|
||||
// xxx:取addresses的方式有待改进
|
||||
- IpAddress ipv4Address = m_ipv4Setting->addresses().at(0);
|
||||
+ IpAddress ipv4Address = m_ipv4Setting->addresses().value(0);
|
||||
QString address = ipv4Address.ip().toString();
|
||||
QString netmask = ipv4Address.netmask().toString();
|
||||
QString gateway = ipv4Address.gateway().toString();
|
||||
|
||||
+ KLOG_DEBUG() << "address:" << address;
|
||||
+ KLOG_DEBUG() << "netmask:" << netmask;
|
||||
+ KLOG_DEBUG() << "gateway:" << gateway;
|
||||
+
|
||||
ui->ipv4Address->setText(address);
|
||||
ui->ipv4Netmask->setText(netmask);
|
||||
ui->ipv4Gateway->setText(gateway);
|
||||
@@ -188,57 +194,108 @@ void Ipv4Widget::clearPtr()
|
||||
}
|
||||
|
||||
// TODO:验证功能待完善
|
||||
+// XXX:输入验证提示暂时先用弹框,之后修改
|
||||
bool Ipv4Widget::isInputValid()
|
||||
{
|
||||
Ipv4Setting::ConfigMethod configMethod = ui->ipv4Method->currentData().value<Ipv4Setting::ConfigMethod>();
|
||||
- bool valid = true;
|
||||
+
|
||||
if (configMethod == Ipv4Setting::ConfigMethod::Automatic)
|
||||
{
|
||||
- isIpv4AddressValid(ui->ipv4PreferredDNS->text());
|
||||
- isIpv4AddressValid(ui->ipv4AlternateDNS->text());
|
||||
}
|
||||
else if (configMethod == Ipv4Setting::ConfigMethod::Manual)
|
||||
{
|
||||
- QString ipv4 = ui->ipv4Address->text();
|
||||
- QString netMask = ui->ipv4Netmask->text();
|
||||
+ QString ipv4 = ui->ipv4Address->text();
|
||||
+ QString netMask = ui->ipv4Netmask->text();
|
||||
+ QString ipv4Gateway = ui->ipv4Gateway->text();
|
||||
|
||||
if (ipv4.isEmpty())
|
||||
{
|
||||
- valid = false;
|
||||
- KLOG_DEBUG() << "Ipv4 address cannot be empty";
|
||||
+ QString error = QString(tr("Ipv4 address can not be empty"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+
|
||||
+ KLOG_DEBUG() << "Ipv4 address can not be empty";
|
||||
+ return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
- if(!isIpv4AddressValid(ipv4))
|
||||
+ if (!isIpv4AddressValid(ipv4))
|
||||
{
|
||||
- valid = false;
|
||||
- KLOG_DEBUG() << "Ipv4Address invalid";
|
||||
+ QString error = QString(tr("Ipv4 Address invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Ipv4 Address invalid";
|
||||
+ return false;
|
||||
}
|
||||
}
|
||||
-
|
||||
+
|
||||
if (netMask.isEmpty())
|
||||
{
|
||||
- valid = false;
|
||||
+ QString error = QString(tr("NetMask can not be empty"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
KLOG_DEBUG() << "NetMask cannot be empty";
|
||||
+ return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
- if(!isIpv4NetmaskValid(netMask))
|
||||
+ if (!isIpv4NetmaskValid(netMask))
|
||||
{
|
||||
- valid = false;
|
||||
+ QString error = QString(tr("Netmask invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
KLOG_DEBUG() << "Netmask invalid";
|
||||
+ return false;
|
||||
}
|
||||
}
|
||||
|
||||
- ui->ipv4Gateway->text();
|
||||
- ui->ipv4PreferredDNS->text();
|
||||
- ui->ipv4AlternateDNS->text();
|
||||
- isIpv4AddressValid(ui->ipv4Gateway->text());
|
||||
- isIpv4AddressValid(ui->ipv4PreferredDNS->text());
|
||||
- isIpv4AddressValid(ui->ipv4AlternateDNS->text());
|
||||
+ if (!ipv4Gateway.isEmpty())
|
||||
+ {
|
||||
+ if (!isIpv4AddressValid(ipv4Gateway))
|
||||
+ {
|
||||
+ QString error = QString(tr("Ipv4 Gateway invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Ipv4 Netmask invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
+ QString preferredDNS = ui->ipv4PreferredDNS->text();
|
||||
+ if (!preferredDNS.isEmpty())
|
||||
+ {
|
||||
+ if (!isIpv4AddressValid(preferredDNS))
|
||||
+ {
|
||||
+ QString error = QString(tr("Ipv4 Preferred DNS invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Ipv4 Preferred DNS invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
- return valid;
|
||||
+
|
||||
+ QString alternateDNS = ui->ipv4AlternateDNS->text();
|
||||
+ if (!alternateDNS.isEmpty())
|
||||
+ {
|
||||
+ if (!isIpv4AddressValid(alternateDNS))
|
||||
+ {
|
||||
+ QString error = QString(tr("Ipv4 Alternate DNS invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Ipv4 Alternate DNS invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
bool Ipv4Widget::isIpv4AddressValid(const QString &address)
|
||||
diff --git a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
index a703f95..a9f1676 100644
|
||||
--- a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
+++ b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "ipv6-widget.h"
|
||||
+#include <kiran-message-box.h>
|
||||
#include <qt5-log-i.h>
|
||||
#include "ui_ipv6-widget.h"
|
||||
using namespace NetworkManager;
|
||||
@@ -177,7 +178,7 @@ void Ipv6Widget::clearPtr()
|
||||
bool Ipv6Widget::isInputValid()
|
||||
{
|
||||
Ipv6Setting::ConfigMethod configMethod = ui->ipv6Method->currentData().value<Ipv6Setting::ConfigMethod>();
|
||||
- bool valid = true;
|
||||
+
|
||||
if (configMethod == Ipv6Setting::ConfigMethod::Ignored)
|
||||
{
|
||||
}
|
||||
@@ -189,24 +190,71 @@ bool Ipv6Widget::isInputValid()
|
||||
QString ipv6 = ui->ipv6Address->text();
|
||||
if (ipv6.isEmpty())
|
||||
{
|
||||
- valid = false;
|
||||
+ QString error = QString(tr("Ipv6 address can not be empty"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+
|
||||
KLOG_DEBUG() << "Ipv6 Address cannot be empty";
|
||||
+ return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isIpv6AddressValid(ipv6))
|
||||
{
|
||||
- valid = false;
|
||||
+ QString error = QString(tr("Ipv6 address invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
KLOG_DEBUG() << "Ipv6Address invalid";
|
||||
+ return false;
|
||||
}
|
||||
}
|
||||
|
||||
- isIpv6AddressValid(ui->ipv6Gateway->text());
|
||||
- isIpv6AddressValid(ui->ipv6AlternateDNS->text());
|
||||
- isIpv6AddressValid(ui->ipv6PreferredDNS->text());
|
||||
+ QString ipv6Gateway = ui->ipv6Gateway->text();
|
||||
+ if (!ipv6Gateway.isEmpty())
|
||||
+ {
|
||||
+ if (!isIpv6AddressValid(ipv6Gateway))
|
||||
+ {
|
||||
+ QString error = QString(tr("Ipv6 Gateway invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Ipv6 Netmask invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
- return valid;
|
||||
+ QString preferredDNS = ui->ipv6PreferredDNS->text();
|
||||
+ if (!preferredDNS.isEmpty())
|
||||
+ {
|
||||
+ if (!isIpv6AddressValid(preferredDNS))
|
||||
+ {
|
||||
+ QString error = QString(tr("Ipv6 Preferred DNS invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Ipv6 Preferred DNS invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ QString alternateDNS = ui->ipv6AlternateDNS->text();
|
||||
+ if (!alternateDNS.isEmpty())
|
||||
+ {
|
||||
+ if (!isIpv6AddressValid(alternateDNS))
|
||||
+ {
|
||||
+ QString error = QString(tr("Ipv6 Alternate DNS invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Ipv6 Alternate DNS invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
bool Ipv6Widget::isIpv6AddressValid(const QString &address)
|
||||
diff --git a/plugins/network/src/plugin/settings/setting-page.cpp b/plugins/network/src/plugin/settings/setting-page.cpp
|
||||
index 241f46c..dd84209 100644
|
||||
--- a/plugins/network/src/plugin/settings/setting-page.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/setting-page.cpp
|
||||
@@ -76,11 +76,12 @@ void SettingPage::setConnectionSettings(const ConnectionSettings::Ptr& other)
|
||||
|
||||
void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType connectionType)
|
||||
{
|
||||
- if(m_connectionSettings == nullptr)
|
||||
+ if (m_connectionSettings == nullptr)
|
||||
{
|
||||
initConnectionSettings(connectionType);
|
||||
initSettingPage();
|
||||
saveSettingPage();
|
||||
+ KLOG_DEBUG() << " m_connectionSettings->toMap():" << m_connectionSettings->toMap();
|
||||
QDBusPendingReply<QDBusObjectPath> replyAdd = NetworkManager::addConnection(m_connectionSettings->toMap());
|
||||
replyAdd.waitForFinished();
|
||||
if (replyAdd.isError())
|
||||
@@ -88,13 +89,16 @@ void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType con
|
||||
KLOG_DEBUG() << "add connection failed," << replyAdd.error();
|
||||
}
|
||||
else
|
||||
- KLOG_DEBUG() << "add new connection";
|
||||
+ {
|
||||
+ KLOG_DEBUG() << "add new connection reply:" << replyAdd.reply();
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
saveSettingPage();
|
||||
//只有无线网络使用自定义settingUpdated信号,因为未连接无线网络前不存在本地Setting,无法在初始化时监听信号
|
||||
- connect(m_connection.data(),&NetworkManager::Connection::updated,this,&SettingPage::settingUpdated,Qt::UniqueConnection);
|
||||
+ connect(m_connection.data(), &NetworkManager::Connection::updated, this, &SettingPage::settingUpdated, Qt::UniqueConnection);
|
||||
+ KLOG_DEBUG() << "m_connectionSettings->toMap():" << m_connectionSettings->toMap();
|
||||
QDBusPendingReply<> replyUpdate = m_connection->update(m_connectionSettings->toMap());
|
||||
replyUpdate.waitForFinished();
|
||||
if (replyUpdate.isError())
|
||||
diff --git a/plugins/network/src/plugin/settings/wired-setting-page.cpp b/plugins/network/src/plugin/settings/wired-setting-page.cpp
|
||||
index 86ec372..4466468 100644
|
||||
--- a/plugins/network/src/plugin/settings/wired-setting-page.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/wired-setting-page.cpp
|
||||
@@ -20,18 +20,17 @@
|
||||
#include <NetworkManagerQt/Manager>
|
||||
#include <NetworkManagerQt/Settings>
|
||||
#include "ui_wired-setting-page.h"
|
||||
+
|
||||
using namespace NetworkManager;
|
||||
|
||||
WiredSettingPage::WiredSettingPage(QWidget *parent) : SettingPage(parent), ui(new Ui::WiredSettingPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
initConnecton();
|
||||
- KLOG_DEBUG() << "WiredSettingPage::WiredSettingPage(QWidget *parent)";
|
||||
}
|
||||
|
||||
WiredSettingPage::~WiredSettingPage()
|
||||
{
|
||||
- KLOG_DEBUG() << "WiredSettingPage::~WiredSettingPage()";
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -54,6 +53,7 @@ void WiredSettingPage::initSpecificSettings()
|
||||
m_wiredSetting = m_connectionSettings->setting(Setting::SettingType::Wired).dynamicCast<WiredSetting>();
|
||||
}
|
||||
|
||||
+// TODO:修改命名
|
||||
void WiredSettingPage::initWidgets()
|
||||
{
|
||||
ui->connectionNameWidget->setConnectionSettings(m_connectionSettings);
|
||||
@@ -109,7 +109,8 @@ void WiredSettingPage::clearPtr()
|
||||
|
||||
bool WiredSettingPage::isInputValid()
|
||||
{
|
||||
- if (ui->ipv4Widget->isInputValid() && ui->ipv6Widget->isInputValid() && ui->connectionNameWidget->isInputValid())
|
||||
+ if (ui->ipv4Widget->isInputValid() && ui->ipv6Widget->isInputValid() &&
|
||||
+ ui->connectionNameWidget->isInputValid() && ui->ethernetWidget->isInputValid())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
466
0005-fix-network-fix-invalid-configuration-created-for-th.patch
Normal file
466
0005-fix-network-fix-invalid-configuration-created-for-th.patch
Normal file
@ -0,0 +1,466 @@
|
||||
From 78bd84e3e5f9626e363e295a1f175c6f2f816ffe Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Tue, 23 Aug 2022 11:45:12 +0800
|
||||
Subject: [PATCH 5/7] fix(network):fix invalid configuration created for the
|
||||
first time
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复初次创建配置失效的问题
|
||||
---
|
||||
.../src/plugin/setting-widget/ipv6-widget.cpp | 27 ++++++++++---------
|
||||
.../src/plugin/settings/setting-page.cpp | 4 +--
|
||||
.../src/plugin/settings/setting-page.h | 4 +--
|
||||
.../plugin/settings/vpn/vpn-l2tp-setting.cpp | 17 ++++++------
|
||||
.../plugin/settings/vpn/vpn-l2tp-setting.h | 5 ++--
|
||||
.../plugin/settings/vpn/vpn-pptp-setting.cpp | 18 ++++++-------
|
||||
.../plugin/settings/vpn/vpn-pptp-setting.h | 5 ++--
|
||||
.../plugin/settings/wired-setting-page.cpp | 9 +++----
|
||||
.../src/plugin/settings/wired-setting-page.h | 3 +--
|
||||
.../plugin/settings/wireless-setting-page.cpp | 19 +++++++------
|
||||
.../plugin/settings/wireless-setting-page.h | 8 +++---
|
||||
11 files changed, 54 insertions(+), 65 deletions(-)
|
||||
|
||||
diff --git a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
index a9f1676..a16bff5 100644
|
||||
--- a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
+++ b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
@@ -81,7 +81,6 @@ void Ipv6Widget::saveSettings()
|
||||
{
|
||||
m_ipv6Setting->setMethod(method);
|
||||
m_ipv6Setting->setAddresses(QList<NetworkManager::IpAddress>());
|
||||
- return;
|
||||
}
|
||||
else if (method == Ipv6Setting::ConfigMethod::Automatic)
|
||||
{
|
||||
@@ -119,11 +118,13 @@ void Ipv6Widget::showSettings()
|
||||
{
|
||||
if (m_ipv6Setting->method() == Ipv6Setting::ConfigMethod::Ignored)
|
||||
{
|
||||
- resetSettings();
|
||||
+ int ipv6MethodIndex = ui->ipv6Method->findData(Ipv6Setting::ConfigMethod::Ignored);
|
||||
+ ui->ipv6Method->setCurrentIndex(ipv6MethodIndex);
|
||||
}
|
||||
else if (m_ipv6Setting->method() == Ipv6Setting::ConfigMethod::Automatic)
|
||||
{
|
||||
- resetSettings();
|
||||
+ int ipv6MethodIndex = ui->ipv6Method->findData(Ipv6Setting::ConfigMethod::Automatic);
|
||||
+ ui->ipv6Method->setCurrentIndex(ipv6MethodIndex);
|
||||
}
|
||||
else if (m_ipv6Setting->method() == Ipv6Setting::ConfigMethod::Manual)
|
||||
{
|
||||
@@ -135,24 +136,24 @@ void Ipv6Widget::showSettings()
|
||||
QString ip = ipv6Address.ip().toString();
|
||||
int prefix = ipv6Address.prefixLength();
|
||||
QString gateway = ipv6Address.gateway().toString();
|
||||
- QString preferredDNS = "";
|
||||
- QString alternateDNS = "";
|
||||
|
||||
ui->ipv6Address->setText(ip);
|
||||
ui->ipv6Prefix->setValue(prefix);
|
||||
ui->ipv6Gateway->setText(gateway);
|
||||
+ }
|
||||
|
||||
- if (!m_ipv6Setting->dns().isEmpty())
|
||||
+ QString preferredDNS = "";
|
||||
+ QString alternateDNS = "";
|
||||
+ if (!m_ipv6Setting->dns().isEmpty())
|
||||
+ {
|
||||
+ preferredDNS = m_ipv6Setting->dns().at(0).toString();
|
||||
+ if (m_ipv6Setting->dns().count() >= 2)
|
||||
{
|
||||
- preferredDNS = m_ipv6Setting->dns().at(0).toString();
|
||||
- if (m_ipv6Setting->dns().count() >= 2)
|
||||
- {
|
||||
- alternateDNS = m_ipv6Setting->dns().at(1).toString();
|
||||
- }
|
||||
+ alternateDNS = m_ipv6Setting->dns().at(1).toString();
|
||||
}
|
||||
- ui->ipv6PreferredDNS->setText(preferredDNS);
|
||||
- ui->ipv6AlternateDNS->setText(alternateDNS);
|
||||
}
|
||||
+ ui->ipv6PreferredDNS->setText(preferredDNS);
|
||||
+ ui->ipv6AlternateDNS->setText(alternateDNS);
|
||||
}
|
||||
else
|
||||
resetSettings();
|
||||
diff --git a/plugins/network/src/plugin/settings/setting-page.cpp b/plugins/network/src/plugin/settings/setting-page.cpp
|
||||
index dd84209..512b263 100644
|
||||
--- a/plugins/network/src/plugin/settings/setting-page.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/setting-page.cpp
|
||||
@@ -81,7 +81,7 @@ void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType con
|
||||
initConnectionSettings(connectionType);
|
||||
initSettingPage();
|
||||
saveSettingPage();
|
||||
- KLOG_DEBUG() << " m_connectionSettings->toMap():" << m_connectionSettings->toMap();
|
||||
+
|
||||
QDBusPendingReply<QDBusObjectPath> replyAdd = NetworkManager::addConnection(m_connectionSettings->toMap());
|
||||
replyAdd.waitForFinished();
|
||||
if (replyAdd.isError())
|
||||
@@ -98,7 +98,6 @@ void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType con
|
||||
saveSettingPage();
|
||||
//只有无线网络使用自定义settingUpdated信号,因为未连接无线网络前不存在本地Setting,无法在初始化时监听信号
|
||||
connect(m_connection.data(), &NetworkManager::Connection::updated, this, &SettingPage::settingUpdated, Qt::UniqueConnection);
|
||||
- KLOG_DEBUG() << "m_connectionSettings->toMap():" << m_connectionSettings->toMap();
|
||||
QDBusPendingReply<> replyUpdate = m_connection->update(m_connectionSettings->toMap());
|
||||
replyUpdate.waitForFinished();
|
||||
if (replyUpdate.isError())
|
||||
@@ -111,7 +110,6 @@ void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType con
|
||||
void SettingPage::initSettingPage()
|
||||
{
|
||||
initSpecificSettings();
|
||||
- initWidgets();
|
||||
}
|
||||
|
||||
bool SettingPage::isInputValid()
|
||||
diff --git a/plugins/network/src/plugin/settings/setting-page.h b/plugins/network/src/plugin/settings/setting-page.h
|
||||
index ef5a8a7..474751a 100644
|
||||
--- a/plugins/network/src/plugin/settings/setting-page.h
|
||||
+++ b/plugins/network/src/plugin/settings/setting-page.h
|
||||
@@ -39,7 +39,6 @@ public:
|
||||
|
||||
virtual void initSettingPage();
|
||||
virtual void initSpecificSettings() = 0;
|
||||
- virtual void initWidgets() = 0;
|
||||
virtual void saveSettingPage() = 0;
|
||||
virtual bool isInputValid();
|
||||
|
||||
@@ -53,7 +52,6 @@ signals:
|
||||
void settingChanged();
|
||||
void settingUpdated();
|
||||
|
||||
-
|
||||
protected:
|
||||
NetworkManager::Connection::Ptr m_connection = nullptr;
|
||||
NetworkManager::ConnectionSettings::Ptr m_connectionSettings = nullptr;
|
||||
@@ -68,4 +66,4 @@ private:
|
||||
bool m_isNewConnection;
|
||||
};
|
||||
|
||||
-#endif //KIRAN_CPANEL_NETWORK_SETTINGPAGE_H
|
||||
+#endif // KIRAN_CPANEL_NETWORK_SETTINGPAGE_H
|
||||
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 b9c7e84..dc9e4d2 100644
|
||||
--- a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp
|
||||
@@ -13,9 +13,9 @@
|
||||
*/
|
||||
|
||||
#include "vpn-l2tp-setting.h"
|
||||
-#include "ui_vpn-l2tp-setting.h"
|
||||
-#include <NetworkManagerQt/Settings>
|
||||
#include <qt5-log-i.h>
|
||||
+#include <NetworkManagerQt/Settings>
|
||||
+#include "ui_vpn-l2tp-setting.h"
|
||||
#define ServiceTypeL2TP "org.freedesktop.NetworkManager.l2tp"
|
||||
using namespace NetworkManager;
|
||||
|
||||
@@ -33,25 +33,24 @@ VpnL2tpSetting::~VpnL2tpSetting()
|
||||
|
||||
void VpnL2tpSetting::initConnection()
|
||||
{
|
||||
- connect(ui->disconnectAndDeleteWidget,&DisconnectAndDeleteButton::disconnectButtonClicked,this,&VpnL2tpSetting::returnPreviousPage);
|
||||
- connect(ui->disconnectAndDeleteWidget,&DisconnectAndDeleteButton::deleteButtonClicked,this,&VpnL2tpSetting::returnPreviousPage);
|
||||
+ connect(ui->disconnectAndDeleteWidget, &DisconnectAndDeleteButton::disconnectButtonClicked, this, &VpnL2tpSetting::returnPreviousPage);
|
||||
+ connect(ui->disconnectAndDeleteWidget, &DisconnectAndDeleteButton::deleteButtonClicked, this, &VpnL2tpSetting::returnPreviousPage);
|
||||
}
|
||||
|
||||
void VpnL2tpSetting::initSettingPage()
|
||||
{
|
||||
initSpecificSettings();
|
||||
- initWidgets();
|
||||
}
|
||||
|
||||
void VpnL2tpSetting::initSpecificSettings()
|
||||
{
|
||||
m_vpnSetting = m_connectionSettings->setting(Setting::SettingType::Vpn).dynamicCast<VpnSetting>();
|
||||
m_ipv4Setting = m_connectionSettings->setting(Setting::SettingType::Ipv4).dynamicCast<Ipv4Setting>();
|
||||
+
|
||||
m_vpnSetting->setServiceType(ServiceTypeL2TP);
|
||||
-}
|
||||
+ m_vpnSetting->setInitialized(true);
|
||||
+ m_ipv4Setting->setInitialized(true);
|
||||
|
||||
-void VpnL2tpSetting::initWidgets()
|
||||
-{
|
||||
ui->connectioNameWidget->setConnectionSettings(m_connectionSettings);
|
||||
ui->vpnWidget->setVpnSetting(m_vpnSetting);
|
||||
ui->vpnPpp->setVpnSetting(m_vpnSetting);
|
||||
@@ -80,7 +79,7 @@ void VpnL2tpSetting::showSettingPage(QString activeConnectionPath)
|
||||
if (activeConnectionPath.isEmpty())
|
||||
ui->disconnectAndDeleteWidget->initButton(SETTING_CONNECTION_STATUS_DEACTIVATED);
|
||||
else
|
||||
- ui->disconnectAndDeleteWidget->initButton(SETTING_CONNECTION_STATUS_ACTIVATED,activeConnectionPath);
|
||||
+ ui->disconnectAndDeleteWidget->initButton(SETTING_CONNECTION_STATUS_ACTIVATED, activeConnectionPath);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.h b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.h
|
||||
index cda99b6..daefdb8 100644
|
||||
--- a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.h
|
||||
+++ b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.h
|
||||
@@ -15,8 +15,8 @@
|
||||
#ifndef KIRAN_CPANEL_NETWORK_VPN_L2TP_SETTING_H
|
||||
#define KIRAN_CPANEL_NETWORK_VPN_L2TP_SETTING_H
|
||||
|
||||
-#include <QWidget>
|
||||
#include <NetworkManagerQt/VpnSetting>
|
||||
+#include <QWidget>
|
||||
#include "setting-page.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui
|
||||
@@ -36,7 +36,6 @@ public:
|
||||
void initConnection();
|
||||
void initSettingPage() override;
|
||||
void initSpecificSettings() override;
|
||||
- void initWidgets() override;
|
||||
void clearPtr() override;
|
||||
|
||||
public slots:
|
||||
@@ -49,4 +48,4 @@ private:
|
||||
NetworkManager::VpnSetting::Ptr m_vpnSetting;
|
||||
};
|
||||
|
||||
-#endif //KIRAN_CPANEL_NETWORK_VPN_L2TP_SETTING_H
|
||||
+#endif // KIRAN_CPANEL_NETWORK_VPN_L2TP_SETTING_H
|
||||
diff --git a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp
|
||||
index c09b2aa..260ae22 100644
|
||||
--- a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp
|
||||
@@ -13,8 +13,8 @@
|
||||
*/
|
||||
|
||||
#include "vpn-pptp-setting.h"
|
||||
-#include "ui_vpn-pptp-setting.h"
|
||||
#include <qt5-log-i.h>
|
||||
+#include "ui_vpn-pptp-setting.h"
|
||||
#define ServiceTypePPTP "org.freedesktop.NetworkManager.pptp"
|
||||
using namespace NetworkManager;
|
||||
|
||||
@@ -22,8 +22,8 @@ VpnPptpSetting::VpnPptpSetting(QWidget *parent) : SettingPage(parent), ui(new Ui
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->generalWidget->setNameLabel(tr("VPN name"));
|
||||
- connect(ui->generalButton,&DisconnectAndDeleteButton::disconnectButtonClicked,this,&VpnPptpSetting::returnPreviousPage);
|
||||
- connect(ui->generalButton,&DisconnectAndDeleteButton::deleteButtonClicked,this,&VpnPptpSetting::returnPreviousPage);
|
||||
+ connect(ui->generalButton, &DisconnectAndDeleteButton::disconnectButtonClicked, this, &VpnPptpSetting::returnPreviousPage);
|
||||
+ connect(ui->generalButton, &DisconnectAndDeleteButton::deleteButtonClicked, this, &VpnPptpSetting::returnPreviousPage);
|
||||
}
|
||||
|
||||
VpnPptpSetting::~VpnPptpSetting()
|
||||
@@ -34,19 +34,17 @@ VpnPptpSetting::~VpnPptpSetting()
|
||||
void VpnPptpSetting::initSettingPage()
|
||||
{
|
||||
initSpecificSettings();
|
||||
- initWidgets();
|
||||
}
|
||||
|
||||
-
|
||||
void VpnPptpSetting::initSpecificSettings()
|
||||
{
|
||||
m_vpnSetting = m_connectionSettings->setting(Setting::SettingType::Vpn).dynamicCast<VpnSetting>();
|
||||
m_ipv4Setting = m_connectionSettings->setting(Setting::SettingType::Ipv4).dynamicCast<Ipv4Setting>();
|
||||
+
|
||||
m_vpnSetting->setServiceType(ServiceTypePPTP);
|
||||
-}
|
||||
+ m_vpnSetting->setInitialized(true);
|
||||
+ m_ipv4Setting->setInitialized(true);
|
||||
|
||||
-void VpnPptpSetting::initWidgets()
|
||||
-{
|
||||
ui->generalWidget->setConnectionSettings(m_connectionSettings);
|
||||
ui->vpnWidget->setVpnSetting(m_vpnSetting);
|
||||
ui->vpnPpp->setVpnSetting(m_vpnSetting);
|
||||
@@ -81,13 +79,13 @@ void VpnPptpSetting::showSettingPage(QString activeConnectionPath)
|
||||
if (activeConnectionPath.isEmpty())
|
||||
ui->generalButton->initButton(SETTING_CONNECTION_STATUS_DEACTIVATED);
|
||||
else
|
||||
- ui->generalButton->initButton(SETTING_CONNECTION_STATUS_ACTIVATED,activeConnectionPath);
|
||||
+ ui->generalButton->initButton(SETTING_CONNECTION_STATUS_ACTIVATED, activeConnectionPath);
|
||||
}
|
||||
}
|
||||
|
||||
void VpnPptpSetting::clearPtr()
|
||||
{
|
||||
- KLOG_DEBUG() << "VpnPptpSetting::clearPtr" ;
|
||||
+ KLOG_DEBUG() << "VpnPptpSetting::clearPtr";
|
||||
m_vpnSetting.clear();
|
||||
SettingPage::clearPtr();
|
||||
|
||||
diff --git a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.h b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.h
|
||||
index 729d1da..fa179a1 100644
|
||||
--- a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.h
|
||||
+++ b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.h
|
||||
@@ -15,9 +15,9 @@
|
||||
#ifndef KIRAN_CPANEL_NETWORK_VPN_PPTP_SETTING_H
|
||||
#define KIRAN_CPANEL_NETWORK_VPN_PPTP_SETTING_H
|
||||
|
||||
+#include <NetworkManagerQt/VpnSetting>
|
||||
#include <QWidget>
|
||||
#include "setting-page.h"
|
||||
-#include <NetworkManagerQt/VpnSetting>
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui
|
||||
{
|
||||
@@ -34,7 +34,6 @@ public:
|
||||
~VpnPptpSetting() override;
|
||||
void initSettingPage() override;
|
||||
void initSpecificSettings() override;
|
||||
- void initWidgets() override;
|
||||
void clearPtr() override;
|
||||
|
||||
public slots:
|
||||
@@ -47,4 +46,4 @@ private:
|
||||
NetworkManager::VpnSetting::Ptr m_vpnSetting;
|
||||
};
|
||||
|
||||
-#endif //KIRAN_CPANEL_NETWORK_VPN_PPTP_SETTING_H
|
||||
+#endif // KIRAN_CPANEL_NETWORK_VPN_PPTP_SETTING_H
|
||||
diff --git a/plugins/network/src/plugin/settings/wired-setting-page.cpp b/plugins/network/src/plugin/settings/wired-setting-page.cpp
|
||||
index 4466468..507aee5 100644
|
||||
--- a/plugins/network/src/plugin/settings/wired-setting-page.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/wired-setting-page.cpp
|
||||
@@ -37,7 +37,6 @@ WiredSettingPage::~WiredSettingPage()
|
||||
void WiredSettingPage::initSettingPage()
|
||||
{
|
||||
initSpecificSettings();
|
||||
- initWidgets();
|
||||
}
|
||||
|
||||
void WiredSettingPage::initConnecton()
|
||||
@@ -51,11 +50,11 @@ void WiredSettingPage::initSpecificSettings()
|
||||
m_ipv4Setting = m_connectionSettings->setting(Setting::SettingType::Ipv4).dynamicCast<Ipv4Setting>();
|
||||
m_ipv6Setting = m_connectionSettings->setting(Setting::SettingType::Ipv6).dynamicCast<Ipv6Setting>();
|
||||
m_wiredSetting = m_connectionSettings->setting(Setting::SettingType::Wired).dynamicCast<WiredSetting>();
|
||||
-}
|
||||
|
||||
-// TODO:修改命名
|
||||
-void WiredSettingPage::initWidgets()
|
||||
-{
|
||||
+ m_ipv4Setting->setInitialized(true);
|
||||
+ m_ipv6Setting->setInitialized(true);
|
||||
+ m_wiredSetting->setInitialized(true);
|
||||
+
|
||||
ui->connectionNameWidget->setConnectionSettings(m_connectionSettings);
|
||||
ui->ipv4Widget->setIpv4Setting(m_ipv4Setting);
|
||||
ui->ipv6Widget->setIpv6Setting(m_ipv6Setting);
|
||||
diff --git a/plugins/network/src/plugin/settings/wired-setting-page.h b/plugins/network/src/plugin/settings/wired-setting-page.h
|
||||
index f90c8a7..335d7a4 100644
|
||||
--- a/plugins/network/src/plugin/settings/wired-setting-page.h
|
||||
+++ b/plugins/network/src/plugin/settings/wired-setting-page.h
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
void initConnecton();
|
||||
void initSettingPage() override;
|
||||
void initSpecificSettings() override;
|
||||
- void initWidgets() override;
|
||||
void clearPtr() override;
|
||||
|
||||
public slots:
|
||||
@@ -50,4 +49,4 @@ private:
|
||||
KiranSwitchButton *m_security;
|
||||
};
|
||||
|
||||
-#endif //KIRAN_CPANEL_NETWORK_WIRED_SETTING_PAGE_H
|
||||
+#endif // KIRAN_CPANEL_NETWORK_WIRED_SETTING_PAGE_H
|
||||
diff --git a/plugins/network/src/plugin/settings/wireless-setting-page.cpp b/plugins/network/src/plugin/settings/wireless-setting-page.cpp
|
||||
index efcdbe1..b0d5877 100644
|
||||
--- a/plugins/network/src/plugin/settings/wireless-setting-page.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/wireless-setting-page.cpp
|
||||
@@ -13,8 +13,8 @@
|
||||
*/
|
||||
|
||||
#include "wireless-setting-page.h"
|
||||
-#include "ui_wireless-setting-page.h"
|
||||
#include <qt5-log-i.h>
|
||||
+#include "ui_wireless-setting-page.h"
|
||||
using namespace NetworkManager;
|
||||
|
||||
WirelessSettingPage::WirelessSettingPage(QWidget *parent) : SettingPage(parent), ui(new Ui::WirelessSettingPage)
|
||||
@@ -32,14 +32,13 @@ WirelessSettingPage::~WirelessSettingPage()
|
||||
|
||||
void WirelessSettingPage::initConnection()
|
||||
{
|
||||
- connect(ui->disconnectAndDeleteButton,&DisconnectAndDeleteButton::disconnectButtonClicked,this,&WirelessSettingPage::returnPreviousPage);
|
||||
- connect(ui->disconnectAndDeleteButton,&DisconnectAndDeleteButton::deleteButtonClicked,this,&WirelessSettingPage::returnPreviousPage);
|
||||
+ connect(ui->disconnectAndDeleteButton, &DisconnectAndDeleteButton::disconnectButtonClicked, this, &WirelessSettingPage::returnPreviousPage);
|
||||
+ connect(ui->disconnectAndDeleteButton, &DisconnectAndDeleteButton::deleteButtonClicked, this, &WirelessSettingPage::returnPreviousPage);
|
||||
}
|
||||
|
||||
void WirelessSettingPage::initSettingPage()
|
||||
{
|
||||
initSpecificSettings();
|
||||
- initWidgets();
|
||||
}
|
||||
|
||||
void WirelessSettingPage::initSpecificSettings()
|
||||
@@ -48,10 +47,12 @@ void WirelessSettingPage::initSpecificSettings()
|
||||
m_ipv6Setting = m_connectionSettings->setting(Setting::SettingType::Ipv6).dynamicCast<Ipv6Setting>();
|
||||
m_wirelessSetting = m_connectionSettings->setting(Setting::SettingType::Wireless).dynamicCast<WirelessSetting>();
|
||||
m_wirelessSecuritySetting = m_connectionSettings->setting(Setting::SettingType::WirelessSecurity).dynamicCast<WirelessSecuritySetting>();
|
||||
-}
|
||||
|
||||
-void WirelessSettingPage::initWidgets()
|
||||
-{
|
||||
+ m_ipv4Setting->setInitialized(true);
|
||||
+ m_ipv6Setting->setInitialized(true);
|
||||
+ m_wirelessSetting->setInitialized(true);
|
||||
+ m_wirelessSecuritySetting->setInitialized(true);
|
||||
+
|
||||
ui->generalWidget->setConnectionSettings(m_connectionSettings);
|
||||
ui->ipv4Widget->setIpv4Setting(m_ipv4Setting);
|
||||
ui->ipv6Widget->setIpv6Setting(m_ipv6Setting);
|
||||
@@ -81,7 +82,7 @@ void WirelessSettingPage::showSettingPage(QString activeConnectionPath)
|
||||
if (activeConnectionPath.isEmpty())
|
||||
ui->disconnectAndDeleteButton->initButton(SETTING_CONNECTION_STATUS_DEACTIVATED);
|
||||
else
|
||||
- ui->disconnectAndDeleteButton->initButton(SETTING_CONNECTION_STATUS_ACTIVATED,activeConnectionPath);
|
||||
+ ui->disconnectAndDeleteButton->initButton(SETTING_CONNECTION_STATUS_ACTIVATED, activeConnectionPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,5 +110,3 @@ void WirelessSettingPage::clearPtr()
|
||||
ui->wirelessSecurity->clearPtr();
|
||||
ui->wireless->clearPtr();
|
||||
}
|
||||
-
|
||||
-
|
||||
diff --git a/plugins/network/src/plugin/settings/wireless-setting-page.h b/plugins/network/src/plugin/settings/wireless-setting-page.h
|
||||
index d0cf97b..bb963fe 100644
|
||||
--- a/plugins/network/src/plugin/settings/wireless-setting-page.h
|
||||
+++ b/plugins/network/src/plugin/settings/wireless-setting-page.h
|
||||
@@ -15,10 +15,10 @@
|
||||
#ifndef KIRAN_CPANEL_NETWORK_WIRELESS_SETTING_PAGE_H
|
||||
#define KIRAN_CPANEL_NETWORK_WIRELESS_SETTING_PAGE_H
|
||||
|
||||
+#include <NetworkManagerQt/WirelessSecuritySetting>
|
||||
+#include <NetworkManagerQt/WirelessSetting>
|
||||
#include <QWidget>
|
||||
#include "setting-page.h"
|
||||
-#include <NetworkManagerQt/WirelessSetting>
|
||||
-#include <NetworkManagerQt/WirelessSecuritySetting>
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui
|
||||
{
|
||||
@@ -36,16 +36,16 @@ public:
|
||||
void initConnection();
|
||||
void initSettingPage() override;
|
||||
void initSpecificSettings() override;
|
||||
- void initWidgets() override;
|
||||
void clearPtr() override;
|
||||
|
||||
public slots:
|
||||
void saveSettingPage() override;
|
||||
void showSettingPage(QString activeConnectionPath = "");
|
||||
+
|
||||
private:
|
||||
Ui::WirelessSettingPage *ui;
|
||||
NetworkManager::WirelessSetting::Ptr m_wirelessSetting;
|
||||
NetworkManager::WirelessSecuritySetting::Ptr m_wirelessSecuritySetting;
|
||||
};
|
||||
|
||||
-#endif //KIRAN_CPANEL_NETWORK_WIRELESS_SETTING_PAGE_H
|
||||
+#endif // KIRAN_CPANEL_NETWORK_WIRELESS_SETTING_PAGE_H
|
||||
--
|
||||
2.33.0
|
||||
|
||||
211
0006-fix-network-only-L2TP-type-is-supported-temporary-an.patch
Normal file
211
0006-fix-network-only-L2TP-type-is-supported-temporary-an.patch
Normal file
@ -0,0 +1,211 @@
|
||||
From 963d10274ea3f9bf5321755a9f6f9b21ca98206d Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Tue, 23 Aug 2022 15:20:59 +0800
|
||||
Subject: [PATCH 6/7] fix(network):only L2TP type is supported temporary, and
|
||||
fix input defect
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 暂时只支持l2tp类型,修复输入缺陷
|
||||
---
|
||||
.../src/plugin/manager/vpn-manager.cpp | 27 +++++------
|
||||
.../network/src/plugin/manager/vpn-manager.h | 9 ++--
|
||||
.../plugin/setting-widget/vpn/vpn-widget.cpp | 46 +++++++++++++++----
|
||||
.../plugin/settings/vpn/vpn-l2tp-setting.cpp | 2 +-
|
||||
.../plugin/settings/vpn/vpn-pptp-setting.cpp | 1 -
|
||||
5 files changed, 58 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/plugins/network/src/plugin/manager/vpn-manager.cpp b/plugins/network/src/plugin/manager/vpn-manager.cpp
|
||||
index cd858b5..e4aecaf 100644
|
||||
--- a/plugins/network/src/plugin/manager/vpn-manager.cpp
|
||||
+++ b/plugins/network/src/plugin/manager/vpn-manager.cpp
|
||||
@@ -47,8 +47,8 @@ void VpnManager::initUI()
|
||||
ui->connectionShowPage->setTitle(tr("VPN"));
|
||||
ui->connectionShowPage->setSwitchButtonVisible(false);
|
||||
|
||||
- // ui->vpnType->addItem(tr("L2TP"), VPN_TYPE_L2TP);
|
||||
- ui->vpnType->addItem(tr("PPTP"), VPN_TYPE_PPTP);
|
||||
+ ui->vpnType->addItem(tr("L2TP"), VPN_TYPE_L2TP);
|
||||
+ // ui->vpnType->addItem(tr("PPTP"), VPN_TYPE_PPTP);
|
||||
Kiran::StylePropertyHelper::setButtonType(ui->saveButton, Kiran::BUTTON_Default);
|
||||
}
|
||||
|
||||
@@ -59,9 +59,10 @@ void VpnManager::initConnection()
|
||||
{
|
||||
//默认创建vpn类型:L2TP
|
||||
ui->vpnTypeWidget->setVisible(true);
|
||||
- ui->vpnType->setCurrentIndex(0);
|
||||
- ui->vpnTypeStacked->setCurrentIndex(VPN_TYPE_PPTP);
|
||||
- ui->pptpSetting->showSettingPage();
|
||||
+ ui->vpnType->setCurrentIndex(VPN_TYPE_L2TP);
|
||||
+ ui->vpnTypeStacked->setCurrentIndex(VPN_TYPE_L2TP);
|
||||
+ ui->l2tpSetting->showSettingPage();
|
||||
+ // ui->vpnType->setCurrentIndex(0);
|
||||
|
||||
QPointer<QScrollBar> scrollBar = ui->scrollArea->verticalScrollBar();
|
||||
scrollBar->setValue(0);
|
||||
@@ -73,7 +74,7 @@ void VpnManager::initConnection()
|
||||
connect(ui->vpnType, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index)
|
||||
{
|
||||
VpnType type = ui->vpnType->currentData().value<VpnType>();
|
||||
- ui->vpnTypeStacked->setCurrentIndex(VPN_TYPE_PPTP);
|
||||
+ ui->vpnTypeStacked->setCurrentIndex(type);
|
||||
switch (type)
|
||||
{
|
||||
case VPN_TYPE_L2TP:
|
||||
@@ -186,14 +187,14 @@ void VpnManager::handleRequestActivateConnection(const QString &connectionPath,
|
||||
inputDialog.setTitle(tr("Tips"));
|
||||
QString tips = QString(tr("Password required to connect to %1.")).arg(settings->id());
|
||||
inputDialog.setText(tips);
|
||||
-
|
||||
- connect(&inputDialog, &TextInputDialog::password, [=](const QString &password)
|
||||
+ inputDialog.setlineEditEchoMode(QLineEdit::Password);
|
||||
+ connect(&inputDialog, &TextInputDialog::password, this, [=](const QString &password)
|
||||
{
|
||||
- NMStringMap secretsMap = vpnSetting->secrets();
|
||||
- secretsMap.insert("password", password);
|
||||
- vpnSetting->setSecrets(secretsMap);
|
||||
- activateVPNConnection(connectionPath, connectionParameter);
|
||||
- connection->clearSecrets(); });
|
||||
+ NMStringMap secretsMap = vpnSetting->secrets();
|
||||
+ secretsMap.insert("password", password);
|
||||
+ vpnSetting->setSecrets(secretsMap);
|
||||
+ activateVPNConnection(connectionPath, connectionParameter);
|
||||
+ connection->clearSecrets(); });
|
||||
|
||||
inputDialog.exec();
|
||||
}
|
||||
diff --git a/plugins/network/src/plugin/manager/vpn-manager.h b/plugins/network/src/plugin/manager/vpn-manager.h
|
||||
index 81233ab..e3fd096 100644
|
||||
--- a/plugins/network/src/plugin/manager/vpn-manager.h
|
||||
+++ b/plugins/network/src/plugin/manager/vpn-manager.h
|
||||
@@ -39,23 +39,24 @@ public:
|
||||
public slots:
|
||||
void clearVpnSetting();
|
||||
void handleRequestEditConnection(const QString &uuid, QString activeConnectionPath);
|
||||
- void handleRequestActivateConnection(const QString &connectionPath,const QString &connectionParameter);
|
||||
+ void handleRequestActivateConnection(const QString &connectionPath, const QString &connectionParameter);
|
||||
|
||||
void handleNotifierConnectionAdded(const QString &path) override;
|
||||
void handleNotifierConnectionRemoved(const QString &path) override;
|
||||
- void activateVPNConnection(const QString &connectionPath,const QString &connectionParameter);
|
||||
+ void activateVPNConnection(const QString &connectionPath, const QString &connectionParameter);
|
||||
|
||||
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, const QString &activePath);
|
||||
void handleVpnStateActivated(const QString &activePath);
|
||||
void handleVpnStateDisconnected(const QString &activePath);
|
||||
void handleVpnStateFailed(const QString &activePath);
|
||||
|
||||
void handleReturnPreviousPage();
|
||||
+
|
||||
private:
|
||||
Ui::VpnManager *ui;
|
||||
};
|
||||
|
||||
-#endif //KIRAN_CPANEL_NETWORK_VPN_MANAGER_H
|
||||
+#endif // KIRAN_CPANEL_NETWORK_VPN_MANAGER_H
|
||||
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 2439947..27de2af 100644
|
||||
--- a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp
|
||||
+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "vpn-widget.h"
|
||||
+#include <kiran-message-box.h>
|
||||
#include <qt5-log-i.h>
|
||||
#include <QHostAddress>
|
||||
#include "ui_vpn-widget.h"
|
||||
@@ -150,24 +151,53 @@ void VpnWidget::clearPtr()
|
||||
|
||||
bool VpnWidget::isInputValid()
|
||||
{
|
||||
- bool valid = true;
|
||||
QString gatewayStr = ui->gateway->text();
|
||||
if (gatewayStr.isEmpty())
|
||||
- valid = false;
|
||||
+ {
|
||||
+ QString error = QString(tr("Gateway can not be empty"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Gateway cannot be empty";
|
||||
+ return false;
|
||||
+ }
|
||||
else
|
||||
{
|
||||
if (!isIpv4AddressValid(gatewayStr))
|
||||
- valid = false;
|
||||
+ {
|
||||
+ QString error = QString(tr("Gateway invalid"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+ KLOG_DEBUG() << "Gateway invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (ui->userName->text().isEmpty())
|
||||
- valid = false;
|
||||
+ {
|
||||
+ QString error = QString(tr("user name can not be empty"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
|
||||
- if ((ui->passwordOptions->currentData().value<Setting::SecretFlagType>() == NetworkManager::Setting::SecretFlagType::None)
|
||||
- && ui->password->text().isEmpty())
|
||||
- valid = false;
|
||||
+ KLOG_DEBUG() << "user name can not be empty";
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if ((ui->passwordOptions->currentData().value<Setting::SecretFlagType>() == Setting::SecretFlagType::None) &&
|
||||
+ ui->password->text().isEmpty())
|
||||
+ {
|
||||
+ QString error = QString(tr("password can not be empty"));
|
||||
+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"),
|
||||
+ error,
|
||||
+ KiranMessageBox::Yes | KiranMessageBox::No);
|
||||
+
|
||||
+ KLOG_DEBUG() << "password can not be empty";
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
- return valid;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
bool VpnWidget::isIpv4AddressValid(const QString &address)
|
||||
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 dc9e4d2..09a7109 100644
|
||||
--- a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp
|
||||
@@ -107,5 +107,5 @@ void VpnL2tpSetting::clearPtr()
|
||||
|
||||
bool VpnL2tpSetting::isInputValid()
|
||||
{
|
||||
- return ui->vpnWidget->isInputValid() || ui->connectioNameWidget->isInputValid();
|
||||
+ return ui->vpnWidget->isInputValid() && ui->connectioNameWidget->isInputValid();
|
||||
}
|
||||
diff --git a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp
|
||||
index 260ae22..817171c 100644
|
||||
--- a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp
|
||||
+++ b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp
|
||||
@@ -85,7 +85,6 @@ void VpnPptpSetting::showSettingPage(QString activeConnectionPath)
|
||||
|
||||
void VpnPptpSetting::clearPtr()
|
||||
{
|
||||
- KLOG_DEBUG() << "VpnPptpSetting::clearPtr";
|
||||
m_vpnSetting.clear();
|
||||
SettingPage::clearPtr();
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
460
0007-feature-network-update-translations.patch
Normal file
460
0007-feature-network-update-translations.patch
Normal file
@ -0,0 +1,460 @@
|
||||
From e25198845ff304e2a968f6d01b557acc15ba2821 Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Tue, 23 Aug 2022 16:14:27 +0800
|
||||
Subject: [PATCH 7/7] feature(network):update translations
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 更新翻译
|
||||
---
|
||||
.../kiran-cpanel-network.zh_CN.ts | 223 ++++++++++++++----
|
||||
1 file changed, 176 insertions(+), 47 deletions(-)
|
||||
|
||||
diff --git a/plugins/network/translations/kiran-cpanel-network.zh_CN.ts b/plugins/network/translations/kiran-cpanel-network.zh_CN.ts
|
||||
index 10521ae..0a1f191 100644
|
||||
--- a/plugins/network/translations/kiran-cpanel-network.zh_CN.ts
|
||||
+++ b/plugins/network/translations/kiran-cpanel-network.zh_CN.ts
|
||||
@@ -25,38 +25,39 @@
|
||||
<translation type="vanished">无线连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="64"/>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="139"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="67"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="151"/>
|
||||
<source>Wired Network %1</source>
|
||||
<translation>有线网络 %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="67"/>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="147"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="72"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="159"/>
|
||||
<source>Wired Network</source>
|
||||
<translation>有线网络</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="83"/>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="155"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="92"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="167"/>
|
||||
<source>Wireless Network %1</source>
|
||||
<translation>无线网络 %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="86"/>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="163"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="97"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="175"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="319"/>
|
||||
<source>Wireless Network</source>
|
||||
<translation>无线网络</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="98"/>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="169"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="110"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="181"/>
|
||||
<source>VPN</source>
|
||||
<translation>VPN</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="105"/>
|
||||
- <location filename="../src/plugin/cpanel-network-widget.cpp" line="170"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="117"/>
|
||||
+ <location filename="../src/plugin/cpanel-network-widget.cpp" line="182"/>
|
||||
<source>Network Details</source>
|
||||
<translation>网络详情</translation>
|
||||
</message>
|
||||
@@ -184,25 +185,35 @@
|
||||
<translation>自动连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="40"/>
|
||||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="41"/>
|
||||
<source>Required</source>
|
||||
<translation>必填</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="76"/>
|
||||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="77"/>
|
||||
<source>Wired Connection %1</source>
|
||||
<translation>有线网络%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="115"/>
|
||||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="116"/>
|
||||
<source>VPN L2TP %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="118"/>
|
||||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="119"/>
|
||||
<source>VPN PPTP %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="180"/>
|
||||
+ <source>Connection name can not be empty</source>
|
||||
+ <translation>网络名称不能为空</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/connection-name-widget.cpp" line="181"/>
|
||||
+ <source>Error</source>
|
||||
+ <translation>错误</translation>
|
||||
+ </message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectionShowPage</name>
|
||||
@@ -262,12 +273,12 @@
|
||||
<translation>忽略</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/disconnect-and-delete-button.cpp" line="95"/>
|
||||
+ <location filename="../src/plugin/setting-widget/disconnect-and-delete-button.cpp" line="99"/>
|
||||
<source>Are you sure you want to delete the connection %1</source>
|
||||
<translation>您是否确定要删除连接 "%1"</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/disconnect-and-delete-button.cpp" line="96"/>
|
||||
+ <location filename="../src/plugin/setting-widget/disconnect-and-delete-button.cpp" line="100"/>
|
||||
<source>Warning</source>
|
||||
<translation>警告</translation>
|
||||
</message>
|
||||
@@ -344,10 +355,20 @@
|
||||
<translation>自定义MTU</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/ethernet-widget.cpp" line="42"/>
|
||||
+ <location filename="../src/plugin/setting-widget/ethernet-widget.cpp" line="44"/>
|
||||
<source>No device specified</source>
|
||||
<translation>不指定设备</translation>
|
||||
</message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ethernet-widget.cpp" line="139"/>
|
||||
+ <source>Clone Mac invalid</source>
|
||||
+ <translation>无效的克隆MAC地址</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ethernet-widget.cpp" line="140"/>
|
||||
+ <source>Error</source>
|
||||
+ <translation>错误</translation>
|
||||
+ </message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Ipv4Widget</name>
|
||||
@@ -387,21 +408,67 @@
|
||||
<translation>备选DNS</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="35"/>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="36"/>
|
||||
<source>Auto</source>
|
||||
<translation>自动</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>Manual</source>
|
||||
<translation>手动</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="38"/>
|
||||
<location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="39"/>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="40"/>
|
||||
<source>Required</source>
|
||||
<translation>必填</translation>
|
||||
</message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="213"/>
|
||||
+ <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>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="225"/>
|
||||
+ <source>Ipv4 Address invalid</source>
|
||||
+ <translation>无效的Ipv4地址</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="236"/>
|
||||
+ <source>NetMask can not be empty</source>
|
||||
+ <translation>子网掩码不能为空</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="247"/>
|
||||
+ <source>Netmask invalid</source>
|
||||
+ <translation>无效的子网掩码</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="260"/>
|
||||
+ <source>Ipv4 Gateway invalid</source>
|
||||
+ <translation>无效的Ipv4网关</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="275"/>
|
||||
+ <source>Ipv4 Preferred DNS invalid</source>
|
||||
+ <translation>无效的Ipv4首选DNS</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv4-widget.cpp" line="289"/>
|
||||
+ <source>Ipv4 Alternate DNS invalid</source>
|
||||
+ <translation>无效的Ipv4备选DNS</translation>
|
||||
+ </message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Ipv6Widget</name>
|
||||
@@ -441,25 +508,59 @@
|
||||
<translation>备选DNS</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="34"/>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="35"/>
|
||||
<source>Auto</source>
|
||||
<translation>自动</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>Manual</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>Ignored</source>
|
||||
<translation>忽略</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="38"/>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="39"/>
|
||||
<source>Required</source>
|
||||
<translation>必填</translation>
|
||||
</message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="194"/>
|
||||
+ <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>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="206"/>
|
||||
+ <source>Ipv6 address invalid</source>
|
||||
+ <translation>无效的Ipv6地址</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="220"/>
|
||||
+ <source>Ipv6 Gateway invalid</source>
|
||||
+ <translation>无效的Ipv6网关</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="235"/>
|
||||
+ <source>Ipv6 Preferred DNS invalid</source>
|
||||
+ <translation>无效的Ipv6首选DNS</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/ipv6-widget.cpp" line="249"/>
|
||||
+ <source>Ipv6 Alternate DNS invalid</source>
|
||||
+ <translation>无效的Ipv6备选DNS</translation>
|
||||
+ </message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManagerTray</name>
|
||||
@@ -471,7 +572,7 @@
|
||||
<context>
|
||||
<name>NetworkTray</name>
|
||||
<message>
|
||||
- <location filename="../src/tray/network-tray.cpp" line="160"/>
|
||||
+ <location filename="../src/tray/network-tray.cpp" line="164"/>
|
||||
<source>Network settings</source>
|
||||
<translation>网络设置</translation>
|
||||
</message>
|
||||
@@ -629,17 +730,17 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/tray/tray-page.ui" line="92"/>
|
||||
+ <location filename="../src/tray/tray-page.ui" line="98"/>
|
||||
<source>TextLabel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/tray/tray-page.cpp" line="78"/>
|
||||
+ <location filename="../src/tray/tray-page.cpp" line="88"/>
|
||||
<source>Select wired network card</source>
|
||||
- <translation>请选择 有线网卡</translation>
|
||||
+ <translation>请选择有线网卡</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/tray/tray-page.cpp" line="93"/>
|
||||
+ <location filename="../src/tray/tray-page.cpp" line="103"/>
|
||||
<source>Select wireless network card</source>
|
||||
<translation>请选择无线网卡</translation>
|
||||
</message>
|
||||
@@ -751,22 +852,22 @@
|
||||
<translation>返回</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/manager/vpn-manager.cpp" line="48"/>
|
||||
+ <location filename="../src/plugin/manager/vpn-manager.cpp" line="47"/>
|
||||
<source>VPN</source>
|
||||
<translation type="unfinished">VPN</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/manager/vpn-manager.cpp" line="53"/>
|
||||
- <source>PPTP</source>
|
||||
+ <location filename="../src/plugin/manager/vpn-manager.cpp" line="50"/>
|
||||
+ <source>L2TP</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/manager/vpn-manager.cpp" line="189"/>
|
||||
+ <location filename="../src/plugin/manager/vpn-manager.cpp" line="187"/>
|
||||
<source>Tips</source>
|
||||
<translation>提示</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/manager/vpn-manager.cpp" line="190"/>
|
||||
+ <location filename="../src/plugin/manager/vpn-manager.cpp" line="188"/>
|
||||
<source>Password required to connect to %1.</source>
|
||||
<translation>连接网络 "%1" 需要密码</translation>
|
||||
</message>
|
||||
@@ -915,27 +1016,55 @@
|
||||
<translation>NT域</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="26"/>
|
||||
<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"/>
|
||||
<source>Required</source>
|
||||
<translation>必填</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="38"/>
|
||||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="39"/>
|
||||
<source>Saved</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>Ask</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>Not required</source>
|
||||
<translation>不要求</translation>
|
||||
</message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="157"/>
|
||||
+ <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>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="168"/>
|
||||
+ <source>Gateway invalid</source>
|
||||
+ <translation>无效的网关</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="179"/>
|
||||
+ <source>user name can not be empty</source>
|
||||
+ <translation>用户名不能为空</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../src/plugin/setting-widget/vpn/vpn-widget.cpp" line="191"/>
|
||||
+ <source>password can not be empty</source>
|
||||
+ <translation>密码不能为空</translation>
|
||||
+ </message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiredManager</name>
|
||||
@@ -955,7 +1084,7 @@
|
||||
<translation>返回</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/manager/wired-manager.cpp" line="46"/>
|
||||
+ <location filename="../src/plugin/manager/wired-manager.cpp" line="44"/>
|
||||
<source>Wired Network Adapter</source>
|
||||
<translation>有线网卡</translation>
|
||||
</message>
|
||||
@@ -968,7 +1097,7 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/settings/wired-setting-page.cpp" line="68"/>
|
||||
+ <location filename="../src/plugin/settings/wired-setting-page.cpp" line="67"/>
|
||||
<source>Network name</source>
|
||||
<translation>网络名称</translation>
|
||||
</message>
|
||||
@@ -991,17 +1120,17 @@
|
||||
<translation>返回</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/manager/wireless-manager.cpp" line="47"/>
|
||||
+ <location filename="../src/plugin/manager/wireless-manager.cpp" line="45"/>
|
||||
<source>Wireless Network Adapter</source>
|
||||
<translation>无线网卡</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/manager/wireless-manager.cpp" line="369"/>
|
||||
+ <location filename="../src/plugin/manager/wireless-manager.cpp" line="365"/>
|
||||
<source>Tips</source>
|
||||
<translation>提示</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/manager/wireless-manager.cpp" line="370"/>
|
||||
+ <location filename="../src/plugin/manager/wireless-manager.cpp" line="366"/>
|
||||
<source>Password required to connect to %1.</source>
|
||||
<translation>连接网络 "%1" 需要密码</translation>
|
||||
</message>
|
||||
@@ -1076,7 +1205,7 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../src/plugin/settings/wireless-setting-page.cpp" line="65"/>
|
||||
+ <location filename="../src/plugin/settings/wireless-setting-page.cpp" line="66"/>
|
||||
<source>Wireless name</source>
|
||||
<translation>无线网络名称</translation>
|
||||
</message>
|
||||
@@ -1084,7 +1213,7 @@
|
||||
<context>
|
||||
<name>WirelessTrayWidget</name>
|
||||
<message>
|
||||
- <location filename="../src/tray/wireless-tray-widget.cpp" line="469"/>
|
||||
+ <location filename="../src/tray/wireless-tray-widget.cpp" line="491"/>
|
||||
<source>the network "%1" not found</source>
|
||||
<translation>未找到网络 "%1"</translation>
|
||||
</message>
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: kiran-control-panel
|
||||
Version: 2.3.4
|
||||
Release: 6
|
||||
Release: 7
|
||||
Summary: Kiran Control Panel
|
||||
Summary(zh_CN): Kiran桌面控制面板
|
||||
|
||||
@ -15,6 +15,14 @@ Patch0005: 0001-fix-search-when-the-relevant-setting-interface-canno.patch
|
||||
Patch0006: 0002-fix-account-error-prompt-box-is-added-with-the-defau.patch
|
||||
Patch0007: 0001-fix-battery-idle-remove-invalid-idle-shutdown-displa.patch
|
||||
Patch0008: 0002-fix-account-The-connection-singleton-in-the-signal-s.patch
|
||||
Patch0009: 0001-feature-network-Add-the-conf-file-to-overwrite-the-o.patch
|
||||
Patch0010: 0002-fix-network-fix-crash-and-wireless-network-disable-f.patch
|
||||
Patch0011: 0003-fix-network-fix-the-problem-of-network-and-details-c.patch
|
||||
Patch0012: 0004-fix-network-Add-error-prompt-box-when-saving-configu.patch
|
||||
Patch0013: 0005-fix-network-fix-invalid-configuration-created-for-th.patch
|
||||
Patch0014: 0006-fix-network-only-L2TP-type-is-supported-temporary-an.patch
|
||||
Patch0015: 0007-feature-network-update-translations.patch
|
||||
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: cmake >= 3.2
|
||||
@ -136,6 +144,7 @@ make %{?_smp_mflags}
|
||||
#network
|
||||
%{_sysconfdir}/xdg/autostart/kiran-network-status-icon.desktop
|
||||
%{_bindir}/kiran-network-status-icon
|
||||
/etc/NetworkManager/conf.d/00-server.conf
|
||||
|
||||
#display
|
||||
%{_datadir}/kiran-cpanel-display/translations/*
|
||||
@ -173,6 +182,12 @@ make %{?_smp_mflags}
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%changelog
|
||||
* Tue Aug 23 2022 luoqing <luoqing@kylinsec.com.cn> - 2.3.4-7
|
||||
- KYOS-F: fix the problem of network and details corresponding error(#I5M0L9)
|
||||
- KYOS-F: Add error prompt box when saving configuration(#I5GYQD)
|
||||
- KYOS-F: fix invalid configuration created for the first time
|
||||
- KYOS-F: fix crash and wireless network disable function defects
|
||||
|
||||
* Thu Aug 18 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.4-6
|
||||
- KYOS-F: account the connection singleton in the signal slot is not automatically disconnected because the receiver parameter is not added, resulting in a crash(#I5HRYF)
|
||||
- KYOS-F: power ,remove invalid idle shutdown display option(#I5M336)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user