Beispiel #1
0
        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);
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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();
     }
 }
Beispiel #6
0
        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 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 SelectTask()
 {
     Tasks tasks = new Tasks();
     tasks.Load();
     tasks.FinishCurrentTaskAndStartPriorityTask();
     Task current = tasks.CurrentTask();
     SetPidginStatus("Busy", current.Summary);
 }
Beispiel #10
0
 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();
 }
Beispiel #11
0
 static void HandleEditTaskActivated(object sender, EventArgs e)
 {
     Tasks tasks = new Tasks();
     tasks.Load();
     RequestWork.EditTask(tasks.CurrentTask());
 }
Beispiel #12
0
 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();
 }
Beispiel #13
0
 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();
 }