Exemple #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);
        }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();
     }
 }
Exemple #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);
 }
 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();
 }
Exemple #11
0
 static void HandleEditTaskActivated(object sender, EventArgs e)
 {
     Tasks tasks = new Tasks();
     tasks.Load();
     RequestWork.EditTask(tasks.CurrentTask());
 }
Exemple #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();
 }
Exemple #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();
 }