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); } }
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); }
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; } } } }
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); } } }
public void DeleteTask(ITask task) { EDSTask edsTask = task as EDSTask; edsTask.Remove(); }
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); } }
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); } } }
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; } } } }
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; }