tasque r194 - in branches/new_cache: . src src/Backends/Rtm
- From: bgmerrell svn gnome org
- To: svn-commits-list gnome org
- Subject: tasque r194 - in branches/new_cache: . src src/Backends/Rtm
- Date: Fri, 26 Dec 2008 20:32:02 +0000 (UTC)
Author: bgmerrell
Date: Fri Dec 26 20:32:02 2008
New Revision: 194
URL: http://svn.gnome.org/viewvc/tasque?rev=194&view=rev
Log:
* configure.ac,
* src/PreferencesDialog.cs,
* src/IBackend.cs,
* src/Application.cs,
* src/Backends/Rtm/RtmTask.cs,
* src/Backends/Rtm/RtmBackend.cs,
* src/CompletedTaskGroup.cs,
* src/TaskGroup.cs,
* src/TaskWindow.cs,
* src/RemoteControl.cs,
* src/Makefile.am: Manual merge of most things from the old cache
branch. This branch will build at this point, but everything is
broken. To summarize: SQLite is removed as an optional backend and
is implemented as an integrated part of Tasque to store tasks before
they are pushed out to a backend.
Modified:
branches/new_cache/ChangeLog
branches/new_cache/configure.ac
branches/new_cache/src/Application.cs
branches/new_cache/src/Backends/Rtm/RtmBackend.cs
branches/new_cache/src/Backends/Rtm/RtmTask.cs
branches/new_cache/src/CompletedTaskGroup.cs
branches/new_cache/src/IBackend.cs
branches/new_cache/src/Makefile.am
branches/new_cache/src/PreferencesDialog.cs
branches/new_cache/src/RemoteControl.cs
branches/new_cache/src/TaskGroup.cs
branches/new_cache/src/TaskWindow.cs
Modified: branches/new_cache/configure.ac
==============================================================================
--- branches/new_cache/configure.ac (original)
+++ branches/new_cache/configure.ac Fri Dec 26 20:32:02 2008
@@ -123,15 +123,6 @@
enable_backend_rtm=$enableval, enable_backend_rtm=no)
#
-# SQLite Backend
-#
-AC_ARG_ENABLE(backend_sqlite,
- AC_HELP_STRING([--enable-backend-sqlite],
- [Enable the SQLite Backend [default=no]]),
- enable_backend_sqlite=$enableval, enable_backend_sqlite=no)
-AM_CONDITIONAL(ENABLE_BACKEND_SQLITE, test "x$enable_backend_sqlite" = "xyes")
-
-#
# ICEcore for IceBackend Support
#
AC_ARG_ENABLE(backend_icecore,
Modified: branches/new_cache/src/Application.cs
==============================================================================
--- branches/new_cache/src/Application.cs (original)
+++ branches/new_cache/src/Application.cs Fri Dec 26 20:32:02 2008
@@ -62,6 +62,7 @@
private EventBox eb;
private IBackend backend;
private PreferencesDialog preferencesDialog;
+ private LocalCache localCache;
private bool quietStart = false;
private DateTime currentDay = DateTime.Today;
@@ -140,6 +141,11 @@
}
// get { return Application.Instance.availableBackends; }
}
+
+ public static LocalCache LocalCache
+ {
+ get { return Application.Instance.localCache; }
+ }
public static Application Instance
{
Modified: branches/new_cache/src/Backends/Rtm/RtmBackend.cs
==============================================================================
--- branches/new_cache/src/Backends/Rtm/RtmBackend.cs (original)
+++ branches/new_cache/src/Backends/Rtm/RtmBackend.cs Fri Dec 26 20:32:02 2008
@@ -17,70 +17,25 @@
{
private const string apiKey = "b29f7517b6584035d07df3170b80c430";
private const string sharedSecret = "93eb5f83628b2066";
- private Gtk.TreeStore taskStore;
- private Gtk.TreeModelSort sortedTasksModel;
- private Gtk.ListStore categoryListStore;
- private Gtk.TreeModelSort sortedCategoriesModel;
-
- private Thread refreshThread;
- private bool runningRefreshThread;
- private AutoResetEvent runRefreshEvent;
+ private Dictionary<string, ITask> tasks;
+ private Dictionary<string, ICategory> categories;
private Rtm rtm;
private string frob;
private Auth rtmAuth;
private string timeline;
- private Dictionary<string, Gtk.TreeIter> taskIters;
- private object taskLock;
-
- private Dictionary<string, RtmCategory> categories;
- private object catLock;
private bool initialized;
private bool configured;
- public event BackendInitializedHandler BackendInitialized;
- public event BackendSyncStartedHandler BackendSyncStarted;
- public event BackendSyncFinishedHandler BackendSyncFinished;
-
public RtmBackend ()
{
initialized = false;
configured = false;
- taskIters = new Dictionary<string, Gtk.TreeIter> ();
- taskLock = new Object();
-
- categories = new Dictionary<string, RtmCategory> ();
- catLock = new Object();
-
- // *************************************
- // Data Model Set up
- // *************************************
- taskStore = new Gtk.TreeStore (typeof (ITask));
-
- sortedTasksModel = new Gtk.TreeModelSort (taskStore);
- sortedTasksModel.SetSortFunc (0, new Gtk.TreeIterCompareFunc (CompareTasksSortFunc));
- sortedTasksModel.SetSortColumnId (0, Gtk.SortType.Ascending);
-
- categoryListStore = new Gtk.ListStore (typeof (ICategory));
-
- sortedCategoriesModel = new Gtk.TreeModelSort (categoryListStore);
- sortedCategoriesModel.SetSortFunc (0, new Gtk.TreeIterCompareFunc (CompareCategorySortFunc));
- sortedCategoriesModel.SetSortColumnId (0, Gtk.SortType.Ascending);
-
- // make sure we have the all Category in our list
- Gtk.Application.Invoke ( delegate {
- AllCategory allCategory = new Tasque.AllCategory ();
- Gtk.TreeIter iter = categoryListStore.Append ();
- categoryListStore.SetValue (iter, 0, allCategory);
- });
-
- runRefreshEvent = new AutoResetEvent(false);
-
- runningRefreshThread = false;
- refreshThread = new Thread(RefreshThreadLoop);
+ tasks = new Dictionary<string, Tasque.ITask> ();
+ categories = new Dictionary<string, ICategory> ();
}
#region Public Properties
@@ -92,17 +47,17 @@
/// <value>
/// All the tasks including ITaskDivider items.
/// </value>
- public Gtk.TreeModel Tasks
+ public Dictionary<string, ITask> Tasks
{
- get { return sortedTasksModel; }
+ get { return tasks; }
}
/// <value>
/// This returns all the task lists (categories) that exist.
/// </value>
- public Gtk.TreeModel Categories
+ public Dictionary<string, ICategory> Categories
{
- get { return sortedCategoriesModel; }
+ get { return categories; }
}
public string RtmUserName
@@ -165,39 +120,30 @@
return rtmTask;
}
+
public void DeleteTask(ITask task)
- {
- RtmTask rtmTask = task as RtmTask;
- if(rtm != null) {
- try {
- rtm.TasksDelete(timeline, rtmTask.ListID, rtmTask.SeriesTaskID, rtmTask.TaskTaskID);
-
- lock(taskLock)
- {
- Gtk.Application.Invoke ( delegate {
- if(taskIters.ContainsKey(rtmTask.ID)) {
- Gtk.TreeIter iter = taskIters[rtmTask.ID];
- taskStore.Remove(ref iter);
- taskIters.Remove(rtmTask.ID);
- }
- });
- }
- } catch(Exception e) {
- Logger.Debug("Unable to delete task: " + task.Name);
- Logger.Debug(e.ToString());
- }
- }
- else
- throw new Exception("Unable to communicate with Remember The Milk");
- }
-
+ {
+ RtmTask rtmTask = task as RtmTask;
+ if(rtm != null) {
+ try {
+ rtm.TasksDelete(timeline, rtmTask.ListID, rtmTask.SeriesTaskID, rtmTask.TaskID);
+
+ if(tasks.ContainsKey(rtmTask.Id) ) {
+ tasks.Remove(rtmTask.Id);
+ }
+ } catch(Exception e) {
+ Logger.Debug("Unable to delete task: " + task.Name);
+ Logger.Debug(e.ToString());
+ }
+ }
+ else
+ throw new Exception("Unable to communicate with Remember The Milk");
+ }
+
public void Refresh()
{
- Logger.Debug("Refreshing data...");
-
- runRefreshEvent.Set();
-
- Logger.Debug("Done refreshing data!");
+ UpdateCategories();
+ UpdateTasks();
}
public void Initialize()
@@ -240,24 +186,11 @@
if(rtm == null)
rtm = new Rtm(apiKey, sharedSecret);
- runningRefreshThread = true;
- Logger.Debug("ThreadState: " + refreshThread.ThreadState);
- if (refreshThread.ThreadState == ThreadState.Running) {
- Logger.Debug ("RtmBackend refreshThread already running");
- } else {
- if (!refreshThread.IsAlive) {
- refreshThread = new Thread(RefreshThreadLoop);
- }
- refreshThread.Start();
- }
- runRefreshEvent.Set();
+ initialized = true;
}
public void Cleanup()
{
- runningRefreshThread = false;
- runRefreshEvent.Set();
- refreshThread.Abort ();
}
public Gtk.Widget GetPreferencesWidget ()
@@ -295,7 +228,7 @@
Logger.Debug("RTM Auth Token is valid!");
Logger.Debug("Setting configured status to true");
configured = true;
- Refresh();
+ //Refresh();
} catch (Exception e) {
rtm = null;
rtmAuth = null;
@@ -308,7 +241,7 @@
{
if(rtm != null) {
try {
- List list = rtm.TasksSetName(timeline, task.ListID, task.SeriesTaskID, task.TaskTaskID, task.Name);
+ List list = rtm.TasksSetName(timeline, task.ListID, task.SeriesTaskID, task.TaskID, task.Name);
UpdateTaskFromResult(list);
} catch(Exception e) {
Logger.Debug("Unable to set name on task: " + task.Name);
@@ -323,9 +256,9 @@
try {
List list;
if(task.DueDate == DateTime.MinValue)
- list = rtm.TasksSetDueDate(timeline, task.ListID, task.SeriesTaskID, task.TaskTaskID);
+ list = rtm.TasksSetDueDate(timeline, task.ListID, task.SeriesTaskID, task.TaskID);
else
- list = rtm.TasksSetDueDate(timeline, task.ListID, task.SeriesTaskID, task.TaskTaskID, task.DueDateString);
+ list = rtm.TasksSetDueDate(timeline, task.ListID, task.SeriesTaskID, task.TaskID, task.DueDateString);
UpdateTaskFromResult(list);
} catch(Exception e) {
Logger.Debug("Unable to set due date on task: " + task.Name);
@@ -343,7 +276,7 @@
{
if(rtm != null) {
try {
- List list = rtm.TasksSetPriority(timeline, task.ListID, task.SeriesTaskID, task.TaskTaskID, task.PriorityString);
+ List list = rtm.TasksSetPriority(timeline, task.ListID, task.SeriesTaskID, task.TaskID, task.PriorityString);
UpdateTaskFromResult(list);
} catch(Exception e) {
Logger.Debug("Unable to set priority on task: " + task.Name);
@@ -358,7 +291,7 @@
{
if(rtm != null) {
try {
- List list = rtm.TasksUncomplete(timeline, task.ListID, task.SeriesTaskID, task.TaskTaskID);
+ List list = rtm.TasksUncomplete(timeline, task.ListID, task.SeriesTaskID, task.TaskID);
UpdateTaskFromResult(list);
} catch(Exception e) {
Logger.Debug("Unable to set Task as completed: " + task.Name);
@@ -379,7 +312,7 @@
{
if(rtm != null) {
try {
- List list = rtm.TasksComplete(timeline, task.ListID, task.SeriesTaskID, task.TaskTaskID);
+ List list = rtm.TasksComplete(timeline, task.ListID, task.SeriesTaskID, task.TaskID);
UpdateTaskFromResult(list);
} catch(Exception e) {
Logger.Debug("Unable to set Task as completed: " + task.Name);
@@ -398,7 +331,7 @@
{
if(rtm != null) {
try {
- List list = rtm.TasksMoveTo(timeline, task.ListID, id, task.SeriesTaskID, task.TaskTaskID);
+ List list = rtm.TasksMoveTo(timeline, task.ListID, id, task.SeriesTaskID, task.TaskID);
UpdateTaskFromResult(list);
} catch(Exception e) {
Logger.Debug("Unable to set Task as completed: " + task.Name);
@@ -410,43 +343,24 @@
public void UpdateTask(RtmTask task)
{
- lock(taskLock)
+ if(tasks.ContainsKey(task.Id))
{
- Gtk.TreeIter iter;
-
- Gtk.Application.Invoke ( delegate {
- if(taskIters.ContainsKey(task.ID)) {
- iter = taskIters[task.ID];
- taskStore.SetValue (iter, 0, task);
- }
- });
- }
+ tasks[task.Id] = task;
+ }
}
public RtmTask UpdateTaskFromResult(List list)
{
TaskSeries ts = list.TaskSeriesCollection[0];
- if(ts != null) {
- RtmTask rtmTask = new RtmTask(ts, this, list.ID);
- lock(taskLock)
- {
- Gtk.Application.Invoke ( delegate {
- if(taskIters.ContainsKey(rtmTask.ID)) {
- Gtk.TreeIter iter = taskIters[rtmTask.ID];
- taskStore.SetValue (iter, 0, rtmTask);
- } else {
- Gtk.TreeIter iter = taskStore.AppendNode();
- taskIters.Add(rtmTask.ID, iter);
- taskStore.SetValue (iter, 0, rtmTask);
- }
- });
- }
- return rtmTask;
- }
- return null;
+ if(ts != null) {
+ RtmTask rtmTask = new RtmTask(ts, this, list.ID);
+ tasks[rtmTask.Id] = rtmTask;
+ return rtmTask;
+ }
+ return null;
}
- public RtmCategory GetCategory(string id)
+ public ICategory GetCategory(string id)
{
if(categories.ContainsKey(id))
return categories[id];
@@ -461,7 +375,7 @@
if(rtm != null) {
try {
- note = rtm.NotesAdd(timeline, rtmTask.ListID, rtmTask.SeriesTaskID, rtmTask.TaskTaskID, String.Empty, text);
+ note = rtm.NotesAdd(timeline, rtmTask.ListID, rtmTask.SeriesTaskID, rtmTask.TaskID, String.Empty, text);
rtmNote = new RtmNote(note);
} catch(Exception e) {
Logger.Debug("RtmBackend.CreateNote: Unable to create a new note");
@@ -506,169 +420,70 @@
#endregion // Public Methods
#region Private Methods
- static int CompareTasksSortFunc (Gtk.TreeModel model,
- Gtk.TreeIter a,
- Gtk.TreeIter b)
- {
- ITask taskA = model.GetValue (a, 0) as ITask;
- ITask taskB = model.GetValue (b, 0) as ITask;
-
- if (taskA == null || taskB == null)
- return 0;
-
- return (taskA.CompareTo (taskB));
- }
-
- static int CompareCategorySortFunc (Gtk.TreeModel model,
- Gtk.TreeIter a,
- Gtk.TreeIter b)
- {
- ICategory categoryA = model.GetValue (a, 0) as ICategory;
- ICategory categoryB = model.GetValue (b, 0) as ICategory;
-
- if (categoryA == null || categoryB == null)
- return 0;
-
- if (categoryA is Tasque.AllCategory)
- return -1;
- else if (categoryB is Tasque.AllCategory)
- return 1;
-
- return (categoryA.Name.CompareTo (categoryB.Name));
- }
-
/// <summary>
/// Update the model to match what is in RTM
/// FIXME: This is a lame implementation and needs to be optimized
/// </summary>
- private void UpdateCategories(Lists lists)
+ private void UpdateCategories()
{
Logger.Debug("RtmBackend.UpdateCategories was called");
+ categories.Clear();
try {
+ Lists lists = rtm.ListsGetList();
foreach(List list in lists.listCollection)
{
RtmCategory rtmCategory = new RtmCategory(list);
-
- lock(catLock)
- {
- Gtk.TreeIter iter;
-
- Gtk.Application.Invoke ( delegate {
-
- if(categories.ContainsKey(rtmCategory.ID)) {
- iter = categories[rtmCategory.ID].Iter;
- categoryListStore.SetValue (iter, 0, rtmCategory);
- } else {
- iter = categoryListStore.Append();
- categoryListStore.SetValue (iter, 0, rtmCategory);
- rtmCategory.Iter = iter;
- categories.Add(rtmCategory.ID, rtmCategory);
- }
- });
- }
+ categories[rtmCategory.ID] = rtmCategory;
}
} catch (Exception e) {
Logger.Debug("Exception in fetch " + e.Message);
}
- Logger.Debug("RtmBackend.UpdateCategories is done");
+ Logger.Debug("RtmBackend.UpdateCategories is done");
}
/// <summary>
/// Update the model to match what is in RTM
/// FIXME: This is a lame implementation and needs to be optimized
/// </summary>
- private void UpdateTasks(Lists lists)
+ private void UpdateTasks()
{
Logger.Debug("RtmBackend.UpdateTasks was called");
+ tasks.Clear();
try {
- foreach(List list in lists.listCollection)
- {
- Tasks tasks = null;
- try {
- tasks = rtm.TasksGetList(list.ID);
- } catch (Exception tglex) {
- Logger.Debug("Exception calling TasksGetList(list.ListID) " + tglex.Message);
- }
- if(tasks != null) {
- foreach(List tList in tasks.ListCollection)
- {
- if (tList.TaskSeriesCollection == null)
- continue;
- foreach(TaskSeries ts in tList.TaskSeriesCollection)
- {
- RtmTask rtmTask = new RtmTask(ts, this, list.ID);
-
- lock(taskLock)
- {
- Gtk.TreeIter iter;
-
- Gtk.Application.Invoke ( delegate {
-
- if(taskIters.ContainsKey(rtmTask.ID)) {
- iter = taskIters[rtmTask.ID];
- } else {
- iter = taskStore.AppendNode ();
- taskIters.Add(rtmTask.ID, iter);
- }
-
- taskStore.SetValue (iter, 0, rtmTask);
- });
- }
- }
- }
- }
- }
- } catch (Exception e) {
- Logger.Debug("Exception in fetch " + e.Message);
- Logger.Debug(e.ToString());
- }
+ Lists lists = rtm.ListsGetList();
+ foreach(List list in lists.listCollection)
+ {
+ Tasks tasksList = null;
+ try {
+ tasksList = rtm.TasksGetList(list.ID);
+ } catch (Exception tglex) {
+ Logger.Debug("Exception calling TasksGetList(list.ListID) " + tglex.Message);
+ }
+
+ if(tasksList != null) {
+ foreach(List tList in tasksList.ListCollection)
+ {
+ foreach(TaskSeries ts in tList.TaskSeriesCollection)
+ {
+ RtmTask rtmTask = new RtmTask(ts, this, list.ID);
+
+ tasks[rtmTask.Id] = rtmTask;
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ Logger.Debug("Exception in fetch " + e.Message);
+ Logger.Debug(e.ToString());
+ }
+
Logger.Debug("RtmBackend.UpdateTasks is done");
}
-
- private void RefreshThreadLoop()
- {
- while(runningRefreshThread) {
- runRefreshEvent.WaitOne();
-
- if(!runningRefreshThread)
- return;
-
- // Fire the event on the main thread
- Gtk.Application.Invoke ( delegate {
- if(BackendSyncStarted != null)
- BackendSyncStarted();
- });
-
- runRefreshEvent.Reset();
-
- if(rtmAuth != null) {
- Lists lists = rtm.ListsGetList();
- UpdateCategories(lists);
- UpdateTasks(lists);
- }
- if(!initialized) {
- initialized = true;
-
- // Fire the event on the main thread
- Gtk.Application.Invoke ( delegate {
- if(BackendInitialized != null)
- BackendInitialized();
- });
- }
-
- // Fire the event on the main thread
- Gtk.Application.Invoke ( delegate {
- if(BackendSyncFinished != null)
- BackendSyncFinished();
- });
- }
- }
-
#endregion // Private Methods
#region Event Handlers
Modified: branches/new_cache/src/Backends/Rtm/RtmTask.cs
==============================================================================
--- branches/new_cache/src/Backends/Rtm/RtmTask.cs (original)
+++ branches/new_cache/src/Backends/Rtm/RtmTask.cs Fri Dec 26 20:32:02 2008
@@ -26,7 +26,7 @@
{
this.taskSeries = taskSeries;
this.rtmBackend = be;
- this.category = be.GetCategory(listID);
+ this.category = be.GetCategory(listID) as RtmCategory;
if(CompletionDate == DateTime.MinValue )
state = TaskState.Active;
@@ -218,7 +218,7 @@
get { return taskSeries.TaskID; }
}
- public string TaskTaskID
+ public string TaskID
{
get { return taskSeries.Task.TaskID; }
}
Modified: branches/new_cache/src/CompletedTaskGroup.cs
==============================================================================
--- branches/new_cache/src/CompletedTaskGroup.cs (original)
+++ branches/new_cache/src/CompletedTaskGroup.cs Fri Dec 26 20:32:02 2008
@@ -141,7 +141,7 @@
Preferences.SelectedCategoryKey);
if (cat != null) {
TreeIter iter;
- TreeModel model = Application.Backend.Categories;
+ TreeModel model = Application.LocalCache.Categories;
if (model.GetIterFirst (out iter)) {
do {
Modified: branches/new_cache/src/IBackend.cs
==============================================================================
--- branches/new_cache/src/IBackend.cs (original)
+++ branches/new_cache/src/IBackend.cs Fri Dec 26 20:32:02 2008
@@ -2,23 +2,16 @@
// User: boyd at 7:02 AMÂ2/11/2008
using System;
+using System.Collections.Generic;
namespace Tasque.Backends
{
- public delegate void BackendInitializedHandler ();
- public delegate void BackendSyncStartedHandler ();
- public delegate void BackendSyncFinishedHandler ();
-
/// <summary>
/// This is the main integration interface for different backends that
/// Tasque can use.
/// </summary>
public interface IBackend
{
- event BackendInitializedHandler BackendInitialized;
- event BackendSyncStartedHandler BackendSyncStarted;
- event BackendSyncFinishedHandler BackendSyncFinished;
-
#region Properties
/// <value>
/// A human-readable name for the backend that will be displayed in the
@@ -29,22 +22,22 @@
{
get;
}
-
+
/// <value>
- /// All the tasks provided by the backend.
- /// </value>
- Gtk.TreeModel Tasks
- {
- get;
- }
-
+ /// Dictionary of ITasks. The key is the backend's task ID or external ID.
+ /// </value>
+ Dictionary<string, ITask> Tasks
+ {
+ get;
+ }
+
/// <value>
- /// This returns all the ICategory items from the backend.
- /// </value>
- Gtk.TreeModel Categories
- {
- get;
- }
+ /// Dictionary of ICategories. The key is the backend's category ID or external ID.
+ /// </value>
+ Dictionary<string, ICategory> Categories
+ {
+ get;
+ }
/// <value>
/// Indication that the backend has enough information
Modified: branches/new_cache/src/Makefile.am
==============================================================================
--- branches/new_cache/src/Makefile.am (original)
+++ branches/new_cache/src/Makefile.am Fri Dec 26 20:32:02 2008
@@ -34,15 +34,6 @@
RTM_CSFILES =
endif
-if ENABLE_BACKEND_SQLITE
-SQLITE_CSFILES = \
- $(srcdir)/Backends/Sqlite/*.cs
-SQLITE_LIBS = -r:Mono.Data.Sqlite
-else
-SQLITE_CSFILES =
-SQLITE_LIBS =
-endif
-
if ENABLE_BACKEND_EDS
EDS_CSFILES = \
$(srcdir)/Backends/EDS/*.cs
@@ -62,8 +53,10 @@
$(srcdir)/AbstractTask.cs \
$(srcdir)/AllCategory.cs \
$(srcdir)/Application.cs \
+ $(srcdir)/Category.cs \
$(srcdir)/CellRendererDate.cs \
$(srcdir)/CompletedTaskGroup.cs \
+ $(srcdir)/Database.cs \
$(srcdir)/DateButton.cs \
$(srcdir)/GtkApplication.cs \
$(srcdir)/GnomeApplication.cs \
@@ -71,6 +64,7 @@
$(srcdir)/ICategory.cs \
$(srcdir)/ITask.cs \
$(srcdir)/INote.cs \
+ $(srcdir)/LocalCache.cs \
$(srcdir)/Logger.cs \
$(srcdir)/NativeApplication.cs \
$(srcdir)/NoteDialog.cs \
@@ -79,8 +73,10 @@
$(srcdir)/PreferencesDialog.cs \
$(srcdir)/RemoteControl.cs \
$(srcdir)/RemoteControlProxy.cs \
+ $(srcdir)/Task.cs \
$(srcdir)/TaskCalendar.cs \
$(srcdir)/TaskGroup.cs \
+ $(srcdir)/TaskModelNode.cs \
$(srcdir)/TaskPriority.cs \
$(srcdir)/TaskState.cs \
$(srcdir)/TaskWindow.cs \
@@ -125,6 +121,7 @@
-r:Mono.Posix \
-r:System.Xml \
-r:System.Web \
+ -r:Mono.Data.Sqlite \
-r:$(top_builddir)/RtmNet/RtmNet \
$(GLIB_SHARP_20_LIBS) \
$(GNOME_SHARP_20_LIBS) \
@@ -179,7 +176,6 @@
$(srcdir)/Backends/EDS/*.cs \
$(srcdir)/Backends/IceCore/*.cs \
$(srcdir)/Backends/Rtm/*.cs \
- $(srcdir)/Backends/Sqlite/*.cs \
$(srcdir)/Backends/Hiveminder/*.cs \
$(srcdir)/Backends/Hiveminder/service/*.cs
Modified: branches/new_cache/src/PreferencesDialog.cs
==============================================================================
--- branches/new_cache/src/PreferencesDialog.cs (original)
+++ branches/new_cache/src/PreferencesDialog.cs Fri Dec 26 20:32:02 2008
@@ -470,7 +470,7 @@
}
IBackend backend = backendComboMap [selectedBackend];
- filteredCategories = new TreeModelFilter (backend.Categories, null);
+ filteredCategories = new TreeModelFilter (Application.LocalCache.Categories, null);
filteredCategories.VisibleFunc = FilterFunc;
categoriesTree.Model = filteredCategories;
}
Modified: branches/new_cache/src/RemoteControl.cs
==============================================================================
--- branches/new_cache/src/RemoteControl.cs (original)
+++ branches/new_cache/src/RemoteControl.cs Fri Dec 26 20:32:02 2008
@@ -85,7 +85,7 @@
bool enterEditMode, bool parseDate)
{
Gtk.TreeIter iter;
- Gtk.TreeModel model = Application.Backend.Categories;
+ Gtk.TreeModel model = Application.LocalCache.Categories;
//
// Validate the input parameters. Don't allow null or empty strings
@@ -169,7 +169,7 @@
string[] emptyArray = categories.ToArray ();
Gtk.TreeIter iter;
- Gtk.TreeModel model = Application.Backend.Categories;
+ Gtk.TreeModel model = Application.LocalCache.Categories;
if (!model.GetIterFirst (out iter))
return emptyArray;
@@ -205,7 +205,7 @@
List<string> ids;
ids = new List<string> ();
- model = Application.Backend.Tasks;
+ model = Application.LocalCache.Tasks;
if (!model.GetIterFirst (out iter))
return new string[0];
@@ -297,7 +297,7 @@
Gtk.TreeModel model;
ITask task = null;
- model = Application.Backend.Tasks;
+ model = Application.LocalCache.Tasks;
if (model.GetIterFirst (out iter)) {
do {
Modified: branches/new_cache/src/TaskGroup.cs
==============================================================================
--- branches/new_cache/src/TaskGroup.cs (original)
+++ branches/new_cache/src/TaskGroup.cs Fri Dec 26 20:32:02 2008
@@ -433,7 +433,7 @@
if (selectedCategoryName != null) {
Gtk.TreeIter iter;
- Gtk.TreeModel model = Application.Backend.Categories;
+ Gtk.TreeModel model = Application.LocalCache.Categories;
// Iterate through (yeah, I know this is gross!) and find the
// matching category
Modified: branches/new_cache/src/TaskWindow.cs
==============================================================================
--- branches/new_cache/src/TaskWindow.cs (original)
+++ branches/new_cache/src/TaskWindow.cs Fri Dec 26 20:32:02 2008
@@ -218,21 +218,9 @@
mainVBox.PackEnd (statusbar, false, false, 0);
- //
- // Delay adding in the TaskGroups until the backend is initialized
- //
-
Shown += OnWindowShown;
DeleteEvent += WindowDeleted;
- backend.BackendInitialized += OnBackendInitialized;
- backend.BackendSyncStarted += OnBackendSyncStarted;
- backend.BackendSyncFinished += OnBackendSyncFinished;
- // if the backend is already initialized, go ahead... initialize
- if(backend.Initialized) {
- OnBackendInitialized();
- }
-
Application.Preferences.SettingChanged += OnSettingChanged;
}
@@ -252,6 +240,7 @@
rangeEnd = new DateTime (rangeEnd.Year, rangeEnd.Month, rangeEnd.Day,
23, 59, 59);
+ /*
overdueGroup = new TaskGroup (Catalog.GetString ("Overdue"),
rangeStart, rangeEnd,
backend.Tasks);
@@ -345,6 +334,7 @@
completedTaskGroup.Show ();
targetVBox.PackStart (completedTaskGroup, false, false, 0);
taskGroups.Add (completedTaskGroup);
+ */
//manualTarget = new TargetService();
@@ -354,7 +344,7 @@
// Set up the combo box (after the above to set the current filter)
- categoryComboBox.Model = Application.Backend.Categories;
+ categoryComboBox.Model = Application.LocalCache.Categories;
// Read preferences for the last-selected category and select it
string selectedCategoryName =
@@ -653,7 +643,7 @@
int count = 0;
Gtk.TreeIter iter;
- Gtk.TreeModel model = Application.Backend.Tasks;
+ Gtk.TreeModel model = Application.LocalCache.Tasks;
if (!model.GetIterFirst (out iter))
return 0;
@@ -1148,39 +1138,6 @@
dialog.Destroy ();
}
- private void OnBackendInitialized()
- {
- backend.BackendInitialized -= OnBackendInitialized;
- PopulateWindow();
- OnBackendSyncFinished (); // To update the statusbar
- }
-
- private void OnBackendSyncStarted ()
- {
- TaskWindow.ShowStatus (Catalog.GetString ("Loading tasks..."));
- }
-
- private void OnBackendSyncFinished ()
- {
- Logger.Debug("Backend sync finished");
- if (Application.Backend.Configured) {
- string now = DateTime.Now.ToString ();
- status = string.Format ("Tasks loaded: {0}", now);
- TaskWindow.lastLoadedTime = now;
- TaskWindow.ShowStatus (status);
- RebuildAddTaskMenu (Application.Backend.Categories);
- addTaskEntry.Sensitive = true;
- categoryComboBox.Sensitive = true;
- // Keep insensitive text color
- Gdk.Color insensitiveColor =
- addTaskEntry.Style.Text (Gtk.StateType.Insensitive);
- addTaskEntry.ModifyText (Gtk.StateType.Normal, insensitiveColor);
- } else {
- string status =
- string.Format ("Not connected.");
- TaskWindow.ShowStatus (status);
- }
- }
#endregion // Event Handlers
#region Private Classes
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]