Merge lp:~joehillen/do-plugins/Help into lp:do-plugins

Proposed by JoE
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
Reviewer Review Type Date Requested Status
Do Plugins Team Pending
Review via email: mp+15392@code.launchpad.net
To post a comment you must log in.
Revision history for this message
JoE (joehillen) wrote :

Added my plugin to search Gnome's Help and integrated ManLookUp into it.

Unmerged revisions

675. By JoE

Added Help plugin, removed ManLookUp

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'Help'
=== added file 'Help/Help.mdp'
--- Help/Help.mdp 1970-01-01 00:00:00 +0000
+++ Help/Help.mdp 2009-11-30 02:30:24 +0000
@@ -0,0 +1,28 @@
1<Project name="Help" fileversion="2.0" language="C#" targetFramework="3.5" ctype="DotNetProject">
2 <Configurations active="Debug">
3 <Configuration name="Debug" ctype="DotNetProjectConfiguration">
4 <Output directory="bin/Debug" assembly="Help" />
5 <Build debugmode="True" target="Library" />
6 <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
7 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
8 </Configuration>
9 <Configuration name="Release" ctype="DotNetProjectConfiguration">
10 <Output directory="." assembly="Help" />
11 <Build debugmode="False" target="Library" />
12 <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
13 <EnvironmentVariables />
14 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
15 </Configuration>
16 </Configurations>
17 <Contents>
18 <File name="src/Help.cs" subtype="Code" buildaction="Compile" />
19 <File name="Resources/Help.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
20 <File name="Resources/icons/search-help.png" subtype="Code" buildaction="EmbedAsResource" />
21 </Contents>
22 <References>
23 <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.9.0.0, Culture=neutral" />
24 <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
25 <ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
26 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
27 </References>
28</Project>
0\ No newline at end of file29\ No newline at end of file
130
=== added file 'Help/Makefile.am'
--- Help/Makefile.am 1970-01-01 00:00:00 +0000
+++ Help/Makefile.am 2009-11-30 02:30:24 +0000
@@ -0,0 +1,17 @@
1include $(top_srcdir)/build.rules.mk
2
3ASSEMBLY=Help
4
5FILES = \
6 src/Help.cs \
7 src/ManPages.cs
8
9RESOURCES = \
10 Resources/Help.addin.xml \
11 Resources/icons/search-help.png \
12 Resources/icons/search-man.png
13
14REFERENCES = \
15 System \
16 $(DO_PLATFORM_LIBS) \
17 $(DO_UNIVERSE_LIBS)
018
=== added directory 'Help/Resources'
=== added file 'Help/Resources/Help.addin.xml.in'
--- Help/Resources/Help.addin.xml.in 1970-01-01 00:00:00 +0000
+++ Help/Resources/Help.addin.xml.in 2009-11-30 02:30:24 +0000
@@ -0,0 +1,27 @@
1<Addin
2 id="Help"
3 namespace="Do"
4 version="1.2"
5 name="Help"
6 description="Use Gnome Do to find Help."
7 author="Joe Hillenbrand and J. Carlos Navea"
8 category="Community"
9 defaultEnabled="false"
10>
11
12 <Runtime>
13 <Import assembly="Help.dll"/>
14 </Runtime>
15
16 <Localizer type="Gettext" catalog="gnome-do-plugins" location="@expanded_datadir@/locale" />
17
18 <Dependencies>
19 <Addin id="Universe" version="1.0" />
20 </Dependencies>
21
22 <Extension path = "/Do/Action">
23 <Action type="Help.HelpAction" />
24 <Action type="Help.ManPagesAction" />
25 </Extension>
26
27</Addin>
028
=== added directory 'Help/Resources/icons'
=== added file 'Help/Resources/icons/search-help.png'
1Binary 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 differ29Binary 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
=== added file 'Help/Resources/icons/search-man.png'
2Binary 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 differ30Binary 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
=== added directory 'Help/src'
=== added file 'Help/src/Help.cs'
--- Help/src/Help.cs 1970-01-01 00:00:00 +0000
+++ Help/src/Help.cs 2009-11-30 02:30:24 +0000
@@ -0,0 +1,76 @@
1// Help.cs
2// by Joe Hillenbrand <joehillen@gmail.com>
3//
4// based on ManLookUp
5// by J. Carlos Navea <loconet@gmail.com>
6//
7// This program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19//
20
21using System;
22using System.Linq;
23using System.Diagnostics;
24using System.Collections.Generic;
25using System.Text.RegularExpressions;
26
27using Mono.Addins;
28
29using Do.Universe;
30
31namespace Help {
32
33 /// <summary>
34 /// HelpAction - use yelp to search for help
35 /// </summary>
36 public class HelpAction : Act {
37
38 public override string Name {
39 get { return AddinManager.CurrentLocalizer.GetString ("Get Help"); }
40 }
41
42 public override string Description {
43 get { return AddinManager.CurrentLocalizer.GetString ("Search Gnome's Help for an Aplication or Text"); }
44 }
45
46 public override string Icon {
47 get { return "search-help.png@" + GetType ().Assembly.FullName; }
48 }
49
50 public override IEnumerable<Type> SupportedItemTypes {
51 get {
52 yield return typeof (ITextItem);
53 yield return typeof (IRunnableItem);
54 }
55 }
56
57 public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems)
58 {
59 string keyword = "";
60 foreach (Item i in items) {
61 if (i is ITextItem){
62 keyword = (i as ITextItem).Text;
63 } else if (i is IRunnableItem) {
64 keyword = (i as IRunnableItem).Name;
65 }
66 if (!string.IsNullOrEmpty (keyword)) {
67 Process term = new Process ();
68 term.StartInfo.FileName = "yelp";
69 term.StartInfo.Arguments = " 'x-yelp-search:"+keyword+"' ";
70 term.Start ();
71 }
72 }
73 yield break;
74 }
75 }
76}
077
=== added file 'Help/src/ManPages.cs'
--- Help/src/ManPages.cs 1970-01-01 00:00:00 +0000
+++ Help/src/ManPages.cs 2009-11-30 02:30:24 +0000
@@ -0,0 +1,74 @@
1// ManPageAction.cs
2// by J. Carlos Navea <loconet@gmail.com>
3//
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18
19using System;
20using System.Linq;
21using System.Diagnostics;
22using System.Collections.Generic;
23using System.Text.RegularExpressions;
24
25using Mono.Addins;
26
27using Do.Universe;
28
29namespace Help {
30
31 /// <summary>
32 /// ManPagesAction - find a man page using yelp
33 /// </summary>
34 public class ManPagesAction : Act {
35
36 public override string Name {
37 get { return AddinManager.CurrentLocalizer.GetString ("Look up man page"); }
38 }
39
40 public override string Description {
41 get { return AddinManager.CurrentLocalizer.GetString ("Find a manual for this..."); }
42 }
43
44 public override string Icon {
45 get { return "search-man.png@" + GetType ().Assembly.FullName; }
46 }
47
48 /// <value>
49 /// Supported items: ITextItem and IRunnableItem
50 /// </value>
51 public override IEnumerable<Type> SupportedItemTypes {
52 get {
53 yield return typeof (ITextItem);
54 }
55 }
56
57 public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems)
58 {
59 string keyword = "";
60 foreach (Item i in items) {
61 if (i is ITextItem) {
62 keyword = (i as ITextItem).Text;
63 }
64 if (!string.IsNullOrEmpty (keyword)) {
65 Process term = new Process ();
66 term.StartInfo.FileName = "yelp";
67 term.StartInfo.Arguments = " 'man:"+keyword+"' ";
68 term.Start ();
69 }
70 }
71 yield break;
72 }
73 }
74}
075
=== modified file 'Makefile.am'
--- Makefile.am 2009-11-08 23:58:01 +0000
+++ Makefile.am 2009-11-30 02:30:24 +0000
@@ -36,11 +36,11 @@
36 GoogleDocs \36 GoogleDocs \
37 GoogleMaps \37 GoogleMaps \
38 GoogleSearch \38 GoogleSearch \
39 Help \
39 ImageShack \40 ImageShack \
40 JIRA \41 JIRA \
41 Launchpad \42 Launchpad \
42 LocateFiles \43 LocateFiles \
43 ManLookUp \
44 Microblogging \44 Microblogging \
45 MPD \45 MPD \
46 NX \46 NX \
4747
=== removed directory 'ManLookUp'
=== removed file 'ManLookUp/Makefile.am'
--- ManLookUp/Makefile.am 2009-06-22 04:05:16 +0000
+++ ManLookUp/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
1include $(top_srcdir)/build.rules.mk
2
3ASSEMBLY=ManLookUp
4
5FILES = \
6 src/ReadManualPageAction.cs
7
8RESOURCES = \
9 Resources/ManLookUp.addin.xml
10
11REFERENCES = \
12 System \
13 System.Core \
14 $(DO_PLATFORM_LIBS) \
15 $(DO_UNIVERSE_LIBS)
160
=== removed file 'ManLookUp/ManLookUp.mdp'
--- ManLookUp/ManLookUp.mdp 2009-06-29 08:47:41 +0000
+++ ManLookUp/ManLookUp.mdp 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1<Project name="ManLookUp" fileversion="2.0" language="C#" Description="Gnome-do plugin" clr-version="Net_2_0" targetFramework="3.5" ctype="DotNetProject">
2 <Configurations active="Debug">
3 <Configuration name="Debug" ctype="DotNetProjectConfiguration">
4 <Output directory="bin/Debug" assemblyKeyFile="." assembly="ManLookUp" />
5 <Build debugmode="True" target="Library" />
6 <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
7 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
8 </Configuration>
9 <Configuration name="Release" ctype="DotNetProjectConfiguration">
10 <Output directory="bin/Release" assembly="ManLookUp" />
11 <Build debugmode="False" target="Library" />
12 <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
13 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
14 </Configuration>
15 </Configurations>
16 <Contents>
17 <File name="src" subtype="Directory" buildaction="Compile" />
18 <File name="src/ReadManualPageAction.cs" subtype="Code" buildaction="Compile" />
19 <File name="Resources/ManLookUp.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
20 </Contents>
21 <References>
22 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
23 <ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
24 <ProjectReference type="Gac" localcopy="True" refto="Mono.Addins, Version=0.4.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
25 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform, Version=0.9.0.0, Culture=neutral" />
26 <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.9.0.0, Culture=neutral" />
27 </References>
28</Project>
29\ No newline at end of file0\ No newline at end of file
301
=== removed directory 'ManLookUp/Resources'
=== removed file 'ManLookUp/Resources/ManLookUp.addin.xml.in'
--- ManLookUp/Resources/ManLookUp.addin.xml.in 2009-06-22 21:50:13 +0000
+++ ManLookUp/Resources/ManLookUp.addin.xml.in 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1<Addin
2 id="ManPages"
3 namespace="Do"
4 version="1.2"
5 name="Read Manual Pages (man)"
6 description="Search and view manual pages."
7 author="J. Carlos Navea"
8 category="Community"
9 defaultEnabled="false"
10>
11
12 <Runtime>
13 <Import assembly="ManLookUp.dll"/>
14 </Runtime>
15
16 <Localizer type="Gettext" catalog="gnome-do-plugins" location="@expanded_datadir@/locale" />
17
18 <Dependencies>
19 <Addin id="Universe" version="1.0" />
20 </Dependencies>
21
22 <Extension path = "/Do/Action">
23 <Action type="ManPages.ReadManualPageAction" />
24 </Extension>
25
26</Addin>
270
=== removed directory 'ManLookUp/src'
=== removed file 'ManLookUp/src/ReadManualPageAction.cs'
--- ManLookUp/src/ReadManualPageAction.cs 2009-06-22 04:05:16 +0000
+++ ManLookUp/src/ReadManualPageAction.cs 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
1// ReadManualPageAction.cs
2//
3// J. Carlos Navea <loconet@gmail.com>
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18
19using System;
20using System.Linq;
21using System.Diagnostics;
22using System.Collections.Generic;
23using System.Text.RegularExpressions;
24
25using Mono.Addins;
26
27using Do.Universe;
28
29namespace ManPages {
30
31 /// <summary>
32 /// ReadManualPageAction - the main action for our plugin.
33 /// Allows us to hook up to Gnome-Do as a command
34 /// that can be applied to raw text or our own man page items.
35 /// </summary>
36 public class ReadManualPageAction : Act {
37
38 /// <value>
39 /// The name of the action
40 /// </value>
41 public override string Name {
42 get { return AddinManager.CurrentLocalizer.GetString ("Read manual page (man)"); }
43 }
44
45 /// <value>
46 /// Action's description
47 /// </value>
48 public override string Description {
49 get { return AddinManager.CurrentLocalizer.GetString ("Look up and read a manual page."); }
50 }
51
52 /// <value>
53 /// The pretty icon
54 /// </value>
55 public override string Icon {
56 get { return "applications-office"; }
57 }
58
59 /// <value>
60 /// List of supported items (ITextItem)
61 /// </value>
62 public override IEnumerable<Type> SupportedItemTypes {
63 get {
64 yield return typeof (ITextItem);
65 }
66 }
67
68 /// <summary>
69 /// Called by Gnome-Do in order to perform our action.
70 /// </summary>
71 /// <param name="items">
72 /// List of <see cref="Item"/> objects, either raw text or custom look up items
73 /// </param>
74 /// <param name="modItems">
75 /// List of <see cref="Item"/> objects, action modifiers
76 /// </param>
77 /// <returns>
78 /// List of <see cref="Item"/>
79 /// </returns>
80 public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems)
81 {
82 string keyword;
83 foreach (Item i in items)
84 {
85 keyword = (i as ITextItem).Text;
86 if (!string.IsNullOrEmpty (keyword)) {
87 Process term = new Process ();
88 term.StartInfo.FileName = "yelp";
89 term.StartInfo.Arguments = " 'man:"+keyword+"' ";
90 term.Start ();
91 }
92 }
93 yield break;
94 }
95 }
96}
970
=== modified file 'configure.ac'
--- configure.ac 2009-11-08 23:58:01 +0000
+++ configure.ac 2009-11-30 02:30:24 +0000
@@ -304,6 +304,8 @@
304GoogleMaps/Resources/GoogleMaps.addin.xml304GoogleMaps/Resources/GoogleMaps.addin.xml
305GoogleSearch/Makefile305GoogleSearch/Makefile
306GoogleSearch/Resources/GoogleSearch.addin.xml306GoogleSearch/Resources/GoogleSearch.addin.xml
307Help/Makefile
308Help/Resources/Help.addin.xml
307ImageShack/Makefile309ImageShack/Makefile
308ImageShack/Resources/ImageShack.addin.xml310ImageShack/Resources/ImageShack.addin.xml
309JIRA/Makefile311JIRA/Makefile
@@ -312,8 +314,6 @@
312Launchpad/Resources/Launchpad.addin.xml314Launchpad/Resources/Launchpad.addin.xml
313LocateFiles/Makefile315LocateFiles/Makefile
314LocateFiles/Resources/LocateFiles.addin.xml316LocateFiles/Resources/LocateFiles.addin.xml
315ManLookUp/Makefile
316ManLookUp/Resources/ManLookUp.addin.xml
317Microblogging/Makefile317Microblogging/Makefile
318Microblogging/Resources/Microblogging.addin.xml318Microblogging/Resources/Microblogging.addin.xml
319MPD/Makefile319MPD/Makefile

Subscribers

People subscribed via source and target branches