Merge lp:~peterbjorgensen/do-plugins/qalculate into lp:do-plugins

Proposed by Peter B. Jørgensen
Status: Merged
Approved by: Alex Launi
Approved revision: 619
Merged at revision: not available
Proposed branch: lp:~peterbjorgensen/do-plugins/qalculate
Merge into: lp:do-plugins
Diff against target: None lines
To merge this branch: bzr merge lp:~peterbjorgensen/do-plugins/qalculate
Reviewer Review Type Date Requested Status
Alex Launi (community) testing Approve
Do Core Team Pending
Review via email: mp+7145@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Peter B. Jørgensen (peterbjorgensen) wrote :

A calculator plugin like Google Calculator, but with the Qalculate command-line tool 'qalc' as backend for quicker results and no online-dependency.

Revision history for this message
Alex Launi (alexlauni) wrote :

Looks pretty good, however it needs updating to be compatible with current trunk for localization. Basically you just rename the addin.xml file to addin.xml.in, and add the line for the localizer (look at another plugin), and your name and description need to be localizable. Again- look at another plugin for this.

review: Needs Fixing (testing)
619. By Peter B. Jørgensen

Merged with the current trunk
Support for localizer added

Revision history for this message
Peter B. Jørgensen (peterbjorgensen) wrote :

> Looks pretty good, however it needs updating to be compatible with current
> trunk for localization. Basically you just rename the addin.xml file to
> addin.xml.in, and add the line for the localizer (look at another plugin), and
> your name and description need to be localizable. Again- look at another
> plugin for this.

The plugin is now merged against the trunk, and the changes for localization are made.

Revision history for this message
Alex Launi (alexlauni) wrote :

looks good, merging

