Merge branch 'maidian' into 'yhkylin/v101'

控制面板埋点

See merge request kylinos-src/kylin-nm!195
This commit is contained in:
赵世旭 2023-06-26 08:56:39 +00:00
commit 6b2c27c7c5
11 changed files with 48 additions and 2 deletions

1
debian/control vendored
View File

@ -26,6 +26,7 @@ Build-Depends: debhelper (>=9),
libkysdk-qtwidgets-dev(>= 1.2.0), libkysdk-qtwidgets-dev(>= 1.2.0),
libkysdk-sysinfo-dev, libkysdk-sysinfo-dev,
libkysdk-waylandhelper-dev(>= 1.2.0kylin2), libkysdk-waylandhelper-dev(>= 1.2.0kylin2),
libkysdk-diagnostics-dev,
libkysec-dev, libkysec-dev,
Standards-Version: 4.5.0 Standards-Version: 4.5.0
Rules-Requires-Root: no Rules-Requires-Root: no

View File

@ -116,6 +116,7 @@ MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent)
connect(m_switchBtn, &KSwitchButton::stateChanged, this, &MobileHotspotWidget::setUiEnabled); connect(m_switchBtn, &KSwitchButton::stateChanged, this, &MobileHotspotWidget::setUiEnabled);
connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MobileHotspotWidget::onInterfaceChanged); connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MobileHotspotWidget::onInterfaceChanged);
connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]() { connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]() {
UkccCommon::buriedSettings("MobileHotspot", "select", QString("Net card"));
m_interfaceName = m_interfaceComboBox->currentText(); m_interfaceName = m_interfaceComboBox->currentText();
updateBandCombox(); updateBandCombox();
}); });
@ -151,6 +152,7 @@ bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event)
showDesktopNotify(tr("wirless switch is close or no wireless device")); showDesktopNotify(tr("wirless switch is close or no wireless device"));
return true; return true;
} }
UkccCommon::buriedSettings("MobileHotspot", "Open", QString("settings"), !m_switchBtn->isChecked() ? "true":"false");
if (m_switchBtn->isChecked()) { if (m_switchBtn->isChecked()) {
// showDesktopNotify(tr("start to close hotspot")); // showDesktopNotify(tr("start to close hotspot"));
QDBusReply<void> reply = m_interface->call("deactiveWirelessAp", m_apNameLine->text(), m_uuid); QDBusReply<void> 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)); int i = m_freqBandComboBox->findText(apInfo.at(5));
if (i >= 0) { if (i >= 0) {
disconnect(m_freqBandComboBox);
m_freqBandComboBox->setCurrentIndex(i); m_freqBandComboBox->setCurrentIndex(i);
connect(m_freqBandComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](){
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
});
} }
} else { } else {
qDebug() << LOG_HEAD << "no such interface " << apInfo.at(2); qDebug() << LOG_HEAD << "no such interface " << apInfo.at(2);
@ -726,15 +732,17 @@ void MobileHotspotWidget::onHotspotActivated(QString devName, QString ssid, QStr
updateBandCombox(); updateBandCombox();
index = m_freqBandComboBox->findText(info.at(1)); index = m_freqBandComboBox->findText(info.at(1));
if (index >= 0) { if (index >= 0) {
disconnect(m_freqBandComboBox);
m_freqBandComboBox->setCurrentIndex(index); m_freqBandComboBox->setCurrentIndex(index);
connect(m_freqBandComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](){
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
});
} }
m_uuid = uuid; m_uuid = uuid;
} else { } else {
qDebug() << "no such device in combo box"; qDebug() << "no such device in combo box";
} }
} }
} }
bool MobileHotspotWidget::getApInfoBySsid(QString devName, QString ssid, QStringList &info) bool MobileHotspotWidget::getApInfoBySsid(QString devName, QString ssid, QStringList &info)
@ -808,6 +816,7 @@ void MobileHotspotWidget::updateBandCombox()
setWidgetHidden(true); setWidgetHidden(true);
return; return;
} }
disconnect(m_freqBandComboBox);
QMap<QString, int> devCapMap = capReply.value(); QMap<QString, int> devCapMap = capReply.value();
if (devCapMap[m_interfaceName] & 0x02) { if (devCapMap[m_interfaceName] & 0x02) {
m_freqBandComboBox->addItem("2.4GHz"); m_freqBandComboBox->addItem("2.4GHz");
@ -819,6 +828,9 @@ void MobileHotspotWidget::updateBandCombox()
if (index >= 0) { if (index >= 0) {
m_freqBandComboBox->setCurrentIndex(index); m_freqBandComboBox->setCurrentIndex(index);
} }
connect(m_freqBandComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](){
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
});
} }
QFrame* MobileHotspotWidget::myLine() QFrame* MobileHotspotWidget::myLine()

