Merge branch '0926' into 'dbus-interface'

fix bug:140403

See merge request kylin-desktop/kylin-nm!717
This commit is contained in:
赵世旭 2022-09-28 01:50:48 +00:00
commit e076b8be07
5 changed files with 36 additions and 6 deletions

View File

@ -148,7 +148,7 @@ bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event)
return true;
}
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);
if (!reply.isValid()) {
qDebug() << "[MobileHotspotWidget] call deactiveWirelessAp failed ";
@ -171,7 +171,7 @@ bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event)
// showDesktopNotify(tr("can not create hotspot with password length less than eight!"));
return true;
}
showDesktopNotify(tr("start to open hotspot ") + m_apNameLine->text());
// showDesktopNotify(tr("start to open hotspot ") + m_apNameLine->text());
QDBusReply<void> reply = m_interface->call("activeWirelessAp",
m_apNameLine->text(),
m_pwdNameLine->text(),

View File

@ -149,6 +149,25 @@ KyConnectItem * KyConnectResourse::getConnectionItemByUuid(QString connectUuid)
return nullptr;
}
KyConnectItem * KyConnectResourse::getConnectionItemByUuidWithoutActivateChecking(QString connectUuid)
{
NetworkManager::Connection::Ptr connectPtr =
m_networkResourceInstance->getConnect(connectUuid);
if (nullptr == connectPtr) {
qWarning()<< "[KyConnectResourse]" <<"get connect failed, connect uuid"<<connectUuid;
return nullptr;
}
KyConnectItem *connectItem = getConnectionItem(connectPtr, "");
if (nullptr != connectItem) {
//connectItem->dumpInfo();
return connectItem;
}
return nullptr;
}
KyConnectItem * KyConnectResourse::getConnectionItemByUuid(QString connectUuid, QString deviceName)
{
NetworkManager::Connection::Ptr connectPtr =

View File

@ -38,6 +38,7 @@ public:
public:
KyConnectItem *getConnectionItemByUuid(QString connectUuid);
KyConnectItem *getConnectionItemByUuidWithoutActivateChecking(QString connectUuid);
KyConnectItem *getConnectionItemByUuid(QString connectUuid, QString deviceName);
void getConnectionList(QString deviceName,
NetworkManager::ConnectionSettings::ConnectionType connectionType,

View File

@ -43,6 +43,10 @@
const QString v10Sp1 = "V10SP1";
const QString intel = "V10SP1-edu";
#define LANPAGE 0
#define WLANPAGE 1
#define AUTOSELET 2
#define KEY_PRODUCT_FEATURES "PRODUCT_FEATURES"
#include <kwindowsystem.h>
@ -645,10 +649,16 @@ void MainWindow::onTabletModeChanged(bool mode)
void MainWindow::onShowMainWindow(int type)
{
m_centralWidget->setCurrentIndex(type);
if (type == LANPAGE || type == WLANPAGE) {
m_centralWidget->setCurrentIndex(type);
if(QApplication::activeWindow() != this) {
this->showMainwindow();
if(QApplication::activeWindow() != this) {
this->showMainwindow();
}
} else if (type == AUTOSELET) {
onTrayIconActivated(QSystemTrayIcon::ActivationReason::Trigger);
} else {
qWarning() << "unsupport parameter";
}
}

View File

@ -947,7 +947,7 @@ void LanPage::onConnectionStateChange(QString uuid,
updateActivatedConnectionArea(p_newItem);
updateConnectionState(m_activeConnectionMap, m_activatedLanListWidget, uuid, (ConnectState)state);
} else if (state == NetworkManager::ActiveConnection::State::Deactivated) {
p_newItem = m_connectResourse->getConnectionItemByUuid(uuid);
p_newItem = m_connectResourse->getConnectionItemByUuidWithoutActivateChecking(uuid);
qDebug() << "[LanPage] deactivated reason" << reason;
if (nullptr == p_newItem) {
qWarning()<<"[LanPage] get active connection failed, connection uuid" << uuid;