Changeset 288 for trunk/hiptop/pester


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

Nicer rescheduling support; cancel reschedule should only be supported for repeating alarms (for non-repeating ones, you can only discard).

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

Legend:

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

    r283 r288  
    131131        if (asNew) {
    132132            mDiscardAlarmButton.hide();
    133             // XXX default to now?
    134133        } else {
    135134            editAlarm(alarm);
     
    154153            Application.registerForEvent(this, Event.EVENT_TIME_FORMAT_CHANGED);
    155154        }
     155    }
     156
     157    public void rescheduleAlarm(Alarm alarm) {
     158        setWindowStyle(SYSTEM_DIALOG_STYLE);
     159        if (alarm.getRepeating()) {
     160            alarm.schedule(); // if we cancel, it'll continue repeating
     161        } else {
     162            getCancelButton().disable();
     163        }
     164        editAlarm(alarm, false);
    156165    }
    157166
  • trunk/hiptop/pester/net/sabi/pester/Pester.java

    r287 r288  
    3636            return true;
    3737        case EVENT_SET_ALARM:
    38             AlarmSetDialog alarmSetDialog = AlarmSetDialog.getDialog();
    39             alarmSetDialog.setWindowStyle(AlarmSetDialog.SYSTEM_DIALOG_STYLE);
    40             alarmSetDialog.editAlarm((Alarm)sAlarmStack.pop(),false);
     38            AlarmSetDialog.getDialog().rescheduleAlarm((Alarm)sAlarmStack.pop());
    4139            return true;
    4240        case EVENT_SNOOZE_ALARM:
    43             String snoozeMinutesString =
    44                 TextInputAlertWindow.
    45                 getTextFieldValue((IPCMessage)e.argument,
    46                                   ID_SNOOZE_MINUTES);
    47             int snoozeMinutes = Integer.parseInt(snoozeMinutesString);
     41            int snoozeMinutes =
     42                Integer.parseInt(TextInputAlertWindow.
     43                                 getTextFieldValue((IPCMessage)e.argument,
     44                                                   ID_SNOOZE_MINUTES));
    4845            ((Alarm)sAlarmStack.pop()).snoozeForMinutes(snoozeMinutes);
    4946            return true;
Note: See TracChangeset for help on using the changeset viewer.