Hi,

I'm playing with libalarm actually and I would like to ask some questions:

1. What's the preferred way to display the alarm dialog, using the
"system ui dialog service", or to do it by MyApp?
Let's check the code.

Common stuff:
==============

 cookie_t cookie = 0;
 alarm_event_t *eve = 0;
 alarm_action_t *act = 0;

 eve = alarm_event_create();
 eve->alarm_time = time(0) + 5;

 alarm_event_set_alarm_appid(eve, APPID);

Using "system ui dialog service":
=================================

 alarm_event_set_title(eve, "TestAlarm");
 alarm_event_set_message(eve, "TestAlarm Message");
 alarm_event_set_icon(eve, "MyIcon.png");

 act = alarm_event_add_actions(eve, 1);
 act->flags = ALARM_ACTION_TYPE_EXEC | ALARM_ACTION_WHEN_RESPONDED;
 alarm_action_set_label(act, "MyApp");
 alarm_action_set_exec_command(act, "MyApp");

 /* Add stop button action */
 act = alarm_event_add_actions(eve, 1);
 alarm_action_set_label(act, "Stop");
 act->flags |= ALARM_ACTION_WHEN_RESPONDED;
 act->flags |= ALARM_ACTION_TYPE_NOP;

 /* Add snooze button action */
 act = alarm_event_add_actions(eve, 1);
 alarm_action_set_label(act, "Snooze");
 act->flags |= ALARM_ACTION_WHEN_RESPONDED;
 act->flags |= ALARM_ACTION_TYPE_SNOOZE;

Using MyApp:
============

 act = alarm_event_add_actions(eve, 1);
 act->flags = ALARM_ACTION_TYPE_EXEC | ALARM_ACTION_WHEN_TRIGGERED;
 alarm_action_set_exec_command(act, "MyApp p1 p2");

2. I would like to use the first approach to have the native layout, but I have no idea how the "title" and "icon" variables are used by the "ui dialog service". Is there any specification for the icon?

Thanks for help!
br,

matus


_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to