控制面板埋点

This commit is contained in:
jzxc95 2023-06-26 16:52:45 +08:00
parent bdefd77302
commit 87f8583153
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-sysinfo-dev,
libkysdk-waylandhelper-dev(>= 1.2.0kylin2),
libkysdk-diagnostics-dev,
libkysec-dev,
Standards-Version: 4.5.0
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_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MobileHotspotWidget::onInterfaceChanged);
connect(m_interfaceComboBox, QOverload<int>::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<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));
if (i >= 0) {
disconnect(m_freqBandComboBox);
m_freqBandComboBox->setCurrentIndex(i);
connect(m_freqBandComboBox, QOverload<int>::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<int>::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<QString, int> 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<int>::of(&QComboBox::currentIndexChanged), [=](){
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
});
}
QFrame* MobileHotspotWidget::myLine()

View File

@ -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
{

View File

@ -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__;

View File

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

View File

@ -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<QAbstractButton *>::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()));

View File

@ -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代替即可

View File

@ -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);

View File

@ -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;

View File

@ -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__;

View File

@ -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;