packages/apps/Calendar
Revision | 061db49b29e5a3036398d70599b726c4dff6259f (tree) |
---|---|
Time | 2010-04-27 03:24:42 |
Author | Erik <roboerik@andr...> |
Commiter | Erik |
Revert "b/2622128 Exception events now get updated to be 'canceled' when deleted"
This reverts commit a9dd45e7a7f422c3c7d74f10d1e65880c181d43b. Moving to master
instead of Froyo.
@@ -84,12 +84,10 @@ public class DeleteEventHelper { | ||
84 | 84 | Events.DTSTART, |
85 | 85 | Events._SYNC_ID, |
86 | 86 | Events.EVENT_TIMEZONE, |
87 | - Events.ORIGINAL_EVENT, | |
88 | 87 | }; |
89 | 88 | |
90 | 89 | private int mEventIndexId; |
91 | 90 | private int mEventIndexRrule; |
92 | - private int mEventIndexOriginalEvent; | |
93 | 91 | private String mSyncId; |
94 | 92 | |
95 | 93 | public DeleteEventHelper(Activity parent, boolean exitWhenDone) { |
@@ -118,16 +116,6 @@ public class DeleteEventHelper { | ||
118 | 116 | }; |
119 | 117 | |
120 | 118 | /** |
121 | - * This callback is used when an exception to an event is deleted | |
122 | - */ | |
123 | - private DialogInterface.OnClickListener mDeleteExceptionDialogListener = | |
124 | - new DialogInterface.OnClickListener() { | |
125 | - public void onClick(DialogInterface dialog, int button) { | |
126 | - deleteExceptionEvent(); | |
127 | - } | |
128 | - }; | |
129 | - | |
130 | - /** | |
131 | 119 | * This callback is used when a list item for a repeating event is selected |
132 | 120 | */ |
133 | 121 | private DialogInterface.OnClickListener mDeleteListListener = |
@@ -214,7 +202,6 @@ public class DeleteEventHelper { | ||
214 | 202 | mCursor = cursor; |
215 | 203 | mEventIndexId = mCursor.getColumnIndexOrThrow(Events._ID); |
216 | 204 | mEventIndexRrule = mCursor.getColumnIndexOrThrow(Events.RRULE); |
217 | - mEventIndexOriginalEvent = mCursor.getColumnIndexOrThrow(Events.ORIGINAL_EVENT); | |
218 | 205 | int eventIndexSyncId = mCursor.getColumnIndexOrThrow(Events._SYNC_ID); |
219 | 206 | mSyncId = mCursor.getString(eventIndexSyncId); |
220 | 207 |
@@ -222,27 +209,15 @@ public class DeleteEventHelper { | ||
222 | 209 | // user if they want to delete all of the repeating events or |
223 | 210 | // just some of them. |
224 | 211 | String rRule = mCursor.getString(mEventIndexRrule); |
225 | - String originalEvent = mCursor.getString(this.mEventIndexOriginalEvent); | |
226 | 212 | if (rRule == null) { |
227 | - AlertDialog dialog = new AlertDialog.Builder(mParent) | |
213 | + // This is a normal event. Pop up a confirmation dialog. | |
214 | + new AlertDialog.Builder(mParent) | |
228 | 215 | .setTitle(R.string.delete_title) |
229 | 216 | .setMessage(R.string.delete_this_event_title) |
230 | 217 | .setIcon(android.R.drawable.ic_dialog_alert) |
218 | + .setPositiveButton(android.R.string.ok, mDeleteNormalDialogListener) | |
231 | 219 | .setNegativeButton(android.R.string.cancel, null) |
232 | - .create(); | |
233 | - | |
234 | - if (originalEvent == null) { | |
235 | - // This is a normal event. Pop up a confirmation dialog. | |
236 | - dialog.setButton(DialogInterface.BUTTON_POSITIVE, | |
237 | - mParent.getText(android.R.string.ok), | |
238 | - mDeleteNormalDialogListener); | |
239 | - } else { | |
240 | - // This is an exception event. Pop up a confirmation dialog. | |
241 | - dialog.setButton(DialogInterface.BUTTON_POSITIVE, | |
242 | - mParent.getText(android.R.string.ok), | |
243 | - mDeleteExceptionDialogListener); | |
244 | - } | |
245 | - dialog.show(); | |
220 | + .show(); | |
246 | 221 | } else { |
247 | 222 | // This is a repeating event. Pop up a dialog asking which events |
248 | 223 | // to delete. |
@@ -268,17 +243,6 @@ public class DeleteEventHelper { | ||
268 | 243 | } |
269 | 244 | } |
270 | 245 | |
271 | - private void deleteExceptionEvent() { | |
272 | - long id = mCursor.getInt(mEventIndexId); | |
273 | - | |
274 | - // update a recurrence exception by setting its status to "canceled" | |
275 | - ContentValues values = new ContentValues(); | |
276 | - values.put(Events.STATUS, Events.STATUS_CANCELED); | |
277 | - | |
278 | - Uri uri = ContentUris.withAppendedId(Calendar.Events.CONTENT_URI, id); | |
279 | - mContentResolver.update(uri, values, null, null); | |
280 | - } | |
281 | - | |
282 | 246 | private void deleteRepeatingEvent(int which) { |
283 | 247 | int indexDtstart = mCursor.getColumnIndexOrThrow(Events.DTSTART); |
284 | 248 | int indexAllDay = mCursor.getColumnIndexOrThrow(Events.ALL_DAY); |