Changeset 239 for trunk/hiptop/pester/net
- Timestamp:
- 07/08/06 19:28:37 (18 years ago)
- Location:
- trunk/hiptop/pester/net/sabi/pester
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hiptop/pester/net/sabi/pester/Alarm.java
r237 r239 13 13 // persisted 14 14 private String mMessage; 15 private boolean mUsesPeriod;15 private int mType; 16 16 private long mPeriod; 17 17 private Date mDate; … … 31 31 } 32 32 public boolean getUsesPeriod() { 33 return m UsesPeriod;33 return mType != TYPE_DATE; 34 34 } 35 35 public Date getDate() { … … 40 40 mMessage = message; 41 41 } 42 public void setPeriod(long period ) {43 m UsesPeriod = true;42 public void setPeriod(long period, boolean repeating) { 43 mType = repeating ? TYPE_PERIODIC_REPEATING : TYPE_PERIODIC; 44 44 mPeriod = period; 45 45 } 46 46 public void setDate(Date date) { 47 m UsesPeriod = false;47 mType = TYPE_DATE; 48 48 mDate = date; 49 49 } … … 58 58 dataStream.writeLong(mPeriod); 59 59 dataStream.writeInt(mDate.getUnixTimeGMT()); 60 dataStream.write Boolean(mUsesPeriod);60 dataStream.writeInt(mType); 61 61 dataStream.flush(); 62 62 return byteStream.toByteArray(); … … 78 78 mMessage = dataStream.readUTF(); 79 79 mPeriod = dataStream.readLong(); 80 m UsesPeriod = dataStream.readBoolean();80 mType = dataStream.readInt(); 81 81 } catch (Exception e) { 82 82 // XXX do something … … 96 96 } 97 97 98 public static final int TYPE_PERIODIC = 0; 99 public static final int TYPE_PERIODIC_REPEATING = 1; 100 public static final int TYPE_DATE = 2; 101 98 102 public static final int STATUS_INVALID = 0; 99 103 public static final int STATUS_EDITING = 1; -
trunk/hiptop/pester/net/sabi/pester/AlarmListView.java
r238 r239 6 6 import danger.ui.Button; 7 7 import danger.ui.DialogWindow; 8 import danger.ui.RadioButton; 8 9 import danger.ui.Rect; 9 10 import danger.ui.TypeAheadTextField; … … 23 24 private TypeAheadTextField sMessageField; 24 25 private Button sDiscardAlarmButton; 26 private RadioButton sInButton, sAtButton; 25 27 26 28 private static Alarm sFocusedAlarm, sEditingAlarm; … … 38 40 sMessageField = (TypeAheadTextField)sEditWindow.getDescendantWithID(ID_MESSAGE_FIELD); 39 41 sEditWindow.disableBottomRightButtonOnEmptyField(sMessageField); 42 sInButton = (RadioButton)sEditWindow.getDescendantWithID(ID_IN_BUTTON); 43 sAtButton = (RadioButton)sEditWindow.getDescendantWithID(ID_AT_BUTTON); 40 44 sDiscardAlarmButton = (Button)sEditWindow.getDescendantWithID(ID_DISCARD_ALARM_BUTTON); 41 45 … … 87 91 sAlarmList.removeItem(sFocusedAlarm); 88 92 return true; 93 case EVENT_IN: 94 sAtButton.setValue(0); 95 return true; 96 case EVENT_AT: 97 sInButton.setValue(0); 98 return true; 89 99 } 90 100 return super.receiveEvent(e);
Note:
See TracChangeset
for help on using the changeset viewer.