Merge lp://qastaging/~jpds/do-plugins/rtm-deletenote into lp://qastaging/~d6g/do-plugins/rtm-1.5

Proposed by Jonathan Davies
Status: Superseded
Proposed branch: lp://qastaging/~jpds/do-plugins/rtm-deletenote
Merge into: lp://qastaging/~d6g/do-plugins/rtm-1.5
Diff against target: None lines
To merge this branch: bzr merge lp://qastaging/~jpds/do-plugins/rtm-deletenote
Reviewer Review Type Date Requested Status
Peng Deng Needs Fixing
Review via email: mp+4994@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Peng Deng (d6g) wrote :

I got an error when compiling:

./src/RTM.cs(797,40): error CS0103: The name `taskId' does not exist in the current context

Also, according to mono guidelines, please write noteId instead of note_id for function arguments.

Revision history for this message
Peng Deng (d6g) :
review: Needs Fixing
598. By Jonathan Davies

* Fixed up variables and made note_id respect Mono guidelines.

Unmerged revisions

598. By Jonathan Davies

* Fixed up variables and made note_id respect Mono guidelines.

597. By Jonathan Davies

DeleteNote does not take listId.

596. By Jonathan Davies

Implemented delete note function.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'RememberTheMilk/Makefile.am'
2--- RememberTheMilk/Makefile.am 2009-03-21 04:56:34 +0000
3+++ RememberTheMilk/Makefile.am 2009-03-22 22:12:57 +0000
4@@ -9,6 +9,7 @@
5 src/RTM.cs \
6 src/RTMCompleteTask.cs \
7 src/RTMDeleteList.cs \
8+ src/RTMDeleteNote.cs \
9 src/RTMDeleteTask.cs \
10 src/RTMListItem.cs \
11 src/RTMListItemSource.cs \
12
13=== modified file 'RememberTheMilk/RTM.mdp'
14--- RememberTheMilk/RTM.mdp 2009-03-21 04:56:34 +0000
15+++ RememberTheMilk/RTM.mdp 2009-03-22 22:12:57 +0000
16@@ -21,6 +21,7 @@
17 <File name="src/RTMCompleteTask.cs" subtype="Code" buildaction="Compile" />
18 <File name="src/RTM.cs" subtype="Code" buildaction="Compile" />
19 <File name="src/RTMDeleteList.cs" subtype="Code" buildaction="Compile" />
20+ <File name="src/RTMDeleteNote.cs" subtype="Code" buildaction="Compile" />
21 <File name="src/RTMDeleteTask.cs" subtype="Code" buildaction="Compile" />
22 <File name="src/RTMListItem.cs" subtype="Code" buildaction="Compile" />
23 <File name="src/RTMListItemSource.cs" subtype="Code" buildaction="Compile" />
24
25=== modified file 'RememberTheMilk/src/RTM.cs'
26--- RememberTheMilk/src/RTM.cs 2009-03-21 04:56:34 +0000
27+++ RememberTheMilk/src/RTM.cs 2009-03-22 22:53:07 +0000
28@@ -782,6 +782,20 @@
29 Catalog.GetString ("A note has been added to the selected Remember The Milk task"),
30 taskId, listId);
31 }
32+
33+ public static void DeleteNote (string note_id)
34+ {
35+ try {
36+ rtm.NotesDelete (timeline, note_id);
37+ } catch (RtmException e) {
38+ Console.Error.WriteLine (e.Message);
39+ return;
40+ }
41+
42+ ActionRoutine (Catalog.GetString ("Note Deleted"),
43+ Catalog.GetString ("The selected note has been deleted."),
44+ taskId, listId);
45+ }
46
47 }
48 }
49
50=== added file 'RememberTheMilk/src/RTMDeleteNote.cs'
51--- RememberTheMilk/src/RTMDeleteNote.cs 1970-01-01 00:00:00 +0000
52+++ RememberTheMilk/src/RTMDeleteNote.cs 2009-03-22 22:12:57 +0000
53@@ -0,0 +1,80 @@
54+/* RTMDeleteNote.cs
55+ *
56+ * GNOME Do is the legal property of its developers. Please refer to the
57+ * COPYRIGHT file distributed with this source distribution.
58+ *
59+ * This program is free software: you can redistribute it and/or modify
60+ * it under the terms of the GNU General Public License as published by
61+ * the Free Software Foundation, either version 3 of the License, or
62+ * (at your option) any later version.
63+ *
64+ * This program is distributed in the hope that it will be useful,
65+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
66+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67+ * GNU General Public License for more details.
68+ *
69+ * You should have received a copy of the GNU General Public License
70+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
71+ */
72+
73+using System;
74+using System.Linq;
75+using System.Collections.Generic;
76+using System.Text.RegularExpressions;
77+using Mono.Unix;
78+
79+using Do.Universe;
80+using Do.Platform;
81+
82+namespace RememberTheMilk
83+{
84+ public class RTMDeleteNote : Act
85+ {
86+
87+ public override string Name {
88+ get { return Catalog.GetString ("Delete Note"); }
89+ }
90+
91+ public override string Description {
92+ get { return Catalog.GetString ("Delete a note from the selected task."); }
93+ }
94+
95+ public override string Icon {
96+ get { return "note-delete.png@" + GetType ().Assembly.FullName; }
97+ }
98+
99+ public override IEnumerable<Type> SupportedItemTypes {
100+ get {
101+ return new Type[] {
102+ typeof (RTMTaskItem),
103+ };
104+ }
105+ }
106+
107+ public override IEnumerable<Type> SupportedModifierItemTypes {
108+ get {
109+ return new Type[] {
110+ typeof (ITextItem),
111+ };
112+ }
113+ }
114+
115+ public override bool ModifierItemsOptional {
116+ get { return false; }
117+ }
118+
119+ public override bool SupportsItem (Item item) {
120+ return true;
121+ }
122+
123+ public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modifierItems)
124+ {
125+ string selectedNote = (items.First () as RTMNoteItem).Id;
126+
127+ Services.Application.RunOnThread (() => {
128+ RTM.DeleteNote (selectedNote);
129+ });
130+ yield break;
131+ }
132+ }
133+}

Subscribers

People subscribed via source and target branches

to all changes: