Changeset 283 for trunk


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

Keep track of recent messages.

Location:
trunk/hiptop/pester
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/hiptop/pester/locale/en_US/Pester.rsrc

    r280 r283  
    246246                shortcut = doneButton
    247247endAlert
     248
     249stringArray ID_ALARM_MESSAGES
     250        "Bus"
     251        "Dinner"
     252        "Exercise"
     253        "Go home"
     254        "Laundry"
     255        "Lunch"
     256        "Meeting"
     257        "Sleep"
     258        "Train"
     259        "Wake up"
     260endStringArray
  • trunk/hiptop/pester/net/sabi/pester/AlarmSetDialog.java

    r280 r283  
    7171        mDiscardAlarmButton =
    7272            (Button)getDescendantWithID(ID_DISCARD_ALARM_BUTTON);
     73        mMessageField.setTextFinder(new MessageFinder());
     74        mMessageField.setNumCharsNeededForCompletion(0);
    7375        mInButton.setValue(1);
    7476        mDateEditor.limitToDangerEpoch();
     
    228230            if (!isValid())
    229231                return true;
    230             mEditingAlarm.setMessage(mMessageField.toString());
     232            String message = mMessageField.toString();
     233            mEditingAlarm.setMessage(message);
     234            MessageFinder.usedMessage(message);
    231235            // set the period regardless, so it gets saved for future use
    232236            mEditingAlarm.setPeriod(editingInterval(),
  • trunk/hiptop/pester/net/sabi/pester/Alarms.java

    r278 r283  
    4444            alarm.resume();
    4545        }
     46        try {
     47            MessageFinder.setMessageListFromByteArray(sSettingsDB.getBytes(KEY_RECENT_MESSAGES));
     48        } catch (SettingsDBException e) {
     49            MessageFinder.setDefaultMessageList();
     50        }
    4651        sAlarmList = this;
    4752    }
     
    6267    public static void removeAlarm(Alarm alarm) {
    6368        sAlarmList.removeItem(alarm);
     69    }
     70    public static void recentMessagesChanged() {
     71        sSettingsDB.setBytes(KEY_RECENT_MESSAGES,
     72                             MessageFinder.messageListAsByteArray());
    6473    }
    6574
     
    94103
    95104    private static String KEY_DEFAULT_ALARM = "default alarm";
     105    private static String KEY_RECENT_MESSAGES = "recent messages";
    96106
    97107    public static Alarm getDefaultAlarm() {
Note: See TracChangeset for help on using the changeset viewer.