Changeset 270 for trunk/hiptop/pester/net/sabi
- Timestamp:
- 07/20/06 22:43:43 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hiptop/pester/net/sabi/pester/AlarmSetDialog.java
r269 r270 99 99 protected void editAlarm(Alarm alarm) { 100 100 mMessageField.setText(alarm.getMessage()); 101 102 boolean usesPeriod = alarm.getUsesPeriod(); 103 if (usesPeriod) { 104 int period = alarm.getPeriod(); 101 102 int period = alarm.getPeriod(); 103 if (period > 0) { 105 104 for (int i = mPeriodUnitsPopup.itemCount() - 1 ; i >= 0 ; --i) { 106 105 int unitsPerSec = mPeriodUnitsPopup.getItem(i).getEvent().data; … … 116 115 editDate(new Date(alarm.getDate())); 117 116 117 boolean usesPeriod = alarm.getUsesPeriod(); 118 118 mInButton.setValue(usesPeriod ? 1 : 0); 119 119 mAtButton.setValue(usesPeriod ? 0 : 1); … … 166 166 } else { 167 167 date = mDateEditor.getDate(); 168 DEBUG.p("+ time editor.getTime = " + Alarm.dateTimeString(date, false));169 168 date.setSeconds(0); 170 DEBUG.p("+ seconds 0 = " + Alarm.dateTimeString(date, false));171 169 } 172 170 return date; … … 225 223 return true; 226 224 mEditingAlarm.setMessage(mMessageField.toString()); 227 if (isIn()) {228 229 230 } else {225 // set the period regardless, so it gets saved for future use 226 mEditingAlarm.setPeriod(editingInterval(), 227 mRepeatCheckBox.getValue() == 1); 228 if (!isIn()) { // otherwise, date = current time + period 231 229 mEditingAlarm.setDate(editingDate()); 232 230 } … … 266 264 Date date = editingDate(); 267 265 Date now = new Date(); 268 if (date.compareTo(now) <= 0) { 269 date.setToday(); 266 if (date.compareTo(now) <= 0) { // XXX do with 1 minute fuzz 267 int time = date.getTime(); 268 date.set(now); // idiotically, setToday() sets the time too 269 date.setTime(time); 270 270 if (date.compareTo(now) <= 0) 271 271 date.addDays(1); // tomorrow … … 282 282 { 283 283 Date date = (Date)e.argument; 284 date.setTime(m DateEditor.getDate().getTime());284 date.setTime(mTimeEditor.getDate().getTime()); 285 285 mTimeEditor.setDate(date); 286 286 mDateEditor.setDate(date);
Note:
See TracChangeset
for help on using the changeset viewer.