예제 #1
0
        public void UpdateTask(EDSTask task)
        {
            // Set the task in the store so the model will update the UI.
            Gtk.TreeIter iter;

            if (!taskIters.ContainsKey(task.Id))
            {
                return;
            }

            iter = taskIters [task.Id];

            if (task.State == TaskState.Deleted)
            {
                taskIters.Remove(task.Id);
                if (!taskStore.Remove(ref iter))
                {
                    Logger.Debug("Successfully deleted from taskStore: {0}",
                                 task.Name);
                }
                else
                {
                    Logger.Debug("Problem removing from taskStore: {0}",
                                 task.Name);
                }
            }
            else
            {
                taskStore.SetValue(iter, 0, task);
            }
        }
예제 #2
0
        public ITask CreateTask(string taskName, ICategory category)
        {
            Gtk.TreeIter taskIter;
            EDSTask      edsTask;

            if (category == null)
            {
                return(null);
            }

            if (category is Tasque.AllCategory && defaultCategory != null)
            {
                category = this.defaultCategory;
            }

            EDSCategory  edsCategory = category as EDSCategory;
            CalComponent task        = new CalComponent(edsCategory.TaskList);

            task.Summary = taskName;

            lock (taskLock) {
                edsTask  = new EDSTask(task, edsCategory);
                taskIter = taskStore.AppendNode();
                taskStore.SetValue(taskIter, 0, edsTask);
                taskIters [task.Uid] = taskIter;
            }

            task.Commit();

            return(edsTask);
        }
예제 #3
0
 public void TasksAdded(object o, Evolution.ObjectsAddedArgs args)
 {
     Logger.Debug("Tasks Added ");
     CalComponent[] addedTasks = CalUtil.ICalToCalComponentArray(args.Objects.Handle, ((CalView)o).Client);
     lock (taskLock) {
         Gtk.TreeIter taskIter;
         EDSTask      edsTask;
         EDSCategory  edsCategory;
         foreach (CalComponent task in addedTasks)
         {
             if (!taskIters.ContainsKey(task.Uid))
             {
                 edsCategory = new EDSCategory(task.Source);
                 edsTask     = new EDSTask(task, edsCategory);
                 taskIter    = taskStore.AppendNode();
                 taskStore.SetValue(taskIter, 0, edsTask);
                 taskIters [edsTask.Id] = taskIter;
             }
         }
     }
 }
예제 #4
0
        public void TasksModified(object o, Evolution.ObjectsModifiedArgs args)
        {
            Logger.Debug("Tasks Modified ");
            Gtk.TreeIter iter;
            EDSTask      edsTask;
            EDSCategory  edsCategory;

            CalComponent[] modifiedTasks = CalUtil.ICalToCalComponentArray(args.Objects.Handle, ((CalView)o).Client);

            foreach (CalComponent task in modifiedTasks)
            {
                Logger.Debug("Modified : " + task.Summary);
                if (taskIters.ContainsKey(task.Uid))
                {
                    edsCategory = new EDSCategory(task.Source);
                    edsTask     = new EDSTask(task, edsCategory);
                    iter        = taskIters[edsTask.Id];
                    taskStore.SetValue(iter, 0, edsTask);
                }
            }
        }
예제 #5
0
        public void DeleteTask(ITask task)
        {
            EDSTask edsTask = task as EDSTask;

            edsTask.Remove();
        }
예제 #6
0
        public void UpdateTask(EDSTask task)
        {
            // Set the task in the store so the model will update the UI.
                       Gtk.TreeIter iter;

                       if (!taskIters.ContainsKey (task.Id))
                               return;

                       iter = taskIters [task.Id];

                       if (task.State == TaskState.Deleted) {
                               taskIters.Remove (task.Id);
                               if (!taskStore.Remove (ref iter)) {
                                       Logger.Debug ("Successfully deleted from taskStore: {0}",
                                               task.Name);
                               } else {
                                       Logger.Debug ("Problem removing from taskStore: {0}",
                                               task.Name);
                               }
                       } else {
                               taskStore.SetValue (iter, 0, task);
                       }
        }
예제 #7
0
        public void TasksModified(object o, Evolution.ObjectsModifiedArgs args)
        {
            Logger.Debug ("Tasks Modified ");
                       Gtk.TreeIter iter;
                       EDSTask edsTask;
                       EDSCategory edsCategory;

                       CalComponent[] modifiedTasks = CalUtil.ICalToCalComponentArray (args.Objects.Handle, ((CalView) o).Client);

                       foreach (CalComponent task in modifiedTasks) {
                   Logger.Debug ("Modified : " + task.Summary);
                               if(taskIters.ContainsKey(task.Uid)) {
                       edsCategory = new EDSCategory (task.Source);
                       edsTask = new EDSTask (task, edsCategory);
                                       iter = taskIters[edsTask.Id];
                                       taskStore.SetValue (iter, 0, edsTask);
                               }
                       }
        }
예제 #8
0
 public void TasksAdded(object o, Evolution.ObjectsAddedArgs args)
 {
     Logger.Debug ("Tasks Added ");
                CalComponent[] addedTasks = CalUtil.ICalToCalComponentArray (args.Objects.Handle, ((CalView) o).Client);
                lock (taskLock) {
                        Gtk.TreeIter taskIter;
                        EDSTask edsTask;
                        EDSCategory edsCategory;
                        foreach (CalComponent task in addedTasks) {
                if(!taskIters.ContainsKey(task.Uid)) {
                    edsCategory = new EDSCategory (task.Source);
                    edsTask = new EDSTask (task, edsCategory);
                    taskIter = taskStore.AppendNode ();
                    taskStore.SetValue (taskIter, 0, edsTask);
                    taskIters [edsTask.Id] = taskIter;
                }
                        }
                }
 }
예제 #9
0
        public ITask CreateTask(string taskName, ICategory category)
        {
            Gtk.TreeIter taskIter;
               EDSTask edsTask;

                       if (category == null )
                               return null;

               if (category is Tasque.AllCategory && defaultCategory != null)
                   category = this.defaultCategory;

                       EDSCategory edsCategory = category as EDSCategory;
                       CalComponent task = new CalComponent (edsCategory.TaskList);
                       task.Summary = taskName;

                       lock (taskLock) {
                   edsTask = new EDSTask (task, edsCategory);
                   taskIter = taskStore.AppendNode ();
                   taskStore.SetValue (taskIter, 0, edsTask);
                   taskIters [task.Uid] = taskIter;
               }

                       task.Commit ();

                       return edsTask;
        }