Merge lp://qastaging/~cszikszoy/do-plugins/fix-itemsources into lp://qastaging/do-plugins
- fix-itemsources
- Merge into trunk
Proposed by
Chris S.
Status: | Merged |
---|---|
Approved by: | Robert Dyer |
Approved revision: | 621 |
Merged at revision: | not available |
Proposed branch: | lp://qastaging/~cszikszoy/do-plugins/fix-itemsources |
Merge into: | lp://qastaging/do-plugins |
Diff against target: | None lines |
To merge this branch: | bzr merge lp://qastaging/~cszikszoy/do-plugins/fix-itemsources |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Dyer (community) | Approve | ||
Review via email: mp+7325@code.qastaging.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'DoPlugins.mds' |
2 | --- DoPlugins.mds 2009-06-06 17:40:03 +0000 |
3 | +++ DoPlugins.mds 2009-06-11 07:36:57 +0000 |
4 | @@ -298,4 +298,4 @@ |
5 | <Entry filename="Dropbox/Dropbox.mdp" /> |
6 | <Entry filename="RemindMe/RemindMe.mdp" /> |
7 | </Entries> |
8 | -</Combine> |
9 | +</Combine> |
10 | \ No newline at end of file |
11 | |
12 | === modified file 'Epiphany/Epiphany.mdp' |
13 | --- Epiphany/Epiphany.mdp 2009-02-28 16:16:48 +0000 |
14 | +++ Epiphany/Epiphany.mdp 2009-06-11 07:36:57 +0000 |
15 | @@ -17,6 +17,7 @@ |
16 | <File name="src" subtype="Directory" buildaction="Compile" /> |
17 | <File name="src/EpiphanyBookmarkItemSource.cs" subtype="Code" buildaction="Compile" /> |
18 | <File name="Resources/Epiphany.addin.xml" subtype="Code" buildaction="EmbedAsResource" /> |
19 | + <File name="src/EpiphanyBrowseBookmarksItem.cs" subtype="Code" buildaction="Compile" /> |
20 | </Contents> |
21 | <References> |
22 | <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
23 | |
24 | === modified file 'Epiphany/Makefile.am' |
25 | --- Epiphany/Makefile.am 2009-01-09 05:04:13 +0000 |
26 | +++ Epiphany/Makefile.am 2009-06-11 07:36:57 +0000 |
27 | @@ -3,7 +3,8 @@ |
28 | ASSEMBLY=Epiphany |
29 | |
30 | FILES = \ |
31 | - src/EpiphanyBookmarkItemSource.cs |
32 | + src/EpiphanyBookmarkItemSource.cs \ |
33 | + src/EpiphanyBrowseBookmarksItem.cs |
34 | |
35 | RESOURCES = \ |
36 | Resources/Epiphany.addin.xml |
37 | |
38 | === modified file 'Epiphany/src/EpiphanyBookmarkItemSource.cs' |
39 | --- Epiphany/src/EpiphanyBookmarkItemSource.cs 2008-12-23 23:42:53 +0000 |
40 | +++ Epiphany/src/EpiphanyBookmarkItemSource.cs 2009-06-11 07:36:57 +0000 |
41 | @@ -50,12 +50,27 @@ |
42 | public override string Icon { get { return "gnome-web-browser"; } } |
43 | |
44 | public override IEnumerable<Type> SupportedItemTypes { |
45 | - get { yield return typeof (BookmarkItem); } |
46 | + get { |
47 | + yield return typeof (BookmarkItem); |
48 | + yield return typeof (IApplicationItem); |
49 | + yield return typeof (EpiphanyBrowseBookmarksItem); |
50 | + } |
51 | } |
52 | |
53 | public override IEnumerable<Item> Items { |
54 | get { return items; } |
55 | } |
56 | + |
57 | + public override IEnumerable<Item> ChildrenOfItem (Item parent) |
58 | + { |
59 | + if (parent is IApplicationItem && (parent as IApplicationItem).Exec.Contains ("epiphany-browser")) |
60 | + yield return new EpiphanyBrowseBookmarksItem (); |
61 | + if (parent is EpiphanyBrowseBookmarksItem) { |
62 | + foreach (BookmarkItem item in Items) |
63 | + yield return item; |
64 | + } |
65 | + yield break; |
66 | + } |
67 | |
68 | public override void UpdateItems () |
69 | { |
70 | |
71 | === added file 'Epiphany/src/EpiphanyBrowseBookmarksItem.cs' |
72 | --- Epiphany/src/EpiphanyBrowseBookmarksItem.cs 1970-01-01 00:00:00 +0000 |
73 | +++ Epiphany/src/EpiphanyBrowseBookmarksItem.cs 2009-06-11 07:36:57 +0000 |
74 | @@ -0,0 +1,42 @@ |
75 | +/* EpiphanyBrowseBookmarksItem.cs |
76 | + * |
77 | + * GNOME Do is the legal property of its developers. Please refer to the |
78 | + * COPYRIGHT file distributed with this |
79 | + * source distribution. |
80 | + * |
81 | + * This program is free software: you can redistribute it and/or modify |
82 | + * it under the terms of the GNU General Public License as published by |
83 | + * the Free Software Foundation, either version 3 of the License, or |
84 | + * (at your option) any later version. |
85 | + * |
86 | + * This program is distributed in the hope that it will be useful, |
87 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
88 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
89 | + * GNU General Public License for more details. |
90 | + * |
91 | + * You should have received a copy of the GNU General Public License |
92 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
93 | + */ |
94 | +using System; |
95 | + |
96 | +using Mono.Unix; |
97 | + |
98 | +using Do.Universe; |
99 | + |
100 | +namespace Epiphany |
101 | +{ |
102 | + public class EpiphanyBrowseBookmarksItem : Item |
103 | + { |
104 | + public override string Name { |
105 | + get { return Catalog.GetString ("Bookmarks"); } |
106 | + } |
107 | + |
108 | + public override string Description { |
109 | + get { return Catalog.GetString ("Browse Bookmarks"); } |
110 | + } |
111 | + |
112 | + public override string Icon { |
113 | + get { return "gnome-web-browser"; } |
114 | + } |
115 | + } |
116 | +} |
117 | \ No newline at end of file |
118 | |
119 | === modified file 'Tomboy/Makefile.am' |
120 | --- Tomboy/Makefile.am 2009-01-09 03:35:25 +0000 |
121 | +++ Tomboy/Makefile.am 2009-06-11 07:36:57 +0000 |
122 | @@ -10,6 +10,7 @@ |
123 | src/SearchNotesAction.cs \ |
124 | gtk-gui/generated.cs \ |
125 | src/TomboyConfiguration.cs \ |
126 | + src/TomboyBrowseNotesItem.cs \ |
127 | gtk-gui/Tomboy.TomboyConfiguration.cs |
128 | |
129 | RESOURCES = \ |
130 | |
131 | === modified file 'Tomboy/Resources/Tomboy.addin.xml' |
132 | --- Tomboy/Resources/Tomboy.addin.xml 2009-03-31 23:19:25 +0000 |
133 | +++ Tomboy/Resources/Tomboy.addin.xml 2009-06-11 07:36:57 +0000 |
134 | @@ -1,10 +1,10 @@ |
135 | <Addin |
136 | id="Tomboy" |
137 | namespace="Do" |
138 | - version="1.3" |
139 | + version="1.4" |
140 | name="Tomboy" |
141 | description="Search and create new Tomboy notes." |
142 | - author="Rick Harding" |
143 | + author="Rick Harding, Chris Szikszoy" |
144 | category="Official" |
145 | defaultEnabled="false" |
146 | > |
147 | |
148 | === modified file 'Tomboy/Tomboy.mdp' |
149 | --- Tomboy/Tomboy.mdp 2009-02-28 16:16:48 +0000 |
150 | +++ Tomboy/Tomboy.mdp 2009-06-11 07:36:57 +0000 |
151 | @@ -26,6 +26,7 @@ |
152 | <File name="gtk-gui/Tomboy.TomboyConfiguration.cs" subtype="Code" buildaction="Compile" /> |
153 | <File name="gtk-gui/objects.xml" subtype="Code" buildaction="EmbedAsResource" /> |
154 | <File name="Resources/Tomboy.addin.xml" subtype="Code" buildaction="EmbedAsResource" /> |
155 | + <File name="src/TomboyBrowseNotesItem.cs" subtype="Code" buildaction="Compile" /> |
156 | </Contents> |
157 | <References> |
158 | <ProjectReference type="Gac" localcopy="True" refto="NDesk.DBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6716e4f9b2ed099" /> |
159 | |
160 | === modified file 'Tomboy/src/NotesItemSource.cs' |
161 | --- Tomboy/src/NotesItemSource.cs 2009-01-21 19:21:55 +0000 |
162 | +++ Tomboy/src/NotesItemSource.cs 2009-06-11 07:36:57 +0000 |
163 | @@ -53,7 +53,7 @@ |
164 | /// A <see cref="ICollection`1"/> |
165 | /// </returns> |
166 | public override string Name { |
167 | - get { return Catalog.GetString ("Tomboy Note Indexer"); } |
168 | + get { return Catalog.GetString ("Tomboy Notes"); } |
169 | } |
170 | |
171 | public override string Description { |
172 | @@ -65,7 +65,11 @@ |
173 | } |
174 | |
175 | public override IEnumerable<Type> SupportedItemTypes { |
176 | - get { yield return typeof (NoteItem); } |
177 | + get { |
178 | + yield return typeof (NoteItem); |
179 | + yield return typeof (IApplicationItem); |
180 | + yield return typeof (TomboyBrowseNotesItem); |
181 | + } |
182 | } |
183 | |
184 | /// <summary> |
185 | @@ -81,6 +85,21 @@ |
186 | get { return notes; } |
187 | } |
188 | |
189 | + public override IEnumerable<Item> ChildrenOfItem (Item item) |
190 | + { |
191 | + if (IsTomboy (item)) { |
192 | + yield return new TomboyBrowseNotesItem (); |
193 | + } else if (item is TomboyBrowseNotesItem) { |
194 | + foreach (NoteItem note in Items) |
195 | + yield return note; |
196 | + } |
197 | + } |
198 | + |
199 | + bool IsTomboy (Item item) |
200 | + { |
201 | + return item.Equals (Do.Platform.Services.UniverseFactory.MaybeApplicationItemFromCommand ("tomboy")); |
202 | + } |
203 | + |
204 | /// <summary> |
205 | /// This method run in the constructor to find the notes we can get |
206 | /// ahold of. |
207 | |
208 | === added file 'Tomboy/src/TomboyBrowseNotesItem.cs' |
209 | --- Tomboy/src/TomboyBrowseNotesItem.cs 1970-01-01 00:00:00 +0000 |
210 | +++ Tomboy/src/TomboyBrowseNotesItem.cs 2009-06-11 07:36:57 +0000 |
211 | @@ -0,0 +1,42 @@ |
212 | +// TomboyBrowseNotesItem.cs |
213 | +// |
214 | +// GNOME Do is the legal property of its developers, whose names are too |
215 | +// numerous to list here. Please refer to the COPYRIGHT file distributed with |
216 | +// this source distribution. |
217 | +// |
218 | +// This program is free software: you can redistribute it and/or modify |
219 | +// it under the terms of the GNU General Public License as published by |
220 | +// the Free Software Foundation, either version 3 of the License, or |
221 | +// (at your option) any later version. |
222 | +// |
223 | +// This program is distributed in the hope that it will be useful, |
224 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
225 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
226 | +// GNU General Public License for more details. |
227 | +// |
228 | +// You should have received a copy of the GNU General Public License |
229 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
230 | + |
231 | +using System; |
232 | + |
233 | +using Mono.Unix; |
234 | + |
235 | +using Do.Universe; |
236 | + |
237 | +namespace Tomboy |
238 | +{ |
239 | + public class TomboyBrowseNotesItem : Item |
240 | + { |
241 | + public override string Name { |
242 | + get { return Catalog.GetString ("Notes"); } |
243 | + } |
244 | + |
245 | + public override string Description { |
246 | + get { return Catalog.GetString ("Browse Tomboy Notes"); } |
247 | + } |
248 | + |
249 | + public override string Icon { |
250 | + get { return "tomboy"; } |
251 | + } |
252 | + } |
253 | +} |
254 | \ No newline at end of file |
255 | |
256 | === modified file 'Vinagre/Makefile.am' |
257 | --- Vinagre/Makefile.am 2009-04-20 22:17:34 +0000 |
258 | +++ Vinagre/Makefile.am 2009-06-11 07:36:57 +0000 |
259 | @@ -5,6 +5,7 @@ |
260 | FILES = \ |
261 | src/Vinagre.cs \ |
262 | src/VNCHost.cs \ |
263 | + src/VinagreBrowseBookmarksItem.cs \ |
264 | src/VNCHostSource.cs |
265 | |
266 | RESOURCES = \ |
267 | |
268 | === modified file 'Vinagre/Vinagre.mdp' |
269 | --- Vinagre/Vinagre.mdp 2009-04-20 22:17:34 +0000 |
270 | +++ Vinagre/Vinagre.mdp 2009-06-11 07:36:57 +0000 |
271 | @@ -19,6 +19,7 @@ |
272 | <File name="src/VNCHost.cs" subtype="Code" buildaction="Compile" /> |
273 | <File name="src/VNCHostSource.cs" subtype="Code" buildaction="Compile" /> |
274 | <File name="Resources/Vinagre.addin.xml" subtype="Code" buildaction="EmbedAsResource" /> |
275 | + <File name="src/VinagreBrowseBookmarksItem.cs" subtype="Code" buildaction="Compile" /> |
276 | </Contents> |
277 | <References> |
278 | <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
279 | |
280 | === modified file 'Vinagre/src/VNCHostSource.cs' |
281 | --- Vinagre/src/VNCHostSource.cs 2009-04-20 23:54:36 +0000 |
282 | +++ Vinagre/src/VNCHostSource.cs 2009-06-11 07:36:57 +0000 |
283 | @@ -56,12 +56,29 @@ |
284 | get { |
285 | yield return typeof (HostItem); |
286 | yield return typeof (VNCHostItem); |
287 | + yield return typeof (IApplicationItem); |
288 | + yield return typeof (VinagrgeBrowseBookmarksItem); |
289 | } |
290 | } |
291 | |
292 | public override IEnumerable<Item> Items { |
293 | get { return items; } |
294 | } |
295 | + |
296 | + public override IEnumerable<Item> ChildrenOfItem (Item item) |
297 | + { |
298 | + if (IsVinagre (item)) { |
299 | + yield return new VinagrgeBrowseBookmarksItem (); |
300 | + } else if (item is VinagrgeBrowseBookmarksItem) { |
301 | + foreach (Item host in Items) |
302 | + yield return host; |
303 | + } |
304 | + } |
305 | + |
306 | + bool IsVinagre (Item item) |
307 | + { |
308 | + return item.Equals (Do.Platform.Services.UniverseFactory.MaybeApplicationItemFromCommand ("vinagre")); |
309 | + } |
310 | |
311 | public override void UpdateItems () |
312 | { |
313 | |
314 | === added file 'Vinagre/src/VinagreBrowseBookmarksItem.cs' |
315 | --- Vinagre/src/VinagreBrowseBookmarksItem.cs 1970-01-01 00:00:00 +0000 |
316 | +++ Vinagre/src/VinagreBrowseBookmarksItem.cs 2009-06-11 07:36:57 +0000 |
317 | @@ -0,0 +1,42 @@ |
318 | +// VinagrgeBrowseBookmarksItem.cs |
319 | +// |
320 | +// GNOME Do is the legal property of its developers, whose names are too |
321 | +// numerous to list here. Please refer to the COPYRIGHT file distributed with |
322 | +// this source distribution. |
323 | +// |
324 | +// This program is free software: you can redistribute it and/or modify |
325 | +// it under the terms of the GNU General Public License as published by |
326 | +// the Free Software Foundation, either version 3 of the License, or |
327 | +// (at your option) any later version. |
328 | +// |
329 | +// This program is distributed in the hope that it will be useful, |
330 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
331 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
332 | +// GNU General Public License for more details. |
333 | +// |
334 | +// You should have received a copy of the GNU General Public License |
335 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
336 | + |
337 | +using System; |
338 | + |
339 | +using Mono.Unix; |
340 | + |
341 | +using Do.Universe; |
342 | + |
343 | +namespace VinagreVNC |
344 | +{ |
345 | + public class VinagrgeBrowseBookmarksItem : Item |
346 | + { |
347 | + public override string Name { |
348 | + get { return Catalog.GetString ("Bookmarks"); } |
349 | + } |
350 | + |
351 | + public override string Description { |
352 | + get { return Catalog.GetString ("Browse Vinagre Bookmarks"); } |
353 | + } |
354 | + |
355 | + public override string Icon { |
356 | + get { return "vinagre"; } |
357 | + } |
358 | + } |
359 | +} |
360 | |
361 | === modified file 'VirtualBox/Makefile.am' |
362 | --- VirtualBox/Makefile.am 2009-02-05 08:03:17 +0000 |
363 | +++ VirtualBox/Makefile.am 2009-06-11 07:36:57 +0000 |
364 | @@ -14,6 +14,7 @@ |
365 | src/VMItem.cs \ |
366 | src/VMItemSource.cs \ |
367 | src/VMThread.cs \ |
368 | + src/VBoxBrowseVMSItem.cs \ |
369 | src/IconMap.cs |
370 | |
371 | RESOURCES = \ |
372 | |
373 | === modified file 'VirtualBox/VirtualBox.mdp' |
374 | --- VirtualBox/VirtualBox.mdp 2009-02-28 16:16:48 +0000 |
375 | +++ VirtualBox/VirtualBox.mdp 2009-06-11 07:36:57 +0000 |
376 | @@ -93,6 +93,7 @@ |
377 | <File name="Resources/icons/os_winxp_64.png" subtype="Code" buildaction="EmbedAsResource" /> |
378 | <File name="Resources/icons/os_xandros_64.png" subtype="Code" buildaction="EmbedAsResource" /> |
379 | <File name="Resources/icons/os_os2ecs.png" subtype="Code" buildaction="EmbedAsResource" /> |
380 | + <File name="src/VBoxBrowseVMSItem.cs" subtype="Code" buildaction="Compile" /> |
381 | </Contents> |
382 | <References> |
383 | <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
384 | |
385 | === added file 'VirtualBox/src/VBoxBrowseVMSItem.cs' |
386 | --- VirtualBox/src/VBoxBrowseVMSItem.cs 1970-01-01 00:00:00 +0000 |
387 | +++ VirtualBox/src/VBoxBrowseVMSItem.cs 2009-06-11 07:36:57 +0000 |
388 | @@ -0,0 +1,43 @@ |
389 | +// VBoxBrowseVMSItem.cs |
390 | +// |
391 | +// GNOME Do is the legal property of its developers, whose names are too |
392 | +// numerous to list here. Please refer to the COPYRIGHT file distributed with |
393 | +// this source distribution. |
394 | +// |
395 | +// This program is free software: you can redistribute it and/or modify |
396 | +// it under the terms of the GNU General Public License as published by |
397 | +// the Free Software Foundation, either version 3 of the License, or |
398 | +// (at your option) any later version. |
399 | +// |
400 | +// This program is distributed in the hope that it will be useful, |
401 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
402 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
403 | +// GNU General Public License for more details. |
404 | +// |
405 | +// You should have received a copy of the GNU General Public License |
406 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
407 | + |
408 | +using System; |
409 | + |
410 | +using Mono.Unix; |
411 | + |
412 | +using Do.Universe; |
413 | + |
414 | +namespace VirtualBox |
415 | +{ |
416 | + public class VBoxBrowseVMSItem : Item |
417 | + { |
418 | + public override string Name { |
419 | + get { return Catalog.GetString ("Virtual Machines"); } |
420 | + } |
421 | + |
422 | + public override string Description { |
423 | + get { return Catalog.GetString ("Browse Virtual Machines"); } |
424 | + } |
425 | + |
426 | + public override string Icon { |
427 | + get { return "VirtualBox_64px.png@"+GetType().Assembly.FullName; } |
428 | + } |
429 | + } |
430 | +} |
431 | + |
432 | |
433 | === modified file 'VirtualBox/src/VMItemSource.cs' |
434 | --- VirtualBox/src/VMItemSource.cs 2009-02-05 08:03:17 +0000 |
435 | +++ VirtualBox/src/VMItemSource.cs 2009-06-11 07:36:57 +0000 |
436 | @@ -36,13 +36,29 @@ |
437 | items = new List<Item> (); |
438 | } |
439 | |
440 | - public override string Name { get { return Catalog.GetString("VirtualBox VMs"); } } |
441 | - public override string Description { get { return Catalog.GetString("Virtual Machines created with VirtualBox"); } } |
442 | - public override string Icon { get { return "VirtualBox_64px.png@"+GetType().Assembly.FullName; } } |
443 | + public override string Name { |
444 | + get { |
445 | + return Catalog.GetString("VirtualBox VMs"); |
446 | + } |
447 | + } |
448 | + |
449 | + public override string Description { |
450 | + get { |
451 | + return Catalog.GetString("Virtual Machines created with VirtualBox"); |
452 | + } |
453 | + } |
454 | + |
455 | + public override string Icon { |
456 | + get { |
457 | + return "VirtualBox_64px.png@"+GetType().Assembly.FullName; |
458 | + } |
459 | + } |
460 | |
461 | public override IEnumerable<Type> SupportedItemTypes { |
462 | get { |
463 | - return new Type[] { typeof (VMItem) }; |
464 | + yield return typeof (VMItem); |
465 | + yield return typeof (IApplicationItem); |
466 | + yield return typeof (VBoxBrowseVMSItem); |
467 | } |
468 | } |
469 | |
470 | @@ -52,14 +68,19 @@ |
471 | |
472 | public override IEnumerable<Item> ChildrenOfItem (Item parent) |
473 | { |
474 | - yield break; |
475 | + if (parent is IApplicationItem && (parent as IApplicationItem).Exec.Contains ("VirtualBox")) |
476 | + yield return new VBoxBrowseVMSItem (); |
477 | + if (parent is VBoxBrowseVMSItem) { |
478 | + foreach (VMItem item in Items) |
479 | + yield return item; |
480 | + } |
481 | + yield break; |
482 | } |
483 | |
484 | public override void UpdateItems () |
485 | { |
486 | items.Clear(); |
487 | - try |
488 | - { |
489 | + try { |
490 | string home = Environment.GetFolderPath (Environment.SpecialFolder.Personal); |
491 | string xml_file = Path.Combine(home, ".VirtualBox/VirtualBox.xml"); |
492 | XmlDocument VboxXML = new XmlDocument(); |
493 | @@ -68,9 +89,7 @@ |
494 | //add each VM as a VMItem |
495 | foreach (XmlNode Machine in MachineEntries) |
496 | items.Add(new VMItem(Machine.Attributes)); |
497 | - } |
498 | - catch (Exception e) |
499 | - { |
500 | + } catch (Exception e) { |
501 | //meltdown |
502 | Log<VMItemSource>.Error("Error parsing VBox XML file."); |
503 | Log<VMItemSource>.Debug (e.ToString ()); |