Status: | Needs review |
---|---|
Proposed branch: | lp:~joehillen/do-plugins/Help |
Merge into: | lp:do-plugins |
Diff against target: |
483 lines (+225/-168) 11 files modified
Help/Help.mdp (+28/-0) Help/Makefile.am (+17/-0) Help/Resources/Help.addin.xml.in (+27/-0) Help/src/Help.cs (+76/-0) Help/src/ManPages.cs (+74/-0) Makefile.am (+1/-1) ManLookUp/Makefile.am (+0/-15) ManLookUp/ManLookUp.mdp (+0/-28) ManLookUp/Resources/ManLookUp.addin.xml.in (+0/-26) ManLookUp/src/ReadManualPageAction.cs (+0/-96) configure.ac (+2/-2) |
To merge this branch: | bzr merge lp:~joehillen/do-plugins/Help |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Do Plugins Team | Pending | ||
Review via email: mp+15392@code.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 | === added directory 'Help' |
2 | === added file 'Help/Help.mdp' |
3 | --- Help/Help.mdp 1970-01-01 00:00:00 +0000 |
4 | +++ Help/Help.mdp 2009-11-30 02:30:24 +0000 |
5 | @@ -0,0 +1,28 @@ |
6 | +<Project name="Help" fileversion="2.0" language="C#" targetFramework="3.5" ctype="DotNetProject"> |
7 | + <Configurations active="Debug"> |
8 | + <Configuration name="Debug" ctype="DotNetProjectConfiguration"> |
9 | + <Output directory="bin/Debug" assembly="Help" /> |
10 | + <Build debugmode="True" target="Library" /> |
11 | + <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" /> |
12 | + <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> |
13 | + </Configuration> |
14 | + <Configuration name="Release" ctype="DotNetProjectConfiguration"> |
15 | + <Output directory="." assembly="Help" /> |
16 | + <Build debugmode="False" target="Library" /> |
17 | + <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" /> |
18 | + <EnvironmentVariables /> |
19 | + <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> |
20 | + </Configuration> |
21 | + </Configurations> |
22 | + <Contents> |
23 | + <File name="src/Help.cs" subtype="Code" buildaction="Compile" /> |
24 | + <File name="Resources/Help.addin.xml" subtype="Code" buildaction="EmbedAsResource" /> |
25 | + <File name="Resources/icons/search-help.png" subtype="Code" buildaction="EmbedAsResource" /> |
26 | + </Contents> |
27 | + <References> |
28 | + <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.9.0.0, Culture=neutral" /> |
29 | + <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" /> |
30 | + <ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
31 | + <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
32 | + </References> |
33 | +</Project> |
34 | \ No newline at end of file |
35 | |
36 | === added file 'Help/Makefile.am' |
37 | --- Help/Makefile.am 1970-01-01 00:00:00 +0000 |
38 | +++ Help/Makefile.am 2009-11-30 02:30:24 +0000 |
39 | @@ -0,0 +1,17 @@ |
40 | +include $(top_srcdir)/build.rules.mk |
41 | + |
42 | +ASSEMBLY=Help |
43 | + |
44 | +FILES = \ |
45 | + src/Help.cs \ |
46 | + src/ManPages.cs |
47 | + |
48 | +RESOURCES = \ |
49 | + Resources/Help.addin.xml \ |
50 | + Resources/icons/search-help.png \ |
51 | + Resources/icons/search-man.png |
52 | + |
53 | +REFERENCES = \ |
54 | + System \ |
55 | + $(DO_PLATFORM_LIBS) \ |
56 | + $(DO_UNIVERSE_LIBS) |
57 | |
58 | === added directory 'Help/Resources' |
59 | === added file 'Help/Resources/Help.addin.xml.in' |
60 | --- Help/Resources/Help.addin.xml.in 1970-01-01 00:00:00 +0000 |
61 | +++ Help/Resources/Help.addin.xml.in 2009-11-30 02:30:24 +0000 |
62 | @@ -0,0 +1,27 @@ |
63 | +<Addin |
64 | + id="Help" |
65 | + namespace="Do" |
66 | + version="1.2" |
67 | + name="Help" |
68 | + description="Use Gnome Do to find Help." |
69 | + author="Joe Hillenbrand and J. Carlos Navea" |
70 | + category="Community" |
71 | + defaultEnabled="false" |
72 | +> |
73 | + |
74 | + <Runtime> |
75 | + <Import assembly="Help.dll"/> |
76 | + </Runtime> |
77 | + |
78 | + <Localizer type="Gettext" catalog="gnome-do-plugins" location="@expanded_datadir@/locale" /> |
79 | + |
80 | + <Dependencies> |
81 | + <Addin id="Universe" version="1.0" /> |
82 | + </Dependencies> |
83 | + |
84 | + <Extension path = "/Do/Action"> |
85 | + <Action type="Help.HelpAction" /> |
86 | + <Action type="Help.ManPagesAction" /> |
87 | + </Extension> |
88 | + |
89 | +</Addin> |
90 | |
91 | === added directory 'Help/Resources/icons' |
92 | === added file 'Help/Resources/icons/search-help.png' |
93 | Binary files Help/Resources/icons/search-help.png 1970-01-01 00:00:00 +0000 and Help/Resources/icons/search-help.png 2009-11-30 02:30:24 +0000 differ |
94 | === added file 'Help/Resources/icons/search-man.png' |
95 | Binary files Help/Resources/icons/search-man.png 1970-01-01 00:00:00 +0000 and Help/Resources/icons/search-man.png 2009-11-30 02:30:24 +0000 differ |
96 | === added directory 'Help/src' |
97 | === added file 'Help/src/Help.cs' |
98 | --- Help/src/Help.cs 1970-01-01 00:00:00 +0000 |
99 | +++ Help/src/Help.cs 2009-11-30 02:30:24 +0000 |
100 | @@ -0,0 +1,76 @@ |
101 | +// Help.cs |
102 | +// by Joe Hillenbrand <joehillen@gmail.com> |
103 | +// |
104 | +// based on ManLookUp |
105 | +// by J. Carlos Navea <loconet@gmail.com> |
106 | +// |
107 | +// This program is free software: you can redistribute it and/or modify |
108 | +// it under the terms of the GNU General Public License as published by |
109 | +// the Free Software Foundation, either version 3 of the License, or |
110 | +// (at your option) any later version. |
111 | +// |
112 | +// This program is distributed in the hope that it will be useful, |
113 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
114 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
115 | +// GNU General Public License for more details. |
116 | +// |
117 | +// You should have received a copy of the GNU General Public License |
118 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
119 | +// |
120 | + |
121 | +using System; |
122 | +using System.Linq; |
123 | +using System.Diagnostics; |
124 | +using System.Collections.Generic; |
125 | +using System.Text.RegularExpressions; |
126 | + |
127 | +using Mono.Addins; |
128 | + |
129 | +using Do.Universe; |
130 | + |
131 | +namespace Help { |
132 | + |
133 | + /// <summary> |
134 | + /// HelpAction - use yelp to search for help |
135 | + /// </summary> |
136 | + public class HelpAction : Act { |
137 | + |
138 | + public override string Name { |
139 | + get { return AddinManager.CurrentLocalizer.GetString ("Get Help"); } |
140 | + } |
141 | + |
142 | + public override string Description { |
143 | + get { return AddinManager.CurrentLocalizer.GetString ("Search Gnome's Help for an Aplication or Text"); } |
144 | + } |
145 | + |
146 | + public override string Icon { |
147 | + get { return "search-help.png@" + GetType ().Assembly.FullName; } |
148 | + } |
149 | + |
150 | + public override IEnumerable<Type> SupportedItemTypes { |
151 | + get { |
152 | + yield return typeof (ITextItem); |
153 | + yield return typeof (IRunnableItem); |
154 | + } |
155 | + } |
156 | + |
157 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
158 | + { |
159 | + string keyword = ""; |
160 | + foreach (Item i in items) { |
161 | + if (i is ITextItem){ |
162 | + keyword = (i as ITextItem).Text; |
163 | + } else if (i is IRunnableItem) { |
164 | + keyword = (i as IRunnableItem).Name; |
165 | + } |
166 | + if (!string.IsNullOrEmpty (keyword)) { |
167 | + Process term = new Process (); |
168 | + term.StartInfo.FileName = "yelp"; |
169 | + term.StartInfo.Arguments = " 'x-yelp-search:"+keyword+"' "; |
170 | + term.Start (); |
171 | + } |
172 | + } |
173 | + yield break; |
174 | + } |
175 | + } |
176 | +} |
177 | |
178 | === added file 'Help/src/ManPages.cs' |
179 | --- Help/src/ManPages.cs 1970-01-01 00:00:00 +0000 |
180 | +++ Help/src/ManPages.cs 2009-11-30 02:30:24 +0000 |
181 | @@ -0,0 +1,74 @@ |
182 | +// ManPageAction.cs |
183 | +// by J. Carlos Navea <loconet@gmail.com> |
184 | +// |
185 | +// |
186 | +// This program is free software: you can redistribute it and/or modify |
187 | +// it under the terms of the GNU General Public License as published by |
188 | +// the Free Software Foundation, either version 3 of the License, or |
189 | +// (at your option) any later version. |
190 | +// |
191 | +// This program is distributed in the hope that it will be useful, |
192 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
193 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
194 | +// GNU General Public License for more details. |
195 | +// |
196 | +// You should have received a copy of the GNU General Public License |
197 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
198 | +// |
199 | + |
200 | +using System; |
201 | +using System.Linq; |
202 | +using System.Diagnostics; |
203 | +using System.Collections.Generic; |
204 | +using System.Text.RegularExpressions; |
205 | + |
206 | +using Mono.Addins; |
207 | + |
208 | +using Do.Universe; |
209 | + |
210 | +namespace Help { |
211 | + |
212 | + /// <summary> |
213 | + /// ManPagesAction - find a man page using yelp |
214 | + /// </summary> |
215 | + public class ManPagesAction : Act { |
216 | + |
217 | + public override string Name { |
218 | + get { return AddinManager.CurrentLocalizer.GetString ("Look up man page"); } |
219 | + } |
220 | + |
221 | + public override string Description { |
222 | + get { return AddinManager.CurrentLocalizer.GetString ("Find a manual for this..."); } |
223 | + } |
224 | + |
225 | + public override string Icon { |
226 | + get { return "search-man.png@" + GetType ().Assembly.FullName; } |
227 | + } |
228 | + |
229 | + /// <value> |
230 | + /// Supported items: ITextItem and IRunnableItem |
231 | + /// </value> |
232 | + public override IEnumerable<Type> SupportedItemTypes { |
233 | + get { |
234 | + yield return typeof (ITextItem); |
235 | + } |
236 | + } |
237 | + |
238 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
239 | + { |
240 | + string keyword = ""; |
241 | + foreach (Item i in items) { |
242 | + if (i is ITextItem) { |
243 | + keyword = (i as ITextItem).Text; |
244 | + } |
245 | + if (!string.IsNullOrEmpty (keyword)) { |
246 | + Process term = new Process (); |
247 | + term.StartInfo.FileName = "yelp"; |
248 | + term.StartInfo.Arguments = " 'man:"+keyword+"' "; |
249 | + term.Start (); |
250 | + } |
251 | + } |
252 | + yield break; |
253 | + } |
254 | + } |
255 | +} |
256 | |
257 | === modified file 'Makefile.am' |
258 | --- Makefile.am 2009-11-08 23:58:01 +0000 |
259 | +++ Makefile.am 2009-11-30 02:30:24 +0000 |
260 | @@ -36,11 +36,11 @@ |
261 | GoogleDocs \ |
262 | GoogleMaps \ |
263 | GoogleSearch \ |
264 | + Help \ |
265 | ImageShack \ |
266 | JIRA \ |
267 | Launchpad \ |
268 | LocateFiles \ |
269 | - ManLookUp \ |
270 | Microblogging \ |
271 | MPD \ |
272 | NX \ |
273 | |
274 | === removed directory 'ManLookUp' |
275 | === removed file 'ManLookUp/Makefile.am' |
276 | --- ManLookUp/Makefile.am 2009-06-22 04:05:16 +0000 |
277 | +++ ManLookUp/Makefile.am 1970-01-01 00:00:00 +0000 |
278 | @@ -1,15 +0,0 @@ |
279 | -include $(top_srcdir)/build.rules.mk |
280 | - |
281 | -ASSEMBLY=ManLookUp |
282 | - |
283 | -FILES = \ |
284 | - src/ReadManualPageAction.cs |
285 | - |
286 | -RESOURCES = \ |
287 | - Resources/ManLookUp.addin.xml |
288 | - |
289 | -REFERENCES = \ |
290 | - System \ |
291 | - System.Core \ |
292 | - $(DO_PLATFORM_LIBS) \ |
293 | - $(DO_UNIVERSE_LIBS) |
294 | |
295 | === removed file 'ManLookUp/ManLookUp.mdp' |
296 | --- ManLookUp/ManLookUp.mdp 2009-06-29 08:47:41 +0000 |
297 | +++ ManLookUp/ManLookUp.mdp 1970-01-01 00:00:00 +0000 |
298 | @@ -1,28 +0,0 @@ |
299 | -<Project name="ManLookUp" fileversion="2.0" language="C#" Description="Gnome-do plugin" clr-version="Net_2_0" targetFramework="3.5" ctype="DotNetProject"> |
300 | - <Configurations active="Debug"> |
301 | - <Configuration name="Debug" ctype="DotNetProjectConfiguration"> |
302 | - <Output directory="bin/Debug" assemblyKeyFile="." assembly="ManLookUp" /> |
303 | - <Build debugmode="True" target="Library" /> |
304 | - <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" /> |
305 | - <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> |
306 | - </Configuration> |
307 | - <Configuration name="Release" ctype="DotNetProjectConfiguration"> |
308 | - <Output directory="bin/Release" assembly="ManLookUp" /> |
309 | - <Build debugmode="False" target="Library" /> |
310 | - <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" /> |
311 | - <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> |
312 | - </Configuration> |
313 | - </Configurations> |
314 | - <Contents> |
315 | - <File name="src" subtype="Directory" buildaction="Compile" /> |
316 | - <File name="src/ReadManualPageAction.cs" subtype="Code" buildaction="Compile" /> |
317 | - <File name="Resources/ManLookUp.addin.xml" subtype="Code" buildaction="EmbedAsResource" /> |
318 | - </Contents> |
319 | - <References> |
320 | - <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
321 | - <ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
322 | - <ProjectReference type="Gac" localcopy="True" refto="Mono.Addins, Version=0.4.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" /> |
323 | - <ProjectReference type="Gac" localcopy="True" refto="Do.Platform, Version=0.9.0.0, Culture=neutral" /> |
324 | - <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.9.0.0, Culture=neutral" /> |
325 | - </References> |
326 | -</Project> |
327 | \ No newline at end of file |
328 | |
329 | === removed directory 'ManLookUp/Resources' |
330 | === removed file 'ManLookUp/Resources/ManLookUp.addin.xml.in' |
331 | --- ManLookUp/Resources/ManLookUp.addin.xml.in 2009-06-22 21:50:13 +0000 |
332 | +++ ManLookUp/Resources/ManLookUp.addin.xml.in 1970-01-01 00:00:00 +0000 |
333 | @@ -1,26 +0,0 @@ |
334 | -<Addin |
335 | - id="ManPages" |
336 | - namespace="Do" |
337 | - version="1.2" |
338 | - name="Read Manual Pages (man)" |
339 | - description="Search and view manual pages." |
340 | - author="J. Carlos Navea" |
341 | - category="Community" |
342 | - defaultEnabled="false" |
343 | -> |
344 | - |
345 | - <Runtime> |
346 | - <Import assembly="ManLookUp.dll"/> |
347 | - </Runtime> |
348 | - |
349 | - <Localizer type="Gettext" catalog="gnome-do-plugins" location="@expanded_datadir@/locale" /> |
350 | - |
351 | - <Dependencies> |
352 | - <Addin id="Universe" version="1.0" /> |
353 | - </Dependencies> |
354 | - |
355 | - <Extension path = "/Do/Action"> |
356 | - <Action type="ManPages.ReadManualPageAction" /> |
357 | - </Extension> |
358 | - |
359 | -</Addin> |
360 | |
361 | === removed directory 'ManLookUp/src' |
362 | === removed file 'ManLookUp/src/ReadManualPageAction.cs' |
363 | --- ManLookUp/src/ReadManualPageAction.cs 2009-06-22 04:05:16 +0000 |
364 | +++ ManLookUp/src/ReadManualPageAction.cs 1970-01-01 00:00:00 +0000 |
365 | @@ -1,96 +0,0 @@ |
366 | -// ReadManualPageAction.cs |
367 | -// |
368 | -// J. Carlos Navea <loconet@gmail.com> |
369 | -// |
370 | -// This program is free software: you can redistribute it and/or modify |
371 | -// it under the terms of the GNU General Public License as published by |
372 | -// the Free Software Foundation, either version 3 of the License, or |
373 | -// (at your option) any later version. |
374 | -// |
375 | -// This program is distributed in the hope that it will be useful, |
376 | -// but WITHOUT ANY WARRANTY; without even the implied warranty of |
377 | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
378 | -// GNU General Public License for more details. |
379 | -// |
380 | -// You should have received a copy of the GNU General Public License |
381 | -// along with this program. If not, see <http://www.gnu.org/licenses/>. |
382 | -// |
383 | - |
384 | -using System; |
385 | -using System.Linq; |
386 | -using System.Diagnostics; |
387 | -using System.Collections.Generic; |
388 | -using System.Text.RegularExpressions; |
389 | - |
390 | -using Mono.Addins; |
391 | - |
392 | -using Do.Universe; |
393 | - |
394 | -namespace ManPages { |
395 | - |
396 | - /// <summary> |
397 | - /// ReadManualPageAction - the main action for our plugin. |
398 | - /// Allows us to hook up to Gnome-Do as a command |
399 | - /// that can be applied to raw text or our own man page items. |
400 | - /// </summary> |
401 | - public class ReadManualPageAction : Act { |
402 | - |
403 | - /// <value> |
404 | - /// The name of the action |
405 | - /// </value> |
406 | - public override string Name { |
407 | - get { return AddinManager.CurrentLocalizer.GetString ("Read manual page (man)"); } |
408 | - } |
409 | - |
410 | - /// <value> |
411 | - /// Action's description |
412 | - /// </value> |
413 | - public override string Description { |
414 | - get { return AddinManager.CurrentLocalizer.GetString ("Look up and read a manual page."); } |
415 | - } |
416 | - |
417 | - /// <value> |
418 | - /// The pretty icon |
419 | - /// </value> |
420 | - public override string Icon { |
421 | - get { return "applications-office"; } |
422 | - } |
423 | - |
424 | - /// <value> |
425 | - /// List of supported items (ITextItem) |
426 | - /// </value> |
427 | - public override IEnumerable<Type> SupportedItemTypes { |
428 | - get { |
429 | - yield return typeof (ITextItem); |
430 | - } |
431 | - } |
432 | - |
433 | - /// <summary> |
434 | - /// Called by Gnome-Do in order to perform our action. |
435 | - /// </summary> |
436 | - /// <param name="items"> |
437 | - /// List of <see cref="Item"/> objects, either raw text or custom look up items |
438 | - /// </param> |
439 | - /// <param name="modItems"> |
440 | - /// List of <see cref="Item"/> objects, action modifiers |
441 | - /// </param> |
442 | - /// <returns> |
443 | - /// List of <see cref="Item"/> |
444 | - /// </returns> |
445 | - public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
446 | - { |
447 | - string keyword; |
448 | - foreach (Item i in items) |
449 | - { |
450 | - keyword = (i as ITextItem).Text; |
451 | - if (!string.IsNullOrEmpty (keyword)) { |
452 | - Process term = new Process (); |
453 | - term.StartInfo.FileName = "yelp"; |
454 | - term.StartInfo.Arguments = " 'man:"+keyword+"' "; |
455 | - term.Start (); |
456 | - } |
457 | - } |
458 | - yield break; |
459 | - } |
460 | - } |
461 | -} |
462 | |
463 | === modified file 'configure.ac' |
464 | --- configure.ac 2009-11-08 23:58:01 +0000 |
465 | +++ configure.ac 2009-11-30 02:30:24 +0000 |
466 | @@ -304,6 +304,8 @@ |
467 | GoogleMaps/Resources/GoogleMaps.addin.xml |
468 | GoogleSearch/Makefile |
469 | GoogleSearch/Resources/GoogleSearch.addin.xml |
470 | +Help/Makefile |
471 | +Help/Resources/Help.addin.xml |
472 | ImageShack/Makefile |
473 | ImageShack/Resources/ImageShack.addin.xml |
474 | JIRA/Makefile |
475 | @@ -312,8 +314,6 @@ |
476 | Launchpad/Resources/Launchpad.addin.xml |
477 | LocateFiles/Makefile |
478 | LocateFiles/Resources/LocateFiles.addin.xml |
479 | -ManLookUp/Makefile |
480 | -ManLookUp/Resources/ManLookUp.addin.xml |
481 | Microblogging/Makefile |
482 | Microblogging/Resources/Microblogging.addin.xml |
483 | MPD/Makefile |
Added my plugin to search Gnome's Help and integrated ManLookUp into it.