diff --git a/kded/networkmanagement.notifyrc b/kded/networkmanagement.notifyrc --- a/kded/networkmanagement.notifyrc +++ b/kded/networkmanagement.notifyrc @@ -810,5 +810,6 @@ Name[x-test]=xxCaptive portal detectedxx Name[zh_CN]=检测到强制网络门户 Name[zh_TW]=偵測到強制入口 +Urgency=Low IconName=dialog-password Action=Popup diff --git a/kded/portalmonitor.cpp b/kded/portalmonitor.cpp --- a/kded/portalmonitor.cpp +++ b/kded/portalmonitor.cpp @@ -46,7 +46,7 @@ { if (connectivity == NetworkManager::Portal) { NetworkManager::ActiveConnection::Ptr primaryConnection = NetworkManager::primaryConnection(); - KNotification *notification = new KNotification(QStringLiteral("CaptivePortal"), KNotification::CloseOnTimeout, this); + KNotification *notification = new KNotification(QStringLiteral("CaptivePortal"), KNotification::Persistent, this); notification->setActions(QStringList{i18n("Log in")}); notification->setComponentName(QStringLiteral("networkmanagement")); if (primaryConnection) { @@ -56,8 +56,9 @@ } notification->setText(i18n("You need to log in to this network")); notification->sendEvent(); - connect(notification, &KNotification::action1Activated, this, [] () { + connect(notification, &KNotification::action1Activated, this, [notification] () { QDesktopServices::openUrl(QUrl("http://networkcheck.kde.org")); + notification->close(); }); } }