From 87f8583153f3fe77434228dc5ee7e209a2d715bd Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Mon, 26 Jun 2023 16:52:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E9=9D=A2=E6=9D=BF=E5=9F=8B?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/control | 1 + plugins/mobilehotspot/mobilehotspotwidget.cpp | 16 ++++++++++++++-- plugins/mobilehotspot/mobilehotspotwidget.h | 2 ++ plugins/netconnect/netconnect.cpp | 6 ++++++ plugins/netconnect/netconnect.h | 2 ++ plugins/proxy/proxy.cpp | 7 +++++++ plugins/proxy/proxy.h | 2 ++ plugins/vpn/vpn.cpp | 5 +++++ plugins/vpn/vpn.h | 3 +++ plugins/wlanconnect/wlanconnect.cpp | 4 ++++ plugins/wlanconnect/wlanconnect.h | 2 ++ 11 files changed, 48 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 5a461d49..31c0e88f 100644 --- a/debian/control +++ b/debian/control @@ -26,6 +26,7 @@ Build-Depends: debhelper (>=9), libkysdk-qtwidgets-dev(>= 1.2.0), libkysdk-sysinfo-dev, libkysdk-waylandhelper-dev(>= 1.2.0kylin2), + libkysdk-diagnostics-dev, libkysec-dev, Standards-Version: 4.5.0 Rules-Requires-Root: no diff --git a/plugins/mobilehotspot/mobilehotspotwidget.cpp b/plugins/mobilehotspot/mobilehotspotwidget.cpp index df0b6985..ff05d975 100644 --- a/plugins/mobilehotspot/mobilehotspotwidget.cpp +++ b/plugins/mobilehotspot/mobilehotspotwidget.cpp @@ -116,6 +116,7 @@ MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent) connect(m_switchBtn, &KSwitchButton::stateChanged, this, &MobileHotspotWidget::setUiEnabled); connect(m_interfaceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &MobileHotspotWidget::onInterfaceChanged); connect(m_interfaceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=]() { + UkccCommon::buriedSettings("MobileHotspot", "select", QString("Net card")); m_interfaceName = m_interfaceComboBox->currentText(); updateBandCombox(); }); @@ -151,6 +152,7 @@ bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event) showDesktopNotify(tr("wirless switch is close or no wireless device")); return true; } + UkccCommon::buriedSettings("MobileHotspot", "Open", QString("settings"), !m_switchBtn->isChecked() ? "true":"false"); if (m_switchBtn->isChecked()) { // showDesktopNotify(tr("start to close hotspot")); QDBusReply reply = m_interface->call("deactiveWirelessAp", m_apNameLine->text(), m_uuid); @@ -465,7 +467,11 @@ void MobileHotspotWidget::getApInfo() } int i = m_freqBandComboBox->findText(apInfo.at(5)); if (i >= 0) { + disconnect(m_freqBandComboBox); m_freqBandComboBox->setCurrentIndex(i); + connect(m_freqBandComboBox, QOverload::of(&QComboBox::currentIndexChanged), [=](){ + UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText()); + }); } } else { qDebug() << LOG_HEAD << "no such interface " << apInfo.at(2); @@ -731,15 +737,17 @@ void MobileHotspotWidget::onHotspotActivated(QString devName, QString ssid, QStr updateBandCombox(); index = m_freqBandComboBox->findText(info.at(1)); if (index >= 0) { + disconnect(m_freqBandComboBox); m_freqBandComboBox->setCurrentIndex(index); + connect(m_freqBandComboBox, QOverload::of(&QComboBox::currentIndexChanged), [=](){ + UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText()); + }); } m_uuid = uuid; } else { qDebug() << "no such device in combo box"; } } - - } bool MobileHotspotWidget::getApInfoBySsid(QString devName, QString ssid, QStringList &info) @@ -813,6 +821,7 @@ void MobileHotspotWidget::updateBandCombox() setWidgetHidden(true); return; } + disconnect(m_freqBandComboBox); QMap devCapMap = capReply.value(); if (devCapMap[m_interfaceName] & 0x02) { m_freqBandComboBox->addItem("2.4GHz"); @@ -824,6 +833,9 @@ void MobileHotspotWidget::updateBandCombox() if (index >= 0) { m_freqBandComboBox->setCurrentIndex(index); } + connect(m_freqBandComboBox, QOverload::of(&QComboBox::currentIndexChanged), [=](){ + UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText()); + }); } QFrame* MobileHotspotWidget::myLine() diff --git a/plugins/mobilehotspot/mobilehotspotwidget.h b/plugins/mobilehotspot/mobilehotspotwidget.h index d297194a..d354ce8a 100644 --- a/plugins/mobilehotspot/mobilehotspotwidget.h +++ b/plugins/mobilehotspot/mobilehotspotwidget.h @@ -47,8 +47,10 @@ #include "blacklistpage.h" #include "connectdevpage.h" #include "fixlabel.h" +#include "ukcccommon.h" using namespace kdk; +using namespace ukcc; class MobileHotspotWidget : public QWidget { diff --git a/plugins/netconnect/netconnect.cpp b/plugins/netconnect/netconnect.cpp index 71bb66ee..0368fca3 100644 --- a/plugins/netconnect/netconnect.cpp +++ b/plugins/netconnect/netconnect.cpp @@ -168,6 +168,7 @@ bool NetConnect::eventFilter(QObject *w, QEvent *e) { if (!wiredSwitch->isCheckable()) { showDesktopNotify(tr("No ethernet device avaliable")); } else { + UkccCommon::buriedSettings(QString("netconnect"), QString("Open"), QString("settings"),wiredSwitch->isChecked()?"false":"true"); if (m_interface != nullptr && m_interface->isValid()) { m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked()); } @@ -237,6 +238,7 @@ void NetConnect::initComponent() { connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) { Q_UNUSED(checked) + UkccCommon::buriedSettings(QString("netconnect"), QString("Advanced settings"), QString("clicked")); runExternalApp(); }); } @@ -453,6 +455,7 @@ void NetConnect::addLanItem(ItemFrame *frame, QString devName, QStringList infoL if (m_interface == nullptr || !m_interface->isValid()) { return; } + UkccCommon::buriedSettings(QString("netconnect"), QString("info"), QString("clicked")); qDebug() << "[NetConnect]call showPropertyWidget" << __LINE__; m_interface->call(QStringLiteral("showPropertyWidget"), devName, infoList.at(1)); qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__; @@ -515,6 +518,7 @@ void NetConnect::addDeviceFrame(QString devName) qDebug() << "[NetConnect]deviceFrameMap insert" << devName; connect(itemFrame->deviceFrame, &DeviceFrame::deviceSwitchClicked ,this, [=] (bool checked) { + UkccCommon::buriedSettings(QString("netconnect"), "device open", QString("settings"), checked?"true":"fasle"); qDebug() << "[NetConnect]call setDeviceEnable" << devName << checked << __LINE__; m_interface->call(QStringLiteral("setDeviceEnable"), devName, checked); qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__; @@ -539,6 +543,7 @@ void NetConnect::addDeviceFrame(QString devName) }); connect(itemFrame->addLanWidget, &AddNetBtn::clicked, this, [=](){ + UkccCommon::buriedSettings(pluginName, "Add net", QString("clicked")); if (m_interface != nullptr && m_interface->isValid()) { qDebug() << "[NetConnect]call showCreateWiredConnectWidget" << devName << __LINE__; m_interface->call(QStringLiteral("showCreateWiredConnectWidget"), devName); @@ -739,6 +744,7 @@ void NetConnect::addOneLanFrame(ItemFrame *frame, QString deviceName, QStringLis if (m_interface == nullptr || !m_interface->isValid()) { return; } + UkccCommon::buriedSettings(QString("netconnect"), QString("info"), QString("clicked")); qDebug() << "[NetConnect]call showPropertyWidget" << deviceName << connUuid << __LINE__; m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, connUuid); qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__; diff --git a/plugins/netconnect/netconnect.h b/plugins/netconnect/netconnect.h index f991540f..7fbc9814 100644 --- a/plugins/netconnect/netconnect.h +++ b/plugins/netconnect/netconnect.h @@ -54,8 +54,10 @@ #include "itemframe.h" #include "kwidget.h" #include "kswitchbutton.h" +#include "ukcccommon.h" using namespace kdk; +using namespace ukcc; enum { DISCONNECTED, diff --git a/plugins/proxy/proxy.cpp b/plugins/proxy/proxy.cpp index 31db8f82..22c88936 100644 --- a/plugins/proxy/proxy.cpp +++ b/plugins/proxy/proxy.cpp @@ -520,6 +520,7 @@ void Proxy::setupComponent(){ void Proxy::setupConnect(){ connect(mEnableBtn, &KSwitchButton::stateChanged, this ,[=](bool checked) { + UkccCommon::buriedSettings(QString("Proxy"), QString("System Proxy Open"), QString("settings"), checked?"true":"false"); mSelectFrame->setVisible(checked); line_8->setVisible(checked); mAutoBtn->setChecked(checked); @@ -533,9 +534,11 @@ void Proxy::setupConnect(){ connect(mProxyBtnGroup, QOverload::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){ if (eBtn == mAutoBtn) { + UkccCommon::buriedSettings(QString("Proxy"), QString("auto"), QString("clicked")); mManualBtn->setChecked(false); proxysettings->set(PROXY_MODE_KEY,"auto"); } else if (eBtn == mManualBtn){ + UkccCommon::buriedSettings(QString("Proxy"), QString("manual"), QString("clicked")); mAutoBtn->setChecked(false); proxysettings->set(PROXY_MODE_KEY,"manual"); } @@ -560,6 +563,7 @@ void Proxy::setupConnect(){ }); connect(mAptBtn , &KSwitchButton::stateChanged, this ,[=](bool checked){ + UkccCommon::buriedSettings(QString("Proxy"), QString("Apt Proxy Open"), QString("settings"), checked?"true":"false"); if (checked) { emit mEditBtn->click(); } else { // 关闭APT代理,删除对应的配置文件 @@ -1149,6 +1153,9 @@ void Proxy::setAppProxyFrameUi(QWidget *widget) connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::onappProxyEnableChanged); connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyState); + connect(m_appEnableBtn, &KSwitchButton::stateChanged, [=](bool checked) { + UkccCommon::buriedSettings(QString("Proxy"), QString("App Proxy Open"), QString("settings"), checked?"true":"false"); + }); connect(m_proxyTypeComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onAppProxyConfChanged())); connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onipEditStateChanged())); connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onAppProxyConfChanged())); diff --git a/plugins/proxy/proxy.h b/plugins/proxy/proxy.h index 6d690847..ed005e98 100644 --- a/plugins/proxy/proxy.h +++ b/plugins/proxy/proxy.h @@ -52,8 +52,10 @@ #include "kswitchbutton.h" #include "kpasswordedit.h" +#include "ukcccommon.h" using namespace kdk; +using namespace ukcc; /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 diff --git a/plugins/vpn/vpn.cpp b/plugins/vpn/vpn.cpp index 3b212942..83885255 100644 --- a/plugins/vpn/vpn.cpp +++ b/plugins/vpn/vpn.cpp @@ -188,6 +188,7 @@ void Vpn::initComponent(){ ui->verticalLayout_3->addWidget(m_listFrame); connect(m_listFrame->m_addVpnWidget, &AddNetBtn::clicked, this, [=]() { + UkccCommon::buriedSettings(QString("VPN"), QString("Add VPN"), QString("clicked")); runExternalApp(); }); @@ -212,6 +213,10 @@ void Vpn::initComponent(){ } }); + connect(m_showBtn, &KSwitchButton::clicked, this, [=](bool checked){ + UkccCommon::buriedSettings(QString("VPN"), QString("Show on Taskbar"), QString("settings"), checked ? "true":"false"); + }); + // connect(m_timeBtn, &KSwitchButton::stateChanged, this, [=](bool state){ // if (m_switchGsettings != nullptr) { // m_switchGsettings->set(VISIBLE, state); diff --git a/plugins/vpn/vpn.h b/plugins/vpn/vpn.h index 78e78258..efbb2f30 100644 --- a/plugins/vpn/vpn.h +++ b/plugins/vpn/vpn.h @@ -32,8 +32,11 @@ #include "kwidget.h" #include "kswitchbutton.h" #include "itemframe.h" +#include "ukcccommon.h" using namespace kdk; +using namespace ukcc; + namespace Ui { class Vpn; diff --git a/plugins/wlanconnect/wlanconnect.cpp b/plugins/wlanconnect/wlanconnect.cpp index 5ce2f20c..82b5a626 100644 --- a/plugins/wlanconnect/wlanconnect.cpp +++ b/plugins/wlanconnect/wlanconnect.cpp @@ -227,6 +227,7 @@ bool WlanConnect::eventFilter(QObject *w, QEvent *e) { if (!getSwitchBtnEnable()) { showDesktopNotify(tr("No wireless network card detected")); } else { + UkccCommon::buriedSettings(QString("wlanconnect"), QString("Open"), QString("settings"),!getSwitchBtnState()?"true":"false"); if (m_interface != nullptr && m_interface->isValid()) { m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !getSwitchBtnState()); } @@ -283,6 +284,7 @@ void WlanConnect::initComponent() { //高级设置 connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) { Q_UNUSED(checked) + UkccCommon::buriedSettings(QString("wlanconnect"), QString("Advanced settings"), QString("clicked")); runExternalApp(); }); @@ -971,6 +973,7 @@ void WlanConnect::addDeviceFrame(QString devName) deviceFrameMap.insert(devName, itemFrame); connect(itemFrame->addWlanWidget, &AddNetBtn::clicked, this, [=](){ + UkccCommon::buriedSettings(QString("wlanconnect"), QString("Add wlan"), QString("clicked")); if (m_interface != nullptr && m_interface->isValid()) { qDebug() << "[NetConnect]call showAddOtherWlanWidget" << devName << __LINE__; m_interface->call(QStringLiteral("showAddOtherWlanWidget"), devName); @@ -1042,6 +1045,7 @@ void WlanConnect::addOneWlanFrame(ItemFrame *frame, QString deviceName, QString if (m_interface == nullptr || !m_interface->isValid()) { return; } + UkccCommon::buriedSettings(QString("wlanconnect"), QString("info"), QString("clicked")); qDebug() << "[WlanConnect]call showPropertyWidget" << __LINE__; m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, name); qDebug() << "[WlanConnect]call showPropertyWidget respond" << __LINE__; diff --git a/plugins/wlanconnect/wlanconnect.h b/plugins/wlanconnect/wlanconnect.h index 38bff337..734dc0d7 100644 --- a/plugins/wlanconnect/wlanconnect.h +++ b/plugins/wlanconnect/wlanconnect.h @@ -47,8 +47,10 @@ #include "wlanitem.h" #include "kwidget.h" #include "kswitchbutton.h" +#include "ukcccommon.h" using namespace kdk; +using namespace ukcc; namespace Ui { class WlanConnect;