ToastFreeware
/
gregoa
/
zavai.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added config options for call and sms ringtones
[gregoa/zavai.git]
/
src
/
app_alarm.vala
diff --git
a/src/app_alarm.vala
b/src/app_alarm.vala
index 48d138bb35cb83acc161e29a8a8fd1062be361f7..2d2699bee642f76869118e1ecfae6942ec61284d 100644
(file)
--- a/
src/app_alarm.vala
+++ b/
src/app_alarm.vala
@@
-60,25
+60,27
@@
protected class AlarmNotifierDialog : ui.notify.Notifier
message_button.show();
}
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(n
otifier_n
ame);
state.set_blink(255);
zavai.led.aux.push_state(state);
return true;
}
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(n
otifier_n
ame);
state.set_blink(255);
state.set_blink(255);
- zavai.led.
aux
.push_state(state);
+ zavai.led.
vibrator
.push_state(state);
return true;
}
return true;
}
- protected
virtual
bool push_ringtone_state()
+ protected
override
bool push_ringtone_state()
{
{
- return false;
+ var state = new zavai.audio.PlayerState(notifier_name, config.ringtone_alarm, true);
+ zavai.audio.soundplayer.push_state(state);
+ return true;
}
}
}
}
@@
-101,6
+103,9
@@
public class AlarmNotifier : zavai.Resource, ui.notify.Notifier
current = info;
dialog = new AlarmNotifierDialog("Alarm", info.label);
current = info;
dialog = new AlarmNotifierDialog("Alarm", info.label);
+ if (zavai.led.auxbutton != null)
+ zavai.led.auxbutton.event += on_auxbutton;
+
uint cancel_timeout = 0;
cancel_timeout = Timeout.add(30 * 1000, () => {
dialog.response(Gtk.ResponseType.CANCEL);
uint cancel_timeout = 0;
cancel_timeout = Timeout.add(30 * 1000, () => {
dialog.response(Gtk.ResponseType.CANCEL);
@@
-118,11
+123,22
@@
public class AlarmNotifier : zavai.Resource, ui.notify.Notifier
clock.alarm_trigger_queue.cancel(current);
break;
}
clock.alarm_trigger_queue.cancel(current);
break;
}
+
+ if (zavai.led.auxbutton != null)
+ zavai.led.auxbutton.event -= on_auxbutton;
+
dialog.destroy();
dialog = null;
current = null;
}
dialog.destroy();
dialog = null;
current = null;
}
+ protected bool on_auxbutton(ulong time, bool pressed)
+ {
+ if (dialog == null) return false;
+ dialog.response(Gtk.ResponseType.OK);
+ return true;
+ }
+
public void on_done(clock.AlarmTriggerInfo info)
{
if (current == null || dialog == null || current != info) return;
public void on_done(clock.AlarmTriggerInfo info)
{
if (current == null || dialog == null || current != info) return;