- Timestamp:
- 07/09/06 21:28:43 (18 years ago)
- Location:
- trunk/hiptop/pester
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hiptop/pester/locale/en_US/Pester.rsrc
r247 r248 68 68 menu ID_PERIOD_UNITS_MENU 69 69 menuItem 70 id = ID_PERIOD_SECONDS71 70 title = "second(s)" 72 71 event = EVENT_PERIOD_UNIT 73 72 eventData = 1 74 73 menuItem 75 id = ID_PERIOD_MINUTES76 74 title = "minute(s)" 77 75 event = EVENT_PERIOD_UNIT 78 76 eventData = 60 79 77 menuItem 80 id = ID_PERIOD_HOURS81 78 title = "hour(s)" 82 79 event = EVENT_PERIOD_UNIT -
trunk/hiptop/pester/net/sabi/pester/AlarmListView.java
r246 r248 13 13 import danger.ui.DatePicker; 14 14 import danger.ui.DialogWindow; 15 import danger.ui.Menu;16 15 import danger.ui.MenuItem; 17 16 import danger.ui.NumberEditor; … … 37 36 private RadioButton sInButton, sAtButton; 38 37 private NumberEditor sPeriodField; 39 private Menu sPeriodUnitsMenu;40 38 private PopupMenu sPeriodUnitsPopup; 41 39 // XXX don't allow <5 second repeating alarms … … 63 61 sAtButton = (RadioButton)sEditWindow.getDescendantWithID(ID_AT_BUTTON); 64 62 sPeriodField = (NumberEditor)sEditWindow.getDescendantWithID(ID_PERIOD_FIELD); 65 sPeriodUnitsMenu = (Menu)sEditWindow.getDescendantWithID(ID_PERIOD_UNITS_MENU);66 63 sPeriodUnitsPopup = (PopupMenu)sEditWindow.getDescendantWithID(ID_PERIOD_UNITS_POPUP); 67 64 sRepeatCheckBox = (CheckBox)sEditWindow.getDescendantWithID(ID_PERIOD_REPEAT_CHECKBOX); … … 97 94 int period = alarm.getPeriod(); 98 95 for (int i = sPeriodUnitsPopup.itemCount() - 1 ; i >= 0 ; --i) { 99 MenuItem item = sPeriodUnitsPopup.getItem(i); 100 int unitsPerSec = item.getEvent().data; 96 int unitsPerSec = sPeriodUnitsPopup.getItem(i).getEvent().data; 101 97 if (period % unitsPerSec == 0) { 102 sPeriodUnitsPopup.setValue WithItemID(sPeriodUnitsMenu.getIDOfItem(item));98 sPeriodUnitsPopup.setValue(i); 103 99 sPeriodField.setValue(period / unitsPerSec); 104 100 break; … … 139 135 } 140 136 137 // XXX make this into a more general validation method; 138 // XXX check before dismissing dialog that alarm is valid 139 // XXX and display alarm date 141 140 protected void constrainDate() { 142 141 // XXX schedule every minute (second?) if in AT mode … … 157 156 sEditingAlarm.setMessage(sMessageField.toString()); 158 157 if (sInButton.getValue() == 1) { 159 int itemI D = sPeriodUnitsPopup.getValueAsItemID();160 MenuItem item WithID = sPeriodUnitsMenu.getItemWithID(itemID);161 Event event = item WithID.getEvent();158 int itemIndex = sPeriodUnitsPopup.getValue(); 159 MenuItem itemAtIndex = sPeriodUnitsPopup.getItem(itemIndex); 160 Event event = itemAtIndex.getEvent(); 162 161 sEditingAlarm.setPeriod(sPeriodField.getValue() * event.data, 163 162 sRepeatCheckBox.getValue() == 1);
Note:
See TracChangeset
for help on using the changeset viewer.