Changeset 294 for trunk/hiptop/pester/net
- Timestamp:
- 07/28/06 04:17:42 (18 years ago)
- Location:
- trunk/hiptop/pester/net/sabi/pester
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hiptop/pester/net/sabi/pester/AlarmListView.java
r292 r294 13 13 import danger.util.DEBUG; 14 14 import danger.util.StringUtils; 15 import danger.util.format.StringFormat; 15 16 16 17 public class AlarmListView extends ActiveListView … … 52 53 switch (e.type) { 53 54 case EVENT_NEW_ALARM: 54 // XXX check for max alarms 55 if (!Alarms.canCreateAlarm()) { 56 AlertWindow alert = 57 Application.getCurrentApp().getAlert(ID_LIMIT_ALERT, this); 58 alert.setMessage(StringFormat.withFormat(alert.getMessage(), 59 String.valueOf(Alarms.MAX_ALARM_COUNT))); 60 alert.show(); 61 return true; 62 } 55 63 alarmSetDialog().editAlarm(new Alarm(), true); 56 64 return true; -
trunk/hiptop/pester/net/sabi/pester/Alarms.java
r284 r294 13 13 public class Alarms extends StdActiveList { 14 14 // max # records in a datastore 15 p rivatestatic final int MAX_ALARM_COUNT = 50;15 public static final int MAX_ALARM_COUNT = 50; 16 16 17 17 private static Alarms sAlarmList = null; … … 62 62 } 63 63 64 public static boolean canCreateAlarm() { 65 return (sAlarmList.size() < MAX_ALARM_COUNT); 66 } 64 67 public static void addAlarm(Alarm alarm) { 65 68 sAlarmList.insertItemSorted(alarm, alarm);
Note:
See TracChangeset
for help on using the changeset viewer.