review: Approve (testing)

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-05-27 04:41:20 +0000
3+++ DoPlugins.mds 2009-06-06 09:54:06 +0000
4@@ -72,6 +72,7 @@
5 <Entry build="True" name="YouTube" configuration="Debug" />
6 <Entry build="True" name="Emesene" configuration="Debug" />
7 <Entry build="True" name="RemindMe" configuration="Debug" />
8+ <Entry build="True" name="Qalculate" configuration="Debug" />
9 </Configuration>
10 <Configuration name="Release" ctype="CombineConfiguration">
11 <Entry build="True" name="Rhythmbox" configuration="Release" />
12@@ -145,6 +146,7 @@
13 <Entry build="True" name="YouTube" configuration="Release" />
14 <Entry build="True" name="Emesene" configuration="Release" />
15 <Entry build="True" name="RemindMe" configuration="Release" />
16+ <Entry build="True" name="Qalculate" configuration="Release" />
17 </Configuration>
18 </Configurations>
19 <StartMode startupentry="Rhythmbox" single="True">
20@@ -219,6 +221,7 @@
21 <Execute type="None" entry="YouTube" />
22 <Execute type="None" entry="Emesene" />
23 <Execute type="None" entry="RemindMe" />
24+ <Execute type="None" entry="Qalculate" />
25 </StartMode>
26 <MonoDevelop.ChangeLogAddIn.ChangeLogInfo policy="UpdateNearestChangeLog" />
27 <Entries>
28@@ -293,5 +296,6 @@
29 <Entry filename="YouTube/YouTube.mdp" />
30 <Entry filename="Emesene/Emesene.mdp" />
31 <Entry filename="RemindMe/RemindMe.mdp" />
32+ <Entry filename="Qalculate/Qalculate.mdp" />
33 </Entries>
34 </Combine>
35\ No newline at end of file
36
37=== modified file 'Makefile.am'
38--- Makefile.am 2009-05-16 16:50:32 +0000
39+++ Makefile.am 2009-06-06 09:54:06 +0000
40@@ -46,6 +46,7 @@
41 Pidgin \
42 PingFM \
43 Putty \
44+ Qalculate \
45 Quote \
46 RememberTheMilk \
47 RemindMe \
48
49=== added directory 'Qalculate'
50=== added file 'Qalculate/Makefile.am'
51--- Qalculate/Makefile.am 1970-01-01 00:00:00 +0000
52+++ Qalculate/Makefile.am 2009-06-06 09:54:06 +0000
53@@ -0,0 +1,16 @@
54+include $(top_srcdir)/build.rules.mk
55+
56+ASSEMBLY=Qalculate
57+
58+FILES = \
59+ src/QalculateAction.cs
60+
61+RESOURCES = \
62+ Resources/Qalculate.addin.xml
63+
64+REFERENCES = \
65+ Mono.Posix \
66+ System \
67+ System.Core \
68+ $(DO_PLATFORM_LIBS) \
69+ $(DO_UNIVERSE_LIBS)
70
71=== added file 'Qalculate/Qalculate.mdp'
72--- Qalculate/Qalculate.mdp 1970-01-01 00:00:00 +0000
73+++ Qalculate/Qalculate.mdp 2009-06-06 09:54:06 +0000
74@@ -0,0 +1,27 @@
75+<Project name="Qalculate" fileversion="2.0" newfilesearch="OnLoadAutoInsert" language="C#" clr-version="Net_2_0" targetFramework="2.0" ctype="DotNetProject">
76+ <Configurations active="Debug">
77+ <Configuration name="Debug" ctype="DotNetProjectConfiguration">
78+ <Output directory="bin/Debug" assembly="Qalculate" />
79+ <Build debugmode="True" target="Library" />
80+ <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
81+ <CodeGeneration compiler="Mcs" warninglevel="3" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
82+ </Configuration>
83+ <Configuration name="Release" ctype="DotNetProjectConfiguration">
84+ <Output directory="bin/Release" assembly="Qalculate" />
85+ <Build debugmode="False" target="Library" />
86+ <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
87+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
88+ </Configuration>
89+ </Configurations>
90+ <Contents>
91+ <File name="Resources/Qalculate.addin.xml" subtype="Code" buildaction="Nothing" />
92+ <File name="src/QalculateAction.cs" subtype="Code" buildaction="Compile" />
93+ </Contents>
94+ <References>
95+ <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
96+ <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />
97+ <ProjectReference type="Gac" localcopy="True" refto="Do.Platform, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />
98+ <ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
99+ <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
100+ </References>
101+</Project>
102\ No newline at end of file
103
104=== added directory 'Qalculate/Resources'
105=== added file 'Qalculate/Resources/Qalculate.addin.xml'
106--- Qalculate/Resources/Qalculate.addin.xml 1970-01-01 00:00:00 +0000
107+++ Qalculate/Resources/Qalculate.addin.xml 2009-06-06 09:54:06 +0000
108@@ -0,0 +1,23 @@
109+<Addin
110+ id="Qalculate"
111+ namespace= "Do"
112+ version="0.1"
113+ name="Qalculate"
114+ description="Perform calculations, and currency/quantity conversions."
115+ author="Peter Bjorn Jorgensen"
116+ category="Community"
117+ defaultEnabled="false"
118+>
119+
120+ <Runtime>
121+ <Import assembly="Qalculate.dll"/>
122+ </Runtime>
123+
124+ <Dependencies>
125+ <Addin id="Universe" version="1.0" />
126+ </Dependencies>
127+
128+ <Extension path= "/Do/Action">
129+ <Action type="Do.Plugins.QalculateAction" />
130+ </Extension>
131+</Addin>
132
133=== added directory 'Qalculate/src'
134=== added file 'Qalculate/src/QalculateAction.cs'
135--- Qalculate/src/QalculateAction.cs 1970-01-01 00:00:00 +0000
136+++ Qalculate/src/QalculateAction.cs 2009-06-06 09:54:06 +0000
137@@ -0,0 +1,46 @@
138+using System;
139+using System.Linq;
140+using System.Collections.Generic;
141+using System.Diagnostics;
142+
143+using Do.Universe;
144+using Do.Platform;
145+using Do.Universe.Common;
146+
147+namespace Do.Plugins {
148+
149+ public class QalculateAction : Act {
150+
151+ public override string Name {
152+ get { return "Qalculate"; }
153+ }
154+
155+ public override string Description {
156+ get { return "Perform a calculation using Qalculate"; }
157+ }
158+
159+ public override string Icon {
160+ get { return "accessories-calculator"; }
161+ }
162+
163+ public override IEnumerable<Type> SupportedItemTypes {
164+ get { yield return typeof (ITextItem); }
165+ }
166+
167+ public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems)
168+ {
169+ string expression = (items.First () as ITextItem).Text;
170+ string result;
171+
172+ ProcessStartInfo ps = new ProcessStartInfo ("qalc", expression);
173+ ps.UseShellExecute = false;
174+ ps.RedirectStandardOutput = true;
175+ Process p = Process.Start (ps);
176+
177+ result = p.StandardOutput.ReadToEnd ();
178+ p.WaitForExit ();
179+
180+ yield return new TextItem (result);
181+ }
182+ }
183+}
184\ No newline at end of file
185
186=== modified file 'configure.ac'
187--- configure.ac 2009-05-18 06:45:46 +0000
188+++ configure.ac 2009-06-06 09:54:06 +0000
189@@ -283,6 +283,7 @@
190 Pidgin/Makefile
191 PingFM/Makefile
192 Putty/Makefile
193+Qalculate/Makefile
194 Quote/Makefile
195 RememberTheMilk/Makefile
196 RemindMe/Makefile

Subscribers

People subscribed via source and target branches