static void HandleDoNothing(object sender, ActionArgs e) { Tasks tasks = new Tasks(); tasks.Load(); Task current = tasks.CurrentTask(); if (!current.IsWorked(DateTime.Now)) { current.Worked.Add(DateTime.Now); } tasks.Save(); SetPidginStatus("Busy", current.Summary); }
static void MenuViewTaskActivated(object sender, EventArgs e) { Tasks tasks = new Tasks(); tasks.Load(); Task current = tasks.CurrentTask(); Notification notify = new Notification(current.Summary, current.Description.Substring(0, (current.Description.Length > 1000 ? 1000 : current.Description.Length))); notify.AddAction("edit", "Edit", HandleEditTaskActivated); notify.AddAction("finish", "Mark Finished", MenuFinishTaskActivated); notify.AddAction("list", "Tasks", HandleViewTaskListActivated); notify.Urgency = Urgency.Critical; notify.Show(); }
static void HandleFinishedTask(object sender, ActionArgs e) { Tasks tasks = new Tasks(); tasks.Load(); Task task = tasks.CurrentTask(); tasks.SetCurrentTaskFinished(); Notification notify = new Notification(); notify.Summary = "Task Finished"; notify.Body = task.Summary; notify.Urgency = Urgency.Critical; notify.Show(); SuggestTask(); }
static void MenuFinishTaskActivated(object sender, EventArgs e) { Tasks tasks = new Tasks(); tasks.Load(); Task task = tasks.CurrentTask(); tasks.SetCurrentTaskFinished(); Notification notify = new Notification(); notify.Summary = "Task Finished"; notify.Body = task.Summary; notify.Urgency = Urgency.Critical; notify.Show(); RequestWork.SuggestTask(); }
internal static void DisplayMessage() { Tasks tasks = new Tasks(); tasks.Load(); Task current = tasks.CurrentTask(); Notification notify; if (current != null) { notify = new Notification("Tasks", "Are you still working on this task?\n" + current.Summary); notify.AddAction("yes", "Yes", HandleDoNothing); notify.AddAction("view", "View", HandleEditTask); notify.AddAction("finish", "Finish", HandleFinishedTask); notify.Timeout = 0; notify.Urgency = Urgency.Critical; notify.Show(); } else { SuggestTask(); } }
static internal void DisplayMessage() { Tasks tasks = new Tasks(); tasks.Load(); Task current = tasks.CurrentTask(); Notification notify; if (current != null) { notify = new Notification("Tasks", "Are you still working on this task?\n" + current.Summary); notify.AddAction("yes", "Yes", HandleDoNothing); notify.AddAction("view", "View", HandleEditTask); notify.AddAction("finish", "Finish", HandleFinishedTask); notify.Timeout = 0; notify.Urgency = Urgency.Critical; notify.Show(); } else { SuggestTask(); } }
static void HandleEditTask(object sender, ActionArgs e) { Tasks tasks = new Tasks(); tasks.Load(); EditTask(tasks.CurrentTask()); }
static void SelectTask() { Tasks tasks = new Tasks(); tasks.Load(); tasks.FinishCurrentTaskAndStartPriorityTask(); Task current = tasks.CurrentTask(); SetPidginStatus("Busy", current.Summary); }
static void HandleEditTaskActivated(object sender, EventArgs e) { Tasks tasks = new Tasks(); tasks.Load(); RequestWork.EditTask(tasks.CurrentTask()); }