~ilja-smoli/do/gtg

« back to all changes in this revision

Viewing changes to GTG/src/GTGDBus.cs

  • Committer: Tomaž Muraus
  • Date: 2010-05-01 10:59:54 UTC
  • Revision ID: kami@k5-storitve.net-20100501105954-laz03kqnvt79z4gz
Now you can also complete, edit, open or delete an existing GTG task.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
20
using System;
 
21
using System.Collections;
21
22
using System.Collections.Generic;
22
23
 
23
24
using NDesk.DBus;
24
 
using org.freedesktop.DBus;
25
25
 
26
26
using Do.Platform;
27
27
using Do.Universe;
38
38
                
39
39
                string open_task_editor(string taskId);
40
40
                string new_task(string status, string title, string dueDate, string startDate, string doneDate, string[] tags, string text, string subTasks);
 
41
                string modify_task(string taskId, Hashtable taskData);
 
42
                string delete_task(string taskId);
41
43
        }
42
44
        
43
45
        public class GTGDBus
48
50
                
49
51
                public GTGDBus()
50
52
                {
 
53
                        GTG = FindInstance();
51
54
                        try
52
55
                        {
53
56
                                GTG = FindInstance();
72
75
                {
73
76
                        return GTG.get_tasks();
74
77
                }
75
 
                
76
78
                                
77
79
                public IDictionary<string, object> GetTask(string taskId)
78
80
                {
103
105
                                return "";
104
106
                        }
105
107
                }
 
108
                
 
109
                public string CompleteTask(GTGTask task)
 
110
                {
 
111
                        try
 
112
                        {
 
113
                                return GTG.modify_task(task.TaskId, task.GetTaskData());
 
114
                        }
 
115
                        catch (Exception)
 
116
                        {
 
117
                                return "";
 
118
                        }
 
119
                }
 
120
                
 
121
                public string DeleteTask(string taskId)
 
122
                {
 
123
                        try
 
124
                        {
 
125
                                return GTG.delete_task(taskId);
 
126
                        }
 
127
                        catch (Exception)
 
128
                        {
 
129
                                return "";
 
130
                        }
 
131
                }
106
132
        }
107
133
}
 
 
b'\\ No newline at end of file'