diff --git a/0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch b/0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch deleted file mode 100644 index 4d7817a39885c471d2cbe3e21dff90b96bf81047..0000000000000000000000000000000000000000 --- a/0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 69d7fe7218644b286c2ba093976d93594d9da576 Mon Sep 17 00:00:00 2001 -From: kylinsecos_admin -Date: Mon, 24 Jan 2022 14:05:06 +0800 -Subject: [PATCH] fix(build): fix incomplete type 'class QPainterPath' build - ---- - src/category-widget.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/category-widget.cpp b/src/category-widget.cpp -index be89521..a481beb 100644 ---- a/src/category-widget.cpp -+++ b/src/category-widget.cpp -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - #define ROLE_CATEGORY_INDEX Qt::UserRole - -@@ -175,4 +176,4 @@ void CategoryWidget::setCurrentCategory(int index) - { - auto item = ui->categorys->item(index); - ui->categorys->setCurrentItem(item); --} -\ No newline at end of file -+} --- -1.8.3.1 - diff --git a/0001-fix-network-fix-the-self-test-defect-v-p-n.patch b/0001-fix-network-fix-the-self-test-defect-v-p-n.patch new file mode 100644 index 0000000000000000000000000000000000000000..f88a694fb7298cfe8576701c0a752a6470da092c --- /dev/null +++ b/0001-fix-network-fix-the-self-test-defect-v-p-n.patch @@ -0,0 +1,1102 @@ +From 391a0f856549f6f6e74ee9eeff1db8361fa641ad Mon Sep 17 00:00:00 2001 +From: luoqing +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(sender()); ++ ++ auto activeVpnConnection = qobject_cast(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(); +- StatusNotification::ActiveConnectionActivatedNotify(connectionInfo); ++ if (item != nullptr) ++ { ++ NetworkConnectionInfo connectionInfo = item->data(Qt::UserRole).value(); ++ 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 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(); ++ KLOG_DEBUG() << dbusArg.currentType() << dbusArg.currentSignature(); ++ ++ NMStringMap dbusMap = qdbus_cast(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 ++#include + #include ++#include + 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 @@ + + + +- +- +- +- 0 +- 36 +- +- +- +- +- 16777215 +- 36 +- +- +- +- EditPreSharedKey +- +- ++ ++ ++ ++ ++ ++ 0 ++ 36 ++ ++ ++ ++ ++ 16777215 ++ 36 ++ ++ ++ ++ EditPreSharedKey ++ ++ ++ ++ ++ ++ ++ Show Password ++ ++ ++ ++ + + + +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 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(); ++ KLOG_DEBUG() << dbusArg.currentType() << dbusArg.currentSignature(); ++ ++ NMStringMap dbusMap = qdbus_cast(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 + #include + #include + 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 @@ + ButtonPasswordVisual + + +- PushButton ++ Show Password + + + +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 @@ + 请输入网络名称 + + +- +- ++ ++ + Other WiFi networks + 其它WIFI网络 + +@@ -205,50 +205,49 @@ + 自动连接 + + +- ++ + Required + 必填 + + +- ++ + Wired Connection %1 + 有线网络%1 + + +- ++ + VPN L2TP %1 + + + +- ++ + VPN PPTP %1 + + + +- ++ + Connection name can not be empty + 网络名称不能为空 + + +- + Error +- 错误 ++ 错误 + + + + ConnectionShowPage + +- ++ + ConnectionShowPage + + + +- ++ + TextLabel + + + +- ++ + ButtonCreateConnection + + +@@ -420,14 +419,13 @@ + 不指定设备 + + +- ++ + Clone Mac invalid + 无效的克隆MAC地址 + + +- + Error +- 错误 ++ 错误 + + + +@@ -498,44 +496,37 @@ + + + +- ++ + Auto + 自动 + + +- ++ + Manual + 手动 + + +- + ++ + Required + 必填 + + +- ++ + Ipv4 address can not be empty + Ipv4地址不能为空 + + +- +- +- +- +- +- +- + Error +- 错误 ++ 错误 + + +- ++ + Ipv4 Address invalid + 无效的Ipv4地址 + + +- ++ + NetMask can not be empty + 子网掩码不能为空 + +@@ -545,17 +536,17 @@ + 无效的子网掩码 + + +- ++ + Ipv4 Gateway invalid + 无效的Ipv4网关 + + +- ++ + Ipv4 Preferred DNS invalid + 无效的Ipv4首选DNS + + +- ++ + Ipv4 Alternate DNS invalid + 无效的Ipv4备选DNS + +@@ -628,56 +619,51 @@ + + + +- ++ + Auto + 自动 + + +- ++ + Manual + 手动 + + +- ++ + Ignored + 忽略 + + +- ++ + Required + 必填 + + +- ++ + Ipv6 address can not be empty + Ipv6地址不能为空 + + +- +- +- +- +- + Error +- 错误 ++ 错误 + + +- ++ + Ipv6 address invalid + 无效的Ipv6地址 + + +- ++ + Ipv6 Gateway invalid + 无效的Ipv6网关 + + +- ++ + Ipv6 Preferred DNS invalid + 无效的Ipv6首选DNS + + +- ++ + Ipv6 Alternate DNS invalid + 无效的Ipv6备选DNS + +@@ -692,7 +678,7 @@ + + NetworkTray + +- ++ + Network settings + 网络设置 + +@@ -780,64 +766,64 @@ + + TrayItemWidget + +- ++ + TrayItemWidget + + + +- ++ + Icon + + + +- ++ + Name + 名称 + + +- ++ + Status + 状态 + + +- ++ + Ignore + 忽略 + + +- ++ + Disconnect + 断开 + + +- +- ++ ++ + Cancel + 取消 + + +- +- ++ ++ + Connect + 连接 + + +- ++ + Connected + 已连接 + + +- ++ + Unconnected + 未连接 + + +- ++ + Please input password + 请输入密码 + + +- ++ + Please input a network name + 请输入网络名称 + +@@ -903,27 +889,32 @@ + 预共享密钥 + + +- ++ + EditPreSharedKey + + + +- ++ ++ Show Password ++ 显示密码 ++ ++ ++ + Internet Key Exchange Protocol + 密钥交换协议 + + +- ++ + EditIpsecIKE + + + +- ++ + Encapsulating Security Payload + 安全封装协议 + + +- ++ + EditIpsecESP + + +@@ -984,7 +975,7 @@ + + + +- ++ + VPN name + VPN名称 + +@@ -1023,12 +1014,12 @@ + + + +- ++ + Tips + 提示 + + +- ++ + Password required to connect to %1. + 连接网络 "%1" 需要密码 + +@@ -1139,7 +1130,7 @@ + + + +- ++ + VPN name + VPN名称 + +@@ -1198,8 +1189,8 @@ + + + +- PushButton +- ++ Show Password ++ 显示密码 + + + +@@ -1212,52 +1203,48 @@ + + + +- + + ++ + Required + 必填 + + +- ++ + Saved + 已保存的 + + +- ++ + Ask + 总是询问 + + +- ++ + Not required + 不要求 + + +- ++ + Gateway can not be empty + 网关不能为空 + + +- +- +- +- + Error +- 错误 ++ 错误 + + +- ++ + Gateway invalid + 无效的网关 + + +- ++ + user name can not be empty + 用户名不能为空 + + +- ++ + password can not be empty + 密码不能为空 + +@@ -1308,7 +1295,7 @@ + + + +- ++ + Network name + 网络名称 + +-- +2.33.0 + diff --git a/kiran-control-panel-2.2.0.tar.gz b/kiran-control-panel-2.2.0.tar.gz deleted file mode 100644 index 24e6734fd5d3921b2bd2dc230ca1eb8da75af8ce..0000000000000000000000000000000000000000 Binary files a/kiran-control-panel-2.2.0.tar.gz and /dev/null differ diff --git a/kiran-control-panel-2.3.5.tar.gz b/kiran-control-panel-2.3.5.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ad49a42a76fd5f0088a5070eb050b0aafc2187c3 Binary files /dev/null and b/kiran-control-panel-2.3.5.tar.gz differ diff --git a/kiran-control-panel.spec b/kiran-control-panel.spec index c587b18d87f170a49d99896cc9c4f5b19b1dcc3d..45535f91f58f24216e38626c5d767be8d3fc05fc 100644 --- a/kiran-control-panel.spec +++ b/kiran-control-panel.spec @@ -1,30 +1,67 @@ Name: kiran-control-panel -Version: 2.2.0 -Release: 2.kb3 +Version: 2.3.5 +Release: 2 Summary: Kiran Control Panel Summary(zh_CN): Kiran桌面控制面板 -License: Mulan PSL v2 +License: MulanPSL-2.0 Source0: %{name}-%{version}.tar.gz -Patch0: 0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch +Patch0001: 0001-fix-network-fix-the-self-test-defect-v-p-n.patch BuildRequires: gcc-c++ BuildRequires: cmake >= 3.2 +BuildRequires: glib2-devel +BuildRequires: upower-devel +BuildRequires: zeromq-devel +BuildRequires: libnotify-devel +BuildRequires: pam-devel + BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtx11extras-devel BuildRequires: qt5-qtsvg-devel +BuildRequires: qt5-qtmultimedia-devel BuildRequires: qt5-linguist +BuildRequires: kf5-networkmanager-qt-devel + BuildRequires: kiran-log-qt5-devel BuildRequires: kiran-widgets-qt5-devel -BuildRequires: glib2-devel +BuildRequires: kiran-qt5-integration-devel +BuildRequires: kiran-qdbusxml2cpp +BuildRequires: kiran-cc-daemon-devel Requires: qt5-qtbase +Requires: qt5-qtbase-gui Requires: qt5-qtx11extras Requires: qt5-qtsvg +Requires: qt5-qtmultimedia +Requires: kf5-networkmanager-qt + Requires: kiran-log-qt5 Requires: kiran-widgets-qt5 +Requires: kiran-qt5-integration +Requires: kiran-system-daemon +Requires: kiran-session-daemon + Requires: glib2 +Requires: upower +Requires: zeromq +Requires: libnotify +Requires: pam + +Requires: NetworkManager-l2tp +#Requires: NetworkManager-pptp + +Obsoletes: kiran-cpanel-account +Obsoletes: kiran-cpanel-appearance +Obsoletes: kiran-cpanel-display +Obsoletes: kiran-cpanel-keybinding +Obsoletes: kiran-cpanel-keyboard +Obsoletes: kiran-cpanel-mouse +Obsoletes: kiran-cpanel-power +Obsoletes: kiran-cpanel-system +Obsoletes: kiran-cpanel-timedate + %description Kiran Control Panel @@ -41,12 +78,15 @@ BuildRequires: qt5-linguist BuildRequires: kiran-log-qt5-devel BuildRequires: kiran-widgets-qt5-devel BuildRequires: glib2-devel +BuildRequires: kiran-qt5-integration-devel + Requires: qt5-qtbase Requires: qt5-qtx11extras Requires: qt5-qtsvg Requires: kiran-log-qt5 Requires: kiran-widgets-qt5 Requires: glib2 +Requires: kiran-qt5-integration %description -n kiran-cpanel-launcher %{summary}. @@ -68,16 +108,56 @@ make %{?_smp_mflags} %make_install %files +#主面板 %dir %{_datadir}/kiran-control-panel %{_bindir}/kiran-control-panel -%{_datadir}/icons/hicolor/kiran-control-panel.svg %{_datadir}/kiran-control-panel/* +%{_datadir}/applications/*.desktop +%{_datadir}/icons/hicolor/* %exclude %{_datadir}/kiran-control-panel/translations/kiran-cpanel-launcher* %exclude %{_datadir}/applications/kiran-control-panel.desktop +#account +%{_sysconfdir}/kiran-cpanel-account/ +%{_libexecdir}/kiran-avatar-editor +%{_datadir}/kiran-cpanel-account/* + +#audio +%{_sysconfdir}/xdg/autostart/kiran-audio-status-icon.desktop +%{_bindir}/kiran-audio-status-icon +%{_datadir}/kiran-cpanel-audio/translations/* + +#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/* + +#mouse +%{_datadir}/kiran-cpanel-mouse/translations/* + +#power +%{_datadir}/kiran-cpanel-power/translations/* + +#system +%{_datadir}/kiran-cpanel-system/translations/* + +#appearance +%{_datadir}/kiran-cpanel-appearance/translations/* + +#keybinding +%{_datadir}/kiran-cpanel-keybinding/translations/* + +#keyboard +%{_datadir}/kiran-cpanel-keyboard/translations/* + +#timedate +%{_datadir}/kiran-cpanel-timedate/translations/* + %files -n kiran-cpanel-launcher %{_bindir}/kiran-cpanel-launcher -%{_datadir}/kiran-control-panel/translations/kiran-cpanel-launcher* %files devel %dir %{_includedir}/kiran-control-panel @@ -88,6 +168,84 @@ make %{?_smp_mflags} rm -rf %{buildroot} %changelog +* Tue Sep 06 2022 luoqing - 2.3.5-2 +- KYOS-F: Fix V-P-N self-test defects + +* Mon Sep 05 2022 luoqing - 2.3.5-1 +- KYOS-F: Fix the network connection status does not change after unplugging the network cable (#I5I0AA) +- KYOS-F: Fix network tay crash (#I5OKBR) +- KYOS-F: Optimized prompt pop-up box, consistent with the overall style (#I5O86G) +- KYOS-F: Re add the network profile during installation to overwrite the original configuration + +* Mon Sep 05 2022 liuxinhao - 2.3.4-10 +- KYOS-F: move some account management controls to common component library + +* Thu Aug 25 2022 luoqing - 2.3.4-9 +- KYOS-F: Add labels to volume and network plugins to support automated testing +- KYOS-F: Temporarily do not overwrite the NetworkManager configuration and optimize the code + +* Thu Aug 25 2022 liuxinhao - 2.3.4-8 +- KYOS-F: updates accessiblename,support automated testing + +* Tue Aug 23 2022 luoqing - 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 - 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) + +* Wed Aug 10 2022 liuxinhao - 2.3.4-5 +- KYOS-B: error prompt box is added with the default disappearance time(#I5HR61) +- KYOS-B: when the relevant setting interface cannot be searched, a prompt will be added(#I5H192) + +* Tue Aug 09 2022 liuxinhao - 2.3.4-4 +- KYOS-F: set panel creategory widget auto fill background + +* Fri Aug 05 2022 luoqing - 2.3.4-3 +- KYOS-B: fix not searching the wireless network for a long time after the WiFi connection is successful(#I5IPVO) + +* Thu Aug 04 2022 liuxinhao - 2.3.4-2 +- KYOS-B: update systeminfo plugin dialog style(#I5H3YX) +- KYOS-B: buttons on system information page are not fully dispalyed(#I5H229) + +* Mon Aug 01 2022 luoqing - 2.3.4-1 +- KYOS-B: fix no notification when connecting to the hidden network(#I5IS25) +- KYOS-B: the tray network icon changes as the primary connection changes(#I5IPBG) +- KYOS-B: fix the lack of operation buttons and button translation in more interfaces connected to WiFi(#I5IQ03,#I5IPY3) + +* Fri Jul 29 2022 liuxinhao - 2.3.3-1 +- KYOS-B: fix the error in the animation display of the Create Account button(#I5HR7F) +- KYOS-B: forbidden to create users with uid less than 1000(#I5HZQF) +- KYOS-B: fix the problem that the user-defined shortcut key type is wrong due to adding shortcut keys(#I5IE4B) + +* Fri Jul 22 2022 luoqing - 2.3.2-1 +- KYOS-B: fix some bugs of network and audio plugins + +* Tue Jul 12 2022 liuxinhao - 2.3.1-4 +- KYOS-B: fix kiran control panel translator + +* Mon Jul 11 2022 liuxinhao - 2.3.1-3 +- KYOS-B: fix system infomation plugin build require + +* Mon Jul 11 2022 luoqing - 2.3.1-2 +- KYOS-B: fix unplugging headphones causes crash + +* Sat Jul 09 2022 liuxinhao - 2.3.1-1 +- KYOS-F: add network plugin +- KYOS-F: fix kiran-control-panel titlebar translation + +* Fri Jul 08 2022 liuxinhao - 2.3.0-3 +- KYOS-F: remove useless pkgconfig file + +* Fri Jul 08 2022 liuxinhao - 2.3.0-2 +- KYOS-F: temporarily shield the network plugin + +* Thu Jul 07 2022 liuxinhao - 2.3.0-1 +- KYOS-F: release kiran-control-panel 2.3 + * Mon Jan 24 2022 longcheng - 2.2.0-2.kb3 - KYOS-B: fix(build): fix incomplete type 'class QPainterPath' build diff --git a/kiran-control-panel.yaml b/kiran-control-panel.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0640149087d572a04c6c0275468e016e46761a2d --- /dev/null +++ b/kiran-control-panel.yaml @@ -0,0 +1,4 @@ +version_control: gitee +src_repo: https://gitee.com/openeuler/kiran-control-panel.git +tag_prefix: "v" +seperator: "."