From 9d606970468542ac5dd32b854a3b746697fc0383 Mon Sep 17 00:00:00 2001 From: jixiaoxu Date: Thu, 16 Mar 2023 11:03:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A7=E5=88=B6=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=8F=92=E4=BB=B6UI=20bug=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notification-ukcc-plugin/notification-ukcc-plugin.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/notification-ukcc-plugin/notification-ukcc-plugin.cpp b/notification-ukcc-plugin/notification-ukcc-plugin.cpp index e6555b1..f07b23d 100644 --- a/notification-ukcc-plugin/notification-ukcc-plugin.cpp +++ b/notification-ukcc-plugin/notification-ukcc-plugin.cpp @@ -330,9 +330,7 @@ void Notice::initConnection() }); connect(m_enableSwitchBtn, &KSwitchButton::stateChanged, [&](bool state){ //Utils::buriedSettings(name(), "whether to get the notification from the app", QString("settings"), state ? "true" : "false"); - m_globalSettings->blockSignals(true); m_globalSettings->setReceiveNotificationsFromApps(state); - m_globalSettings->blockSignals(false); setHiddenNoticeApp(state); }); @@ -504,6 +502,11 @@ void Notice::initItemUi(const QString &desktopPath, const UkuiNotification::Sing menu->initStaus(settings); menu->blockSignals(false); + connect(appSwitch, &KSwitchButton::stateChanged, [=](bool state) { + //Utils::buriedSettings(name(), "whether auto turn on do not disturb mode", QString("settings"), state ? "true" : "false"); + UkuiNotification::ApplicationsSettings::self()->setAppSetting(desktopPath, UkuiNotification::SettingsProperty::AllowNotify, state); + }); + connect(&settings, &UkuiNotification::SingleApplicationSettings::allowNotifyChanged, [=](bool state) { appSwitch->blockSignals(true); appSwitch->setChecked(state); @@ -526,7 +529,7 @@ void Notice::initItemUi(const QString &desktopPath, const UkuiNotification::Sing }); connect(&settings, &UkuiNotification::SingleApplicationSettings::popupStyleChanged, [=](UkuiNotification::SettingsProperty::Property style) { menu->blockSignals(true); - menu->setShowOnLockScreenEnable(style); + menu->setPopupStyle(style); menu->blockSignals(false); }); connect(&settings, &UkuiNotification::SingleApplicationSettings::uninstalled, [=]() {