View File

@ -47,8 +47,10 @@
#include "blacklistpage.h" #include "blacklistpage.h"
#include "connectdevpage.h" #include "connectdevpage.h"
#include "fixlabel.h" #include "fixlabel.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
class MobileHotspotWidget : public QWidget class MobileHotspotWidget : public QWidget
{ {

View File

@ -168,6 +168,7 @@ bool NetConnect::eventFilter(QObject *w, QEvent *e) {
if (!wiredSwitch->isCheckable()) { if (!wiredSwitch->isCheckable()) {
showDesktopNotify(tr("No ethernet device avaliable")); showDesktopNotify(tr("No ethernet device avaliable"));
} else { } else {
UkccCommon::buriedSettings(QString("netconnect"), QString("Open"), QString("settings"),wiredSwitch->isChecked()?"false":"true");
if (m_interface != nullptr && m_interface->isValid()) { if (m_interface != nullptr && m_interface->isValid()) {
m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked()); m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked());
} }
@ -237,6 +238,7 @@ void NetConnect::initComponent() {
connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) { connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) {
Q_UNUSED(checked) Q_UNUSED(checked)
UkccCommon::buriedSettings(QString("netconnect"), QString("Advanced settings"), QString("clicked"));
runExternalApp(); runExternalApp();
}); });
} }
@ -453,6 +455,7 @@ void NetConnect::addLanItem(ItemFrame *frame, QString devName, QStringList infoL
if (m_interface == nullptr || !m_interface->isValid()) { if (m_interface == nullptr || !m_interface->isValid()) {
return; return;
} }
UkccCommon::buriedSettings(QString("netconnect"), QString("info"), QString("clicked"));
qDebug() << "[NetConnect]call showPropertyWidget" << __LINE__; qDebug() << "[NetConnect]call showPropertyWidget" << __LINE__;
m_interface->call(QStringLiteral("showPropertyWidget"), devName, infoList.at(1)); m_interface->call(QStringLiteral("showPropertyWidget"), devName, infoList.at(1));
qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__; qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__;
@ -515,6 +518,7 @@ void NetConnect::addDeviceFrame(QString devName)
qDebug() << "[NetConnect]deviceFrameMap insert" << devName; qDebug() << "[NetConnect]deviceFrameMap insert" << devName;
connect(itemFrame->deviceFrame, &DeviceFrame::deviceSwitchClicked ,this, [=] (bool checked) { 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__; qDebug() << "[NetConnect]call setDeviceEnable" << devName << checked << __LINE__;
m_interface->call(QStringLiteral("setDeviceEnable"), devName, checked); m_interface->call(QStringLiteral("setDeviceEnable"), devName, checked);
qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__; qDebug() << "[NetConnect]call setDeviceEnable Respond" << __LINE__;
@ -539,6 +543,7 @@ void NetConnect::addDeviceFrame(QString devName)
}); });
connect(itemFrame->addLanWidget, &AddNetBtn::clicked, this, [=](){ connect(itemFrame->addLanWidget, &AddNetBtn::clicked, this, [=](){
UkccCommon::buriedSettings(pluginName, "Add net", QString("clicked"));
if (m_interface != nullptr && m_interface->isValid()) { if (m_interface != nullptr && m_interface->isValid()) {
qDebug() << "[NetConnect]call showCreateWiredConnectWidget" << devName << __LINE__; qDebug() << "[NetConnect]call showCreateWiredConnectWidget" << devName << __LINE__;
m_interface->call(QStringLiteral("showCreateWiredConnectWidget"), devName); 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()) { if (m_interface == nullptr || !m_interface->isValid()) {
return; return;
} }
UkccCommon::buriedSettings(QString("netconnect"), QString("info"), QString("clicked"));
qDebug() << "[NetConnect]call showPropertyWidget" << deviceName << connUuid << __LINE__; qDebug() << "[NetConnect]call showPropertyWidget" << deviceName << connUuid << __LINE__;
m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, connUuid); m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, connUuid);
qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__; qDebug() << "[NetConnect]call showPropertyWidget respond" << __LINE__;

View File

@ -54,8 +54,10 @@
#include "itemframe.h" #include "itemframe.h"
#include "kwidget.h" #include "kwidget.h"
#include "kswitchbutton.h" #include "kswitchbutton.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
enum { enum {
DISCONNECTED, DISCONNECTED,

View File

@ -528,6 +528,7 @@ void Proxy::setupComponent(){
void Proxy::setupConnect(){ void Proxy::setupConnect(){
connect(mEnableBtn, &KSwitchButton::stateChanged, this ,[=](bool checked) { connect(mEnableBtn, &KSwitchButton::stateChanged, this ,[=](bool checked) {
UkccCommon::buriedSettings(QString("Proxy"), QString("System Proxy Open"), QString("settings"), checked?"true":"false");
mSelectFrame->setVisible(checked); mSelectFrame->setVisible(checked);
line_8->setVisible(checked); line_8->setVisible(checked);
mAutoBtn->setChecked(checked); mAutoBtn->setChecked(checked);
@ -541,9 +542,11 @@ void Proxy::setupConnect(){
connect(mProxyBtnGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){ connect(mProxyBtnGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){
if (eBtn == mAutoBtn) { if (eBtn == mAutoBtn) {
UkccCommon::buriedSettings(QString("Proxy"), QString("auto"), QString("clicked"));
mManualBtn->setChecked(false); mManualBtn->setChecked(false);
proxysettings->set(PROXY_MODE_KEY,"auto"); proxysettings->set(PROXY_MODE_KEY,"auto");
} else if (eBtn == mManualBtn){ } else if (eBtn == mManualBtn){
UkccCommon::buriedSettings(QString("Proxy"), QString("manual"), QString("clicked"));
mAutoBtn->setChecked(false); mAutoBtn->setChecked(false);
proxysettings->set(PROXY_MODE_KEY,"manual"); proxysettings->set(PROXY_MODE_KEY,"manual");
} }
@ -568,6 +571,7 @@ void Proxy::setupConnect(){
}); });
connect(mAptBtn , &KSwitchButton::stateChanged, this ,[=](bool checked){ connect(mAptBtn , &KSwitchButton::stateChanged, this ,[=](bool checked){
UkccCommon::buriedSettings(QString("Proxy"), QString("Apt Proxy Open"), QString("settings"), checked?"true":"false");
if (checked) { if (checked) {
emit mEditBtn->click(); emit mEditBtn->click();
} else { // 关闭APT代理删除对应的配置文件 } else { // 关闭APT代理删除对应的配置文件
@ -1205,6 +1209,9 @@ void Proxy::setAppProxyFrameUi(QWidget *widget)
connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyUiEnable); connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyUiEnable);
connect(m_appEnableBtn, &KSwitchButton::stateChanged, this, &Proxy::setAppProxyState); 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_proxyTypeComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onAppProxyConfChanged()));
connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onipEditStateChanged())); connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onipEditStateChanged()));
connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onAppProxyConfChanged())); connect(m_ipAddressLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onAppProxyConfChanged()));

View File

@ -52,8 +52,10 @@
#include "kswitchbutton.h" #include "kswitchbutton.h"
#include "kpasswordedit.h" #include "kpasswordedit.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
/* qt会将glib里的signals成员识别为宏所以取消该宏 /* qt会将glib里的signals成员识别为宏所以取消该宏
* signals时使Q_SIGNALS代替即可 * signals时使Q_SIGNALS代替即可

View File

@ -188,6 +188,7 @@ void Vpn::initComponent(){
ui->verticalLayout_3->addWidget(m_listFrame); ui->verticalLayout_3->addWidget(m_listFrame);
connect(m_listFrame->m_addVpnWidget, &AddNetBtn::clicked, this, [=]() { connect(m_listFrame->m_addVpnWidget, &AddNetBtn::clicked, this, [=]() {
UkccCommon::buriedSettings(QString("VPN"), QString("Add VPN"), QString("clicked"));
runExternalApp(); 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){ // connect(m_timeBtn, &KSwitchButton::stateChanged, this, [=](bool state){
// if (m_switchGsettings != nullptr) { // if (m_switchGsettings != nullptr) {
// m_switchGsettings->set(VISIBLE, state); // m_switchGsettings->set(VISIBLE, state);

View File

@ -32,8 +32,11 @@
#include "kwidget.h" #include "kwidget.h"
#include "kswitchbutton.h" #include "kswitchbutton.h"
#include "itemframe.h" #include "itemframe.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
namespace Ui { namespace Ui {
class Vpn; class Vpn;

View File

@ -227,6 +227,7 @@ bool WlanConnect::eventFilter(QObject *w, QEvent *e) {
if (!getSwitchBtnEnable()) { if (!getSwitchBtnEnable()) {
showDesktopNotify(tr("No wireless network card detected")); showDesktopNotify(tr("No wireless network card detected"));
} else { } else {
UkccCommon::buriedSettings(QString("wlanconnect"), QString("Open"), QString("settings"),!getSwitchBtnState()?"true":"false");
if (m_interface != nullptr && m_interface->isValid()) { if (m_interface != nullptr && m_interface->isValid()) {
m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !getSwitchBtnState()); m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !getSwitchBtnState());
} }
@ -283,6 +284,7 @@ void WlanConnect::initComponent() {
//高级设置 //高级设置
connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) { connect(ui->detailBtn, &QPushButton::clicked, this, [=](bool checked) {
Q_UNUSED(checked) Q_UNUSED(checked)
UkccCommon::buriedSettings(QString("wlanconnect"), QString("Advanced settings"), QString("clicked"));
runExternalApp(); runExternalApp();
}); });
@ -971,6 +973,7 @@ void WlanConnect::addDeviceFrame(QString devName)
deviceFrameMap.insert(devName, itemFrame); deviceFrameMap.insert(devName, itemFrame);
connect(itemFrame->addWlanWidget, &AddNetBtn::clicked, this, [=](){ connect(itemFrame->addWlanWidget, &AddNetBtn::clicked, this, [=](){
UkccCommon::buriedSettings(QString("wlanconnect"), QString("Add wlan"), QString("clicked"));
if (m_interface != nullptr && m_interface->isValid()) { if (m_interface != nullptr && m_interface->isValid()) {
qDebug() << "[NetConnect]call showAddOtherWlanWidget" << devName << __LINE__; qDebug() << "[NetConnect]call showAddOtherWlanWidget" << devName << __LINE__;
m_interface->call(QStringLiteral("showAddOtherWlanWidget"), devName); 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()) { if (m_interface == nullptr || !m_interface->isValid()) {
return; return;
} }
UkccCommon::buriedSettings(QString("wlanconnect"), QString("info"), QString("clicked"));
qDebug() << "[WlanConnect]call showPropertyWidget" << __LINE__; qDebug() << "[WlanConnect]call showPropertyWidget" << __LINE__;
m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, name); m_interface->call(QStringLiteral("showPropertyWidget"), deviceName, name);
qDebug() << "[WlanConnect]call showPropertyWidget respond" << __LINE__; qDebug() << "[WlanConnect]call showPropertyWidget respond" << __LINE__;

View File

@ -47,8 +47,10 @@
#include "wlanitem.h" #include "wlanitem.h"
#include "kwidget.h" #include "kwidget.h"
#include "kswitchbutton.h" #include "kswitchbutton.h"
#include "ukcccommon.h"
using namespace kdk; using namespace kdk;
using namespace ukcc;
namespace Ui { namespace Ui {
class WlanConnect; class WlanConnect;