mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-06 07:23:08 +02:00
Check global switch as well
This commit is contained in:
parent
ac413c8854
commit
1794113f37
4 changed files with 10 additions and 6 deletions
|
@ -3609,7 +3609,9 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
AudioInjectorOptions options;
|
AudioInjectorOptions options;
|
||||||
options.localOnly = true;
|
options.localOnly = true;
|
||||||
options.stereo = true;
|
options.stereo = true;
|
||||||
if (SettingsScriptingInterface::getInstance()->getValue(MenuOption::NotificationSoundsSnapshot).toBool()) {
|
Setting::Handle<bool> notificationSounds{ MenuOption::NotificationSounds, true};
|
||||||
|
Setting::Handle<bool> notificationSoundSnapshot{ MenuOption::NotificationSoundsSnapshot, true};
|
||||||
|
if (notificationSounds.get() && notificationSoundSnapshot.get()) {
|
||||||
if (_snapshotSoundInjector) {
|
if (_snapshotSoundInjector) {
|
||||||
_snapshotSoundInjector->setOptions(options);
|
_snapshotSoundInjector->setOptions(options);
|
||||||
_snapshotSoundInjector->restart();
|
_snapshotSoundInjector->restart();
|
||||||
|
|
|
@ -270,9 +270,9 @@ Menu::Menu() {
|
||||||
// Settings > Notifications > Play Notification Sounds
|
// Settings > Notifications > Play Notification Sounds
|
||||||
SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance();
|
SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance();
|
||||||
action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds", 0,
|
action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds", 0,
|
||||||
settings->getValue("play_notification_sounds").toBool());
|
settings->getValue(MenuOption::NotificationSounds).toBool());
|
||||||
connect(action, &QAction::triggered, [action, settings] {
|
connect(action, &QAction::triggered, [action, settings] {
|
||||||
settings->setValue("play_notification_sounds", action->isChecked());
|
settings->setValue(MenuOption::NotificationSounds, action->isChecked());
|
||||||
});
|
});
|
||||||
notificationsMenu->addSeparator();
|
notificationsMenu->addSeparator();
|
||||||
|
|
||||||
|
|
|
@ -217,6 +217,7 @@ namespace MenuOption {
|
||||||
const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar";
|
const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar";
|
||||||
const QString Shadows = "Shadows";
|
const QString Shadows = "Shadows";
|
||||||
const QString AmbientOcclusion = "Ambient Occlusion";
|
const QString AmbientOcclusion = "Ambient Occlusion";
|
||||||
|
const QString NotificationSounds = "play_notification_sounds";
|
||||||
const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot";
|
const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot";
|
||||||
const QString NotificationSoundsTablet = "play_notification_sounds_tablet";
|
const QString NotificationSoundsTablet = "play_notification_sounds_tablet";
|
||||||
}
|
}
|
||||||
|
|
|
@ -441,9 +441,10 @@ void TabletProxy::emitWebEvent(const QVariant& msg) {
|
||||||
|
|
||||||
void TabletProxy::onTabletShown() {
|
void TabletProxy::onTabletShown() {
|
||||||
if (_tabletShown) {
|
if (_tabletShown) {
|
||||||
Setting::Handle<bool> notificationSoundTablet{ "play_notification_sounds_tablet", true};
|
Setting::Handle<bool> notificationSounds{ QStringLiteral("play_notification_sounds"), true};
|
||||||
if (notificationSoundTablet.get()) {
|
Setting::Handle<bool> notificationSoundTablet{ QStringLiteral("play_notification_sounds_tablet"), true};
|
||||||
static_cast<TabletScriptingInterface*>(parent())->playSound(TabletScriptingInterface::TabletOpen);
|
if (notificationSounds.get() && notificationSoundTablet.get()) {
|
||||||
|
dynamic_cast<TabletScriptingInterface*>(parent())->playSound(TabletScriptingInterface::TabletOpen);
|
||||||
}
|
}
|
||||||
if (_showRunningScripts) {
|
if (_showRunningScripts) {
|
||||||
_showRunningScripts = false;
|
_showRunningScripts = false;
|
||||||
|
|
Loading…
Reference in a new issue