From deaecc705086c37411a60dc522be9058c39542d5 Mon Sep 17 00:00:00 2001 From: vladest Date: Sun, 29 Apr 2018 11:19:01 +0200 Subject: [PATCH] Added notifications settings --- interface/src/Menu.cpp | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 74cd1c0ca1..ed8c6910ce 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -287,23 +287,43 @@ Menu::Menu() { settings->setValue("play_notification_sounds_type_0", action->isChecked()); }); // Settings > Notifications > Level of Detail - addActionToQMenuAndActionHash(notificationsMenu, "Level of Detail"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Level of Detail", 0, + settings->getValue("play_notification_sounds_type_1").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_1", action->isChecked()); + }); // Settings > Notifications > Connection - addActionToQMenuAndActionHash(notificationsMenu, "Connection"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Connection", 0, + settings->getValue("play_notification_sounds_type_2").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_2", action->isChecked()); + }); // Settings > Notifications > Connection Refused - addActionToQMenuAndActionHash(notificationsMenu, "Connection Refused"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Connection Refused", 0, + settings->getValue("play_notification_sounds_type_3").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_3", action->isChecked()); + }); // Settings > Notifications > Edit Error - addActionToQMenuAndActionHash(notificationsMenu, "Edit Error"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Edit Error", 0, + settings->getValue("play_notification_sounds_type_4").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_4", action->isChecked()); + }); // Settings > Notifications > Tablet - addActionToQMenuAndActionHash(notificationsMenu, "Tablet"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Tablet", 0, + settings->getValue("play_notification_sounds_type_5").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_5", action->isChecked()); + }); // Settings > Notifications > Wallet addActionToQMenuAndActionHash(notificationsMenu, "Wallet"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Wallet", 0, + settings->getValue("play_notification_sounds_type_6").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_6", action->isChecked()); + }); + // Settings > Developer Menu addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus()));