Do

Merge lp:~cszikszoy/do/contactdetailitems into lp:do

Proposed by Chris S.
Status: Merged
Approved by: Robert Dyer
Approved revision: 1299
Merged at revision: not available
Proposed branch: lp:~cszikszoy/do/contactdetailitems
Merge into: lp:do
Diff against target: None lines
To merge this branch: bzr merge lp:~cszikszoy/do/contactdetailitems
Reviewer Review Type Date Requested Status
Do Core Team Pending
Review via email: mp+11404@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris S. (cszikszoy) wrote :

This adds a couple of ContactDetailItems to Do.Universe.Common. Those being the AddressContactDetailItem, PhoneContactDetailItem and EmailContactDetailItem. These came from Evolution, but I found myself copying it over in the Skype rewrite, and thought that was a bit dumb. It would be good if these were in Do.Universe so that any other plugin that indexes contacts could access them as well.

One thing I'm missing is a house icon. I'll ask DanRabbit if he can help with that.

Revision history for this message
Robert Dyer (psybers) wrote :

Did you forget to commit the phone image?

Revision history for this message
Chris S. (cszikszoy) wrote :

> Did you forget to commit the phone image?

Yeah, I think I did forget to commit that image. I also need to ask DanRabbit about an image for the AddressContactDetailItem

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Do.Universe/Do.Universe.mdp'
2--- Do.Universe/Do.Universe.mdp 2009-04-22 04:42:48 +0000
3+++ Do.Universe/Do.Universe.mdp 2009-09-09 01:13:58 +0000
4@@ -42,6 +42,11 @@
5 <File name="src/Do.Universe/Do.Universe.Common" subtype="Directory" buildaction="Compile" />
6 <File name="src/Do.Universe/Do.Universe.Common/TextItem.cs" subtype="Code" buildaction="Compile" />
7 <File name="src/Do.Universe/Do.Universe.Common/BookmarkItem.cs" subtype="Code" buildaction="Compile" />
8+ <File name="Resources/phone.png" subtype="Code" buildaction="Nothing" />
9+ <File name="src/Do.Universe/Do.Universe.Common/AddressContactDetailItem.cs" subtype="Code" buildaction="Compile" />
10+ <File name="src/Do.Universe/Do.Universe.Common/EmailContactDetailItem.cs" subtype="Code" buildaction="Compile" />
11+ <File name="src/Do.Universe/Do.Universe.Common/PhoneContactDetailItem.cs" subtype="Code" buildaction="Compile" />
12+ <File name="src/Do.Universe/Do.Universe.Common/ContactDetailItem.cs" subtype="Code" buildaction="Compile" />
13 </Contents>
14 <References>
15 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
16
17=== modified file 'Do.Universe/Makefile.am'
18--- Do.Universe/Makefile.am 2008-12-22 00:36:53 +0000
19+++ Do.Universe/Makefile.am 2009-09-09 01:13:58 +0000
20@@ -12,6 +12,10 @@
21 src/Do.Universe/ContactItem.cs \
22 src/Do.Universe/Do.Universe.Common/BookmarkItem.cs \
23 src/Do.Universe/Do.Universe.Common/TextItem.cs \
24+ src/Do.Universe/Do.Universe.Common/EmailContactDetailItem.cs \
25+ src/Do.Universe/Do.Universe.Common/PhoneContactDetailItem.cs \
26+ src/Do.Universe/Do.Universe.Common/AddressContactDetailItem.cs \
27+ src/Do.Universe/Do.Universe.Common/ContactDetailItem.cs \
28 src/Do.Universe/Do.Universe.Safe/SafeAct.cs \
29 src/Do.Universe/Do.Universe.Safe/SafeElement.cs \
30 src/Do.Universe/Do.Universe.Safe/SafeItem.cs \
31@@ -34,6 +38,7 @@
32 src/Do.Universe/ProxyItem.cs
33
34 RESOURCES = \
35+ Resources/phone.png \
36 Resources/Do.Universe.addin.xml
37
38 REFERENCES = \
39
40=== added file 'Do.Universe/src/Do.Universe/Do.Universe.Common/AddressContactDetailItem.cs'
41--- Do.Universe/src/Do.Universe/Do.Universe.Common/AddressContactDetailItem.cs 1970-01-01 00:00:00 +0000
42+++ Do.Universe/src/Do.Universe/Do.Universe.Common/AddressContactDetailItem.cs 2009-09-09 01:13:58 +0000
43@@ -0,0 +1,47 @@
44+// EmailContactDetailItem.cs
45+//
46+// GNOME Do is the legal property of its developers.
47+// Please refer to the COPYRIGHT file distributed with this
48+// source distribution.
49+//
50+// This program is free software: you can redistribute it and/or modify
51+// it under the terms of the GNU General Public License as published by
52+// the Free Software Foundation, either version 3 of the License, or
53+// (at your option) any later version.
54+//
55+// This program is distributed in the hope that it will be useful,
56+// but WITHOUT ANY WARRANTY; without even the implied warranty of
57+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58+// GNU General Public License for more details.
59+//
60+// You should have received a copy of the GNU General Public License
61+// along with this program. If not, see <http://www.gnu.org/licenses/>.
62+
63+using System;
64+using Mono.Posix;
65+
66+namespace Do.Universe.Common
67+{
68+ public class AddressContactDetailItem : ContactDetailItem
69+ {
70+ public AddressContactDetailItem (ContactItem owner, string detail) :
71+ base (owner, detail)
72+ {
73+ }
74+
75+ public override string Name {
76+ get {
77+ return Catalog.GetString ("Address");
78+ }
79+ }
80+
81+ public override string Description {
82+ get { return Value.Replace (System.Environment.NewLine, " "); }
83+ }
84+
85+
86+ public override string Icon {
87+ get { return "house.png@" + GetType ().Assembly.FullName; }
88+ }
89+ }
90+}
91\ No newline at end of file
92
93=== added file 'Do.Universe/src/Do.Universe/Do.Universe.Common/ContactDetailItem.cs'
94--- Do.Universe/src/Do.Universe/Do.Universe.Common/ContactDetailItem.cs 1970-01-01 00:00:00 +0000
95+++ Do.Universe/src/Do.Universe/Do.Universe.Common/ContactDetailItem.cs 2009-09-09 01:13:58 +0000
96@@ -0,0 +1,42 @@
97+// ContactDetailItem.cs
98+//
99+// GNOME Do is the legal property of its developers.
100+// Please refer to the COPYRIGHT file distributed with this
101+// source distribution.
102+//
103+// This program is free software: you can redistribute it and/or modify
104+// it under the terms of the GNU General Public License as published by
105+// the Free Software Foundation, either version 3 of the License, or
106+// (at your option) any later version.
107+//
108+// This program is distributed in the hope that it will be useful,
109+// but WITHOUT ANY WARRANTY; without even the implied warranty of
110+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
111+// GNU General Public License for more details.
112+//
113+// You should have received a copy of the GNU General Public License
114+// along with this program. If not, see <http://www.gnu.org/licenses/>.
115+
116+using System;
117+
118+namespace Do.Universe.Common
119+{
120+ public class ContactDetailItem : Item, IContactDetailItem
121+ {
122+ public readonly ContactItem Owner;
123+ string detail;
124+
125+ public ContactDetailItem (ContactItem owner, string detail)
126+ {
127+ Owner = owner;
128+ this.detail = detail;
129+ }
130+
131+ public override string Name { get { return Key; } }
132+ public override string Description { get { return Value; } }
133+ public override string Icon { get { return "stock_person"; } }
134+
135+ public virtual string Key { get { return detail; } }
136+ public virtual string Value { get { return Owner [detail]; } }
137+ }
138+}
139\ No newline at end of file
140
141=== added file 'Do.Universe/src/Do.Universe/Do.Universe.Common/EmailContactDetailItem.cs'
142--- Do.Universe/src/Do.Universe/Do.Universe.Common/EmailContactDetailItem.cs 1970-01-01 00:00:00 +0000
143+++ Do.Universe/src/Do.Universe/Do.Universe.Common/EmailContactDetailItem.cs 2009-09-09 01:13:58 +0000
144@@ -0,0 +1,42 @@
145+// EmailContactDetailItem.cs
146+//
147+// GNOME Do is the legal property of its developers.
148+// Please refer to the COPYRIGHT file distributed with this
149+// source distribution.
150+//
151+// This program is free software: you can redistribute it and/or modify
152+// it under the terms of the GNU General Public License as published by
153+// the Free Software Foundation, either version 3 of the License, or
154+// (at your option) any later version.
155+//
156+// This program is distributed in the hope that it will be useful,
157+// but WITHOUT ANY WARRANTY; without even the implied warranty of
158+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
159+// GNU General Public License for more details.
160+//
161+// You should have received a copy of the GNU General Public License
162+// along with this program. If not, see <http://www.gnu.org/licenses/>.
163+
164+using System;
165+using Mono.Posix;
166+
167+namespace Do.Universe.Common
168+{
169+ public class EmailContactDetailItem : ContactDetailItem
170+ {
171+ public EmailContactDetailItem (ContactItem owner, string detail) :
172+ base (owner, detail)
173+ {
174+ }
175+
176+ public override string Name {
177+ get {
178+ return Catalog.GetString ("Email");
179+ }
180+ }
181+
182+ public override string Icon {
183+ get { return "gnome-stock-mail-snd"; }
184+ }
185+ }
186+}
187\ No newline at end of file
188
189=== added file 'Do.Universe/src/Do.Universe/Do.Universe.Common/PhoneContactDetailItem.cs'
190--- Do.Universe/src/Do.Universe/Do.Universe.Common/PhoneContactDetailItem.cs 1970-01-01 00:00:00 +0000
191+++ Do.Universe/src/Do.Universe/Do.Universe.Common/PhoneContactDetailItem.cs 2009-09-09 01:13:58 +0000
192@@ -0,0 +1,45 @@
193+// PhoneContactDetailItem.cs
194+//
195+// GNOME Do is the legal property of its developers.
196+// Please refer to the COPYRIGHT file distributed with this
197+// source distribution.
198+//
199+// This program is free software: you can redistribute it and/or modify
200+// it under the terms of the GNU General Public License as published by
201+// the Free Software Foundation, either version 3 of the License, or
202+// (at your option) any later version.
203+//
204+// This program is distributed in the hope that it will be useful,
205+// but WITHOUT ANY WARRANTY; without even the implied warranty of
206+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
207+// GNU General Public License for more details.
208+//
209+// You should have received a copy of the GNU General Public License
210+// along with this program. If not, see <http://www.gnu.org/licenses/>.
211+
212+using System;
213+using Mono.Posix;
214+
215+namespace Do.Universe.Common
216+{
217+ public class PhoneContactDetailItem : ContactDetailItem
218+ {
219+ public PhoneContactDetailItem (ContactItem owner, string detail) :
220+ base (owner, detail)
221+ {
222+ }
223+
224+ public override string Name {
225+ get {
226+ if (Key.Contains (".work")) return Catalog.GetString ("Work Phone");
227+ if (Key.Contains (".home")) return Catalog.GetString ("Home Phone");
228+ if (Key.Contains (".mobile")) return Catalog.GetString ("Mobile Phone");
229+ return "Phone";
230+ }
231+ }
232+
233+ public override string Icon {
234+ get { return "phone.png@" + GetType ().Assembly.FullName; }
235+ }
236+ }
237+}
238\ No newline at end of file