Changeset 277


Ignore:
Timestamp:
07/23/06 05:34:34 (18 years ago)
Author:
Nicholas Riley
Message:

Properly update display of periodic alarms when time changes. Add calendar IPC message creation (not hooked up yet, maybe never). Be slightly more efficient about tooltip drawing.

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

Legend:

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

    r276 r277  
    66import java.io.DataOutputStream;
    77import danger.app.Application;
     8import danger.app.IPCMessage;
    89import danger.audio.RingToneObject;
    910import danger.internal.Date;
     
    151152            mDate.addSeconds(realSecondsLeft < 0 ? 0 : realSecondsLeft);
    152153            // no need to call resume(): alarm uses absolute time
     154            update();
    153155        } else {
    154156            resume();
     
    175177        mState = STATE_INVALID;
    176178        mAlarm.deactivate();
     179    }
     180
     181    // XXX not sure if this is featureful enough to be worthwhile
     182    public IPCMessage getCalendarIPCMessage() {
     183        if (mState != STATE_SCHEDULED)
     184            return null;
     185        IPCMessage message = new IPCMessage();
     186        message.addItem("action", "new");
     187        message.addItem("title", getMessage());
     188        message.addItem("start", mDate.getUnixTimeGMT());
     189        return message;
    177190    }
    178191
  • trunk/hiptop/pester/net/sabi/pester/AlarmListView.java

    r276 r277  
    5050        switch (e.type) {
    5151        case EVENT_NEW_ALARM:
     52            // XXX check for max alarms
    5253            alarmSetDialog().editAlarm(new Alarm(), true);
    5354            return true;
     
    100101            ToolTipWindow.showToolTip(alarm.getDateTimeString() + " - " +
    101102                                      alarm.getIntervalString(),
    102                                       10, rect.bottom, 1, sAlarmListWindow);
     103                                      localToGlobalH(10),
     104                                      localToGlobalV(mToolTipY),
     105                                      1, sAlarmListWindow);
    103106        int secondsUntilUpdate = alarm.getSecondsUntilNextIntervalStringUpdate();
    104107        if (secondsUntilUpdate == 0)
Note: See TracChangeset for help on using the changeset viewer.