add SoundNotifications toggle.conf

This commit is contained in:
John Colvin committed 2018-10-26 11:35:47 -05:00
1 parent 484c7a98a8
commit c56b41bf47
2 files changed
+16 -8

No files matched your search

+12 -8
View File
@@ -53,18 +53,22 @@ namespace mbts.ui {
ToastNotificationController _toast_controller;
SoundNotificationPlayer _sound_player;
Dispatcher _dispatcher;
bool _toast_notifications_enabled, _sound_notifications_enabled = NotificationSettings.Default.sound_notification.enabled;
bool
_sound_notifications_enabled = Configuration.get<bts.config.toggles.SoundNotifications>().enabled,
_toast_notifications_enabled = Configuration.get<bts.config.toggles.ToastNotifications>().enabled;
[ImportingConstructor]
public Notifier(IBus bus, UserSettingsHub settings_hub) {
_disposer = new ThreadSafeDisposable(dispose_core);
Thread thread = new Thread(start) {
IsBackground = true,
Priority = ThreadPriority.BelowNormal,
Name = "BTSNotifications"
};
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
if (_sound_notifications_enabled || _toast_notifications_enabled) {
Thread thread = new Thread(start) {
IsBackground = true,
Priority = ThreadPriority.BelowNormal,
Name = "BTSNotifications"
};
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
void start() {
try {
+4
View File
@@ -28,6 +28,10 @@ message ToastNotifications {
optional bool enabled = 1 [default = false];
}
message SoundNotifications {
optional bool enabled = 1 [default = true];
}
message VolumeAtPrice{
optional bool enabled = 1 [default = true];
}