From fc78e7dc311a6027925ce2cdbfb1d6928501a981 Mon Sep 17 00:00:00 2001 From: Enrico Zini Date: Sun, 28 Mar 2010 16:07:24 +0100 Subject: [PATCH] Alarm notification now pushes ringtones --- src/app_alarm.vala | 12 ++++++------ src/app_notify.vala | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app_alarm.vala b/src/app_alarm.vala index 8b7cfd2..e09879f 100644 --- a/src/app_alarm.vala +++ b/src/app_alarm.vala @@ -60,25 +60,25 @@ protected class AlarmNotifierDialog : ui.notify.Notifier message_button.show(); } - protected virtual bool push_aux_state() + protected override bool push_aux_state() { - var state = new zavai.led.LedState(name); + var state = new zavai.led.LedState(notifier_name); state.set_blink(255); zavai.led.aux.push_state(state); return true; } - protected virtual bool push_vibrator_state() + protected override bool push_vibrator_state() { - var state = new zavai.led.LedState(name); + var state = new zavai.led.LedState(notifier_name); state.set_blink(255); zavai.led.aux.push_state(state); return true; } - protected virtual bool push_ringtone_state() + protected override bool push_ringtone_state() { - var state = new zavai.audio.PlayerState(name, config.ringtone_alarm, true); + var state = new zavai.audio.PlayerState(notifier_name, config.ringtone_alarm, true); zavai.audio.soundplayer.push_state(state); return true; } diff --git a/src/app_notify.vala b/src/app_notify.vala index 13b5ae6..2a4b14c 100644 --- a/src/app_notify.vala +++ b/src/app_notify.vala @@ -56,12 +56,12 @@ public abstract class Notifier : Gtk.Dialog // Setup our attention seeking strategy bool has_aux = zavai.led.aux != null && push_aux_state(); bool has_vibrator = zavai.led.vibrator != null && push_vibrator_state(); - // TODO bool has_ringtone = zavai.audio.soundplayer != null && push_ringtone_state(); + bool has_ringtone = zavai.audio.soundplayer != null && push_ringtone_state(); // Run dialog int res = base.run(); - // TODO: Restore ringtone state + if (has_ringtone) zavai.audio.soundplayer.pop_state(notifier_name); if (has_vibrator) zavai.led.vibrator.pop_state(notifier_name); if (has_aux) zavai.led.aux.pop_state(notifier_name); ui.power.backlight.release(notifier_name); -- 2.39.5