From 641e80d184fa2a0ae6e7f061273b7db120686b57 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Fri, 22 Sep 2023 10:30:12 +0800 Subject: [PATCH 01/16] fix(ui): modify ui of system proxy manual mode(bug#190970 #190975) --- plugins/proxy/proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/proxy/proxy.cpp b/plugins/proxy/proxy.cpp index cdef6f4c..737f217b 100644 --- a/plugins/proxy/proxy.cpp +++ b/plugins/proxy/proxy.cpp @@ -348,7 +348,7 @@ void Proxy::initUi(QWidget *widget) mIgnoreLayout->setSpacing(10); mIgnoreLayout->setContentsMargins(16, 0, 16, 24); mIgnoreLabel = new QLabel(mIgnoreFrame); - mIgnoreLabel->setFixedHeight(36); + mIgnoreLabel->setWordWrap(true); mIgnoreLineEdit = new QTextEdit(mIgnoreFrame); mIgnoreLineEdit->setFixedHeight(120); mIgnoreLineEdit->setStyleSheet("border-radius:6px;background-color: palette(button)"); From 259aadfbf65bebdcb4aa0bf19675fb3475f584ca Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Fri, 22 Sep 2023 18:08:09 +0800 Subject: [PATCH 02/16] =?UTF-8?q?pref(ui):=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=89=98=E7=9B=98=E6=97=A0=E7=BA=BF=E5=AF=86=E7=A0=81=E6=A1=86?= =?UTF-8?q?=E8=89=B2=E6=9D=BF=EF=BC=8C=E8=A6=86=E7=9B=96KPasswordEdit?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=89=B2=E6=9D=BF(bug#191685)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/list-items/wlanlistitem.cpp | 13 ++++++++++++- src/frontend/list-items/wlanlistitem.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/frontend/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index 091ee32a..fe894181 100644 --- a/src/frontend/list-items/wlanlistitem.cpp +++ b/src/frontend/list-items/wlanlistitem.cpp @@ -254,6 +254,18 @@ void WlanListItem::keyPressEvent(QKeyEvent *event) return QFrame::keyPressEvent(event); } +void WlanListItem::paintEvent(QPaintEvent *event) +{ + QPalette pal = this->palette(); + if (m_pwdLineEdit != nullptr) { + pal.setColor(QPalette::Base, pal.color(QPalette::Base)); + pal.setColor(QPalette::Text, pal.color(QPalette::Text)); + m_pwdLineEdit->setPalette(pal); + } + + return QWidget::paintEvent(event); +} + void WlanListItem::initWlanUI() { m_hasPwd = (m_wirelessNetItem.m_secuType.isEmpty() || m_wirelessNetItem.m_secuType == "") ? false : true; @@ -281,7 +293,6 @@ void WlanListItem::initWlanUI() m_pwdLineEdit = new KPasswordEdit(m_pwdFrame); m_pwdLineEdit->setFixedWidth(LINEEDIT_WIDTH); m_pwdLineEdit->setProperty("needTranslucent", true); -// m_pwdLineEdit->setUseCustomPalette(true); m_pwdLineEdit->setClearButtonEnabled(false); //禁用ClearBtn按钮 m_pwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, true); //打开输入法 // m_pwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, false); diff --git a/src/frontend/list-items/wlanlistitem.h b/src/frontend/list-items/wlanlistitem.h index ab28e729..d5443ee9 100644 --- a/src/frontend/list-items/wlanlistitem.h +++ b/src/frontend/list-items/wlanlistitem.h @@ -90,6 +90,7 @@ protected: void leaveEvent(QEvent *event); bool eventFilter(QObject *watched, QEvent *event); void keyPressEvent(QKeyEvent *event); + void paintEvent(QPaintEvent *event); Q_SIGNALS: void itemHeightChanged(const bool isExpanded, const QString &ssid); From 435749c5c730817a94c1fa3fb9b4ab0efc1af0ec Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Tue, 26 Sep 2023 10:38:51 +0800 Subject: [PATCH 03/16] fix(ui): set firewall dialog to skip taskbar, modify main logic(bug#194718) --- src/frontend/networkmode/firewalldialog.cpp | 4 ++++ src/main.cpp | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontend/networkmode/firewalldialog.cpp b/src/frontend/networkmode/firewalldialog.cpp index 749d4efb..c90da985 100644 --- a/src/frontend/networkmode/firewalldialog.cpp +++ b/src/frontend/networkmode/firewalldialog.cpp @@ -20,6 +20,9 @@ #include "firewalldialog.h" #include +#include "windowmanager/windowmanager.h" +#include "kwindowsystem.h" +#include "kwindowsystem_export.h" #define THEME_SCHAME "org.ukui.style" #define COLOR_THEME "styleName" @@ -30,6 +33,7 @@ FirewallDialog::FirewallDialog(QWidget *parent): KDialog(parent) initUI(); this->setWindowIcon(QIcon::fromTheme("kylin-network")); this->setFixedSize(480, 204); + KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); setAttribute(Qt::WA_DeleteOnClose); // centerToScreen(); connect(qApp, &QApplication::paletteChanged, this, &FirewallDialog::onPaletteChanged); diff --git a/src/main.cpp b/src/main.cpp index c93edd0b..f7482b41 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -141,10 +141,11 @@ int main(int argc, char *argv[]) QDBusReply pid = interface1->servicePid(serviceName); qDebug() << "current display " << getenv("DISPLAY") << QApplication::applicationPid() << "exist kylin-nm display" << displayFromPid(pid.value()); - if (getenv("DISPLAY") != displayFromPid(pid.value())) { - return 0; + if (getenv("DISPLAY") == displayFromPid(pid.value())) { + interface.call(QStringLiteral("showKylinNM"), 2); } } + return 0; } QThread *thread = new QThread(); From 890e3ca5775960d250c792c4d9e17f8d70dbb165 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Tue, 26 Sep 2023 16:01:46 +0800 Subject: [PATCH 04/16] =?UTF-8?q?fix(hotspot):=E6=97=A0=E7=BA=BF=E7=BD=91?= =?UTF-8?q?=E5=8D=A1=E7=83=AD=E7=82=B9=E8=83=BD=E5=8A=9B=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9(#195043)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/dbus-interface/kylinnetworkdeviceresource.cpp | 2 +- src/backend/dbus-interface/kywirelessnetresource.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp b/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp index eb8cc2c4..8509f287 100644 --- a/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp +++ b/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp @@ -453,7 +453,7 @@ int KyNetworkDeviceResourse::getWirelessDeviceCapability(const QString deviceNam qobject_cast(connectDevice.data()); int cap = 0x00; - if (wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::AdhocCap) { + if (wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::ApCap) { cap = cap | 0x02; } else { return 0x01; diff --git a/src/backend/dbus-interface/kywirelessnetresource.cpp b/src/backend/dbus-interface/kywirelessnetresource.cpp index 6196d55c..fc020d68 100644 --- a/src/backend/dbus-interface/kywirelessnetresource.cpp +++ b/src/backend/dbus-interface/kywirelessnetresource.cpp @@ -295,6 +295,10 @@ QString KyWirelessNetResource::getDeviceIFace(NetworkManager::ActiveConnection:: NetworkManager::Device:: Ptr devicePtr = m_networkResourceInstance->findDeviceUni(ifaceUni); + if (devicePtr.isNull()) { + return QString(); + } + return devicePtr->interfaceName(); } From 8d98e360562293f182a1a71fff9f709636ba2ac5 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Tue, 26 Sep 2023 17:47:32 +0800 Subject: [PATCH 05/16] update changelog --- debian/changelog | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 36e6aa1d..166d6261 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +kylin-nm (3.24.0.0-0k2.20) v101; urgency=medium + + * BUG: + - #191685 【WiFi】深浅模式下,连接wifi后,允许发现弹窗,鼠标放置到关闭按钮再移开,关闭按钮的×消失 + - #190970 【网络代理】英文模式下系统代理界面显示不全 + - #190975 【网络代理】藏文模式下系统代理界面显示不全 + - #195043 【990】【9006c】【wifi】移动热点界面无法开启热点,通过命令可以开启 + * 需求号:无 + * 其他改动说明: + * 其他改动影响域:托盘密码框 UI 移动热点 + + -- zhaoshixu Tue, 26 Sep 2023 17:39:03 +0800 + kylin-nm (3.24.0.0-0k2.19) v101; urgency=medium * BUG: From 0e88ecccf8e4782ea60e9c8c1bafa03e89e25bd9 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Thu, 28 Sep 2023 09:46:24 +0800 Subject: [PATCH 06/16] =?UTF-8?q?fix(=E5=8D=95=E4=BE=8B):=E4=BD=BF?= =?UTF-8?q?=E7=94=A8QtSingleApplication=E5=A4=84=E7=90=86=E5=8D=95?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 10 ++++++++++ src/main.cpp | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 166d6261..9d5d5b1b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +kylin-nm (3.24.0.0-0k2.21) v101; urgency=medium + + * BUG: + - #194718 【网络连接】麒麟网络设置工具可固定到任务栏 + * 需求号:无 + * 其他改动说明: 弹窗跳过任务栏 + * 其他改动影响域:单例 + + -- zhaoshixu Thu, 28 Sep 2023 09:41:09 +0800 + kylin-nm (3.24.0.0-0k2.20) v101; urgency=medium * BUG: diff --git a/src/main.cpp b/src/main.cpp index f7482b41..aa2e8ed0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) interface.call(QStringLiteral("showKylinNM"), 1); } else if (parser.isSet(snOption)){ interface.call(QStringLiteral("showKylinNM"), 0); - } else { + } /*else { const QString serviceName = "com.kylin.network"; QDBusConnectionInterface *interface1 = QDBusConnection::sessionBus().interface(); QDBusReply pid = interface1->servicePid(serviceName); @@ -145,6 +145,10 @@ int main(int argc, char *argv[]) interface.call(QStringLiteral("showKylinNM"), 2); } } + return 0;*/ + } + + if (a.isRunning()) { return 0; } From 58f5d4d27a2fd9b0b9a8dc1de7390c1f806f6588 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Thu, 28 Sep 2023 14:05:23 +0800 Subject: [PATCH 07/16] =?UTF-8?q?fix(display):=E5=A4=9Adisplay=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=80=82=E9=85=8D(#194718)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mobilehotspot/mobilehotspot.cpp | 24 +- plugins/mobilehotspot/mobilehotspotwidget.cpp | 68 +-- plugins/netconnect/netconnect.cpp | 91 ++-- plugins/netconnect/netconnect.h | 2 + plugins/wlanconnect/wlanconnect.cpp | 96 ++-- plugins/wlanconnect/wlanconnect.h | 4 +- src/backend/backend.pri | 8 +- src/backend/dbus.cpp | 419 ++++++++++++++++++ src/backend/{dbusadaptor.h => dbus.h} | 41 +- src/backend/dbus.xml | 186 ++++++++ src/backend/dbus_adaptor.cpp | 191 ++++++++ src/backend/dbus_adaptor.h | 266 +++++++++++ src/backend/dbus_interface.cpp | 26 ++ src/backend/dbus_interface.h | 224 ++++++++++ src/backend/dbusadaptor.cpp | 279 ------------ src/frontend/mainwindow.cpp | 66 ++- src/frontend/mainwindow.h | 16 +- src/frontend/tab-pages/lanpage.cpp | 37 +- src/frontend/tab-pages/lanpage.h | 2 +- src/frontend/tab-pages/wlanpage.cpp | 97 ++-- src/frontend/tab-pages/wlanpage.h | 2 +- src/main.cpp | 43 +- 22 files changed, 1670 insertions(+), 518 deletions(-) create mode 100644 src/backend/dbus.cpp rename src/backend/{dbusadaptor.h => dbus.h} (78%) create mode 100644 src/backend/dbus.xml create mode 100644 src/backend/dbus_adaptor.cpp create mode 100644 src/backend/dbus_adaptor.h create mode 100644 src/backend/dbus_interface.cpp create mode 100644 src/backend/dbus_interface.h delete mode 100644 src/backend/dbusadaptor.cpp diff --git a/plugins/mobilehotspot/mobilehotspot.cpp b/plugins/mobilehotspot/mobilehotspot.cpp index 46bd4409..cc127cfc 100644 --- a/plugins/mobilehotspot/mobilehotspot.cpp +++ b/plugins/mobilehotspot/mobilehotspot.cpp @@ -21,7 +21,7 @@ #include - +#include MobileHotspot::MobileHotspot() : mFirstLoad(true) { @@ -113,23 +113,31 @@ bool MobileHotspot::isExitWirelessDevice() return false; } - QDBusMessage result = interface->call(QStringLiteral("getDeviceListAndEnabled"),1); - if(result.type() == QDBusMessage::ErrorMessage) { - qWarning() << "getWirelessDeviceList error:" << result.errorMessage(); + QDBusReply reply = interface->call(QStringLiteral("getDeviceListAndEnabled"),1); + if(!reply.isValid()) { + qWarning() << "getWirelessDeviceList error:" << reply.error().message(); return false; } - auto dbusArg = result.arguments().at(0).value(); QMap deviceListMap; - dbusArg >> deviceListMap; + QVariantMap::const_iterator itemIter = reply.value().cbegin(); + while (itemIter != reply.value().cend()) { + deviceListMap.insert(itemIter.key(), itemIter.value().toBool()); + itemIter ++; + } - QDBusReply > capReply = interface->call("getWirelessDeviceCap"); + QDBusReply capReply = interface->call("getWirelessDeviceCap"); if (!capReply.isValid()) { qDebug()<<"execute dbus method 'getWirelessDeviceCap' is invalid in func initInterfaceInfo()" < devCapMap = capReply.value(); + QMap devCapMap; + QVariantMap::const_iterator item = reply.value().cbegin(); + while (item != reply.value().cend()) { + devCapMap.insert(item.key(), item.value().toInt()); + item ++; + } if (deviceListMap.isEmpty()) { qDebug() << "no wireless device"; diff --git a/plugins/mobilehotspot/mobilehotspotwidget.cpp b/plugins/mobilehotspot/mobilehotspotwidget.cpp index 8682d7ab..39fd251d 100644 --- a/plugins/mobilehotspot/mobilehotspotwidget.cpp +++ b/plugins/mobilehotspot/mobilehotspotwidget.cpp @@ -314,31 +314,26 @@ void MobileHotspotWidget::onInterfaceChanged() { m_interfaceName = m_interfaceComboBox->currentText(); if(m_interface->isValid()) { - QDBusMessage result = m_interface->call(QStringLiteral("getWirelessList")); - if(result.type() == QDBusMessage::ErrorMessage) + QDBusReply reply = m_interface->call(QStringLiteral("getWirelessList"), m_interfaceName); + if(!reply.isValid()) { - qWarning() << "getWirelessList error:" << result.errorMessage(); + qWarning() << "getWirelessList error:" << reply.error().message(); return; } bool flag = false; - auto dbusArg = result.arguments().at(0).value(); - QMap> variantList; - dbusArg >> variantList; - if (variantList.size() != 0) { - QMap>::iterator iter; - for (iter = variantList.begin(); iter != variantList.end(); iter++) { - if (m_interfaceName == iter.key()) { - QVector wlanListInfo = iter.value(); - if (!wlanListInfo.isEmpty() && wlanListInfo.at(0).size() > 1) { - flag = true; - } - break; - } - } + + QList variantList; + for (int j = 0; j < reply.value().size(); ++j) { + variantList << reply.value().at(j).toStringList(); } + + if (!variantList.isEmpty() && variantList.at(0).size() > 1) { + flag = true; + } + if (flag) { m_interfaceWarnLabel->setText(tr("use ") + m_interfaceName + - tr(" share network, will interrupt local wireless connection")); + tr(" share network, will interrupt local wireless connection")); m_interfaceFrame->setFixedHeight(PASSWORD_FRAME_FIX_HIGHT); m_warnWidget->show(); } else { @@ -390,22 +385,32 @@ void MobileHotspotWidget::initInterfaceInfo() m_interfaceComboBox->hidePopup(); } m_interfaceComboBox->clear(); - QDBusReply > reply = m_interface->call("getDeviceListAndEnabled",WIRELESS); - - if (!reply.isValid()) { - qDebug() << LOG_HEAD <<"execute dbus method 'getDeviceListAndEnabled' is invalid in func initInterfaceInfo()"; - setWidgetHidden(true); + QDBusReply reply = m_interface->call(QStringLiteral("getDeviceListAndEnabled"),WIRELESS); + if(!reply.isValid()) { + qWarning() << "[WlanConnect]getWirelessDeviceList error:" << reply.error().message(); return; } - QMap devMap = reply.value(); - QDBusReply > capReply = m_interface->call("getWirelessDeviceCap"); + QMap devMap; + QVariantMap::const_iterator item = reply.value().cbegin(); + while (item != reply.value().cend()) { + devMap.insert(item.key(), item.value().toBool()); + item ++; + } + + + QDBusReply capReply = m_interface->call("getWirelessDeviceCap"); if (!capReply.isValid()) { qDebug() << LOG_HEAD <<"execute dbus method 'getWirelessDeviceCap' is invalid in func initInterfaceInfo()" < devCapMap = capReply.value(); + QMap devCapMap; + QVariantMap::const_iterator itemIter = capReply.value().cbegin(); + while (itemIter != capReply.value().cend()) { + devCapMap.insert(itemIter.key(), itemIter.value().toInt()); + itemIter ++; + } if (devMap.isEmpty()) { qDebug() << LOG_HEAD << "no wireless device"; @@ -824,14 +829,21 @@ void MobileHotspotWidget::updateBandCombox() { QString tmp = m_freqBandComboBox->currentText(); m_freqBandComboBox->clear(); - QDBusReply > capReply = m_interface->call("getWirelessDeviceCap"); + QDBusReply capReply = m_interface->call("getWirelessDeviceCap"); if (!capReply.isValid()) { qDebug()<<"execute dbus method 'getWirelessDeviceCap' is invalid in func initInterfaceInfo()" << capReply.error().message(); setWidgetHidden(true); return; } m_isUserSelect = false; - QMap devCapMap = capReply.value(); + + QMap devCapMap; + QVariantMap::const_iterator itemIter = capReply.value().cbegin(); + while (itemIter != capReply.value().cend()) { + devCapMap.insert(itemIter.key(), itemIter.value().toInt()); + itemIter ++; + } + if (devCapMap[m_interfaceName] & 0x02) { m_freqBandComboBox->addItem("2.4GHz"); } diff --git a/plugins/netconnect/netconnect.cpp b/plugins/netconnect/netconnect.cpp index fa3c268b..6dae527c 100644 --- a/plugins/netconnect/netconnect.cpp +++ b/plugins/netconnect/netconnect.cpp @@ -74,6 +74,9 @@ void NetConnect::showDesktopNotify(const QString &message) NetConnect::NetConnect() : mFirstLoad(true) { + qDBusRegisterMetaType(); + qDBusRegisterMetaType>(); + QTranslator* translator = new QTranslator(this); translator->load("/usr/share/kylin-nm/netconnect/" + QLocale::system().name()); QApplication::installTranslator(translator); @@ -107,7 +110,6 @@ QWidget *NetConnect::pluginUi() { pluginWidget = new QWidget; pluginWidget->setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(pluginWidget); - qDBusRegisterMetaType>(); m_interface = new QDBusInterface("com.kylin.network", "/com/kylin/network", "com.kylin.network", @@ -249,16 +251,21 @@ void NetConnect::getDeviceStatusMap(QMap &map) if (m_interface == nullptr || !m_interface->isValid()) { return; } + map.clear(); qDebug() << "[NetConnect]call getDeviceListAndEnabled" << __LINE__; - QDBusMessage result = m_interface->call(QStringLiteral("getDeviceListAndEnabled"),0); + QDBusReply reply = m_interface->call(QStringLiteral("getDeviceListAndEnabled"),0); qDebug() << "[NetConnect]call getDeviceListAndEnabled Respond" << __LINE__; - if(result.type() == QDBusMessage::ErrorMessage) + if(!reply.isValid()) { - qWarning() << "[NetConnect]getWiredDeviceList error:" << result.errorMessage(); + qWarning() << "[NetConnect]getWiredDeviceList error:" << reply.error().message(); return; } - auto dbusArg = result.arguments().at(0).value(); - dbusArg >> map; + + QVariantMap::const_iterator item = reply.value().cbegin(); + while (item != reply.value().cend()) { + map.insert(item.key(), item.value().toBool()); + item ++; + } } //lanUpdate @@ -390,26 +397,17 @@ void NetConnect::initNetListFromDevice(QString deviceName) if (m_interface == nullptr || !m_interface->isValid()) { return; } - qDebug() << "[NetConnect]call getWiredList" << __LINE__; - QDBusMessage result = m_interface->call(QStringLiteral("getWiredList")); - qDebug() << "[NetConnect]call getWiredList respond" << __LINE__; - if(result.type() == QDBusMessage::ErrorMessage) - { - qWarning() << "getWiredList error:" << result.errorMessage(); - return; - } - auto dbusArg = result.arguments().at(0).value(); - QMap> variantList; - dbusArg >> variantList; + + QMap> variantList = getWiredList(); if (variantList.size() == 0) { qDebug() << "[NetConnect]initNetListFromDevice " << deviceName << " list empty"; return; } - QMap>::iterator iter; + QMap>::iterator iter; for (iter = variantList.begin(); iter != variantList.end(); iter++) { if (deviceName == iter.key()) { - QVector wlanListInfo = iter.value(); + QList wlanListInfo = iter.value(); //处理列表 已连接 qDebug() << "[NetConnect]initNetListFromDevice " << deviceName << " acitved lan " << wlanListInfo.at(0); addLanItem(deviceFrameMap[deviceName], deviceName, wlanListInfo.at(0), true); @@ -486,22 +484,25 @@ void NetConnect::addDeviceFrame(QString devName) qDebug() << "[NetConnect]addDeviceFrame " << devName; qDebug() << "[NetConnect]call getDeviceListAndEnabled" << __LINE__; - QDBusMessage result = m_interface->call(QStringLiteral("getDeviceListAndEnabled"),0); + QDBusReply reply = m_interface->call(QStringLiteral("getDeviceListAndEnabled"),0); qDebug() << "[NetConnect]call getDeviceListAndEnabled Respond" << __LINE__; - if(result.type() == QDBusMessage::ErrorMessage) - { - qWarning() << "[NetConnect]getWiredDeviceList error:" << result.errorMessage(); + if(!reply.isValid()) { + qWarning() << "[NetConnect]getWiredDeviceList error:" << reply.error().message(); return; } - auto dbusArg = result.arguments().at(0).value(); QMap map; - dbusArg >> map; + QVariantMap::const_iterator item = reply.value().cbegin(); + while (item != reply.value().cend()) { + map.insert(item.key(), item.value().toBool()); + item ++; + } bool enable = true; if (map.contains(devName)) { enable = map[devName]; } + ItemFrame *itemFrame = new ItemFrame(devName, pluginWidget); ui->availableLayout->addWidget(itemFrame); itemFrame->deviceFrame->deviceLabel->setText(tr("card")+/*QString("%1").arg(count)+*/":"+devName); @@ -887,17 +888,9 @@ int NetConnect::getInsertPos(QString connName, QString deviceName) if(m_interface == nullptr || !m_interface->isValid()) { index = 0; } else { - qDebug() << "[NetConnect]call getWiredList" << __LINE__; - QDBusMessage result = m_interface->call(QStringLiteral("getWiredList")); - qDebug() << "[NetConnect]call getWiredList respond" << __LINE__; - if(result.type() == QDBusMessage::ErrorMessage) - { - qWarning() << "getWiredList error:" << result.errorMessage(); - return 0; - } - auto dbusArg = result.arguments().at(0).value(); - QMap> variantList; - dbusArg >> variantList; + + QMap> variantList = getWiredList(); + if (!variantList.contains(deviceName)) { qDebug() << "[NetConnect] getInsertPos but " << deviceName << "not exist"; return 0; @@ -915,3 +908,29 @@ int NetConnect::getInsertPos(QString connName, QString deviceName) } return index; } + +QMap> NetConnect::getWiredList() +{ + QMap> map; + + QMap statusMap; + getDeviceStatusMap(statusMap); + + for (int i = 0; i < statusMap.keys().size(); ++i) { + qDebug() << "[NetConnect]call getWiredList" << __LINE__; + QDBusReply reply = m_interface->call(QStringLiteral("getWiredList"), statusMap.keys().at(i)); + qDebug() << "[NetConnect]call getWiredList respond" << __LINE__; + if(!reply.isValid()) + { + qWarning() << "getWiredList error:" << reply.error().message(); + break; + } + + QList list; + for (int j = 0; j < reply.value().size(); ++j) { + list << reply.value().at(j).toStringList(); + } + map.insert(statusMap.keys().at(i), list); + } + return map; +} diff --git a/plugins/netconnect/netconnect.h b/plugins/netconnect/netconnect.h index 7fbc9814..1e94d05e 100644 --- a/plugins/netconnect/netconnect.h +++ b/plugins/netconnect/netconnect.h @@ -144,6 +144,8 @@ private: QMap deviceStatusMap; QMap deviceFrameMap; + QMap> getWiredList(); + private slots: void updateLanInfo(QString deviceName, QStringList lanInfo); diff --git a/plugins/wlanconnect/wlanconnect.cpp b/plugins/wlanconnect/wlanconnect.cpp index e1b01309..facdec20 100644 --- a/plugins/wlanconnect/wlanconnect.cpp +++ b/plugins/wlanconnect/wlanconnect.cpp @@ -167,6 +167,7 @@ QWidget *WlanConnect::pluginUi() { pluginWidget->setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(pluginWidget); qDBusRegisterMetaType>(); + qDBusRegisterMetaType(); m_interface = new QDBusInterface("com.kylin.network", "/com/kylin/network", "com.kylin.network", QDBusConnection::sessionBus()); @@ -317,28 +318,18 @@ void WlanConnect::updateList() } qDebug() << "update list"; if(m_interface != nullptr && m_interface->isValid()) { - qDebug() << "[WlanConnect]call getWirelessList" << __LINE__; - QDBusMessage result = m_interface->call(QStringLiteral("getWirelessList")); - qDebug() << "[WlanConnect]call getWirelessList respond" << __LINE__; - if(result.type() == QDBusMessage::ErrorMessage) - { - qWarning() << "getWirelessList error:" << result.errorMessage(); - return; - } - auto dbusArg = result.arguments().at(0).value(); - QMap> variantList; - dbusArg >> variantList; + QMap> variantList = getWirelessList(); if (variantList.size() == 0) { qDebug() << "[WlanConnect]updateList " << " list empty"; return; } - QMap>::iterator iter; + QMap>::iterator iter; for (iter = variantList.begin(); iter != variantList.end(); iter++) { if (deviceFrameMap.contains(iter.key())) { - QVector wifiList = iter.value(); + QList wifiList = iter.value(); resortWifiList(deviceFrameMap[iter.key()], wifiList); deviceFrameMap[iter.key()]->filletStyleChange(); } @@ -346,7 +337,7 @@ void WlanConnect::updateList() } } -void WlanConnect::resortWifiList(ItemFrame *frame, QVector list) +void WlanConnect::resortWifiList(ItemFrame *frame, QList list) { if(nullptr == frame || frame->lanItemLayout->count() <= 0 || list.isEmpty()) { return; @@ -702,16 +693,20 @@ void WlanConnect::getDeviceList(QStringList &list) return; } qDebug() << "[WlanConnect]call getDeviceListAndEnabled" << __LINE__; - QDBusMessage result = m_interface->call(QStringLiteral("getDeviceListAndEnabled"),1); + QDBusReply reply = m_interface->call(QStringLiteral("getDeviceListAndEnabled"),1); qDebug() << "[WlanConnect]call getDeviceListAndEnabled respond" << __LINE__; - if(result.type() == QDBusMessage::ErrorMessage) + if(!reply.isValid()) { - qWarning() << "[WlanConnect]getWirelessDeviceList error:" << result.errorMessage(); + qWarning() << "[WlanConnect]getWirelessDeviceList error:" << reply.error().message(); return; } - auto dbusArg = result.arguments().at(0).value(); + QMap map; - dbusArg >> map; + QVariantMap::const_iterator item = reply.value().cbegin(); + while (item != reply.value().cend()) { + map.insert(item.key(), item.value().toBool()); + item ++; + } //筛选已托管(managed)网卡 QMap::iterator iters; @@ -770,26 +765,20 @@ void WlanConnect::initNetListFromDevice(QString deviceName) if (m_interface == nullptr || !m_interface->isValid()) { return; } - qDebug() << "[WlanConnect]call getWirelessList" << __LINE__; - QDBusMessage result = m_interface->call(QStringLiteral("getWirelessList")); - qDebug() << "[WlanConnect]call getWirelessList respond" << __LINE__; - if(result.type() == QDBusMessage::ErrorMessage) - { - qWarning() << "getWirelessList error:" << result.errorMessage(); - return; - } - auto dbusArg = result.arguments().at(0).value(); - QMap> variantList; - dbusArg >> variantList; + + QMap> variantList = getWirelessList(); if (variantList.size() == 0) { qDebug() << "[WlanConnect]initNetListFromDevice " << deviceName << " list empty"; return; } - QMap>::iterator iter; + QMap>::iterator iter; for (iter = variantList.begin(); iter != variantList.end(); iter++) { if (deviceName == iter.key()) { - QVector wlanListInfo = iter.value(); + QList wlanListInfo = iter.value(); + if (wlanListInfo.size() <= 0) { + break; + } //处理列表 已连接 qDebug() << "[WlanConnect]initNetListFromDevice " << deviceName << " acitved wifi " << wlanListInfo.at(0); addActiveItem(deviceFrameMap[deviceName], deviceName, wlanListInfo.at(0)); @@ -903,21 +892,13 @@ int WlanConnect::sortWlanNet(QString deviceName, QString name, QString signal) if (m_interface == nullptr || !m_interface->isValid()) { return 0; } - qDebug() << "[WlanConnect]call getWirelessList" << __LINE__; - QDBusMessage result = m_interface->call(QStringLiteral("getWirelessList")); - qDebug() << "[WlanConnect]call getWirelessList respond" << __LINE__; - if(result.type() == QDBusMessage::ErrorMessage) - { - qWarning() << "getWirelessList error:" << result.errorMessage(); - return 0; - } - auto dbusArg = result.arguments().at(0).value(); - QMap> variantList; - dbusArg >> variantList; - QMap>::iterator iter; + + QMap> variantList = getWirelessList(); + + QMap>::iterator iter; for (iter = variantList.begin(); iter != variantList.end(); iter++) { if (deviceName == iter.key()) { - QVector wlanListInfo = iter.value(); + QList wlanListInfo = iter.value(); for (int i = 0; i < wlanListInfo.size(); i++) { if (name == wlanListInfo.at(i).at(0)) { return i; @@ -1127,3 +1108,28 @@ void WlanConnect::itemActiveConnectionStatusChanged(WlanItem *item, int status) } } +QMap> WlanConnect::getWirelessList() +{ + QMap> map; + QStringList list; + getDeviceList(list); + + for (int i = 0; i < list.size(); ++i) { + qDebug() << "[NetConnect]call getWirelessList" << __LINE__; + QDBusReply reply = m_interface->call(QStringLiteral("getWirelessList"), list.at(i)); + qDebug() << "[NetConnect]call getWirelessList respond" << __LINE__; + if(!reply.isValid()) + { + qWarning() << "getWirelessList error:" << reply.error().message(); + break; + } + + QList llist; + for (int j = 0; j < reply.value().size(); ++j) { + llist << reply.value().at(j).toStringList(); + } + map.insert(list.at(i), llist); + } + return map; +} + diff --git a/plugins/wlanconnect/wlanconnect.h b/plugins/wlanconnect/wlanconnect.h index 734dc0d7..a822a658 100644 --- a/plugins/wlanconnect/wlanconnect.h +++ b/plugins/wlanconnect/wlanconnect.h @@ -91,7 +91,7 @@ private: int sortWlanNet(QString deviceName, QString name, QString signal); void updateIcon(WlanItem *item, QString signalStrength, QString security, QString isApConnection, int category); - void resortWifiList(ItemFrame *frame, QVector list); + void resortWifiList(ItemFrame *frame, QList list); //单wifi图标 @@ -174,6 +174,8 @@ private: QTimer * m_scanTimer = nullptr; // QTimer * m_updateTimer = nullptr; + + QMap> getWirelessList(); private: KSwitchButton *m_wifiSwitch; bool m_firstLoad; diff --git a/src/backend/backend.pri b/src/backend/backend.pri index 0d383624..103a0db0 100644 --- a/src/backend/backend.pri +++ b/src/backend/backend.pri @@ -3,13 +3,17 @@ include(hotspot/hotspot.pri) include(dbus-interface/dbus-interface.pri) HEADERS += \ - $$PWD/dbusadaptor.h \ + $$PWD/dbus.h \ + $$PWD/dbus_adaptor.h \ + $$PWD/dbus_interface.h \ $$PWD/sysdbusregister.h \ $$PWD/utils.h \ $$PWD/wifi-auth-thread.h SOURCES += \ - $$PWD/dbusadaptor.cpp \ + $$PWD/dbus.cpp \ + $$PWD/dbus_adaptor.cpp \ + $$PWD/dbus_interface.cpp \ $$PWD/sysdbusregister.cpp \ $$PWD/utils.cpp \ $$PWD/wifi-auth-thread.cpp diff --git a/src/backend/dbus.cpp b/src/backend/dbus.cpp new file mode 100644 index 00000000..5f27b092 --- /dev/null +++ b/src/backend/dbus.cpp @@ -0,0 +1,419 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp com.kylin.weather.xml -a dbusadaptor -c DbusAdaptor -l MainWindow + * + * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#include "dbus.h" +#include +#include +#include +#include +#include +#include +#include + +const QByteArray GSETTINGS_SCHEMA_KYLIN_NM = "org.ukui.kylin-nm.switch"; +const QString KEY_WIRELESS_SWITCH = "wirelessswitch"; +const QString KEY_WIRED_SWITCH = "wiredswitch"; + +/* + * Implementation of adaptor class DbusAdaptor + */ + +DbusAdaptor::DbusAdaptor(QString display, MainWindow *m, QObject *parent) + : QObject(parent), + m_display(display), + m_mainWindow(m) +{ + // constructor + qDBusRegisterMetaType >(); + qDBusRegisterMetaType >(); + qDBusRegisterMetaType >(); + qDBusRegisterMetaType >>(); + + bool isServiceRegistered = QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("com.kylin.network")); + if(!isServiceRegistered) { + registerService(); + } + + m_watcher = new QDBusServiceWatcher(QStringLiteral("com.kylin.network"),QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); + connect(m_watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &DbusAdaptor::onServiceOwnerChanged); + + connectToMainwindow(); +} + +void DbusAdaptor::onServiceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner) +{ + if (newOwner.isEmpty()) { + bool success = registerService(); + if (success) { + m_watcher->deleteLater(); + } + qDebug() << "try to register service:" << success; + return; + } + + uint newOwnerPid = QDBusConnection::sessionBus().interface()->servicePid(newOwner); + qDebug() << "newOwnerPid:" << newOwnerPid << ", myPid:" << QCoreApplication::applicationPid() << ", display:" << m_display; +} + +bool DbusAdaptor::registerService() +{ + new NetworkAdaptor(this); + + QDBusConnection conn = QDBusConnection::sessionBus(); + auto reply = conn.interface()->registerService(QStringLiteral("com.kylin.network"), + QDBusConnectionInterface::ReplaceExistingService, + QDBusConnectionInterface::DontAllowReplacement); + if (reply.value() == QDBusConnectionInterface::ServiceNotRegistered) { + return false; + } + + bool res = QDBusConnection::sessionBus().registerObject("/com/kylin/network", this); + if (!res) { + QDBusConnection::sessionBus().interface()->unregisterService(QStringLiteral("com.kylin.network")); + } + return res; +} + + +//无线列表 +QVariantList DbusAdaptor::getWirelessList(QString devName) +{ + QList list; + m_mainWindow->getWirelessList(devName, list); + QVariantList vList; + for (int i = 0; i < list.size(); ++i) { + vList.append(QVariant::fromValue(list.at(i))); + } + return vList; +} + +bool DbusAdaptor::getWirelessSwitchBtnState() +{ + return m_mainWindow->getWirelessSwitchBtnState(); +} + +//有线列表 +QVariantList DbusAdaptor::getWiredList(QString devName) +{ + QList list; + m_mainWindow->getWiredList(devName, list); + QVariantList vList; + for (int i = 0; i < list.size(); ++i) { + vList.append(QVariant::fromValue(list.at(i))); + } + return vList; + +} + +//有线开关 +void DbusAdaptor::setWiredSwitchEnable(bool enable) +{ + //todo mainwindow调用backend 对开关 打开/关闭 + if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA_KYLIN_NM)) { + QGSettings *gsetting = new QGSettings(GSETTINGS_SCHEMA_KYLIN_NM); + if (gsetting->get(KEY_WIRED_SWITCH).toBool() != enable) { + gsetting->set(KEY_WIRED_SWITCH, enable); + } + delete gsetting; + gsetting = nullptr; + } else { + qDebug()<<"isSchemaInstalled false"; + } +} + +//无线开关 +void DbusAdaptor::setWirelessSwitchEnable(bool enable) +{ + //todo mainwindow调用backend 对开关 打开/关闭 +// if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA_KYLIN_NM)) { +// QGSettings *gsetting = new QGSettings(GSETTINGS_SCHEMA_KYLIN_NM); +// if (gsetting->get(KEY_WIRELESS_SWITCH).toBool() != enable) { +// gsetting->set(KEY_WIRELESS_SWITCH, enable); +// } +// delete gsetting; +// gsetting = nullptr; +// } else { +// qDebug()<<"isSchemaInstalled false"; +// } + m_mainWindow->setWirelessSwitchEnable(enable); +} + +//启用/禁用网卡 +void DbusAdaptor::setDeviceEnable(QString devName, bool enable) +{ + m_mainWindow->setWiredDeviceEnable(devName, enable); +} + +//设置默认网卡 +//void DbusAdaptor::setDefaultWiredDevice(QString deviceName) +//{ +// if (!checkDeviceExist(WIRED, deviceName)) { +// return; +// } +// setDefaultDevice(WIRED, deviceName); +// parent()->setWiredDefaultDevice(deviceName); +// return; +//} + +//QString DbusAdaptor::getDefaultWiredDevice() +//{ +// QSettings * m_settings = new QSettings(CONFIG_FILE_PATH, QSettings::IniFormat); +// m_settings->beginGroup("DEFAULTCARD"); +// QString key("wired"); +// QString deviceName = m_settings->value(key, "").toString(); +// m_settings->endGroup(); +// delete m_settings; +// m_settings = nullptr; +// return deviceName; +//} + +//void DbusAdaptor::setDefaultWirelessDevice(QString deviceName) +//{ +// if (!checkDeviceExist(WIRED, deviceName)) { +// return; +// } +// setDefaultDevice(WIRELESS, deviceName); +// parent()->setWirelessDefaultDevice(deviceName); +// return; +//} + +//QString DbusAdaptor::getDefaultWirelessDevice() +//{ +// QSettings * m_settings = new QSettings(CONFIG_FILE_PATH, QSettings::IniFormat); +// m_settings->beginGroup("DEFAULTCARD"); +// QString key("wireless"); +// QString deviceName = m_settings->value(key, "").toString(); +// m_settings->endGroup(); +// delete m_settings; +// m_settings = nullptr; +// return deviceName; +//} + +//连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid +void DbusAdaptor::activateConnect(int type, QString devName, QString ssid) +{ + if (type == WIRED) { + m_mainWindow->activateWired(devName,ssid); + } else if (type == WIRELESS) { + m_mainWindow->activateWireless(devName,ssid); + } else { + qDebug() << "[DbusAdaptor] activateConnect type is invalid"; + } +} + +//断开连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid +void DbusAdaptor::deActivateConnect(int type, QString devName, QString ssid) +{ + if (type == WIRED) { + qDebug() << "deactivateWired"; + m_mainWindow->deactivateWired(devName,ssid); + } else if (type == WIRELESS) { + m_mainWindow->deactivateWireless(devName,ssid); + } else { + qDebug() << "[DbusAdaptor] deactivateConnect type is invalid"; + } +} + +//获取设备列表和启用/禁用状态 +QVariantMap DbusAdaptor::getDeviceListAndEnabled(int devType) +{ + QMap map; + map.clear(); + getDeviceEnableState(devType, map); + QVariantMap vMap; + QMap::const_iterator item = map.cbegin(); + while (item != map.cend()) { + vMap.insert(item.key(), QVariant::fromValue(item.value())); + item ++; + } + return vMap; +} + +//获取无线设备能力 +QVariantMap DbusAdaptor::getWirelessDeviceCap() +{ + QMap map; + m_mainWindow->getWirelessDeviceCap(map); + QVariantMap vMap; + QMap::const_iterator item = map.cbegin(); + while (item != map.cend()) { + vMap.insert(item.key(), QVariant::fromValue(item.value())); + item ++; + } + return vMap; +} + +//唤起属性页 根据网卡类型 参数2 为ssid/uuid +void DbusAdaptor::showPropertyWidget(QString devName, QString ssid) +{ + QString display = checkDisplay(); + if (m_display == display) { + m_mainWindow->showPropertyWidget(devName,ssid); + } else { + Q_EMIT showPropertyWidgetSignal(display, devName, ssid); + } +} + +//唤起新建有线连接界面 +void DbusAdaptor::showCreateWiredConnectWidget(QString devName) +{ + QString display = checkDisplay(); + if (m_display == display) { + m_mainWindow->showCreateWiredConnectWidget(devName); + } else { + Q_EMIT showCreateWiredConnectWidgetSignal(display, devName); + } +} + +//唤起加入其他无线网络界面 +void DbusAdaptor::showAddOtherWlanWidget(QString devName) +{ + QString display = checkDisplay(); + if (m_display == display) { + qDebug() << "showAddOtherWlanWidget"; + m_mainWindow->showAddOtherWlanWidget(devName); + } else { + qDebug() << display; + Q_EMIT showAddOtherWlanWidgetSignal(display, devName); + } +} + +//开启热点 +void DbusAdaptor::activeWirelessAp(const QString apName, const QString apPassword, const QString band, const QString apDevice) +{ + m_mainWindow->activeWirelessAp(apName, apPassword, band, apDevice); +} + +//断开热点 +void DbusAdaptor::deactiveWirelessAp(const QString apName, const QString uuid) +{ + m_mainWindow->deactiveWirelessAp(apName, uuid); +} + +//获取热点 +QStringList DbusAdaptor::getStoredApInfo() +{ + QStringList list; + list.clear(); + m_mainWindow->getStoredApInfo(list); + return list; +} + +//获取热点path +QString DbusAdaptor::getApConnectionPath(QString uuid) +{ + QString path; + path.clear(); + m_mainWindow->getApConnectionPath(path, uuid); + return path; +} + +//获取热点path +QString DbusAdaptor::getActiveConnectionPath(QString uuid) +{ + QString path; + path.clear(); + m_mainWindow->getActiveConnectionPath(path, uuid); + return path; +} + +QStringList DbusAdaptor::getApInfoBySsid(QString devName, QString ssid) +{ + QStringList list; + list.clear(); + m_mainWindow->getApInfoBySsid(devName, ssid, list); + return list; +} + +void DbusAdaptor::showKylinNM(int type) +{ + qDebug() << "display" << checkDisplay(); + QString display = checkDisplay(); + if (m_display == display) { + m_mainWindow->onShowMainWindow(type); + } else { + + Q_EMIT showKylinNMSignal(display, type); + } +} + +//扫描 +void DbusAdaptor::reScan() +{ + m_mainWindow->rescan(); +} + +void DbusAdaptor::keyRingInit() +{ + m_mainWindow->keyRingInit(); +} + +void DbusAdaptor::keyRingClear() +{ + m_mainWindow->keyRingClear(); +} + +void DbusAdaptor::connectToMainwindow() +{ + connect(m_mainWindow, &MainWindow::lanAdd, this, &DbusAdaptor::lanAdd); + connect(m_mainWindow, &MainWindow::lanRemove, this, &DbusAdaptor::lanRemove); + connect(m_mainWindow, &MainWindow::lanUpdate, this, &DbusAdaptor::lanUpdate); + connect(m_mainWindow, &MainWindow::wlanAdd, this, &DbusAdaptor::wlanAdd); + connect(m_mainWindow, &MainWindow::wlanRemove, this, &DbusAdaptor::wlanRemove); + connect(m_mainWindow, &MainWindow::wlanactiveConnectionStateChanged, this, &DbusAdaptor::wlanactiveConnectionStateChanged); + connect(m_mainWindow, &MainWindow::lanActiveConnectionStateChanged, this, &DbusAdaptor::lanActiveConnectionStateChanged); + connect(m_mainWindow, &MainWindow::activateFailed, this, &DbusAdaptor::activateFailed); + connect(m_mainWindow, &MainWindow::deactivateFailed, this, &DbusAdaptor::deactivateFailed); + connect(m_mainWindow, &MainWindow::deviceStatusChanged, this, &DbusAdaptor::deviceStatusChanged); + connect(m_mainWindow, &MainWindow::wirelessDeviceStatusChanged, this, &DbusAdaptor::wirelessDeviceStatusChanged); + connect(m_mainWindow, &MainWindow::deviceNameChanged, this, &DbusAdaptor::deviceNameChanged); + connect(m_mainWindow, &MainWindow::wirelessSwitchBtnChanged, this, &DbusAdaptor::wirelessSwitchBtnChanged); + connect(m_mainWindow, &MainWindow::hotspotDeactivated, this, &DbusAdaptor::hotspotDeactivated); + connect(m_mainWindow, &MainWindow::hotspotActivated, this, &DbusAdaptor::hotspotActivated); + connect(m_mainWindow, &MainWindow::signalStrengthChange, this, &DbusAdaptor::signalStrengthChange); + connect(m_mainWindow, &MainWindow::secuTypeChange, this, &DbusAdaptor::secuTypeChange); + connect(m_mainWindow, &MainWindow::timeToUpdate, this, &DbusAdaptor::timeToUpdate); +} + +QString DbusAdaptor::checkDisplay() +{ + uint pid = 0; + QDBusReply pidReply = connection().interface()->servicePid(message().service()); + qDebug() << "caller pid: " << pidReply.value(); + if(pidReply.isValid()) { + pid = pidReply.value(); + } else { + return {}; + } + return displayFromPid(pid);; +} + +QString DbusAdaptor::displayFromPid(uint pid) +{ + QFile environFile(QStringLiteral("/proc/%1/environ").arg(QString::number(pid))); + if (environFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + const QByteArray DISPLAY = qApp->property("sessionType").toString() == "wayland" ? QByteArrayLiteral("WAYLAND_DISPLAY") + : QByteArrayLiteral("DISPLAY"); + const auto lines = environFile.readAll().split('\0'); + for (const QByteArray &line : lines) { + const int equalsIdx = line.indexOf('='); + if (equalsIdx <= 0) { + continue; + } + const QByteArray key = line.left(equalsIdx); + if (key == DISPLAY) { + const QByteArray value = line.mid(equalsIdx + 1); + return value; + } + } + } + return {}; +} + diff --git a/src/backend/dbusadaptor.h b/src/backend/dbus.h similarity index 78% rename from src/backend/dbusadaptor.h rename to src/backend/dbus.h index a6fa6a8d..5115146d 100644 --- a/src/backend/dbusadaptor.h +++ b/src/backend/dbus.h @@ -15,6 +15,8 @@ #include #include #include +#include "dbus_adaptor.h" +#include "dbus_interface.h" #include "tabpage.h" #include "../dbus-interface/kylinnetworkdeviceresource.h" @@ -34,23 +36,19 @@ QT_END_NAMESPACE #include "mainwindow.h" -class DbusAdaptor: public QDBusAbstractAdaptor +class DbusAdaptor: public QObject, protected QDBusContext { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.kylin.network") public: - DbusAdaptor(MainWindow *parent); - virtual ~DbusAdaptor(); - - inline MainWindow *parent() const - { return static_cast(QObject::parent()); } + explicit DbusAdaptor(QString display, MainWindow *m, QObject *parent = nullptr); public: // PROPERTIES public Q_SLOTS: // METHODS //无线列表 - QMap > getWirelessList(); + QVariantList getWirelessList(QString devName); //有线列表 - QMap> getWiredList(); + QVariantList getWiredList(QString devName); //有线总开关 Q_NOREPLY void setWiredSwitchEnable(bool enable); //无线总开关 @@ -67,9 +65,9 @@ public Q_SLOTS: // METHODS //断开连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid Q_NOREPLY void deActivateConnect(int type, QString devName, QString ssid); //获取设备列表和启用/禁用状态 - QMap getDeviceListAndEnabled(int devType); + QVariantMap getDeviceListAndEnabled(int devType); //获取无线设备能力 - QMap getWirelessDeviceCap(); + QVariantMap getWirelessDeviceCap(); //唤起属性页 根据网卡类型 参数2 为ssid/uuid Q_NOREPLY void showPropertyWidget(QString devName, QString ssid); //唤起新建有线连接界面 @@ -124,6 +122,29 @@ Q_SIGNALS: // SIGNALS void secuTypeChange(QString devName, QString ssid, QString secuType); //列表排序 void timeToUpdate(); + + + + void showKylinNMSignal(QString display, int type); + + //唤起属性页 根据网卡类型 参数2 为ssid/uuid + void showPropertyWidgetSignal(QString display, QString devName, QString ssid); + //唤起新建有线连接界面 + void showCreateWiredConnectWidgetSignal(QString display, QString devName); + //唤起加入其他无线网络界面 + void showAddOtherWlanWidgetSignal(QString display, QString devName); + +private: + MainWindow *m_mainWindow; + QString m_display; + QDBusServiceWatcher *m_watcher = nullptr; + + QString checkDisplay(); + QString displayFromPid(uint pid); + void connectToMainwindow(); + bool registerService(); +private Q_SLOT: + void onServiceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner); }; #endif diff --git a/src/backend/dbus.xml b/src/backend/dbus.xml new file mode 100644 index 00000000..59d36c32 --- /dev/null +++ b/src/backend/dbus.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/backend/dbus_adaptor.cpp b/src/backend/dbus_adaptor.cpp new file mode 100644 index 00000000..56e99012 --- /dev/null +++ b/src/backend/dbus_adaptor.cpp @@ -0,0 +1,191 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp dbus.xml -a dbus_adaptor + * + * qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#include "dbus_adaptor.h" +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementation of adaptor class NetworkAdaptor + */ + +NetworkAdaptor::NetworkAdaptor(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + setAutoRelaySignals(true); +} + +NetworkAdaptor::~NetworkAdaptor() +{ + // destructor +} + +void NetworkAdaptor::activateConnect(int type, const QString &devName, const QString &ssid) +{ + // handle method call com.kylin.network.activateConnect + QMetaObject::invokeMethod(parent(), "activateConnect", Q_ARG(int, type), Q_ARG(QString, devName), Q_ARG(QString, ssid)); +} + +void NetworkAdaptor::activeWirelessAp(const QString &apName, const QString &apPassword, const QString &band, const QString &apDevice) +{ + // handle method call com.kylin.network.activeWirelessAp + QMetaObject::invokeMethod(parent(), "activeWirelessAp", Q_ARG(QString, apName), Q_ARG(QString, apPassword), Q_ARG(QString, band), Q_ARG(QString, apDevice)); +} + +void NetworkAdaptor::deActivateConnect(int type, const QString &devName, const QString &ssid) +{ + // handle method call com.kylin.network.deActivateConnect + QMetaObject::invokeMethod(parent(), "deActivateConnect", Q_ARG(int, type), Q_ARG(QString, devName), Q_ARG(QString, ssid)); +} + +void NetworkAdaptor::deactiveWirelessAp(const QString &apName, const QString &uuid) +{ + // handle method call com.kylin.network.deactiveWirelessAp + QMetaObject::invokeMethod(parent(), "deactiveWirelessAp", Q_ARG(QString, apName), Q_ARG(QString, uuid)); +} + +QString NetworkAdaptor::getActiveConnectionPath(const QString &uuid) +{ + // handle method call com.kylin.network.getActiveConnectionPath + QString out0; + QMetaObject::invokeMethod(parent(), "getActiveConnectionPath", Q_RETURN_ARG(QString, out0), Q_ARG(QString, uuid)); + return out0; +} + +QString NetworkAdaptor::getApConnectionPath(const QString &uuid) +{ + // handle method call com.kylin.network.getApConnectionPath + QString out0; + QMetaObject::invokeMethod(parent(), "getApConnectionPath", Q_RETURN_ARG(QString, out0), Q_ARG(QString, uuid)); + return out0; +} + +QStringList NetworkAdaptor::getApInfoBySsid(const QString &devName, const QString &ssid) +{ + // handle method call com.kylin.network.getApInfoBySsid + QStringList out0; + QMetaObject::invokeMethod(parent(), "getApInfoBySsid", Q_RETURN_ARG(QStringList, out0), Q_ARG(QString, devName), Q_ARG(QString, ssid)); + return out0; +} + +QVariantMap NetworkAdaptor::getDeviceListAndEnabled(int devType) +{ + // handle method call com.kylin.network.getDeviceListAndEnabled + QVariantMap out0; + QMetaObject::invokeMethod(parent(), "getDeviceListAndEnabled", Q_RETURN_ARG(QVariantMap, out0), Q_ARG(int, devType)); + return out0; +} + +QStringList NetworkAdaptor::getStoredApInfo() +{ + // handle method call com.kylin.network.getStoredApInfo + QStringList out0; + QMetaObject::invokeMethod(parent(), "getStoredApInfo", Q_RETURN_ARG(QStringList, out0)); + return out0; +} + +QVariantList NetworkAdaptor::getWiredList(const QString &devName) +{ + // handle method call com.kylin.network.getWiredList + QVariantList out0; + QMetaObject::invokeMethod(parent(), "getWiredList", Q_RETURN_ARG(QVariantList, out0), Q_ARG(QString, devName)); + return out0; +} + +QVariantMap NetworkAdaptor::getWirelessDeviceCap() +{ + // handle method call com.kylin.network.getWirelessDeviceCap + QVariantMap out0; + QMetaObject::invokeMethod(parent(), "getWirelessDeviceCap", Q_RETURN_ARG(QVariantMap, out0)); + return out0; +} + +QVariantList NetworkAdaptor::getWirelessList(const QString &devName) +{ + // handle method call com.kylin.network.getWirelessList + QVariantList out0; + QMetaObject::invokeMethod(parent(), "getWirelessList", Q_RETURN_ARG(QVariantList, out0), Q_ARG(QString, devName)); + return out0; +} + +bool NetworkAdaptor::getWirelessSwitchBtnState() +{ + // handle method call com.kylin.network.getWirelessSwitchBtnState + bool out0; + QMetaObject::invokeMethod(parent(), "getWirelessSwitchBtnState", Q_RETURN_ARG(bool, out0)); + return out0; +} + +void NetworkAdaptor::keyRingClear() +{ + // handle method call com.kylin.network.keyRingClear + QMetaObject::invokeMethod(parent(), "keyRingClear"); +} + +void NetworkAdaptor::keyRingInit() +{ + // handle method call com.kylin.network.keyRingInit + QMetaObject::invokeMethod(parent(), "keyRingInit"); +} + +void NetworkAdaptor::reScan() +{ + // handle method call com.kylin.network.reScan + QMetaObject::invokeMethod(parent(), "reScan"); +} + +void NetworkAdaptor::setDeviceEnable(const QString &devName, bool enable) +{ + // handle method call com.kylin.network.setDeviceEnable + QMetaObject::invokeMethod(parent(), "setDeviceEnable", Q_ARG(QString, devName), Q_ARG(bool, enable)); +} + +void NetworkAdaptor::setWiredSwitchEnable(bool enable) +{ + // handle method call com.kylin.network.setWiredSwitchEnable + QMetaObject::invokeMethod(parent(), "setWiredSwitchEnable", Q_ARG(bool, enable)); +} + +void NetworkAdaptor::setWirelessSwitchEnable(bool enable) +{ + // handle method call com.kylin.network.setWirelessSwitchEnable + QMetaObject::invokeMethod(parent(), "setWirelessSwitchEnable", Q_ARG(bool, enable)); +} + +void NetworkAdaptor::showAddOtherWlanWidget(const QString &devName) +{ + // handle method call com.kylin.network.showAddOtherWlanWidget + QMetaObject::invokeMethod(parent(), "showAddOtherWlanWidget", Q_ARG(QString, devName)); +} + +void NetworkAdaptor::showCreateWiredConnectWidget(const QString &devName) +{ + // handle method call com.kylin.network.showCreateWiredConnectWidget + QMetaObject::invokeMethod(parent(), "showCreateWiredConnectWidget", Q_ARG(QString, devName)); +} + +void NetworkAdaptor::showKylinNM(int type) +{ + // handle method call com.kylin.network.showKylinNM + QMetaObject::invokeMethod(parent(), "showKylinNM", Q_ARG(int, type)); +} + +void NetworkAdaptor::showPropertyWidget(const QString &devName, const QString &ssid) +{ + // handle method call com.kylin.network.showPropertyWidget + QMetaObject::invokeMethod(parent(), "showPropertyWidget", Q_ARG(QString, devName), Q_ARG(QString, ssid)); +} + diff --git a/src/backend/dbus_adaptor.h b/src/backend/dbus_adaptor.h new file mode 100644 index 00000000..e562a2d3 --- /dev/null +++ b/src/backend/dbus_adaptor.h @@ -0,0 +1,266 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp dbus.xml -a dbus_adaptor + * + * qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#ifndef DBUS_ADAPTOR_H +#define DBUS_ADAPTOR_H + +#include +#include +QT_BEGIN_NAMESPACE +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; +QT_END_NAMESPACE + +/* + * Adaptor class for interface com.kylin.network + */ +class NetworkAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "com.kylin.network") + Q_CLASSINFO("D-Bus Introspection", "" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" + "") +public: + NetworkAdaptor(QObject *parent); + virtual ~NetworkAdaptor(); + +public: // PROPERTIES +public Q_SLOTS: // METHODS + Q_NOREPLY void activateConnect(int type, const QString &devName, const QString &ssid); + void activeWirelessAp(const QString &apName, const QString &apPassword, const QString &band, const QString &apDevice); + Q_NOREPLY void deActivateConnect(int type, const QString &devName, const QString &ssid); + void deactiveWirelessAp(const QString &apName, const QString &uuid); + QString getActiveConnectionPath(const QString &uuid); + QString getApConnectionPath(const QString &uuid); + QStringList getApInfoBySsid(const QString &devName, const QString &ssid); + QVariantMap getDeviceListAndEnabled(int devType); + QStringList getStoredApInfo(); + QVariantList getWiredList(const QString &devName); + QVariantMap getWirelessDeviceCap(); + QVariantList getWirelessList(const QString &devName); + bool getWirelessSwitchBtnState(); + void keyRingClear(); + void keyRingInit(); + void reScan(); + Q_NOREPLY void setDeviceEnable(const QString &devName, bool enable); + Q_NOREPLY void setWiredSwitchEnable(bool enable); + Q_NOREPLY void setWirelessSwitchEnable(bool enable); + Q_NOREPLY void showAddOtherWlanWidget(const QString &devName); + Q_NOREPLY void showCreateWiredConnectWidget(const QString &devName); + void showKylinNM(int type); + Q_NOREPLY void showPropertyWidget(const QString &devName, const QString &ssid); +Q_SIGNALS: // SIGNALS + void activateFailed(const QString &errorMessage); + void deactivateFailed(const QString &errorMessage); + void deviceNameChanged(const QString &oldName, const QString &newName, int type); + void deviceStatusChanged(); + void hotspotActivated(const QString &devName, const QString &ssid, const QString &uuid, const QString &activePath, const QString &settingPath); + void hotspotDeactivated(const QString &devName, const QString &ssid); + void lanActiveConnectionStateChanged(const QString &devName, const QString &uuid, int status); + void lanAdd(const QString &devName, const QStringList &info); + void lanRemove(const QString &dbusPath); + void lanUpdate(const QString &devName, const QStringList &info); + void secuTypeChange(const QString &devName, const QString &ssid, const QString &secuType); + void showAddOtherWlanWidgetSignal(const QString &display, const QString &devName); + void showCreateWiredConnectWidgetSignal(const QString &display, const QString &devName); + void showKylinNMSignal(const QString &display, int type); + void showPropertyWidgetSignal(const QString &display, const QString &devName, const QString &ssid); + void signalStrengthChange(const QString &devName, const QString &ssid, int strength); + void timeToUpdate(); + void wirelessDeviceStatusChanged(); + void wirelessSwitchBtnChanged(bool state); + void wlanAdd(const QString &devName, const QStringList &info); + void wlanRemove(const QString &devName, const QString &ssid); + void wlanactiveConnectionStateChanged(const QString &devName, const QString &ssid, const QString &uuid, int status); +}; + +#endif diff --git a/src/backend/dbus_interface.cpp b/src/backend/dbus_interface.cpp new file mode 100644 index 00000000..1f04e21e --- /dev/null +++ b/src/backend/dbus_interface.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp dbus.xml -p dbus_interface + * + * qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "dbus_interface.h" + +/* + * Implementation of interface class ComKylinNetworkInterface + */ + +ComKylinNetworkInterface::ComKylinNetworkInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +ComKylinNetworkInterface::~ComKylinNetworkInterface() +{ +} + diff --git a/src/backend/dbus_interface.h b/src/backend/dbus_interface.h new file mode 100644 index 00000000..f8a73c64 --- /dev/null +++ b/src/backend/dbus_interface.h @@ -0,0 +1,224 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp dbus.xml -p dbus_interface + * + * qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef DBUS_INTERFACE_H +#define DBUS_INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface com.kylin.network + */ +class ComKylinNetworkInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "com.kylin.network"; } + +public: + ComKylinNetworkInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); + + ~ComKylinNetworkInterface(); + +public Q_SLOTS: // METHODS + inline Q_NOREPLY void activateConnect(int type, const QString &devName, const QString &ssid) + { + QList argumentList; + argumentList << QVariant::fromValue(type) << QVariant::fromValue(devName) << QVariant::fromValue(ssid); + callWithArgumentList(QDBus::NoBlock, QStringLiteral("activateConnect"), argumentList); + } + + inline QDBusPendingReply<> activeWirelessAp(const QString &apName, const QString &apPassword, const QString &band, const QString &apDevice) + { + QList argumentList; + argumentList << QVariant::fromValue(apName) << QVariant::fromValue(apPassword) << QVariant::fromValue(band) << QVariant::fromValue(apDevice); + return asyncCallWithArgumentList(QStringLiteral("activeWirelessAp"), argumentList); + } + + inline Q_NOREPLY void deActivateConnect(int type, const QString &devName, const QString &ssid) + { + QList argumentList; + argumentList << QVariant::fromValue(type) << QVariant::fromValue(devName) << QVariant::fromValue(ssid); + callWithArgumentList(QDBus::NoBlock, QStringLiteral("deActivateConnect"), argumentList); + } + + inline QDBusPendingReply<> deactiveWirelessAp(const QString &apName, const QString &uuid) + { + QList argumentList; + argumentList << QVariant::fromValue(apName) << QVariant::fromValue(uuid); + return asyncCallWithArgumentList(QStringLiteral("deactiveWirelessAp"), argumentList); + } + + inline QDBusPendingReply getActiveConnectionPath(const QString &uuid) + { + QList argumentList; + argumentList << QVariant::fromValue(uuid); + return asyncCallWithArgumentList(QStringLiteral("getActiveConnectionPath"), argumentList); + } + + inline QDBusPendingReply getApConnectionPath(const QString &uuid) + { + QList argumentList; + argumentList << QVariant::fromValue(uuid); + return asyncCallWithArgumentList(QStringLiteral("getApConnectionPath"), argumentList); + } + + inline QDBusPendingReply getApInfoBySsid(const QString &devName, const QString &ssid) + { + QList argumentList; + argumentList << QVariant::fromValue(devName) << QVariant::fromValue(ssid); + return asyncCallWithArgumentList(QStringLiteral("getApInfoBySsid"), argumentList); + } + + inline QDBusPendingReply getDeviceListAndEnabled(int devType) + { + QList argumentList; + argumentList << QVariant::fromValue(devType); + return asyncCallWithArgumentList(QStringLiteral("getDeviceListAndEnabled"), argumentList); + } + + inline QDBusPendingReply getStoredApInfo() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("getStoredApInfo"), argumentList); + } + + inline QDBusPendingReply getWiredList(const QString &devName) + { + QList argumentList; + argumentList << QVariant::fromValue(devName); + return asyncCallWithArgumentList(QStringLiteral("getWiredList"), argumentList); + } + + inline QDBusPendingReply getWirelessDeviceCap() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("getWirelessDeviceCap"), argumentList); + } + + inline QDBusPendingReply getWirelessList(const QString &devName) + { + QList argumentList; + argumentList << QVariant::fromValue(devName); + return asyncCallWithArgumentList(QStringLiteral("getWirelessList"), argumentList); + } + + inline QDBusPendingReply getWirelessSwitchBtnState() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("getWirelessSwitchBtnState"), argumentList); + } + + inline QDBusPendingReply<> keyRingClear() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("keyRingClear"), argumentList); + } + + inline QDBusPendingReply<> keyRingInit() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("keyRingInit"), argumentList); + } + + inline QDBusPendingReply<> reScan() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("reScan"), argumentList); + } + + inline Q_NOREPLY void setDeviceEnable(const QString &devName, bool enable) + { + QList argumentList; + argumentList << QVariant::fromValue(devName) << QVariant::fromValue(enable); + callWithArgumentList(QDBus::NoBlock, QStringLiteral("setDeviceEnable"), argumentList); + } + + inline Q_NOREPLY void setWiredSwitchEnable(bool enable) + { + QList argumentList; + argumentList << QVariant::fromValue(enable); + callWithArgumentList(QDBus::NoBlock, QStringLiteral("setWiredSwitchEnable"), argumentList); + } + + inline Q_NOREPLY void setWirelessSwitchEnable(bool enable) + { + QList argumentList; + argumentList << QVariant::fromValue(enable); + callWithArgumentList(QDBus::NoBlock, QStringLiteral("setWirelessSwitchEnable"), argumentList); + } + + inline Q_NOREPLY void showAddOtherWlanWidget(const QString &devName) + { + QList argumentList; + argumentList << QVariant::fromValue(devName); + callWithArgumentList(QDBus::NoBlock, QStringLiteral("showAddOtherWlanWidget"), argumentList); + } + + inline Q_NOREPLY void showCreateWiredConnectWidget(const QString &devName) + { + QList argumentList; + argumentList << QVariant::fromValue(devName); + callWithArgumentList(QDBus::NoBlock, QStringLiteral("showCreateWiredConnectWidget"), argumentList); + } + + inline QDBusPendingReply<> showKylinNM(int type) + { + QList argumentList; + argumentList << QVariant::fromValue(type); + return asyncCallWithArgumentList(QStringLiteral("showKylinNM"), argumentList); + } + + inline Q_NOREPLY void showPropertyWidget(const QString &devName, const QString &ssid) + { + QList argumentList; + argumentList << QVariant::fromValue(devName) << QVariant::fromValue(ssid); + callWithArgumentList(QDBus::NoBlock, QStringLiteral("showPropertyWidget"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void activateFailed(const QString &errorMessage); + void deactivateFailed(const QString &errorMessage); + void deviceNameChanged(const QString &oldName, const QString &newName, int type); + void deviceStatusChanged(); + void hotspotActivated(const QString &devName, const QString &ssid, const QString &uuid, const QString &activePath, const QString &settingPath); + void hotspotDeactivated(const QString &devName, const QString &ssid); + void lanActiveConnectionStateChanged(const QString &devName, const QString &uuid, int status); + void lanAdd(const QString &devName, const QStringList &info); + void lanRemove(const QString &dbusPath); + void lanUpdate(const QString &devName, const QStringList &info); + void secuTypeChange(const QString &devName, const QString &ssid, const QString &secuType); + void showAddOtherWlanWidgetSignal(const QString &display, const QString &devName); + void showCreateWiredConnectWidgetSignal(const QString &display, const QString &devName); + void showKylinNMSignal(const QString &display, int type); + void showPropertyWidgetSignal(const QString &display, const QString &devName, const QString &ssid); + void signalStrengthChange(const QString &devName, const QString &ssid, int strength); + void timeToUpdate(); + void wirelessDeviceStatusChanged(); + void wirelessSwitchBtnChanged(bool state); + void wlanAdd(const QString &devName, const QStringList &info); + void wlanRemove(const QString &devName, const QString &ssid); + void wlanactiveConnectionStateChanged(const QString &devName, const QString &ssid, const QString &uuid, int status); +}; + +namespace com { + namespace kylin { + typedef ::ComKylinNetworkInterface network; + } +} +#endif diff --git a/src/backend/dbusadaptor.cpp b/src/backend/dbusadaptor.cpp deleted file mode 100644 index 0f22c845..00000000 --- a/src/backend/dbusadaptor.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp com.kylin.weather.xml -a dbusadaptor -c DbusAdaptor -l MainWindow - * - * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#include "dbusadaptor.h" -#include -#include -#include -#include -#include -#include -#include - -const QByteArray GSETTINGS_SCHEMA_KYLIN_NM = "org.ukui.kylin-nm.switch"; -const QString KEY_WIRELESS_SWITCH = "wirelessswitch"; -const QString KEY_WIRED_SWITCH = "wiredswitch"; - -/* - * Implementation of adaptor class DbusAdaptor - */ - -DbusAdaptor::DbusAdaptor(MainWindow *parent) - : QDBusAbstractAdaptor(parent) -{ - // constructor - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >>(); - //setAutoRelaySignals(true)后会自动转发mainwindow发出的同名信号,因此不必再额外写一个转发 - setAutoRelaySignals(true); -} - -DbusAdaptor::~DbusAdaptor() -{ - // destructor -} - -//无线列表 -QMap > DbusAdaptor::getWirelessList() -{ - QMap > map; - parent()->getWirelessList(map); - return map; -} - -bool DbusAdaptor::getWirelessSwitchBtnState() -{ - return parent()->getWirelessSwitchBtnState(); -} - -//有线列表 -QMap> DbusAdaptor::getWiredList() -{ - QMap> map; - parent()->getWiredList(map); - return map; -} - -//有线开关 -void DbusAdaptor::setWiredSwitchEnable(bool enable) -{ - //todo mainwindow调用backend 对开关 打开/关闭 - if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA_KYLIN_NM)) { - QGSettings *gsetting = new QGSettings(GSETTINGS_SCHEMA_KYLIN_NM); - if (gsetting->get(KEY_WIRED_SWITCH).toBool() != enable) { - gsetting->set(KEY_WIRED_SWITCH, enable); - } - delete gsetting; - gsetting = nullptr; - } else { - qDebug()<<"isSchemaInstalled false"; - } -} - -//无线开关 -void DbusAdaptor::setWirelessSwitchEnable(bool enable) -{ - //todo mainwindow调用backend 对开关 打开/关闭 -// if (QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA_KYLIN_NM)) { -// QGSettings *gsetting = new QGSettings(GSETTINGS_SCHEMA_KYLIN_NM); -// if (gsetting->get(KEY_WIRELESS_SWITCH).toBool() != enable) { -// gsetting->set(KEY_WIRELESS_SWITCH, enable); -// } -// delete gsetting; -// gsetting = nullptr; -// } else { -// qDebug()<<"isSchemaInstalled false"; -// } - parent()->setWirelessSwitchEnable(enable); -} - -//启用/禁用网卡 -void DbusAdaptor::setDeviceEnable(QString devName, bool enable) -{ - parent()->setWiredDeviceEnable(devName, enable); -} - -//设置默认网卡 -//void DbusAdaptor::setDefaultWiredDevice(QString deviceName) -//{ -// if (!checkDeviceExist(WIRED, deviceName)) { -// return; -// } -// setDefaultDevice(WIRED, deviceName); -// parent()->setWiredDefaultDevice(deviceName); -// return; -//} - -//QString DbusAdaptor::getDefaultWiredDevice() -//{ -// QSettings * m_settings = new QSettings(CONFIG_FILE_PATH, QSettings::IniFormat); -// m_settings->beginGroup("DEFAULTCARD"); -// QString key("wired"); -// QString deviceName = m_settings->value(key, "").toString(); -// m_settings->endGroup(); -// delete m_settings; -// m_settings = nullptr; -// return deviceName; -//} - -//void DbusAdaptor::setDefaultWirelessDevice(QString deviceName) -//{ -// if (!checkDeviceExist(WIRED, deviceName)) { -// return; -// } -// setDefaultDevice(WIRELESS, deviceName); -// parent()->setWirelessDefaultDevice(deviceName); -// return; -//} - -//QString DbusAdaptor::getDefaultWirelessDevice() -//{ -// QSettings * m_settings = new QSettings(CONFIG_FILE_PATH, QSettings::IniFormat); -// m_settings->beginGroup("DEFAULTCARD"); -// QString key("wireless"); -// QString deviceName = m_settings->value(key, "").toString(); -// m_settings->endGroup(); -// delete m_settings; -// m_settings = nullptr; -// return deviceName; -//} - -//连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid -void DbusAdaptor::activateConnect(int type, QString devName, QString ssid) -{ - if (type == WIRED) { - parent()->activateWired(devName,ssid); - } else if (type == WIRELESS) { - parent()->activateWireless(devName,ssid); - } else { - qDebug() << "[DbusAdaptor] activateConnect type is invalid"; - } -} - -//断开连接 根据网卡类型 参数1 0:lan 1:wlan 参数3 为ssid/uuid -void DbusAdaptor::deActivateConnect(int type, QString devName, QString ssid) -{ - if (type == WIRED) { - qDebug() << "deactivateWired"; - parent()->deactivateWired(devName,ssid); - } else if (type == WIRELESS) { - parent()->deactivateWireless(devName,ssid); - } else { - qDebug() << "[DbusAdaptor] deactivateConnect type is invalid"; - } -} - -//获取设备列表和启用/禁用状态 -QMap DbusAdaptor::getDeviceListAndEnabled(int devType) -{ - QMap map; - map.clear(); - getDeviceEnableState(devType, map); - return map; -} - -//获取无线设备能力 -QMap DbusAdaptor::getWirelessDeviceCap() -{ - QMap map; - parent()->getWirelessDeviceCap(map); - return map; -} - -//唤起属性页 根据网卡类型 参数2 为ssid/uuid -void DbusAdaptor::showPropertyWidget(QString devName, QString ssid) -{ - qDebug() << "showPropertyWidget"; - parent()->showPropertyWidget(devName,ssid); -} - -//唤起新建有线连接界面 -void DbusAdaptor::showCreateWiredConnectWidget(QString devName) -{ - qDebug() << "showCreateWiredConnectWidget"; - parent()->showCreateWiredConnectWidget(devName); -} - -//唤起加入其他无线网络界面 -void DbusAdaptor::showAddOtherWlanWidget(QString devName) -{ - qDebug() << "showAddOtherWlanWidget"; - parent()->showAddOtherWlanWidget(devName); -} - -//开启热点 -void DbusAdaptor::activeWirelessAp(const QString apName, const QString apPassword, const QString band, const QString apDevice) -{ - parent()->activeWirelessAp(apName, apPassword, band, apDevice); -} - -//断开热点 -void DbusAdaptor::deactiveWirelessAp(const QString apName, const QString uuid) -{ - parent()->deactiveWirelessAp(apName, uuid); -} - -//获取热点 -QStringList DbusAdaptor::getStoredApInfo() -{ - QStringList list; - list.clear(); - parent()->getStoredApInfo(list); - return list; -} - -//获取热点path -QString DbusAdaptor::getApConnectionPath(QString uuid) -{ - QString path; - path.clear(); - parent()->getApConnectionPath(path, uuid); - return path; -} - -//获取热点path -QString DbusAdaptor::getActiveConnectionPath(QString uuid) -{ - QString path; - path.clear(); - parent()->getActiveConnectionPath(path, uuid); - return path; -} - -QStringList DbusAdaptor::getApInfoBySsid(QString devName, QString ssid) -{ - QStringList list; - list.clear(); - parent()->getApInfoBySsid(devName, ssid, list); - return list; -} - -void DbusAdaptor::showKylinNM(int type) -{ - parent()->onShowMainWindow(type); -} - -//扫描 -void DbusAdaptor::reScan() -{ - parent()->rescan(); -} - -void DbusAdaptor::keyRingInit() -{ - parent()->keyRingInit(); -} - -void DbusAdaptor::keyRingClear() -{ - parent()->keyRingClear(); -} diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index d172a46c..2696b29e 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -71,7 +71,7 @@ const QString intel = "V10SP1-edu"; #include #include -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +MainWindow::MainWindow(QString display, QWidget *parent) : QMainWindow(parent), m_display(display) { firstlyStart(); } @@ -396,6 +396,26 @@ void MainWindow::initDbusConnnect() } }); + QDBusConnection::sessionBus().connect(QString("com.kylin.network"), + QString("/com/kylin/network"), + QString("com.kylin.network"), + QString("showKylinNMSignal"), this, SLOT(onShowKylinNMSlot(QString,int))); + + QDBusConnection::sessionBus().connect(QString("com.kylin.network"), + QString("/com/kylin/network"), + QString("com.kylin.network"), + QString("showPropertyWidgetSignal"), this, SLOT(onShowPropertyWidgetSlot(QString,QString,QString))); + + QDBusConnection::sessionBus().connect(QString("com.kylin.network"), + QString("/com/kylin/network"), + QString("com.kylin.network"), + QString("showCreateWiredConnectWidgetSignal"), this, SLOT(onShowCreateWiredConnectWidgetSlot(QString,QString))); + + QDBusConnection::sessionBus().connect(QString("com.kylin.network"), + QString("/com/kylin/network"), + QString("com.kylin.network"), + QString("showAddOtherWlanWidgetSignal"), this, SLOT(onShowAddOtherWlanWidgetSlot(QString,QString))); + } /** @@ -861,13 +881,14 @@ void MainWindow::keyPressEvent(QKeyEvent *event) /** * @brief MainWindow::getWirelessList 获取wifi列表,供dbus调用 - * @param map + * @param devName + * @param list */ -void MainWindow::getWirelessList(QMap > &map) +void MainWindow::getWirelessList(QString devName, QList &list) { - map.clear(); + list.clear(); if (nullptr != m_wlanWidget) { - m_wlanWidget->getWirelessList(map); + m_wlanWidget->getWirelessList(devName, list); } } @@ -882,11 +903,11 @@ bool MainWindow::getWirelessSwitchBtnState() * @brief MainWindow::getWiredList 获取lan列表,供dbus调用 * @param map */ -void MainWindow::getWiredList(QMap> &map) +void MainWindow::getWiredList(QString devName, QList &list) { - map.clear(); + list.clear(); if (nullptr != m_lanWidget) { - m_lanWidget->getWiredList(map); + m_lanWidget->getWiredList(devName, list); } } @@ -1041,3 +1062,32 @@ void MainWindow::keyRingClear() { agent_clear(); } + +void MainWindow::onShowKylinNMSlot(QString display, int type) +{ + if (display == m_display) { + onShowMainWindow(type); + } +} + +//唤起属性页 根据网卡类型 参数2 为ssid/uuid +void MainWindow::onShowPropertyWidgetSlot(QString display, QString devName, QString ssid) +{ + if (display == m_display) { + showPropertyWidget(devName, ssid); + } +} +//唤起新建有线连接界面 +void MainWindow::onShowCreateWiredConnectWidgetSlot(QString display, QString devName) +{ + if (display == m_display) { + showCreateWiredConnectWidget(devName); + } +} +//唤起加入其他无线网络界面 +void MainWindow::onShowAddOtherWlanWidgetSlot(QString display, QString devName) +{ + if (display == m_display) { + showAddOtherWlanWidget(devName); + } +} diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index dd2d8191..01962c21 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -61,7 +61,7 @@ class MainWindow : public QMainWindow { Q_OBJECT public: - explicit MainWindow(QWidget *parent = nullptr); + explicit MainWindow(QString display, QWidget *parent = nullptr); void showMainwindow(); void hideMainwindow(); @@ -69,8 +69,8 @@ public: void setWirelessDefaultDevice(QString deviceName); //for dbus - void getWirelessList(QMap > &map); - void getWiredList(QMap> &map); + void getWirelessList(QString devName, QList &list); + void getWiredList(QString devName, QList &list); //开启热点 void activeWirelessAp(const QString apName, const QString apPassword, const QString wirelessBand, const QString apDevice); //断开热点 @@ -204,6 +204,8 @@ private: NetworkMode *m_networkMode; + QString m_display; + public Q_SLOTS: void onShowMainWindow(int type); @@ -221,6 +223,14 @@ private Q_SLOTS: void onTimeUpdateTrayIcon(); void onTabletModeChanged(bool mode); void onRefreshTrayIconTooltip(); + + void onShowKylinNMSlot(QString display, int type); + //唤起属性页 根据网卡类型 参数2 为ssid/uuid + void onShowPropertyWidgetSlot(QString display, QString devName, QString ssid); + //唤起新建有线连接界面 + void onShowCreateWiredConnectWidgetSlot(QString display, QString devName); + //唤起加入其他无线网络界面 + void onShowAddOtherWlanWidgetSlot(QString display, QString devName); }; #endif // MAINWINDOW_H diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 8152c46a..07f60e89 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -991,34 +991,29 @@ void LanPage::onConnectionStateChange(QString uuid, } -void LanPage::getWiredList(QMap > &map) +void LanPage::getWiredList(QString devName, QList &list) { QStringList devlist; m_deviceResource->getNetworkDeviceList(NetworkManager::Device::Type::Ethernet, devlist); - if (devlist.isEmpty()) { + if (!devlist.contains(devName)) { return; } - Q_FOREACH (auto deviceName, devlist) { - QList activedList; - QList deactivedList; - QVector vector; - m_activeResourse->getActiveConnectionList(deviceName,NetworkManager::ConnectionSettings::Wired,activedList); - if (!activedList.isEmpty()) { - vector.append(QStringList() << activedList.at(0)->m_connectName << activedList.at(0)->m_connectUuid << activedList.at(0)->m_connectPath); - } else { - vector.append(QStringList()<<("--")); - } - - m_connectResourse->getConnectionList(deviceName, NetworkManager::ConnectionSettings::Wired, deactivedList); //未激活列表的显示 - if (!deactivedList.isEmpty()) { - for (int i = 0; i < deactivedList.size(); i++) { - vector.append(QStringList()<m_connectName<m_connectUuid << deactivedList.at(i)->m_connectPath); - } - } - map.insert(deviceName, vector); + QList activedList; + QList deactivedList; + m_activeResourse->getActiveConnectionList(devName,NetworkManager::ConnectionSettings::Wired,activedList); + if (!activedList.isEmpty()) { + list.append(QStringList() << activedList.at(0)->m_connectName << activedList.at(0)->m_connectUuid << activedList.at(0)->m_connectPath); + } else { + list.append(QStringList()<<("--")); + } + + m_connectResourse->getConnectionList(devName, NetworkManager::ConnectionSettings::Wired, deactivedList); //未激活列表的显示 + if (!deactivedList.isEmpty()) { + for (int i = 0; i < deactivedList.size(); i++) { + list.append(QStringList()<m_connectName<m_connectUuid << deactivedList.at(i)->m_connectPath); + } } - return; } void LanPage::sendLanUpdateSignal(KyConnectItem *p_connectItem) diff --git a/src/frontend/tab-pages/lanpage.h b/src/frontend/tab-pages/lanpage.h index bbb3c8b5..76ade9f6 100644 --- a/src/frontend/tab-pages/lanpage.h +++ b/src/frontend/tab-pages/lanpage.h @@ -43,7 +43,7 @@ public: ~LanPage(); //for dbus - void getWiredList(QMap > &map); + void getWiredList(QString devName, QList &list); void activateWired(const QString& devName, const QString& connUuid); void deactivateWired(const QString& devName, const QString& connUuid); void showDetailPage(QString devName, QString uuid); diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index fdc0ecfb..fc5aecf2 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -1359,72 +1359,61 @@ void WlanPage::onRefreshIconTimer() } //for dbus -void WlanPage::getWirelessList(QMap > &map) +void WlanPage::getWirelessList(QString devName, QList &list) { - QMap actMap; - m_wirelessNetResource->getWirelessActiveConnection(NetworkManager::ActiveConnection::State::Activated, actMap); + KyWirelessNetItem data; - QMap > wlanMap; - if (!m_wirelessNetResource->getAllDeviceWifiNetwork(wlanMap)) { + QList wlanList; + if (!m_wirelessNetResource->getDeviceWifiNetwork(devName, wlanList)) { return; } - QMap >::iterator iter = wlanMap.begin(); - while (iter != wlanMap.end()) { - QVector vector; - QString activeSsid ; - //先是已连接 - if (actMap.contains(iter.key())) { - qDebug() << "find " <getSsidByUuid(actMap[iter.key()].at(0), ssid); - if (m_wirelessNetResource->getWifiNetwork(iter.key(), ssid, data)) { - int category = 0; - int signalStrength; - QString uni,secuType; - - if (m_netDeviceResource->getActiveConnectionInfo(iter.key(), signalStrength, uni, secuType)) { - category = data.getCategory(uni); - } - if (!m_showWifi6Plus && category == 2) { - category = 1; - } - vector.append(QStringList() << data.m_NetSsid - << QString::number(signalStrength) - << secuType - << data.m_connectUuid - << (m_connectResource->isApConnection(data.m_connectUuid) ? IsApConnection : NotApConnection) - << QString::number(category)); - activeSsid = data.m_NetSsid; - } else { - vector.append(QStringList("--")); - } - } else { - vector.append(QStringList("--")); - } - //未连接 - Q_FOREACH (auto itemData, iter.value()) { - if (itemData.m_NetSsid == activeSsid) { - continue; - } + QString activeSsid ; + //先是已连接 + if (m_wirelessNetResource->getActiveWirelessNetItem(devName, data)) { + qDebug() << "find " << devName; + QString ssid =""; + m_wirelessNetResource->getSsidByUuid(data.m_connectUuid, ssid); + if (m_wirelessNetResource->getWifiNetwork(devName, ssid, data)) { int category = 0; - category = itemData.getCategory(itemData.m_uni); + int signalStrength; + QString uni,secuType; + + if (m_netDeviceResource->getActiveConnectionInfo(devName, signalStrength, uni, secuType)) { + category = data.getCategory(uni); + } if (!m_showWifi6Plus && category == 2) { category = 1; } - vector.append(QStringList()<isApConnection(itemData.m_connectUuid) ? IsApConnection : NotApConnection) + list.append(QStringList() << data.m_NetSsid + << QString::number(signalStrength) + << secuType + << data.m_connectUuid + << (m_connectResource->isApConnection(data.m_connectUuid) ? IsApConnection : NotApConnection) << QString::number(category)); + activeSsid = data.m_NetSsid; + } else { + list.append(QStringList("--")); } - - map.insert(iter.key(), vector); - iter++; + } else { + list.append(QStringList("--")); + } + //未连接 + Q_FOREACH (auto itemData, wlanList) { + if (itemData.m_NetSsid == activeSsid) { + continue; + } + int category = 0; + category = itemData.getCategory(itemData.m_uni); + if (!m_showWifi6Plus && category == 2) { + category = 1; + } + list.append(QStringList()<isApConnection(itemData.m_connectUuid) ? IsApConnection : NotApConnection) + << QString::number(category)); } - - return; } //for dbus diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index 41d55246..85256044 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -52,7 +52,7 @@ public: ~WlanPage() = default; //for dbus - void getWirelessList(QMap > &map); + void getWirelessList(QString devName, QList &list); //开启热点 void activeWirelessAp(const QString apName, const QString apPassword, const QString wirelessBand, const QString apDevice); //断开热点 diff --git a/src/main.cpp b/src/main.cpp index f7482b41..c6aa7de9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,7 @@ //#include "mainwindow.h" #include "mainwindow.h" -#include "dbusadaptor.h" +#include "dbus.h" #include #include #include "qt-single-application.h" @@ -125,23 +125,29 @@ int main(int argc, char *argv[]) parser.addOptions({swOption,snOption}); parser.process(a); + QString display; + QString sessionType; + if(QString(getenv("XDG_SESSION_TYPE")) == "wayland") { + sessionType = "wayland"; + display = getenv("WAYLAND_DISPLAY"); + } else { + sessionType = "x11"; + display = getenv("DISPLAY"); + } + qDebug() << display; + QDBusInterface interface("com.kylin.network", "/com/kylin/network", "com.kylin.network", QDBusConnection::sessionBus()); - if(interface.isValid()) { - if (parser.isSet(swOption)) - { - interface.call(QStringLiteral("showKylinNM"), 1); - } else if (parser.isSet(snOption)){ - interface.call(QStringLiteral("showKylinNM"), 0); - } else { - const QString serviceName = "com.kylin.network"; - QDBusConnectionInterface *interface1 = QDBusConnection::sessionBus().interface(); - QDBusReply pid = interface1->servicePid(serviceName); - qDebug() << "current display " << getenv("DISPLAY") << QApplication::applicationPid() - << "exist kylin-nm display" << displayFromPid(pid.value()); - if (getenv("DISPLAY") == displayFromPid(pid.value())) { + + if (a.isRunning()) { + if(interface.isValid()) { + if (parser.isSet(swOption)) { + interface.call(QStringLiteral("showKylinNM"), 1); + } else if (parser.isSet(snOption)) { + interface.call(QStringLiteral("showKylinNM"), 0); + } else { interface.call(QStringLiteral("showKylinNM"), 2); } } @@ -190,7 +196,7 @@ int main(int argc, char *argv[]) ::usleep(1000); } - MainWindow w; + MainWindow w(display, nullptr); a.setActivationWindow(&w); w.setProperty("useStyleWindowManager", false); //禁用拖动 a.setWindowIcon(QIcon::fromTheme("kylin-network")); @@ -205,13 +211,8 @@ int main(int argc, char *argv[]) // w.setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint /*| Qt::X11BypassWindowManagerHint*/); - DbusAdaptor adaptor(&w); + DbusAdaptor adaptor(display, &w); Q_UNUSED(adaptor); - auto connection = QDBusConnection::sessionBus(); - if (!connection.registerService("com.kylin.network") || !connection.registerObject("/com/kylin/network", &w)) { - qCritical() << "QDbus register service failed reason:" << connection.lastError(); - } - return a.exec(); } From c7cb51b17fa16bd9bf05f2515f9f104d9740cb1d Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Thu, 28 Sep 2023 14:12:34 +0800 Subject: [PATCH 08/16] update changelog --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9d5d5b1b..4967b8bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +kylin-nm (3.24.0.0-0k2.22) v101; urgency=medium + + * BUG: + - #194718 【网络连接】麒麟网络设置工具可固定到任务栏 + * 需求号:无 + * 其他改动说明: + * 其他改动影响域:多display场景 + + -- zhaoshixu Thu, 28 Sep 2023 14:11:38 +0800 + kylin-nm (3.24.0.0-0k2.21) v101; urgency=medium * BUG: From a771281f6b4cd44131449c12653a9ddda781d08d Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Tue, 29 Aug 2023 11:47:28 +0800 Subject: [PATCH 09/16] =?UTF-8?q?perf(plugins):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E9=9D=A2=E6=9D=BF=E7=95=8C=E9=9D=A2=E5=8D=95?= =?UTF-8?q?=E7=BD=91=E5=8D=A1=E6=98=BE=E7=A4=BA(story#18148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/netconnect/netconnect.cpp | 71 ++++++++++++++++++++++++++- plugins/netconnect/netconnect.h | 3 ++ plugins/wlanconnect/wlanconnect.cpp | 76 +++++++++++++++++++++++++++-- plugins/wlanconnect/wlanconnect.h | 3 +- 4 files changed, 147 insertions(+), 6 deletions(-) diff --git a/plugins/netconnect/netconnect.cpp b/plugins/netconnect/netconnect.cpp index 6dae527c..303edcd9 100644 --- a/plugins/netconnect/netconnect.cpp +++ b/plugins/netconnect/netconnect.cpp @@ -83,6 +83,16 @@ NetConnect::NetConnect() : mFirstLoad(true) { pluginName = tr("LAN"); pluginType = NETWORK; + + m_interface = new QDBusInterface("com.kylin.network", + "/com/kylin/network", + "com.kylin.network", + QDBusConnection::sessionBus()); + if(!m_interface->isValid()) { + qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message()); + } + updatePluginShowSettings(); + connect(m_interface, SIGNAL(deviceStatusChanged()), this, SLOT(updatePluginShowSettings()),Qt::QueuedConnection); } NetConnect::~NetConnect() { @@ -110,6 +120,7 @@ QWidget *NetConnect::pluginUi() { pluginWidget = new QWidget; pluginWidget->setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(pluginWidget); + m_interface = new QDBusInterface("com.kylin.network", "/com/kylin/network", "com.kylin.network", @@ -117,6 +128,9 @@ QWidget *NetConnect::pluginUi() { if(!m_interface->isValid()) { qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message()); } + + qDBusRegisterMetaType>(); + initSearchText(); initComponent(); } @@ -130,7 +144,54 @@ const QString NetConnect::name() const { bool NetConnect::isEnable() const { - return true; + //get isEnable + QDBusInterface dbus("com.kylin.network", "/com/kylin/network", + "com.kylin.network", + QDBusConnection::sessionBus()); + if (!dbus.isValid()) { + return false; + } + + QMap map; + QDBusReply reply = dbus.call(QStringLiteral("getDeviceListAndEnabled"),0); + if(!reply.isValid()) + { + qWarning() << "[NetConnect]getWiredDeviceList error:" << reply.error().message(); + return false; + } + + QVariantMap::const_iterator item = reply.value().cbegin(); + while (item != reply.value().cend()) { + map.insert(item.key(), item.value().toBool()); + item ++; + } + + bool isEnabled = !map.isEmpty(); + + const QByteArray schema("org.ukui.control-center.plugins"); + if (QGSettings::isSchemaInstalled(schema)) { + return isEnabled; + } + + //get gsettings + QGSettings *showSettings; + QString path("/org/ukui/control-center/plugins/netconnect/"); + showSettings = new QGSettings(schema, path.toUtf8()); + + QVariant enabledState = showSettings->get("show"); + + //set gsettings + if (!enabledState.isValid() || enabledState.isNull()) { + qWarning() << "QGSettins get plugin show status error"; + } else { + if (enabledState.toBool() != isEnabled) { + showSettings->set("show", isEnabled); + } + } + delete showSettings; + showSettings = nullptr; + + return isEnabled; } @@ -154,7 +215,8 @@ void NetConnect::initSearchText() { ui->detailBtn->setText(tr("Advanced settings")); ui->titleLabel->setText(tr("LAN")); //~ contents_path /netconnect/open - ui->openLabel->setText(tr("open")); + tr("open"); + ui->openLabel->setText(tr("LAN")); } bool NetConnect::eventFilter(QObject *w, QEvent *e) { @@ -934,3 +996,8 @@ QMap> NetConnect::getWiredList() } return map; } + +void NetConnect::updatePluginShowSettings() +{ + isEnable(); +} diff --git a/plugins/netconnect/netconnect.h b/plugins/netconnect/netconnect.h index 1e94d05e..35fc9514 100644 --- a/plugins/netconnect/netconnect.h +++ b/plugins/netconnect/netconnect.h @@ -156,6 +156,9 @@ private slots: void onDeviceStatusChanged(); void onDeviceNameChanged(QString, QString, int); + + //更新控制面板插件Gsetting show + void updatePluginShowSettings(); }; Q_DECLARE_METATYPE(QList); diff --git a/plugins/wlanconnect/wlanconnect.cpp b/plugins/wlanconnect/wlanconnect.cpp index facdec20..4b794241 100644 --- a/plugins/wlanconnect/wlanconnect.cpp +++ b/plugins/wlanconnect/wlanconnect.cpp @@ -139,6 +139,15 @@ WlanConnect::WlanConnect() : m_firstLoad(true) { pluginName = tr("WLAN"); pluginType = NETWORK; + + m_interface = new QDBusInterface("com.kylin.network", "/com/kylin/network", + "com.kylin.network", + QDBusConnection::sessionBus()); + if(!m_interface->isValid()) { + qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message()); + } + updatePluginShowSettings(); + connect(m_interface, SIGNAL(wirelessDeviceStatusChanged()), this, SLOT(updatePluginShowSettings()), Qt::QueuedConnection); } WlanConnect::~WlanConnect() @@ -167,13 +176,14 @@ QWidget *WlanConnect::pluginUi() { pluginWidget->setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(pluginWidget); qDBusRegisterMetaType>(); - qDBusRegisterMetaType(); + qDBusRegisterMetaType(); m_interface = new QDBusInterface("com.kylin.network", "/com/kylin/network", "com.kylin.network", QDBusConnection::sessionBus()); if(!m_interface->isValid()) { qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message()); } + initSearchText(); initComponent(); } @@ -187,7 +197,61 @@ const QString WlanConnect::name() const { bool WlanConnect::isEnable() const { - return true; + //get isEnable + QDBusInterface dbus("com.kylin.network", "/com/kylin/network", + "com.kylin.network", + QDBusConnection::sessionBus()); + if (!dbus.isValid()) { + return false; + } + QMap map; + QDBusReply reply = dbus.call(QStringLiteral("getDeviceListAndEnabled"), 1); + if(!reply.isValid()) + { + qWarning() << "[NetConnect]getWiredDeviceList error:" << reply.error().message(); + return false; + } + + QVariantMap::const_iterator item = reply.value().cbegin(); + while (item != reply.value().cend()) { + map.insert(item.key(), item.value().toBool()); + item ++; + } + //筛选已托管(managed)网卡 + QStringList list; + QMap::iterator iters; + for (iters = map.begin(); iters != map.end(); ++iters) { + if (iters.value() == true) { + list << iters.key(); + } + } + + bool isEnabled = !list.isEmpty(); + + const QByteArray schema("org.ukui.control-center.plugins"); + if (QGSettings::isSchemaInstalled(schema)) { + return isEnabled; + } + + //get gsettings + QGSettings *showSettings; + QString path("/org/ukui/control-center/plugins/wlanconnect/"); + showSettings = new QGSettings(schema, path.toUtf8()); + + QVariant enabledState = showSettings->get("show"); + + //set gsettings + if (!enabledState.isValid() || enabledState.isNull()) { + qWarning() << "QGSettins get plugin show status error"; + } else { + if (enabledState.toBool() != isEnabled) { + showSettings->set("show", isEnabled); + } + } + delete showSettings; + showSettings = nullptr; + + return isEnabled; } @@ -211,7 +275,8 @@ void WlanConnect::initSearchText() { ui->detailBtn->setText(tr("Advanced settings")); ui->titleLabel->setText(tr("WLAN")); //~ contents_path /wlanconnect/open - ui->openLabel->setText(tr("open")); + tr("open"); + ui->openLabel->setText(tr("WLAN")); } bool WlanConnect::eventFilter(QObject *w, QEvent *e) { @@ -1133,3 +1198,8 @@ QMap> WlanConnect::getWirelessList() return map; } +void WlanConnect::updatePluginShowSettings() +{ + isEnable(); +} + diff --git a/plugins/wlanconnect/wlanconnect.h b/plugins/wlanconnect/wlanconnect.h index a822a658..249d6431 100644 --- a/plugins/wlanconnect/wlanconnect.h +++ b/plugins/wlanconnect/wlanconnect.h @@ -194,6 +194,7 @@ private slots: void reScan(); - + //更新控制面板插件Gsetting show + void updatePluginShowSettings(); }; #endif // WLANCONNECT_H From 7ce857f0c848ae1446976f697765583cc587734a Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Sun, 8 Oct 2023 17:41:06 +0800 Subject: [PATCH 10/16] =?UTF-8?q?pref(=E6=89=98=E7=9B=98=E7=95=8C=E9=9D=A2?= =?UTF-8?q?):=20=E8=B0=83=E6=95=B4=E6=89=98=E7=9B=98=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=8D=95=E7=BD=91=E5=8D=A1=E6=98=BE=E7=A4=BA(story#18148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/mainwindow.cpp | 54 +++++++++++++++++++++++++++++++ src/frontend/mainwindow.h | 5 +++ src/frontend/tab-pages/lanpage.h | 4 +++ src/frontend/tab-pages/wlanpage.h | 4 +++ 4 files changed, 67 insertions(+) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 2696b29e..803a0e38 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -38,6 +38,7 @@ #define MAINWINDOW_HEIGHT 476 #define LAYOUT_MARGINS 0,0,0,0 #define LOADING_TRAYICON_TIMER_MS 60 +#define TABBAR_HEIGHT 30 #define THEME_SCHAME "org.ukui.style" #define COLOR_THEME "styleName" @@ -174,6 +175,11 @@ void MainWindow::firstlyStart() //加载key ring agent_init(); + + //单网卡显示 + setCentralWidgetPages(); + connect(m_lanWidget, &LanPage::deviceStatusChanged, this, &MainWindow::setCentralWidgetPages); + connect(m_wlanWidget, &LanPage::wirelessDeviceStatusChanged, this, &MainWindow::setCentralWidgetPages); } /** @@ -826,8 +832,56 @@ void MainWindow::onRefreshTrayIconTooltip() m_trayIcon->setToolTip(trayIconToolTip); } +void MainWindow::setCentralWidgetPages() +{ + bool isChanged = false; + if (m_isWiredUsable != m_lanWidget->isWiredDeviceUsable()) { + if (m_lanWidget->isWiredDeviceUsable()) { + m_centralWidget->insertTab(LANPAGE, m_lanWidget, ""); + m_isWiredUsable = true; + } else { + m_centralWidget->removeTab(LANPAGE); + m_isWiredUsable = false; + } + isChanged = true; + } + + if (m_isWirelessUsable != m_wlanWidget->isWirelessDeviceUsable()) { + if (m_wlanWidget->isWirelessDeviceUsable()) { + m_centralWidget->insertTab(WLANPAGE, m_wlanWidget, ""); + m_isWirelessUsable = true; + } else { + m_centralWidget->removeTab(WLANPAGE); + m_isWirelessUsable = false; + } + isChanged = true; + } + + if (!isChanged) { + return; + } + + if (m_isWiredUsable && m_isWirelessUsable) { + m_centralWidget->tabBar()->show(); + this->setFixedHeight(MAINWINDOW_HEIGHT); + resetWindowPosition(); + } else { + m_centralWidget->tabBar()->hide(); + this->setFixedHeight(MAINWINDOW_HEIGHT - TABBAR_HEIGHT); + resetWindowPosition(); + } + + if (m_trayIcon) { + m_trayIcon->setVisible(m_isWiredUsable || m_isWirelessUsable); + } +} + void MainWindow::onShowMainWindow(int type) { + if (!m_trayIcon->isVisible()) { + qWarning() << "no valid network card, do not show kylin-nm mainwindow"; + return; + } if (type == LANPAGE || type == WLANPAGE) { m_centralWidget->setCurrentIndex(type); diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index 01962c21..11fafd1e 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -206,6 +206,9 @@ private: QString m_display; + bool m_isWiredUsable = true; + bool m_isWirelessUsable = true; + public Q_SLOTS: void onShowMainWindow(int type); @@ -231,6 +234,8 @@ private Q_SLOTS: void onShowCreateWiredConnectWidgetSlot(QString display, QString devName); //唤起加入其他无线网络界面 void onShowAddOtherWlanWidgetSlot(QString display, QString devName); + //设置界面显示 单网卡/多网卡 + void setCentralWidgetPages(); }; #endif // MAINWINDOW_H diff --git a/src/frontend/tab-pages/lanpage.h b/src/frontend/tab-pages/lanpage.h index 76ade9f6..ca06e5cc 100644 --- a/src/frontend/tab-pages/lanpage.h +++ b/src/frontend/tab-pages/lanpage.h @@ -52,6 +52,10 @@ public: bool lanIsConnected(); void getWiredDeviceConnectState(QMap &map); + bool isWiredDeviceUsable() { + return !m_devList.isEmpty(); + } + protected: bool eventFilter(QObject *watched, QEvent *event); diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index 85256044..089b3461 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -88,6 +88,10 @@ public: return m_currentDevice; } + bool isWirelessDeviceUsable() { + return !m_devList.isEmpty(); + } + Q_SIGNALS: void oneItemExpanded(const QString &ssid); void wlanAdd(QString devName, QStringList info); From a85a5490828aa504efd38f6d9022594b8bbd57d4 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Mon, 9 Oct 2023 10:17:53 +0800 Subject: [PATCH 11/16] fix(wlan device combobox): modify logic of device combobox display --- src/frontend/tab-pages/wlanpage.cpp | 39 +++++++++++++---------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index fc5aecf2..31b05b35 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -294,9 +294,8 @@ void WlanPage::initDeviceCombox() } } else { m_deviceFrame->hide(); - //解决因m_currentDevice被置空,安全中心网络显示BUG -// m_currentDevice = ""; -// setDefaultDevice(WIRELESS, m_currentDevice); + m_currentDevice = ""; + setDefaultDevice(WIRELESS, m_currentDevice); } connect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), @@ -780,25 +779,23 @@ void WlanPage::deleteDeviceFromCombox(QString deviceName) disconnect(m_deviceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &WlanPage::onDeviceComboxIndexChanged); - if (getSwitchBtnState()) { - if (0 == m_devList.count()) { - m_deviceFrame->hide(); - //m_tipsLabel->show(); - //m_deviceComboBox->hide(); - m_currentDevice = ""; + if (0 == m_devList.count()) { + m_deviceFrame->hide(); + //m_tipsLabel->show(); + //m_deviceComboBox->hide(); + m_currentDevice = ""; + setDefaultDevice(WIRELESS, m_currentDevice); + } else if (1 == m_devList.count()) { + m_deviceFrame->hide(); + m_deviceComboBox->clear(); + m_currentDevice = m_devList.at(0); + setDefaultDevice(WIRELESS, m_currentDevice); + } else { + int index = m_deviceComboBox->findText(deviceName); + if (-1 != index) { + m_deviceComboBox->removeItem(index); + m_currentDevice = m_deviceComboBox->currentText(); setDefaultDevice(WIRELESS, m_currentDevice); - } else if (1 == m_devList.count()) { - m_deviceFrame->hide(); - m_deviceComboBox->clear(); - m_currentDevice = m_devList.at(0); - setDefaultDevice(WIRELESS, m_currentDevice); - } else { - int index = m_deviceComboBox->findText(deviceName); - if (-1 != index) { - m_deviceComboBox->removeItem(index); - m_currentDevice = m_deviceComboBox->currentText(); - setDefaultDevice(WIRELESS, m_currentDevice); - } } } From ebfe2ebf219ade36153ff622171f73810bca1083 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Tue, 17 Oct 2023 10:08:04 +0800 Subject: [PATCH 12/16] feat(connectivity):add connectivity detect page(#23680) --- src/backend/dbus-interface/kylinutil.cpp | 86 +++++++ src/backend/dbus-interface/kylinutil.h | 2 + src/frontend/connectivity/connectivity.pri | 9 + .../connectivity/connectivitypage.cpp | 205 +++++++++++++++++ src/frontend/connectivity/connectivitypage.h | 55 +++++ src/frontend/frontend.pri | 1 + src/frontend/mainwindow.cpp | 49 +++- src/frontend/mainwindow.h | 6 + src/frontend/netdetails/ipv4page.cpp | 2 +- src/translations/kylin-nm_bo.ts | 214 +++++++++++------- src/translations/kylin-nm_bo_CN.ts | 214 +++++++++++------- src/translations/kylin-nm_mn.ts | 212 ++++++++++------- src/translations/kylin-nm_tr.ts | 212 ++++++++++------- src/translations/kylin-nm_zh_CN.ts | 212 ++++++++++------- 14 files changed, 1073 insertions(+), 406 deletions(-) create mode 100644 src/frontend/connectivity/connectivity.pri create mode 100644 src/frontend/connectivity/connectivitypage.cpp create mode 100644 src/frontend/connectivity/connectivitypage.h diff --git a/src/backend/dbus-interface/kylinutil.cpp b/src/backend/dbus-interface/kylinutil.cpp index 7f307eb3..0b60fa26 100644 --- a/src/backend/dbus-interface/kylinutil.cpp +++ b/src/backend/dbus-interface/kylinutil.cpp @@ -217,3 +217,89 @@ out: g_object_unref (props_proxy); } +QString getConnectivityCheckSpareUriByGDbus() +{ + GDBusProxy *props_proxy; + GVariant *ret = NULL, *path_value = NULL; + GError *error = NULL; + QString str; + + /* Create a D-Bus object proxy for the active connection object's properties */ + props_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + NULL, + "org.freedesktop.NetworkManager", + "/org/freedesktop/NetworkManager", + "org.freedesktop.DBus.Properties", + NULL, NULL); + g_assert (props_proxy); + + /* Get the object path of the Connection details */ + ret = g_dbus_proxy_call_sync (props_proxy, + "Get", + g_variant_new ("(ss)", + "org.freedesktop.NetworkManager", + "ConnectivityCheckSpareUri"), + G_DBUS_CALL_FLAGS_NONE, -1, + NULL, &error); + if (!ret) { + g_dbus_error_strip_remote_error (error); + qDebug() << "failed to getConnectivityCheckSpareUri"; + g_error_free (error); + } + + g_variant_get (ret, "(v)", &path_value); +// if (!g_variant_is_of_type (path_value, G_VARIANT_TYPE_VARIANT)) { +// g_warning ("Unexpected type returned getting Connection property: %s", +// g_variant_get_type_string (path_value)); +// goto out; +// } + + str = QString(g_variant_get_string(path_value, NULL)); + +out: + if (path_value) + g_variant_unref (path_value); + if (ret) + g_variant_unref (ret); + g_object_unref (props_proxy); + + return str; +} + +void setConnectivityCheckSpareUriByGDbus(QString uri) +{ + GDBusProxy *props_proxy; + GVariant *ret = NULL; + GError *error = NULL; + + /* Create a D-Bus object proxy for the active connection object's properties */ + props_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + NULL, + "org.freedesktop.NetworkManager", + "/org/freedesktop/NetworkManager", + "org.freedesktop.DBus.Properties", + NULL, NULL); + g_assert (props_proxy); + + /* Get the object path of the Connection details */ + ret = g_dbus_proxy_call_sync (props_proxy, + "Set", + g_variant_new ("(ssv)", + "org.freedesktop.NetworkManager", + "ConnectivityCheckSpareUri", + g_variant_new_string(uri.toStdString().c_str())), + G_DBUS_CALL_FLAGS_NONE, -1, + NULL, &error); + if (!ret) { + g_dbus_error_strip_remote_error (error); + qDebug() << "failed to setConnectivityCheckSpareUri"; + g_error_free (error); + } + +out: + if (ret) + g_variant_unref (ret); + g_object_unref (props_proxy); +} diff --git a/src/backend/dbus-interface/kylinutil.h b/src/backend/dbus-interface/kylinutil.h index 3925b419..6e520164 100644 --- a/src/backend/dbus-interface/kylinutil.h +++ b/src/backend/dbus-interface/kylinutil.h @@ -37,6 +37,8 @@ QString getConnectTypeByDbus(QString &connectPath); QString getSsidFromByteArray(QByteArray &rawSsid); void setWiredEnabledByGDbus(bool enabled); void setDeviceManagedByGDbus(QString dbusPath, bool managed); +QString getConnectivityCheckSpareUriByGDbus(); +void setConnectivityCheckSpareUriByGDbus(QString str); bool getWiredEnabledByGDbus(); #endif // KYLINUTIL_H diff --git a/src/frontend/connectivity/connectivity.pri b/src/frontend/connectivity/connectivity.pri new file mode 100644 index 00000000..cfbdbcb6 --- /dev/null +++ b/src/frontend/connectivity/connectivity.pri @@ -0,0 +1,9 @@ +INCLUDEPATH += $$PWD + +FORMS += \ + +HEADERS += \ + $$PWD/connectivitypage.h \ + +SOURCES += \ + $$PWD/connectivitypage.cpp \ diff --git a/src/frontend/connectivity/connectivitypage.cpp b/src/frontend/connectivity/connectivitypage.cpp new file mode 100644 index 00000000..f6aa9687 --- /dev/null +++ b/src/frontend/connectivity/connectivitypage.cpp @@ -0,0 +1,205 @@ +#include "connectivitypage.h" +#include +#include +#include +#include +#include +#include + +#include "windowmanager/windowmanager.h" +#include "kwindowsystem.h" +#include "kwindowsystem_export.h" +#include "kylinutil.h" + +#define THEME_SCHAME "org.ukui.style" +#define COLOR_THEME "styleName" + +#define BOTTOM_LAYOUT_MARGINS 24, 16, 24, 24 +#define LAYOUT_SPACING 16 + +ConnectivityPage::ConnectivityPage(QString uri, QWidget *parent) + :m_uri(uri), QDialog(parent) +{ + this->setAttribute(Qt::WA_DeleteOnClose, true); + this->setFixedSize(380, 369); + this->setWindowTitle(tr("Network connectivity detection")); + setAttribute(Qt::WA_DeleteOnClose, false); + KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager); + m_connectResource = new KyConnectResourse(this); + initUi(); + initConnect(); + NetworkManager::Connectivity connectivity; + m_connectResource->getConnectivity(connectivity); + setWarning(connectivity); + m_publicNetworkButton->setChecked(m_uri.isEmpty()); + m_intranetButton->setChecked(!m_uri.isEmpty()); + if (!m_uri.isEmpty()) { + checkUri(); + } +} + +void ConnectivityPage::initUi() +{ + m_scrollArea = new QScrollArea(this); + m_scrollArea->setFixedWidth(380); + m_scrollArea->setFrameShape(QFrame::NoFrame); + m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_scrollArea->setContentsMargins(0,0,0,0); + + m_icon = new QLabel(this); + m_statusText = new QLabel(this); + m_statusText->setWordWrap(true); + + //如访问 Internet 受限,请切换网络 IP 连通性检测方式后再试。 + m_text = new QLabel(this); + m_text->setText(tr("If access to the Internet is restricted, please switch the network IP connectivity detection method and try again.")); + m_text->setWordWrap(true); + m_text->adjustSize(); +// m_text->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + m_publicNetworkButton = new QRadioButton(this); + m_publicNetworkButton->setText(tr("Public network (default)")); + m_intranetButton = new QRadioButton(this); + m_intranetButton->setText(tr("Local area network (intranet)")); + + m_uriEdit = new QLineEdit(this); + m_uriEdit->setText(m_uri); + m_warningLabel = new QLabel(this); + QPalette hintTextColor; + hintTextColor.setColor(QPalette::WindowText, Qt::red); + m_warningLabel->setPalette(hintTextColor); + m_warningLabel->setWordWrap(true); + + m_confirmBtn = new QPushButton(this); + m_confirmBtn->setText(tr("Confirm")); + + m_warningWidget = new QWidget(this); + m_warningWidget->adjustSize(); + m_editWidget = new QWidget(this); + m_centerWidget = new QWidget(this); + m_centerWidget->setFixedWidth(380); + m_bottomWidget = new QWidget(this); + + QHBoxLayout* warningLayout = new QHBoxLayout(m_warningWidget); + warningLayout->setContentsMargins(0, 0, 0, 24); + warningLayout->setSpacing(8); + warningLayout->addWidget(m_icon); + warningLayout->addWidget(m_statusText); + warningLayout->addStretch(); + + QVBoxLayout* editLayout = new QVBoxLayout(m_editWidget); + editLayout->setContentsMargins(22,0,0,0); + editLayout->setSpacing(0); + editLayout->addWidget(m_uriEdit); + editLayout->addWidget(m_warningLabel); + + QVBoxLayout* mainLayout = new QVBoxLayout(this); + mainLayout->setContentsMargins(0,0,0,0); + mainLayout->setSpacing(0); + mainLayout->addWidget(m_scrollArea); + mainLayout->addWidget(m_bottomWidget); + this->setLayout(mainLayout); + + //中间页面 + QVBoxLayout *vLayout = new QVBoxLayout(m_centerWidget); + vLayout->setContentsMargins(25, 17, 23, 0); + vLayout->setSpacing(0); + vLayout->addWidget(m_warningWidget); + vLayout->addWidget(m_text); + vLayout->addSpacing(10); + vLayout->addWidget(m_publicNetworkButton); + vLayout->addSpacing(12); + vLayout->addWidget(m_intranetButton); + vLayout->addWidget(m_editWidget); + + //底部按钮 + QHBoxLayout* bottomLayout = new QHBoxLayout(m_bottomWidget); + bottomLayout->setContentsMargins(BOTTOM_LAYOUT_MARGINS); + bottomLayout->setSpacing(LAYOUT_SPACING); + bottomLayout->addStretch(); + bottomLayout->addWidget(m_confirmBtn); + + m_scrollArea->setWidget(m_centerWidget); + m_scrollArea->setWidgetResizable(true); + + this->setWindowFlags(Qt::Dialog); +} + +void ConnectivityPage::initConnect() +{ + connect(m_confirmBtn, &QPushButton::released, this, [=](){ + if (m_publicNetworkButton->isChecked()) { + setConnectivityCheckSpareUriByGDbus(""); + } else { + setConnectivityCheckSpareUriByGDbus(m_uriEdit->text()); + } + close(); + }); + connect(m_publicNetworkButton, &QRadioButton::toggled, [&](bool checked){ + if (checked) { + m_uriEdit->clear(); + m_uriEdit->setDisabled(true); + m_confirmBtn->setEnabled(true); + } + }); + connect(m_intranetButton, &QRadioButton::toggled, [&](bool checked){ + if (checked) { + checkUri(); + m_uriEdit->setDisabled(false); + m_uriEdit->setFocus(); + } + }); + connect(m_uriEdit, &QLineEdit::textChanged, this ,&ConnectivityPage::checkUri); + connect(m_connectResource, &KyConnectResourse::connectivityChanged, this, &ConnectivityPage::setWarning); +} + +void ConnectivityPage::setWarning(NetworkManager::Connectivity connectivity) +{ + if (NetworkManager::Connectivity::Full == connectivity) { + //网络已连接,可正常访问 Internet 。 + m_icon->setPixmap(QIcon::fromTheme("ukui-dialog-success").pixmap(16,16)); + m_statusText->setText(tr("The network is connected and can access the Internet normally.")); + } else if (NetworkManager::Connectivity::Limited == connectivity + || NetworkManager::Connectivity::Portal == connectivity) { + //网络已连接,访问 Internet 受限。 + m_icon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(16,16)); + m_statusText->setText(tr("The network is connected and access to the Internet is restricted.")); + } else { + qWarning() << "network status is " << connectivity << "should not show this page"; + } +} + +void ConnectivityPage::checkUri() +{ + QString text = m_uriEdit->text(); //locationbar input data + if (text.isEmpty()) { + m_confirmBtn->setEnabled(false); + m_warningLabel->setText(tr("Please enter the local area network (intranet) detection address")); + m_warningLabel->show(); + return; + } + int pos = 0; + + QRegExp rx; + //url regular expression + rx.setPattern("(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"); + QRegExpValidator rv; + rv.setRegExp(rx); + //Test for a match between the url and the regular expression + QValidator::State rvState = rv.validate(text, pos); + if (rvState == QValidator::Acceptable) { + m_confirmBtn->setEnabled(true); + m_warningLabel->clear(); + m_warningLabel->hide(); + } else { + m_confirmBtn->setEnabled(false); + m_warningLabel->setText(tr("Format error")); + m_warningLabel->show(); + } +} + +void ConnectivityPage::closeEvent(QCloseEvent *event) +{ + Q_EMIT pageClose(); + return QWidget::closeEvent(event); +} diff --git a/src/frontend/connectivity/connectivitypage.h b/src/frontend/connectivity/connectivitypage.h new file mode 100644 index 00000000..df2b3294 --- /dev/null +++ b/src/frontend/connectivity/connectivitypage.h @@ -0,0 +1,55 @@ +#ifndef CONNECTIVITYPAGE_H +#define CONNECTIVITYPAGE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "divider.h" +#include "kylinconnectresource.h" + +class ConnectivityPage : public QDialog +{ + Q_OBJECT +public: + explicit ConnectivityPage(QString uri = "", QWidget *parent = nullptr); + +protected: + void closeEvent(QCloseEvent *event); + +private: + QScrollArea *m_scrollArea; + QWidget* m_warningWidget; + QWidget* m_centerWidget; + QWidget* m_editWidget; + QWidget* m_bottomWidget; + + QString m_uri; + QPushButton *m_confirmBtn; + QLabel *m_icon; + QLabel *m_statusText; + QLabel *m_text; + QRadioButton *m_publicNetworkButton; + QRadioButton *m_intranetButton; + QLineEdit *m_uriEdit; + QLabel* m_warningLabel; + + KyConnectResourse* m_connectResource; + + void initUi(); + void initConnect(); + +private Q_SLOTS: + void setWarning(NetworkManager::Connectivity connectivity); + void checkUri(); + +Q_SIGNALS: + void pageClose(); +}; + +#endif // CONNECTIVITYPAGE_H diff --git a/src/frontend/frontend.pri b/src/frontend/frontend.pri index b7703595..079127eb 100644 --- a/src/frontend/frontend.pri +++ b/src/frontend/frontend.pri @@ -5,6 +5,7 @@ include(tab-pages/tab-pages.pri) include(list-items/list-items.pri) include(netdetails/netdetails.pri) include(enterprise-wlan/enterprise-wlan.pri) +include(connectivity/connectivity.pri) include(networkmode/networkmode.pri) FORMS += \ diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 2696b29e..52f21fc4 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -33,6 +33,7 @@ #include "ukuistylehelper/ukuistylehelper.h" #include "windowmanager/windowmanager.h" #include "kysdk/kysdk-system/libkysysinfo.h" +#include "kylinutil.h" #define MAINWINDOW_WIDTH 420 #define MAINWINDOW_HEIGHT 476 @@ -68,6 +69,12 @@ const QString intel = "V10SP1-edu"; #define LOW_SIGNAL_LIMIT_ICON "ukui-network-wireless-signal-weak-error-symbolic" #define NONE_SIGNAL_LIMIT_ICON "ukui-network-wireless-signal-none-error-symbolic" +#define EXCELLENT_SIGNAL_INTRANET_ICON "ukui-network-wireless-signal-excellent-intranet-symbolic" +#define GOOD_SIGNAL_INTRANET_ICON "ukui-network-wireless-signal-good-intranet-symbolic" +#define OK_SIGNAL_INTRANET_ICON "ukui-network-wireless-signal-ok-intranet-symbolic" +#define LOW_SIGNAL_INTRANET_ICON "ukui-network-wireless-signal-weak-intranet-symbolic" +#define NONE_SIGNAL_INTRANET_ICON "ukui-network-wireless-signal-none-intranet-symbolic" + #include #include @@ -327,11 +334,13 @@ void MainWindow::initTrayIcon() m_trayIcon = new QSystemTrayIcon(); m_trayIconMenu = new QMenu(); - m_showMainwindowAction = new QAction(tr("Show MainWindow"),this); +// m_showMainwindowAction = new QAction(tr("Show MainWindow"),this); m_showSettingsAction = new QAction(tr("Settings"),this); + m_showConnectivityPageAction = new QAction(tr("Network Connectivity Detection"), this); // m_trayIcon->setToolTip(QString(tr("Network tool"))); m_showSettingsAction->setIcon(QIcon::fromTheme("document-page-setup-symbolic", QIcon(":/res/x/setup.png")) ); + m_showConnectivityPageAction->setIcon(QIcon::fromTheme("gnome-netstatus-txrx")); // m_trayIconMenu->addAction(m_showMainwindowAction); m_trayIconMenu->addAction(m_showSettingsAction); m_trayIcon->setContextMenu(m_trayIconMenu); @@ -342,6 +351,20 @@ void MainWindow::initTrayIcon() connect(m_trayIcon, &QSystemTrayIcon::activated, this, &MainWindow::onTrayIconActivated); // connect(m_showMainwindowAction, &QAction::triggered, this, &MainWindow::onShowMainwindowActionTriggled); connect(m_showSettingsAction, &QAction::triggered, this, &MainWindow::onShowSettingsActionTriggled); + connect(m_showConnectivityPageAction, &QAction::triggered, [=]() { + if (m_connectivityPage != nullptr) { + KWindowSystem::activateWindow(m_connectivityPage->winId()); + KWindowSystem::raiseWindow(m_connectivityPage->winId()); + return; + } + QString uri = getConnectivityCheckSpareUriByGDbus(); + m_connectivityPage = new ConnectivityPage(uri, this); + connect(m_connectivityPage, &ConnectivityPage::pageClose, [&](){ + m_connectivityPage = nullptr; + }); + m_connectivityPage->show(); + }); + m_trayIcon->show(); } @@ -733,10 +756,34 @@ void MainWindow::onRefreshTrayIcon() } } + if(!getConnectivityCheckSpareUriByGDbus().isEmpty()) { + if (iconStatus == IconActiveType::LAN_CONNECTED) { + m_trayIcon->setIcon(QIcon::fromTheme("network-intranet-symbolic")); + } else if (iconStatus == IconActiveType::WLAN_CONNECTED) { + if (signalStrength > MW_EXCELLENT_SIGNAL){ + m_trayIcon->setIcon(QIcon::fromTheme(EXCELLENT_SIGNAL_INTRANET_ICON)); + } else if (signalStrength > MW_GOOD_SIGNAL) { + m_trayIcon->setIcon(QIcon::fromTheme(GOOD_SIGNAL_INTRANET_ICON)); + } else if (signalStrength > MW_OK_SIGNAL) { + m_trayIcon->setIcon(QIcon::fromTheme(OK_SIGNAL_INTRANET_ICON)); + } else if (signalStrength > MW_LOW_SIGNAL) { + m_trayIcon->setIcon(QIcon::fromTheme(LOW_SIGNAL_INTRANET_ICON)); + } else { + m_trayIcon->setIcon(QIcon::fromTheme(NONE_SIGNAL_INTRANET_ICON)); + } + } + } + if (signalStrength == -1) { m_trayIcon->setIcon(QIcon::fromTheme("network-wired-disconnected-symbolic")); } onRefreshTrayIconTooltip(); + + if (iconStatus > IconActiveType::NOT_CONNECTED) { + m_trayIconMenu->addAction(m_showConnectivityPageAction); + } else { + m_trayIconMenu->removeAction(m_showConnectivityPageAction); + } } void MainWindow::onSetTrayIconLoading() diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index 01962c21..d033bb7d 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -34,6 +34,7 @@ #include "wlanpage.h" #include "netdetails/netdetail.h" #include "netdetails/joinhiddenwifipage.h" +#include "connectivity/connectivitypage.h" //安全中心-网络防火墙模式配置 #include "networkmodeconfig.h" //删除此头文件,别在添加 @@ -47,7 +48,9 @@ enum IconActiveType { NOT_CONNECTED = 0, LAN_CONNECTED, + LAN_CONNECTED_INTRANET, WLAN_CONNECTED, + WLAN_CONNECTED_INTRANET, LAN_CONNECTED_LIMITED, WLAN_CONNECTED_LIMITED, ACTIVATING, @@ -180,6 +183,8 @@ private: LanPage * m_lanWidget = nullptr; WlanPage * m_wlanWidget = nullptr; + ConnectivityPage* m_connectivityPage = nullptr; + //监听主题的Gsettings QGSettings * m_styleGsettings = nullptr; @@ -192,6 +197,7 @@ private: QMenu * m_trayIconMenu = nullptr; QAction * m_showMainwindowAction = nullptr; QAction * m_showSettingsAction = nullptr; + QAction * m_showConnectivityPageAction = nullptr; bool m_lanIsLoading = false; bool m_wlanIsLoading = false; diff --git a/src/frontend/netdetails/ipv4page.cpp b/src/frontend/netdetails/ipv4page.cpp index 6cfb863f..99ba800f 100644 --- a/src/frontend/netdetails/ipv4page.cpp +++ b/src/frontend/netdetails/ipv4page.cpp @@ -154,7 +154,7 @@ void Ipv4Page::initComponent() { void Ipv4Page::setIpv4Config(KyIpConfigType ipv4Config) { - if (ipv4Config == CONFIG_IP_MANUAL) { + if (ipv4Config == CONFIG_IP_MANUAL) { ipv4ConfigCombox->setCurrentIndex(MANUAL_CONFIG); } else { ipv4ConfigCombox->setCurrentIndex(AUTO_CONFIG); diff --git a/src/translations/kylin-nm_bo.ts b/src/translations/kylin-nm_bo.ts index 362f6a5e..8cb61314 100644 --- a/src/translations/kylin-nm_bo.ts +++ b/src/translations/kylin-nm_bo.ts @@ -4,26 +4,74 @@ ConfigPage - + Network profile type - + Public(recommended) Devices on the network cannot discover this computer. Generally, it is suitable for networks in public places, such as airports or coffee shops, etc. - + Private Devices on the network can discover this computer. Generally applicable to a network at home or work where you know and trust the individuals and devices on the network. - + Config firewall and security settings + + ConnectivityPage + + + Network connectivity detection + + + + + If access to the Internet is restricted, please switch the network IP connectivity detection method and try again. + + + + + Public network (default) + + + + + Local area network (intranet) + + + + + Confirm + + + + + The network is connected and can access the Internet normally. + + + + + The network is connected and access to the Internet is restricted. + + + + + Please enter the local area network (intranet) detection address + + + + + Format error + + + CreatNetPage @@ -232,27 +280,27 @@ EnterpriseWlanDialog - + Wi-Fi network requires authentication - + Access to Wi-Fi network " - + " requires a password or encryption key. - + Cancel - + Connect @@ -260,22 +308,22 @@ FirewallDialog - + Allow other devices on this network to discover this computer? - + It is not recommended to enable this feature on public networks - + Not allowed (recommended) - + Allowed @@ -429,38 +477,38 @@ LanListItem - + Not connected - + Wired Device not carried - - - + + + Disconnect - - - + + + Connect - - + + Property - - + + Delete @@ -468,7 +516,7 @@ LanPage - + No ethernet device avaliable @@ -493,23 +541,23 @@ - + Wired Device not carried - - + + Connected: - + (Limited) - + Not Connected @@ -530,46 +578,46 @@ MainWindow - + kylin-nm - + LAN - + WLAN - + Settings - - + + Network Connectivity Detection + + + + + Network tool - + Network Card - + Not connected to the network - - - Show MainWindow - - MultipleDnsWidget @@ -602,102 +650,102 @@ - + Detail - + Security - - + + Config - + Confirm - + Cancel - + Forget this network - + IPv4 - + IPv6 - + Add LAN Connect - + Connect Hidden WLAN - + Delete this network - - - + + + None - + Auto - + start check ipv4 address conflict - + start check ipv6 address conflict - + this wifi no support enterprise type - + this wifi no support None type - + this wifi no support WPA2 type - + this wifi no support WPA3 type @@ -1007,42 +1055,42 @@ WlanListItem - + Not connected - - - - + + + + Disconnect - - - - - + + + + + Connect - - + + Property - - + + Forget - + Auto Connect @@ -1073,12 +1121,12 @@ - + Connected: - + Not Connected diff --git a/src/translations/kylin-nm_bo_CN.ts b/src/translations/kylin-nm_bo_CN.ts index b3b21ecd..33f9e902 100644 --- a/src/translations/kylin-nm_bo_CN.ts +++ b/src/translations/kylin-nm_bo_CN.ts @@ -35,26 +35,74 @@ ConfigPage - + Network profile type དྲ་རྒྱའི་བཀོད་སྒྲིག་ཡིག་ཆའི་རིགས། - + Public(recommended) Devices on the network cannot discover this computer. Generally, it is suitable for networks in public places, such as airports or coffee shops, etc. སྤྱི་སྤྱོད།(འོས་སྦྱོར་བྱས་པ།)དྲ་རྒྱའི་སྒྲིག་ཆས་ཀྱིས་གློག་ཀླད་འདི་མཐོང་མི་ཐུབ། སྤྱིར་བཏང་གི་གནས་ཚུལ་འོག་ཏུ་མི་མང་འདུ་སའི་ནང་གི་དྲ་བ་ལ་འཚམ་པ་སྟེ།དཔེར་ན་གནམ་གྲུ་ཐང་དང་འཚིག་ཇའི་ཁང་སོགས་ལྟ་བུ།. - + Private Devices on the network can discover this computer. Generally applicable to a network at home or work where you know and trust the individuals and devices on the network. ཆེད་སྤྱོད། དྲ་རྒྱའི་སྒྲིག་ཆས་ཀྱིས་གློག་ཀླད་འདི་མཐོང་ཐུབ། སྤྱིར་བཏང་གི་གནས་ཚུལ་འོག་ཁྱིམ་ཚང་ངམ་ལས་དོན་ཚན་པའི་དྲ་བ་དང་འཚམ་པས།ཁྱེད་ཀྱིས་དྲ་ཐོག་གི་མི་སྒེར་དང་སྒྲིག་ཆས་ལ་ངོས་འཛིན་དང་ཡིད་ཆེས་བྱེད་དགོས།. - + Config firewall and security settings མེ་འགོག་གྱང་རྩིག་དང་བདེ་འཇགས་བཀོད་སྒྲིག་བྱ་དགོས། + + ConnectivityPage + + + Network connectivity detection + དྲ་རྒྱའི་སྦྲེལ་མཐུད་རང་བཞིན་གྱི་ཞིབ་དཔྱད་ཚད་ལེན། + + + + If access to the Internet is restricted, please switch the network IP connectivity detection method and try again. + གལ་ཏེ་དྲ་སྦྲེལ་ལ་འཚམས་འདྲི་བྱེད་པར་ཚོད་འཛིན་ཐེབས་པ་དང་། དྲ་རྒྱའི་IPལ་ཞིབ་དཔྱད་ཚད་ལེན་བྱེད་ཐབས་བརྗེས་ནས་ཚོད་ལྟ་བྱེད་དགོས།. + + + + Public network (default) + སྤྱི་པའི་དྲ་རྒྱ། (ཁས་མ་བླངས་པ། ) + + + + Local area network (intranet) + ཅུས་ཁོངས་དྲ་བ། (ནང་དྲ། ) + + + + Confirm + གཏན་འཁེལ་བྱ། + + + + The network is connected and can access the Internet normally. + དྲ་རྒྱ་སྦྲེལ་མཐུད་བྱས་ཟིན་པས་རྒྱུན་ལྡན་གྱི་དྲ་སྦྲེལ་ལ་འཚམས་འདྲི་བྱས་ཆོག. + + + + The network is connected and access to the Internet is restricted. + དྲ་རྒྱ་སྦྲེལ་མཐུད་བྱས་ཟིན་པས་དྲ་སྦྲེལ་ལ་འཚམས་འདྲི་བྱས་པ་རེད།. + + + + Please enter the local area network (intranet) detection address + ཅུས་ཁོངས་ཀྱི་དྲ་རྒྱའི་(ནང་དྲ་)ཞིབ་དཔྱད་ཚད་ལེན་ས་གནས་ནང་འཇུག་བྱེད་རོགས། + + + + Format error + རྣམ་གཞག་གི་ནོར་འཁྲུལ། + + CopyButton @@ -500,7 +548,7 @@ Close - སྒོ་རྒྱག་པ། + སྒོ་རྒྱག་པ། @@ -524,27 +572,27 @@ 关闭 - + Wi-Fi network requires authentication Wi-Fiཡི་དྲ་རྒྱའི་བླང་བྱར་སྤྲོད་བྱ་རྒྱུའི་བླང་བྱ་བཏོན་ཡོད། - + Access to Wi-Fi network " Wii-Fiབར་གྱི་དྲ་རྒྱར་འཚམས་འདྲི་གནང་བ་རེད། - + " requires a password or encryption key. གསང་གྲངས་དང་གསང་བའི་ལྡེ་མིག་དགོས། - + Cancel ཕྱིར་འཐེན། - + Connect སྦྲེལ་མཐུད་བྱེད་པ @@ -568,22 +616,22 @@ དེ་ལྟར་མ་བྱས་ - + Allow other devices on this network to discover this computer? དྲ་རྒྱའི་སྟེང་གི་སྒྲིག་ཆས་གཞན་པས་གློག་ཀླད་འདི་རྙེད་དུ་འཇུག་གམ།? - + It is not recommended to enable this feature on public networks བསམ་འཆར་མེད་།སྤྱི་པའི་དྲ་རྒྱའི་སྟེང་ནས་ནུས་པ་འདི་མགོ་བརྩམས་། - + Not allowed (recommended) མི་ཆོག་པ་(འོས་སྦྱོར།) - + Allowed ཆོག་པ་ @@ -757,38 +805,38 @@ LanListItem - + Not connected འབྲེལ་མཐུད་མི་བྱེད་པ། - + Wired Device not carried སྐུད་ཡོད་སྒྲིག་ཆས་འཁྱེར་མེད་པ། - - - + + + Disconnect འབྲེལ་ཐག་ཆད་པ། - - - + + + Connect སྦྲེལ་མཐུད་བྱེད་པ - - + + Property ངོ་བོ། - - + + Delete དྲ་རྒྱ་དེ་བསུབ་དགོས། @@ -796,7 +844,7 @@ LanPage - + No ethernet device avaliable ཨེ་ཙི་དྲ་རྒྱའི་སྒྲིག་ཆས་ལ་བཙན་འཛུལ་བྱས་མི་ཆོག། @@ -825,7 +873,7 @@ སྐུད་ཡོད་དྲ་བ་ཆད་སོང་། - + Wired Device not carried སྐུད་ཡོད་སྒྲིག་ཆས་འཁྱེར་མེད་པ། @@ -834,18 +882,18 @@ སྐུད་ཡོད་དྲ་བ་སྦྲེལ་ཡོད། - - + + Connected: འབྲེལ་མཐུད་བྱུང་ཡོད།: - + Not Connected འབྲེལ་མཐུད་མ་བྱས་པ། - + (Limited) (དྲ་བར་ཚོད་འཛིན་ཐེབས་པ་རེད།) @@ -866,46 +914,50 @@ MainWindow - + kylin-nm དྲ་རྒྱའི་ཡོ་བྱད། - + LAN 有线网络 སྐུད་ཡོད་དྲ་བ། - + WLAN 无线局域网 སྐུད་མེད་ཅུས་ཁོངས་ཀྱི་དྲ་བ། - Show MainWindow - རླུང་གཙོ་བོ་མངོན་པར་བྱས་ཡོད། + རླུང་གཙོ་བོ་མངོན་པར་བྱས་ཡོད། - + Settings 设置网络项 སྒྲིག་བཀོད། - - + + Network Connectivity Detection + དྲ་རྒྱའི་སྦྲེལ་མཐུད་རང་བཞིན་གྱི་ཞིབ་དཔྱད་ཚད་ལེན། + + + + Network tool དྲ་རྒྱའི་ལག་ཆ་ - + Network Card དྲ་བྱང་། - + Not connected to the network དྲ་རྒྱ་དང་སྦྲེལ་མཐུད་མ་བྱས་པ། @@ -945,22 +997,22 @@ དྲ་རྒྱའི་གསལ་འདེབས་གནས་ཚུལ། - + Detail ཞིབ་ཕྲའི་གནས་ཚུལ། - + IPv4 IPv4 - + IPv6 IPv6 - + Security བདེ་འཇགས། @@ -969,62 +1021,62 @@ 关闭 - - + + Config བཀོད་སྒྲིག་བཅས་བྱ་དགོས། - + Confirm གཏན་འཁེལ་བྱ་དགོས། - + Cancel ཕྱིར་འཐེན། - + Forget this network དྲ་རྒྱ་འདི་བརྗེད་སོང་། - + Delete this network དྲ་རྒྱ་དེ་བསུབ་དགོས། - + Add LAN Connect སྐུད་ཡོད་དྲ་བ་ཁ་སྣོན་བྱ་དགོས། - + Connect Hidden WLAN ཧའེ་ཏེན་ཝེ་ལན་དང་འབྲེལ་མཐུད་བྱེད་པ། - - - + + + None གཅིག་ཀྱང་མེད། - + Auto རང་འགུལ་གྱིས་རླངས་ - + start check ipv4 address conflict ipv4ས་གནས་ཀྱི་འགལ་བ་ལ་ཞིབ་བཤེར་བྱེད་འགོ་ཚུགས། - + start check ipv6 address conflict ipv6གནས་ཡུལ་དང་འགལ་བར་ཞིབ་བཤེར་བྱེད་འགོ་ཚུགས། @@ -1037,22 +1089,22 @@ ipv6ཐག་གཅོད་གདོང་གཏུག་བྱུང་བ་རེད།! - + this wifi no support enterprise type wifiལ་རྒྱབ་སྐྱོར་མེད་པའི་ཁེ་ལས་ཀྱི་རིགས་དབྱིབས། - + this wifi no support None type wifiལ་རྒྱབ་སྐྱོར་མི་བྱེད་པར་རིགས་དབྱིབས་གཅིག་ཀྱང་མེད། - + this wifi no support WPA2 type wifiལ་རྒྱབ་སྐྱོར་མི་བྱེད་པའི་WPA2རིགས་དབྱིབས་ - + this wifi no support WPA3 type wifiལ་རྒྱབ་སྐྱོར་མི་བྱེད་པའི་WPA3རིགས་དབྱིབས་ @@ -1464,42 +1516,42 @@ WlanListItem - + Not connected འབྲེལ་མཐུད་མི་བྱེད་པ། - - - - + + + + Disconnect འབྲེལ་ཐག་ཆད་པ། - - - - - + + + + + Connect སྦྲེལ་མཐུད་བྱེད་པ - - + + Forget བརྗེད་པ། - - + + Property ངོ་བོ། - + Auto Connect རང་འགུལ་གྱིས་སྦྲེལ་མཐུད་ @@ -1553,12 +1605,12 @@ སྐུད་མེད་དྲ་རྒྱ་ཆད་སོང་། - + Connected: འབྲེལ་མཐུད་བྱུང་ཡོད།: - + Not Connected འབྲེལ་མཐུད་མ་བྱས་པ། diff --git a/src/translations/kylin-nm_mn.ts b/src/translations/kylin-nm_mn.ts index 804b8443..5bbf1a04 100644 --- a/src/translations/kylin-nm_mn.ts +++ b/src/translations/kylin-nm_mn.ts @@ -35,26 +35,74 @@ ConfigPage - + Network profile type ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ ᠹᠠᠢᠯ ᠤ᠋ᠨ ᠳᠦᠷᠦᠯ - + Public(recommended) Devices on the network cannot discover this computer. Generally, it is suitable for networks in public places, such as airports or coffee shops, etc. ᠨᠡᠢᠳᠡ ᠵᠢᠨ ᠰᠦᠯᠵᠢᠶᠡᠨ ( ᠳᠠᠨᠢᠯᠴᠠᠭᠤᠯᠬᠤ) ᠳ᠋ᠤ᠌ ᠬᠢ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠲᠤᠰ ᠺᠣᠮᠫᠢᠦ᠋ᠲ᠋ᠧᠷ ᠢ᠋ ᠣᠯᠵᠤ ᠮᠡᠳᠡᠵᠤ ᠪᠣᠯᠬᠤ ᠥᠬᠡᠢ᠂ ᠶᠡᠷᠦᠳᠡ ᠵᠢᠨ ᠪᠠᠢᠳᠠᠯ ᠳ᠋ᠤ᠌ ᠣᠯᠠᠨ ᠨᠡᠢᠳᠡ ᠵᠢᠨ ᠳᠠᠯᠠᠪᠠᠢ ᠳ᠋ᠤ᠌ ᠬᠢ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠨ᠎ᠡ᠂ ᠵᠢᠰᠢᠶᠡᠯᠡᠪᠡᠯ ᠨᠢᠰᠬᠡᠯ ᠤ᠋ᠨ ᠪᠠᠭᠤᠳᠠᠯ ᠤ᠋ᠨ ᠺᠤᠹᠸ ᠵᠢᠨ ᠦᠷᠦᠬᠡ ᠵᠡᠷᠭᠡ. - + Private Devices on the network can discover this computer. Generally applicable to a network at home or work where you know and trust the individuals and devices on the network. ᠳᠤᠰᠬᠠᠢ ᠬᠡᠷᠡᠭᠯᠡᠬᠦ᠂ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠲᠤᠰ ᠺᠣᠮᠫᠢᠦ᠋ᠲ᠋ᠧᠷ ᠢ᠋ ᠣᠯᠵᠤ ᠮᠡᠳᠡᠪᠡ᠂ ᠶᠡᠷᠦᠳᠡ ᠵᠢᠨ ᠪᠠᠢᠳᠠᠯ ᠳ᠋ᠤ᠌ ᠬᠡᠷᠦᠢ ᠤ᠋ᠨ ᠪᠤᠶᠤ ᠠᠯᠪᠠᠨ ᠪᠠᠢᠭᠤᠯᠭ᠎ᠠ ᠵᠢᠨ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳ᠋ᠤ᠌ ᠬᠡᠷᠡᠭᠯᠡᠨ᠎ᠡ᠂ ᠲᠠ ᠳᠠᠨᠢᠬᠤ ᠮᠦᠷᠳᠡᠭᠡᠨ ᠨᠠᠢᠳᠠᠪᠤᠷᠢᠳᠠᠢ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳᠡᠬᠡᠷᠡᠬᠢ ᠬᠤᠪᠢ ᠬᠥᠮᠦᠨ ᠪᠤᠶᠤ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ. - + Config firewall and security settings ᠭᠠᠯ ᠰᠡᠷᠬᠡᠢᠯᠡᠬᠦ ᠬᠡᠷᠡᠮ ᠪᠤᠯᠤᠨ ᠠᠮᠤᠷ ᠳᠦᠪᠰᠢᠨ ᠤ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ + + ConnectivityPage + + + Network connectivity detection + ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠶᠢ ᠵᠠᠯᠭᠠᠵᠤ ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠬᠡᠮᠵᠢᠨ᠎ᠡ + + + + If access to the Internet is restricted, please switch the network IP connectivity detection method and try again. + ᠬᠡᠷᠪᠡ ᠢᠨᠲ᠋ᠸᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠠ ᠳᠤ ᠰᠤᠷᠪᠤᠯᠵᠢᠯᠠᠬᠤ ᠳᠤ ᠬᠦᠷᠪᠡᠯ ᠂ ᠰᠦᠯᠵᠢᠶ᠎ᠠ ᠶᠢᠨ IP ᠶᠢ ᠬᠤᠯᠪᠤᠵᠤ ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠬᠡᠮᠵᠢᠭᠦ ᠠᠷᠭ᠎ᠠ ᠶᠢ ᠰᠤᠯᠢᠵᠤ ᠂ ᠲᠠᠷᠠᠭ᠎ᠠ ᠨᠢ ᠲᠠᠭᠢᠨ ᠰᠢᠯᠭᠠᠯᠲᠠ ᠬᠢᠨ᠎ᠡ. + + + + Public network (default) + ᠨᠡᠶᠢᠲᠡ ᠶᠢᠨ ᠬᠡᠷᠡᠭᠯᠡᠭᠡᠨ ᠦ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ( ᠳᠤᠪ ᠳᠤᠭᠤᠢ ᠲᠠᠨᠢᠯᠴᠠᠨ᠎ᠠ ) + + + + Local area network (intranet) + ᠬᠡᠰᠡᠭ ᠬᠡᠪᠴᠢᠶᠡᠨ ᠦ ᠲᠣᠤᠷ ( ᠳᠣᠲᠣᠭᠠᠳᠤ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ) + + + + Confirm + ᠪᠠᠳᠤᠯᠠᠬᠤ + + + + The network is connected and can access the Internet normally. + ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠨᠢᠭᠡᠨᠲᠡ ᠬᠣᠯᠪᠣᠭᠳᠠᠵᠤ ᠂ ᠢᠨᠲ᠋ᠧᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠶᠢ ᠬᠡᠪ ᠦᠨ ᠶᠣᠰᠣᠭᠠᠷ ᠰᠤᠷᠪᠤᠯᠵᠢᠯᠠᠵᠤ ᠪᠣᠯᠣᠨ᠎ᠠ. + + + + The network is connected and access to the Internet is restricted. + ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠨᠢᠭᠡᠨᠲᠡ ᠬᠣᠯᠪᠣᠭᠳᠠᠵᠤ ᠂ ᠢᠨᠲ᠋ᠧᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠦ ᠠᠶᠢᠯᠴᠢᠯᠠᠯᠲᠠ ᠳᠤ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠭᠳᠠᠵᠠᠶ. + + + + Please enter the local area network (intranet) detection address + ᠬᠡᠰᠡᠭ ᠬᠡᠪᠴᠢᠶᠡᠨ ᠦ ᠲᠣᠤᠷ (ᠳᠣᠲᠣᠭᠠᠳᠤ ᠲᠣᠤᠷ) ᠢ ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠬᠡᠮᠵᠢᠬᠦ ᠬᠠᠶᠢᠭ ᠢ ᠣᠷᠣᠭᠤᠯᠵᠤ ᠢᠷᠡᠭᠡᠷᠡᠢ + + + + Format error + ᠬᠡᠯᠪᠡᠷᠢ ᠨᠢ ᠪᠤᠷᠤᠭᠤ + + CopyButton @@ -524,27 +572,27 @@ 关闭 - + Wi-Fi network requires authentication Wi-Fi ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠬᠡᠷᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠱᠠᠭᠠᠷᠳᠠᠬᠤ - + Access to Wi-Fi network " Wi-Fi ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳ᠋ᠤ᠌ ᠠᠢᠯᠴᠢᠯᠠᠬᠤ - + " requires a password or encryption key. ᠨᠢᠭᠤᠴᠠ ᠺᠣᠳ᠋ ᠱᠠᠭᠠᠷᠳᠠᠬᠤ ᠪᠤᠶᠤ ᠨᠢᠭᠤᠴᠠ ᠳᠦᠯᠬᠢᠬᠦᠷ ᠨᠢᠭᠤᠴᠠᠯᠠᠬᠤ. - + Cancel ᠦᠬᠡᠢᠰᠬᠡᠬᠦ - + Connect ᠴᠦᠷᠬᠡᠯᠡᠬᠡ @@ -552,22 +600,22 @@ FirewallDialog - + Allow other devices on this network to discover this computer? ᠲᠤᠰ ᠳᠦᠯᠵᠢᠶᠡᠨ ᠳᠡᠭᠡᠷᠡᠬᠢ ᠪᠤᠰᠤᠳ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠡᠨᠡ ᠺᠣᠮᠫᠢᠦ᠋ᠲ᠋ᠧᠷ ᠢ᠋ ᠣᠯᠵᠤ ᠮᠡᠳᠡᠬᠦ ᠵᠢ ᠵᠥᠪᠰᠢᠶᠡᠷᠡᠬᠦ ᠤᠤ? - + It is not recommended to enable this feature on public networks ᠨᠡᠢᠳᠡ ᠵᠢᠨ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳᠡᠭᠡᠷ᠎ᠡ ᠲᠤᠰ ᠴᠢᠳᠠᠪᠬᠢ ᠵᠢ ᠨᠡᠬᠡᠬᠡᠬᠦ ᠥᠬᠡᠢ ᠪᠠᠢᠬᠤ ᠵᠢ ᠰᠠᠨᠠᠭᠤᠯᠵᠤ ᠪᠠᠢᠨ᠎ᠠ - + Not allowed (recommended) ᠵᠥᠪᠰᠢᠶᠡᠷᠡᠬᠦ ᠥᠬᠡᠢ ( ᠳᠠᠨᠢᠯᠴᠠᠭᠤᠯᠬᠤ) - + Allowed ᠵᠥᠪᠰᠢᠶᠡᠷᠡᠬᠦ @@ -737,38 +785,38 @@ LanListItem - + Not connected ᠴᠦᠷᠬᠡᠯᠡᠭᠡ ᠦᠬᠡᠢ - + Wired Device not carried ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠤᠳᠠᠰᠤ ᠵᠠᠯᠭᠠᠭ᠎ᠠ ᠦᠬᠡᠢ - - - + + + Disconnect ᠳᠠᠰᠤᠯᠬᠤ - - - + + + Connect ᠴᠦᠷᠬᠡᠯᠡᠬᠡ - - + + Property ᠬᠠᠷᠢᠶᠠᠯᠠᠯ - - + + Delete ᠲᠤᠰ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠠᠰᠤᠬᠤ @@ -776,7 +824,7 @@ LanPage - + No ethernet device avaliable ᠤᠳᠠᠰᠤᠳᠤ ᠳᠦᠬᠦᠬᠡᠷᠦᠮᠵᠢ ᠵᠢ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠤᠯᠤᠭᠰᠠᠨ ᠦᠬᠡᠢ @@ -805,7 +853,7 @@ ᠤᠳᠠᠰᠤᠳᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠨᠢᠭᠡᠨᠳᠡ ᠳᠠᠰᠤᠯᠪᠠ - + Wired Device not carried ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠤᠳᠠᠰᠤ ᠵᠠᠯᠭᠠᠭ᠎ᠠ ᠦᠬᠡᠢ @@ -814,18 +862,18 @@ ᠤᠳᠠᠰᠤᠳᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠨᠢᠭᠡᠨᠳᠡ ᠴᠦᠷᠬᠡᠯᠡᠪᠡ - - + + Connected: ᠴᠥᠷᠬᠡᠯᠡᠪᠡ: - + Not Connected ᠴᠥᠷᠬᠡᠯᠡᠭᠡ ᠥᠬᠡᠢ - + (Limited) ( ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠭᠳᠠᠪᠠ) @@ -846,46 +894,50 @@ MainWindow - + kylin-nm ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠪᠠᠭᠠᠵᠢ - + LAN 有线网络 ᠤᠳᠠᠰᠤᠳᠤ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - + WLAN 无线局域网 ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠬᠡᠰᠡᠭ ᠰᠦᠯᠵᠢᠶ᠎ᠡ - Show MainWindow - ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠪᠠᠭᠠᠵᠢ ᠵᠢ ᠨᠡᠬᠡᠬᠡᠬᠦ + ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠪᠠᠭᠠᠵᠢ ᠵᠢ ᠨᠡᠬᠡᠬᠡᠬᠦ - + Settings ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠲᠦᠷᠦᠯ ᠢ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠲᠦᠷᠦᠯ ᠢ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ - - + + Network Connectivity Detection + ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠶᠢ ᠵᠠᠯᠭᠠᠵᠤ ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠬᠡᠮᠵᠢᠨ᠎ᠡ + + + + Network tool ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠪᠠᠭᠠᠵᠢ - + Network Card ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠺᠠᠷᠲ - + Not connected to the network ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳ᠋ᠤ᠌ ᠴᠥᠷᠬᠡᠯᠡᠭᠡ ᠥᠬᠡᠢ @@ -921,22 +973,22 @@ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ ᠵᠢᠨ ᠮᠡᠳᠡᠭᠡ - + Detail ᠳᠡᠯᠭᠡᠷᠡᠩᠭᠦᠢ ᠠᠭᠤᠯᠭ᠎ᠠ - + IPv4 IPv4 - + IPv6 IPv6 - + Security ᠠᠮᠤᠷ ᠳᠦᠪᠰᠢᠨ @@ -945,62 +997,62 @@ 关闭 - - + + Config ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠭ᠎ᠠ - + Confirm ᠪᠠᠳᠤᠯᠠᠬᠤ - + Cancel ᠦᠬᠡᠢᠰᠬᠡᠬᠦ - + Forget this network ᠲᠤᠰ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠮᠠᠷᠳᠠᠬᠤ - + Delete this network ᠲᠤᠰ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠠᠰᠤᠬᠤ - + Add LAN Connect ᠤᠳᠠᠰᠤᠳᠤ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠨᠡᠮᠡᠬᠦ - + Connect Hidden WLAN ᠨᠢᠭᠤᠴᠠᠯᠠᠭᠰᠠᠨ WLAN ᠲᠤ᠌/ ᠳ᠋ᠤ᠌ ᠴᠦᠷᠬᠡᠯᠡᠬᠦ - - - + + + None ᠦᠬᠡᠢ - + Auto ᠠᠦ᠋ᠲ᠋ᠤ᠋ - + start check ipv4 address conflict ipv4 ᠬᠠᠶᠢᠭ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠢ᠋ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠡᠬᠢᠯᠡᠪᠡ - + start check ipv6 address conflict ipv6 ᠬᠠᠶᠢᠭ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠢ᠋ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠡᠬᠢᠯᠡᠪᠡ @@ -1013,22 +1065,22 @@ ipv6 ᠬᠠᠶᠢᠭ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠲᠠᠢ! - + this wifi no support enterprise type ᠲᠤᠰ wifi ᠠᠵᠤ ᠠᠬᠤᠢᠯᠠᠯ ᠤ᠋ᠨ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠤ᠋ ᠲᠦᠷᠦᠯ ᠢ᠋ ᠳᠡᠮᠵᠢᠬᠦ ᠦᠬᠡᠢ - + this wifi no support None type ᠲᠤᠰ wifi ᠬᠤᠭᠤᠰᠤᠨ ᠬᠡᠯᠪᠡᠷᠢ ᠵᠢ ᠳᠡᠮᠵᠢᠬᠦ ᠦᠬᠡᠢ - + this wifi no support WPA2 type ᠲᠤᠰ wifiWPA2 ᠳᠦᠷᠦᠯ ᠢ᠋ ᠳᠡᠮᠵᠢᠬᠦ ᠦᠬᠡᠢ - + this wifi no support WPA3 type ᠲᠤᠰ wifiWPA3 ᠳᠦᠷᠦᠯ ᠢ᠋ ᠳᠡᠮᠵᠢᠬᠦ ᠦᠬᠡᠢ @@ -1425,42 +1477,42 @@ WlanListItem - + Not connected ᠴᠦᠷᠬᠡᠯᠡᠭᠡ ᠦᠬᠡᠢ - - - - + + + + Disconnect ᠳᠠᠰᠤᠯᠬᠤ - - - - - + + + + + Connect ᠴᠦᠷᠬᠡᠯᠡᠬᠡ - - + + Forget ᠲᠤᠰ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠮᠠᠷᠳᠠᠬᠤ - - + + Property ᠬᠠᠷᠢᠶᠠᠯᠠᠯ - + Auto Connect ᠲᠤᠰ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶᠡᠨ ᠳ᠋ᠤ᠌ ᠠᠦ᠋ᠲ᠋ᠤ᠋ ᠪᠡᠷ ᠵᠠᠯᠭᠠᠬᠤ @@ -1514,12 +1566,12 @@ ᠤᠳᠠᠰᠤ ᠦᠬᠡᠢ ᠲᠤᠤᠷ ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠳᠠᠰᠤᠯᠪᠠ - + Connected: ᠴᠥᠷᠬᠡᠯᠡᠪᠡ: - + Not Connected ᠴᠥᠷᠬᠡᠯᠡᠭᠡ ᠥᠬᠡᠢ diff --git a/src/translations/kylin-nm_tr.ts b/src/translations/kylin-nm_tr.ts index d6e0d55a..d2de6327 100644 --- a/src/translations/kylin-nm_tr.ts +++ b/src/translations/kylin-nm_tr.ts @@ -102,26 +102,74 @@ ConfigPage - + Network profile type - + Public(recommended) Devices on the network cannot discover this computer. Generally, it is suitable for networks in public places, such as airports or coffee shops, etc. - + Private Devices on the network can discover this computer. Generally applicable to a network at home or work where you know and trust the individuals and devices on the network. - + Config firewall and security settings + + ConnectivityPage + + + Network connectivity detection + + + + + If access to the Internet is restricted, please switch the network IP connectivity detection method and try again. + + + + + Public network (default) + + + + + Local area network (intranet) + + + + + Confirm + + + + + The network is connected and can access the Internet normally. + + + + + The network is connected and access to the Internet is restricted. + + + + + Please enter the local area network (intranet) detection address + + + + + Format error + + + CreatNetPage @@ -1251,27 +1299,27 @@ EnterpriseWlanDialog - + Wi-Fi network requires authentication - + Access to Wi-Fi network " - + " requires a password or encryption key. - + Cancel - + Connect @@ -1279,22 +1327,22 @@ FirewallDialog - + Allow other devices on this network to discover this computer? - + It is not recommended to enable this feature on public networks - + Not allowed (recommended) - + Allowed @@ -1455,38 +1503,38 @@ LanListItem - + Not connected Bağlanamadı - + Wired Device not carried - - - + + + Disconnect Bağlantıyı Kes - - - + + + Connect - - + + Property - - + + Delete @@ -1494,7 +1542,7 @@ LanPage - + No ethernet device avaliable @@ -1519,23 +1567,23 @@ - + Wired Device not carried - - + + Connected: - + (Limited) - + Not Connected @@ -1556,7 +1604,7 @@ MainWindow - + kylin-nm @@ -1577,33 +1625,38 @@ Gizli Ağı Bağlan - + LAN - + WLAN WLAN - + Settings - - + + Network Connectivity Detection + + + + + Network tool - + Network Card - + Not connected to the network @@ -1620,9 +1673,8 @@ HotSpot - Show MainWindow - Ana Pencereyi Göster + Ana Pencereyi Göster Not connected @@ -1744,102 +1796,102 @@ - + Detail - + Security - - + + Config Ayar - + Confirm - + Cancel - + Forget this network - + IPv4 IPv6 adresi: {4?} - + IPv6 IPv6 adresi: {6?} - + Add LAN Connect - + Connect Hidden WLAN - + Delete this network - - - + + + None Yok - + Auto Oto - + start check ipv4 address conflict - + start check ipv6 address conflict - + this wifi no support enterprise type - + this wifi no support None type - + this wifi no support WPA2 type - + this wifi no support WPA3 type @@ -2354,42 +2406,42 @@ WlanListItem - + Not connected Bağlanamadı - - - - + + + + Disconnect Bağlantıyı Kes - - - - - + + + + + Connect - - + + Property - - + + Forget - + Auto Connect @@ -2420,12 +2472,12 @@ - + Connected: - + Not Connected diff --git a/src/translations/kylin-nm_zh_CN.ts b/src/translations/kylin-nm_zh_CN.ts index e0a10765..8d9efe4a 100644 --- a/src/translations/kylin-nm_zh_CN.ts +++ b/src/translations/kylin-nm_zh_CN.ts @@ -35,26 +35,74 @@ ConfigPage - + Network profile type 网络配置文件类型 - + Public(recommended) Devices on the network cannot discover this computer. Generally, it is suitable for networks in public places, such as airports or coffee shops, etc. 公用(推荐) 网络中的设备不可发现此电脑。一般情况下适用于公共场所中的网络,如机场或咖啡店等等。 - + Private Devices on the network can discover this computer. Generally applicable to a network at home or work where you know and trust the individuals and devices on the network. 专用 网络中的设备可发现此电脑。一般情况下适用于家庭或工作单位的网络,您认识并信任网络上的个人和设备。 - + Config firewall and security settings 配置防火墙和安全设置 + + ConnectivityPage + + + Network connectivity detection + 网络连通性检测 + + + + If access to the Internet is restricted, please switch the network IP connectivity detection method and try again. + 如访问 Internet 受限,请切换网络 IP 连通性检测方式后再试。 + + + + Public network (default) + 公网(默认) + + + + Local area network (intranet) + 局域网(内网) + + + + Confirm + 确定 + + + + The network is connected and can access the Internet normally. + 网络已连接,可正常访问 Internet 。 + + + + The network is connected and access to the Internet is restricted. + 网络已连接,访问 Internet 受限。 + + + + Please enter the local area network (intranet) detection address + 请输入局域网(内网)检测地址 + + + + Format error + 格式错误 + + CopyButton @@ -524,27 +572,27 @@ 关闭 - + Wi-Fi network requires authentication Wi-Fi 网络要求认证 - + Access to Wi-Fi network " 访问 Wi-Fi 网络 - + " requires a password or encryption key. 需要密码或加密密钥。 - + Cancel 取消 - + Connect 连接 @@ -568,22 +616,22 @@ - + Allow other devices on this network to discover this computer? 是否允许此网络上的其他设备发现这台电脑? - + It is not recommended to enable this feature on public networks 不建议在公共网络上开启此功能 - + Not allowed (recommended) 不允许(推荐) - + Allowed 允许 @@ -757,38 +805,38 @@ LanListItem - + Not connected 未连接 - + Wired Device not carried 未插入网线 - - - + + + Disconnect 断开 - - - + + + Connect 连接 - - + + Property 属性 - - + + Delete 删除此网络 @@ -796,7 +844,7 @@ LanPage - + No ethernet device avaliable 未检测到有线设备 @@ -825,7 +873,7 @@ 有线网络已断开 - + Wired Device not carried 未插入网线 @@ -834,18 +882,18 @@ 有线网络已连接 - - + + Connected: 已连接: - + Not Connected 未连接 - + (Limited) (网络受限) @@ -866,46 +914,50 @@ MainWindow - + kylin-nm 网络工具 - + LAN 有线网络 有线网络 - + WLAN 无线局域网 无线局域网 - Show MainWindow - 打开网络工具 + 打开网络工具 - + Settings 设置网络项 设置网络项 - - + + Network Connectivity Detection + 网络连通性检测 + + + + Network tool 网络工具 - + Network Card 网卡 - + Not connected to the network 未连接网络 @@ -941,22 +993,22 @@ 网络提示消息 - + Detail 详情 - + IPv4 IPv4 - + IPv6 IPv6 - + Security 安全 @@ -965,62 +1017,62 @@ 关闭 - - + + Config 配置 - + Confirm 确定 - + Cancel 取消 - + Forget this network 忘记此网络 - + Delete this network 删除此网络 - + Add LAN Connect 添加有线网络 - + Connect Hidden WLAN 连接到隐藏 WLAN - - - + + + None - + Auto 自动 - + start check ipv4 address conflict 开始检测 ipv4 地址冲突 - + start check ipv6 address conflict 开始检测 ipv6 地址冲突 @@ -1033,22 +1085,22 @@ ipv6地址冲突! - + this wifi no support enterprise type 此 wifi 不支持企业网类型 - + this wifi no support None type 此 wifi 不支持空类型 - + this wifi no support WPA2 type 此 wifi 不支持 WPA2 类型 - + this wifi no support WPA3 type 此 wifi 不支持 WPA3 类型 @@ -1452,42 +1504,42 @@ WlanListItem - + Not connected 未连接 - - - - + + + + Disconnect 断开 - - - - - + + + + + Connect 连接 - - + + Forget 忘记此网络 - - + + Property 属性 - + Auto Connect 自动加入该网络 @@ -1541,12 +1593,12 @@ 无线网络已断开 - + Connected: 已连接: - + Not Connected 未连接 From e98839feed9b6a63bfdbcec2f3ab6c1118579858 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Wed, 18 Oct 2023 14:20:36 +0800 Subject: [PATCH 13/16] fix(display):wayland display(#197411) --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c6aa7de9..c8726e5e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -134,7 +134,8 @@ int main(int argc, char *argv[]) sessionType = "x11"; display = getenv("DISPLAY"); } - qDebug() << display; + qDebug() << sessionType << display; + qApp->setProperty("sessionType", sessionType); QDBusInterface interface("com.kylin.network", "/com/kylin/network", From 9a8de3ed1a5fdeda6b6b56cc0ced25eea203ef7b Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Wed, 18 Oct 2023 14:54:12 +0800 Subject: [PATCH 14/16] update changelog --- debian/changelog | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4967b8bd..c35b9d95 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +kylin-nm (3.25.0.0-0k0.1) v101; urgency=medium + + * BUG: + * 需求号: + - #23928 仅支持单一网络功能、单网卡时界面显示优化 + * 其他改动说明: + * 其他改动影响域:控制面板 托盘tab页 + + -- zhaoshixu Wed, 18 Oct 2023 14:47:09 +0800 + +kylin-nm (3.24.0.0-0k2.23) v101; urgency=medium + + * BUG: + - #197411 【网络连接】点击控制面板-有线网络界面内"添加有线网络"和属性按钮无反应 + * 需求号:无 + * 其他改动说明: + * 其他改动影响域:wayland环境下控制面板唤出网络界面 + + -- zhaoshixu Tue, 17 Oct 2023 17:26:48 +0800 + kylin-nm (3.24.0.0-0k2.22) v101; urgency=medium * BUG: From aae488426c2c347b1cf2b7e0f3db458c5f28808a Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Wed, 1 Nov 2023 10:38:24 +0800 Subject: [PATCH 15/16] =?UTF-8?q?fix(icon):=E4=BF=AE=E6=94=B9=E5=86=85?= =?UTF-8?q?=E7=BD=91=E6=A3=80=E6=B5=8B=E5=9C=B0=E5=9D=80=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=9B=B8=E5=BA=94=E5=8F=98=E5=8C=96(#197648)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dbus-interface/kylinconnectresource.cpp | 1 + src/backend/dbus-interface/kylinconnectresource.h | 1 + .../dbus-interface/kylinnetworkresourcemanager.cpp | 6 ++++++ .../dbus-interface/kylinnetworkresourcemanager.h | 1 + src/frontend/mainwindow.cpp | 14 ++++++++++++++ src/frontend/mainwindow.h | 1 + src/frontend/tab-pages/wlanpage.cpp | 1 + src/frontend/tab-pages/wlanpage.h | 1 + 8 files changed, 26 insertions(+) diff --git a/src/backend/dbus-interface/kylinconnectresource.cpp b/src/backend/dbus-interface/kylinconnectresource.cpp index dea6d572..0c04e8e1 100644 --- a/src/backend/dbus-interface/kylinconnectresource.cpp +++ b/src/backend/dbus-interface/kylinconnectresource.cpp @@ -81,6 +81,7 @@ KyConnectResourse::KyConnectResourse(QObject *parent) : QObject(parent) connect(m_networkResourceInstance, &KyNetworkResourceManager::connectionUpdate, this, &KyConnectResourse::connectionUpdate); connect(m_networkResourceInstance, &KyNetworkResourceManager::connectivityChanged, this, &KyConnectResourse::connectivityChanged); + connect(m_networkResourceInstance, &KyNetworkResourceManager::connectivityCheckSpareUriChanged, this, &KyConnectResourse::connectivityCheckSpareUriChanged); connect(m_networkResourceInstance, &KyNetworkResourceManager::needShowDesktop, this, &KyConnectResourse::needShowDesktop); } diff --git a/src/backend/dbus-interface/kylinconnectresource.h b/src/backend/dbus-interface/kylinconnectresource.h index 3ab29bd2..0af9c4b5 100644 --- a/src/backend/dbus-interface/kylinconnectresource.h +++ b/src/backend/dbus-interface/kylinconnectresource.h @@ -86,6 +86,7 @@ Q_SIGNALS: void connectionUpdate(QString uuid); void connectionRemove(QString path); void connectivityChanged(NetworkManager::Connectivity connectivity); + void connectivityCheckSpareUriChanged(); void needShowDesktop(QString); diff --git a/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp b/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp index 71c3a9b9..a9fcdd8e 100644 --- a/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp +++ b/src/backend/dbus-interface/kylinnetworkresourcemanager.cpp @@ -598,6 +598,12 @@ void KyNetworkResourceManager::onPropertiesChanged(QVariantMap qvm) Q_EMIT wiredEnabledChanged(wiredEnable); } } + for(QString keyStr : qvm.keys()) { + //内网检测地址变化 + if (keyStr == "ConnectivityCheckSpareUri") { + Q_EMIT connectivityCheckSpareUriChanged(); + } + } } void KyNetworkResourceManager::onConnectionUpdated() diff --git a/src/backend/dbus-interface/kylinnetworkresourcemanager.h b/src/backend/dbus-interface/kylinnetworkresourcemanager.h index 9cf59896..ad8c4bf0 100644 --- a/src/backend/dbus-interface/kylinnetworkresourcemanager.h +++ b/src/backend/dbus-interface/kylinnetworkresourcemanager.h @@ -129,6 +129,7 @@ Q_SIGNALS: void wifiNetworkDeviceDisappear(); void wifiEnabledChanged(bool); void wiredEnabledChanged(bool); + void connectivityCheckSpareUriChanged(); void activeConnectionsReset(); void activeConnectionAdd(QString uuid); diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 52f21fc4..2818b874 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -400,6 +400,7 @@ void MainWindow::initDbusConnnect() connect(m_wlanWidget, &WlanPage::timeToUpdate , this, &MainWindow::onTimeUpdateTrayIcon); connect(m_wlanWidget, &WlanPage::showMainWindow, this, &MainWindow::onShowMainWindow); connect(m_wlanWidget, &WlanPage::connectivityChanged, this, &MainWindow::onConnectivityChanged); + connect(m_wlanWidget, &WlanPage::connectivityCheckSpareUriChanged, this, &MainWindow::onConnectivityCheckSpareUriChanged); connect(m_lanWidget, &LanPage::lanConnectChanged, this, &MainWindow::onRefreshTrayIconTooltip); connect(m_lanWidget, &LanPage::deviceStatusChanged, this, &MainWindow::onRefreshTrayIconTooltip); @@ -901,6 +902,19 @@ void MainWindow::onConnectivityChanged(NetworkManager::Connectivity connectivity onRefreshTrayIcon(); } +void MainWindow::onConnectivityCheckSpareUriChanged() +{ + if (!m_trayIcon) { + return; + } + + if (iconStatus == ACTIVATING) { + return; + } + + onRefreshTrayIcon(); +} + void MainWindow::onTimeUpdateTrayIcon() { if (!m_trayIcon) { diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index d033bb7d..d2265735 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -226,6 +226,7 @@ private Q_SLOTS: void onLanConnectStatusToChangeTrayIcon(int state); void onWlanConnectStatusToChangeTrayIcon(int state); void onConnectivityChanged(NetworkManager::Connectivity connectivity); + void onConnectivityCheckSpareUriChanged(); void onTimeUpdateTrayIcon(); void onTabletModeChanged(bool mode); void onRefreshTrayIconTooltip(); diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index fc5aecf2..8114d15e 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -81,6 +81,7 @@ WlanPage::WlanPage(QWidget *parent) : TabPage(parent) connect(m_wirelessConnectOpreation, &KyWirelessConnectOperation::wifiEnabledChanged, this, &WlanPage::onWifiEnabledChanged); connect(m_connectResource, &KyConnectResourse::connectivityChanged, this, &WlanPage::connectivityChanged); + connect(m_connectResource, &KyConnectResourse::connectivityCheckSpareUriChanged, this, &WlanPage::connectivityCheckSpareUriChanged); connect(m_netSwitch, &KSwitchButton::clicked, this, [=](bool checked) { //解决 switchBtn不支持点击的情况下,点击按钮,有无线网卡后不自动开启的问题 if (getSwitchBtnEnable()) { diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index 85256044..27bd5fcc 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -104,6 +104,7 @@ Q_SIGNALS: void showMainWindow(int type); void connectivityChanged(NetworkManager::Connectivity connectivity); + void connectivityCheckSpareUriChanged(); void wirelessSwitchBtnChanged(bool state); From 855f4780d0af21eee65acf61f24f8d15bd259570 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Wed, 1 Nov 2023 15:34:22 +0800 Subject: [PATCH 16/16] update changelog --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index c35b9d95..7d992cee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +kylin-nm (3.25.0.0-0k1.1) v101; urgency=medium + + * BUG:无 + * 需求号: + - #23680 网络连通性检测地址调整+内网连通性检测功能 + * 其他改动说明: + *其他改动影响域:自身 + + -- zhaoshixu Wed, 01 Nov 2023 15:29:41 +0800 + kylin-nm (3.25.0.0-0k0.1) v101; urgency=medium * BUG: