Tablet opening notification sound settings added

This commit is contained in:
vladest 2018-05-06 09:41:10 +02:00
parent c7ab1f3dbf
commit ac413c8854
3 changed files with 8 additions and 3 deletions

View file

@ -311,9 +311,10 @@ Menu::Menu() {
});
// Settings > Notifications > Tablet
action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Tablet", 0,
settings->getValue("play_notification_sounds_type_5").toBool());
settings->getValue(MenuOption::NotificationSoundsTablet).toBool());
connect(action, &QAction::triggered, [action, settings] {
settings->setValue("play_notification_sounds_type_5", action->isChecked());
settings->setValue(MenuOption::NotificationSoundsTablet, action->isChecked());
qDebug() << "vladest. tablet sound check up" << settings->getValue(MenuOption::NotificationSoundsTablet).toBool();
});
// Settings > Notifications > Wallet
addActionToQMenuAndActionHash(notificationsMenu, "Wallet");

View file

@ -218,6 +218,7 @@ namespace MenuOption {
const QString Shadows = "Shadows";
const QString AmbientOcclusion = "Ambient Occlusion";
const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot";
const QString NotificationSoundsTablet = "play_notification_sounds_tablet";
}
#endif // hifi_Menu_h

View file

@ -441,7 +441,10 @@ void TabletProxy::emitWebEvent(const QVariant& msg) {
void TabletProxy::onTabletShown() {
if (_tabletShown) {
static_cast<TabletScriptingInterface*>(parent())->playSound(TabletScriptingInterface::TabletOpen);
Setting::Handle<bool> notificationSoundTablet{ "play_notification_sounds_tablet", true};
if (notificationSoundTablet.get()) {
static_cast<TabletScriptingInterface*>(parent())->playSound(TabletScriptingInterface::TabletOpen);
}
if (_showRunningScripts) {
_showRunningScripts = false;
pushOntoStack("hifi/dialogs/TabletRunningScripts.qml");