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, [=]() {