From 8f0908efcb7f81f0ed5cf195146759073443c55b Mon Sep 17 00:00:00 2001 From: chenxuechao Date: Thu, 14 Jul 2022 20:24:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=20129360=EF=BC=8C?= =?UTF-8?q?=E3=80=90=E7=BD=91=E7=BB=9C=E8=BF=9E=E6=8E=A5=E3=80=91=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=83=AD=E7=82=B9=E9=BB=91=E5=90=8D=E5=8D=95=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E5=90=AF=E5=90=8E=E7=A7=BB=E5=8A=A8=E7=83=AD?= =?UTF-8?q?=E7=82=B9=E7=95=8C=E9=9D=A2=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=BB=91?= =?UTF-8?q?=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mobilehotspot/mobilehotspotwidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/mobilehotspot/mobilehotspotwidget.cpp b/plugins/mobilehotspot/mobilehotspotwidget.cpp index 17684fbb..5ec607ff 100644 --- a/plugins/mobilehotspot/mobilehotspotwidget.cpp +++ b/plugins/mobilehotspot/mobilehotspotwidget.cpp @@ -255,9 +255,7 @@ void MobileHotspotWidget::initDbusConnect() } connect(m_apNameLine, &QLineEdit::textEdited, this, &MobileHotspotWidget::onApLineEditTextEdit); - connect(m_connectDevPage, SIGNAL(setStaIntoBlacklist(QString)), m_blacklistPage, SLOT(onsetStaIntoBlacklist(QString))); - connect(m_pwdNameLine, SIGNAL(textChanged(QString)), this, SLOT(onPwdTextChanged())); } @@ -415,6 +413,7 @@ void MobileHotspotWidget::getApInfo() } else { m_switchBtn->setChecked(false); setUiEnabled(false); + m_uuid = apInfo.at(4); } } else { qDebug() << "no such interface " << apInfo.at(2); @@ -618,7 +617,6 @@ void MobileHotspotWidget::onHotspotActivated(QString devName, QString ssid, QStr if (m_switchBtn->isChecked()) { return; } - if (activePath != nullptr) { deleteActivePathInterface(); initActivePathInterface(activePath); @@ -780,6 +778,7 @@ QString MobileHotspotWidget::getSettingPathByUuid() if (!reply.isValid()) { return nullptr; } + return reply.value(); } From fe36d99816aec3d61b3d46d37eec986248473d8d Mon Sep 17 00:00:00 2001 From: chenxuechao Date: Thu, 14 Jul 2022 20:30:06 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3BUG=20129623=EF=BC=8C=20?= =?UTF-8?q?=E3=80=90=E7=BD=91=E7=BB=9C=E8=BF=9E=E6=8E=A5=E3=80=91=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E9=9D=A2=E6=9D=BF=E5=BC=80=E5=90=AF=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E6=97=A0=E7=BA=BF=E7=BD=91=E7=BB=9C=E5=BC=80=E5=85=B3=EF=BC=8C?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=A0=8F=E6=97=A0=E7=BA=BF=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E7=BD=AE?= =?UTF-8?q?=E7=81=B0=EF=BC=8C=E4=B8=94=E6=8C=89=E9=92=AE=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/tab-pages/wlanpage.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index d106e0b6..c13edcbc 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -1435,7 +1435,6 @@ void WlanPage::setWirelessSwitchEnable(bool enable) m_wirelessConnectOpreation->setWirelessEnabled(enable); if (!enable) { m_netSwitch->setChecked(false); - m_netSwitch->setCheckable(false); m_activatedNetFrame->hide(); m_activatedNetDivider->hide(); m_inactivatedNetFrame->hide(); From f8a0548d627695eb52a0c775c32e7e227e8acdb5 Mon Sep 17 00:00:00 2001 From: chenxuechao Date: Fri, 15 Jul 2022 11:19:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=83=AD=E7=82=B9=E7=AE=A1=E6=8E=A7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BB=A3=E7=A0=81=E5=A2=9E=E5=8A=A0=E5=AE=8F?= =?UTF-8?q?=E5=BC=80=E5=85=B3=EF=BC=8C=20=E4=BF=AE=E6=94=B9=E6=8B=BC?= =?UTF-8?q?=E5=86=99=E9=94=99=E8=AF=AF=E7=9A=84=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mobilehotspot/connectdevpage.cpp | 8 +++++--- plugins/mobilehotspot/connectdevpage.h | 4 ++-- plugins/mobilehotspot/mobilehotspotwidget.cpp | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/plugins/mobilehotspot/connectdevpage.cpp b/plugins/mobilehotspot/connectdevpage.cpp index 15f0d56f..e4c0fde5 100644 --- a/plugins/mobilehotspot/connectdevpage.cpp +++ b/plugins/mobilehotspot/connectdevpage.cpp @@ -65,17 +65,18 @@ QFrame* ConnectdevPage::myLine() void ConnectdevPage::getConnectStaDevice(QMap &staMap) { staMap.clear(); - if (m_avtivePathInterface == nullptr || !m_avtivePathInterface->isValid()) { - qDebug() << "dbus interface m_avtivePathInterface is invaild"; + if (m_activePathInterface == nullptr || !m_activePathInterface->isValid()) { + qDebug() << "dbus interface m_activePathInterface is invaild"; return; } - QDBusMessage reply = m_avtivePathInterface->call("Getstainfo"); + QDBusMessage reply = m_activePathInterface->call("Getstainfo"); if(reply.type() == QDBusMessage::ErrorMessage) { qWarning() << "[mobilehotspot]Getstainfo error:" << reply.errorMessage(); return; } + if (reply.arguments().isEmpty() || reply.arguments().at(0).toString() == "" || reply.arguments().at(0).toString() == "[Invalid UTF-8]" @@ -91,6 +92,7 @@ void ConnectdevPage::getConnectStaDevice(QMap &staMap) staMap[macList.at(index)] = hostNameList.at(index); } } + } void ConnectdevPage::initStaDev() diff --git a/plugins/mobilehotspot/connectdevpage.h b/plugins/mobilehotspot/connectdevpage.h index 147cab36..f4324ae2 100644 --- a/plugins/mobilehotspot/connectdevpage.h +++ b/plugins/mobilehotspot/connectdevpage.h @@ -44,7 +44,7 @@ public: void refreshStalist(); inline void setInterface(QDBusInterface *activeInterface) { - m_avtivePathInterface = activeInterface; + m_activePathInterface = activeInterface; } private: @@ -54,7 +54,7 @@ private: QVBoxLayout *m_staListLayout = nullptr; QMap m_staMap; - QDBusInterface *m_avtivePathInterface = nullptr; + QDBusInterface *m_activePathInterface = nullptr; void getConnectStaDevice(QMap &blacklistMap); bool removeStaFromBlacklist(QString staMac); diff --git a/plugins/mobilehotspot/mobilehotspotwidget.cpp b/plugins/mobilehotspot/mobilehotspotwidget.cpp index 5ec607ff..61d987b6 100644 --- a/plugins/mobilehotspot/mobilehotspotwidget.cpp +++ b/plugins/mobilehotspot/mobilehotspotwidget.cpp @@ -67,6 +67,8 @@ void MobileHotspotWidget::showDesktopNotify(const QString &message) iface.callWithArgumentList(QDBus::AutoDetect,"Notify",args); } +//#define HOTSPOT_CONTROL + MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent) { m_Vlayout = new QVBoxLayout(this); @@ -79,8 +81,11 @@ MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent) qDBusRegisterMetaType >>(); initUI(); + +#ifdef HOTSPOT_CONTROL initConnectDevPage(); initBlackListPage(); +#endif m_switchBtn->installEventFilter(this); m_interface = new QDBusInterface("com.kylin.network", "/com/kylin/network", @@ -99,7 +104,9 @@ MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent) initInterfaceInfo(); getApInfo(); +#ifdef HOTSPOT_CONTROL initNmDbus(); +#endif this->setLayout(m_Vlayout); m_Vlayout->addStretch(); @@ -110,8 +117,10 @@ MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent) updateBandCombox(); }); +#ifdef HOTSPOT_CONTROL m_connectDevPage->refreshStalist(); m_blacklistPage->refreshBlacklist(); +#endif this->update(); } @@ -255,7 +264,9 @@ void MobileHotspotWidget::initDbusConnect() } connect(m_apNameLine, &QLineEdit::textEdited, this, &MobileHotspotWidget::onApLineEditTextEdit); +#ifdef HOTSPOT_CONTROL connect(m_connectDevPage, SIGNAL(setStaIntoBlacklist(QString)), m_blacklistPage, SLOT(onsetStaIntoBlacklist(QString))); +#endif connect(m_pwdNameLine, SIGNAL(textChanged(QString)), this, SLOT(onPwdTextChanged())); } @@ -593,10 +604,12 @@ void MobileHotspotWidget::onDeviceNameChanged(QString oldName, QString newName, //热点断开 void MobileHotspotWidget::onHotspotDeactivated(QString devName, QString ssid) { +#ifdef HOTSPOT_CONTROL deleteActivePathInterface(); m_connectDevPage->setInterface(nullptr); m_connectDevPage->refreshStalist(); m_blacklistPage->refreshBlacklist(); +#endif this->update(); if (!m_switchBtn->isChecked()) { @@ -617,6 +630,7 @@ void MobileHotspotWidget::onHotspotActivated(QString devName, QString ssid, QStr if (m_switchBtn->isChecked()) { return; } +#ifdef HOTSPOT_CONTROL if (activePath != nullptr) { deleteActivePathInterface(); initActivePathInterface(activePath); @@ -628,6 +642,7 @@ void MobileHotspotWidget::onHotspotActivated(QString devName, QString ssid, QStr m_connectDevPage->refreshStalist(); m_blacklistPage->refreshBlacklist(); +#endif this->update(); if (devName == m_interfaceComboBox->currentText() && ssid == m_apNameLine->text()) {