Merge and resolve conflicts from arne/aj_bugfix_delete_timedtask_notif

pull/14/head
Sam Bosley 12 years ago
commit a4bd31c5c4

@ -50,6 +50,11 @@ public class TimerPlugin extends BroadcastReceiver {
* @param start if true, start timer. else, stop it
*/
public static void updateTimer(Context context, Task task, boolean start) {
// if this call comes from tasklist, then we need to fill in the gaps to handle this correctly
// this is needed just for stopping a task
if (!start && (task.getValue(Task.TIMER_START) == 0))
task = PluginServices.getTaskService().fetchById(task.getId(), Task.ID, Task.TIMER_START, Task.ELAPSED_SECONDS);
if(start) {
if(task.getValue(Task.TIMER_START) == 0) {
task.setValue(Task.TIMER_START, DateUtilities.now());

@ -89,6 +89,7 @@ import com.todoroo.astrid.tags.TagsControlSet;
import com.todoroo.astrid.taskrabbit.TaskRabbitControlSet;
import com.todoroo.astrid.timers.TimerActionControlSet;
import com.todoroo.astrid.timers.TimerControlSet;
import com.todoroo.astrid.timers.TimerPlugin;
import com.todoroo.astrid.ui.DateChangedAlerts;
import com.todoroo.astrid.ui.DeadlineControlSet;
import com.todoroo.astrid.ui.EditNotesControlSet;
@ -982,6 +983,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
taskService.delete(model);
TimerPlugin.updateTimer(getActivity(), model, false);
shouldSaveState = false;
showDeleteToast();

@ -102,6 +102,7 @@ import com.todoroo.astrid.service.UpgradeService;
import com.todoroo.astrid.subtasks.SubtasksListFragment;
import com.todoroo.astrid.sync.SyncProviderPreferences;
import com.todoroo.astrid.taskrabbit.TaskRabbitMetadata;
import com.todoroo.astrid.timers.TimerPlugin;
import com.todoroo.astrid.ui.QuickAddBar;
import com.todoroo.astrid.utility.AstridPreferences;
import com.todoroo.astrid.utility.Constants;
@ -1133,6 +1134,7 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
public void onClick(DialogInterface dialog, int which) {
onTaskDelete(task);
taskService.delete(task);
TimerPlugin.updateTimer(getActivity(), task, false);
loadTaskListContent(true);
}
}).setNegativeButton(android.R.string.cancel, null).show();
@ -1259,6 +1261,9 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
}
case CONTEXT_MENU_PURGE_TASK_ID: {
itemId = item.getGroupId();
Task task = new Task();
task.setId(itemId);
TimerPlugin.updateTimer(getActivity(), task, false);
taskService.purge(itemId);
loadTaskListContent(true);
return true;

Loading…
Cancel
Save