Ignore:
Timestamp:
07/08/06 19:28:37 (18 years ago)
Author:
Nicholas Riley
Message:

Final initial control set for edit dialog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hiptop/pester/net/sabi/pester/Alarm.java

    r237 r239  
    1313    // persisted
    1414    private String mMessage;
    15     private boolean mUsesPeriod;
     15    private int mType;
    1616    private long mPeriod;
    1717    private Date mDate;
     
    3131    }
    3232    public boolean getUsesPeriod() {
    33         return mUsesPeriod;
     33        return mType != TYPE_DATE;
    3434    }
    3535    public Date getDate() {
     
    4040        mMessage = message;
    4141    }
    42     public void setPeriod(long period) {
    43         mUsesPeriod = true;
     42    public void setPeriod(long period, boolean repeating) {
     43        mType = repeating ? TYPE_PERIODIC_REPEATING : TYPE_PERIODIC;
    4444        mPeriod = period;
    4545    }
    4646    public void setDate(Date date) {
    47         mUsesPeriod = false;
     47        mType = TYPE_DATE;
    4848        mDate = date;
    4949    }
     
    5858            dataStream.writeLong(mPeriod);
    5959            dataStream.writeInt(mDate.getUnixTimeGMT());
    60             dataStream.writeBoolean(mUsesPeriod);
     60            dataStream.writeInt(mType);
    6161            dataStream.flush();
    6262            return byteStream.toByteArray();
     
    7878            mMessage = dataStream.readUTF();
    7979            mPeriod = dataStream.readLong();
    80             mUsesPeriod = dataStream.readBoolean();
     80            mType = dataStream.readInt();
    8181        } catch (Exception e) {
    8282            // XXX do something
     
    9696    }
    9797
     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
    98102    public static final int STATUS_INVALID = 0;
    99103    public static final int STATUS_EDITING = 1;
Note: See TracChangeset for help on using the changeset viewer.