Ignore:
Timestamp:
07/25/06 16:36:34 (18 years ago)
Author:
Nicholas Riley
Message:

First pass at alarm snooze/reschedule; still pretty ugly.

Location:
trunk/hiptop/pester/net/sabi/pester
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/hiptop/pester/net/sabi/pester/Alarm.java

    r280 r287  
    7979    public void setUID(int uid) {
    8080        mUID = uid;
     81    }
     82    public void snoozeForMinutes(int minutes) {
     83        mDate = new Date();
     84        mDate.addMinutes(minutes);
     85        resume();
    8186    }
    8287
  • trunk/hiptop/pester/net/sabi/pester/Pester.java

    r278 r287  
    33import danger.app.Application;
    44import danger.app.Event;
    5 import danger.ui.AlertWindow;
     5import danger.app.IPCMessage;
     6import danger.ui.Layout;
     7import danger.ui.TextField;
     8import danger.ui.TextInputAlertWindow;
    69import danger.ui.ScreenWindow;
     10import danger.ui.StaticText;
    711import danger.util.DEBUG;
    812import java.util.Stack;
     
    2226        case Event.EVENT_ALARM:
    2327            Alarm alarm = (Alarm)e.argument;
    24             AlertWindow alert = getAlert(ID_ALARM_ALERT, this);
     28            TextInputAlertWindow alert = getTextInputAlert(ID_ALARM_ALERT, this);
    2529            alert.setTitle(alarm.getDateTimeString());
    2630            alert.setMessage(alarm.getMessage());
    2731            alert.setShowTone(alarm.getAlert());
    28             alert.show(AlertWindow.SYSTEM_ALERT_TYPE_ALARM);
     32            alert.disableButtonOnEmptyField(ID_SNOOZE_BUTTON, ID_SNOOZE_MINUTES);
     33            alert.setShowCancel(false);
     34            alert.show(TextInputAlertWindow.SYSTEM_ALERT_TYPE_ALARM);
    2935            sAlarmStack.push(alarm);
     36            return true;
     37        case EVENT_SET_ALARM:
     38            AlarmSetDialog alarmSetDialog = AlarmSetDialog.getDialog();
     39            alarmSetDialog.setWindowStyle(AlarmSetDialog.SYSTEM_DIALOG_STYLE);
     40            alarmSetDialog.editAlarm((Alarm)sAlarmStack.pop(),false);
     41            return true;
     42        case EVENT_SNOOZE_ALARM:
     43            String snoozeMinutesString =
     44                TextInputAlertWindow.
     45                getTextFieldValue((IPCMessage)e.argument,
     46                                  ID_SNOOZE_MINUTES);
     47            int snoozeMinutes = Integer.parseInt(snoozeMinutesString);
     48            ((Alarm)sAlarmStack.pop()).snoozeForMinutes(snoozeMinutes);
    3049            return true;
    3150        case EVENT_DISMISS_ALARM:
Note: See TracChangeset for help on using the changeset viewer.