
Currency Converter
Source (link to git-repo or to original if based on someone elses unmodified work):
A simple Plasmoid created using PyQt and PyKDE4.
Features:
- Select to and/or from the dropdown list and the converted amount will be updated.
- Change the amount to be converted and TAB or click outside the Amount field
and the result will be updated.
- Selected currencies and amount is saved between sessions.
- Refreshing selected convertion when no activity for a user defined period of time.
- Current/last conversion result is shown in the tool tip when docked in the panel.
Install the Plasmoid:
plasmapkg -i ./currency-converter.plasmoid
Update the Plasmoid:
plasmapkg -u ./currency-converter.plasmoid
or add it from "Add Widgets"=>"Install New Widgets"=>"Download New Plasma Widgets"
TODO:
- Translations. Currently only Danish translations.
- Check version upgrade process: Is the config persistent?
- Credits label link doesn't launch web site.
- Dates aren't localized.
- Send notifications instead of showMessage.
- Better error detection on web service query.
- Create a Currency Converter Data Engine.
- Connect/emit settingsChanged in Settings.
- Show the most used currencies at top of list.
IDEAS (comments are welcome):
- Monitor currencies and notify on (...)
- Offer other services than Yahoo! Finance.
- 0.6.1
- Use QDoubleValidator instead of KDoubleValidator which has been removed from pykde.
- 0.6
- The Plasmoid now finally docks in the panel using Plasma.PopupApplet.
- New icon! (cut'n'paste from other icons - hmmm).
- Only import required parts of the used modules. The functionalities such
as System Notifications and Network monitoring are now separate classes
which makes them reusable in my other Plasmoids.
- Fail gracefully on wrong KDE SC version.
- Fix for not detecting network on some distributions.
- Current/last conversion result is now shown in the tool tip when docked in the panel.
- Removed collapse/expand because it didn't work properly and current result can be seen in tooltip.
- Added context menu for updating current conversion.
- Added configuration for refresh/update interval.
- Improved KIO handling.
- Notification on network errors.
- Much improved error handling when no network connection using Solid. The Plasmoid
is now disabled until a connection is established instead of just giving up and dying ;-)
- Now using the KDE Currency classes (Only works from KDE SC 4.4.4).
- Showing Currency name first instead of currency code to make the easier to find in the list.
Changelog for earlier versions at https://github.com/tanghus/currency-converter-plasmoid/blob/master/Changelog
NOTE: If the download link doesn't work here's a direct link: https://github.com/tanghus/currency-converter-plasmoid/releases/download/v0.6.1/currency-converter-0.6.1.plasmoid
Ratings & Comments
24 Comments
Hi, this plasmoid is very usefull and i hesitate to install new distro because of plasmoids not ported yet.his is the case with currency converter the plasmoid doesn't work anymore on plasma 5, seems to be a problem with python scripting not supported anymore by new platform. the plasmoid have to be ported in qml. is there a hope that you can port it or use the qml plasmoid for sailfish os as a basis to do this? thank you
I'm on Arch Linux. Since the latest pyqt4 update (v4.11-2) it stopped working. It displays the message 'script initialization failed'.
Are you sure you have the python plasmoid script engine installed? On Kubuntu it's called plasma-scriptengine-python. Also try to test from CLI by running: plasmoidviewer currency-converter
I would love to see this plasmoid use www.oanda.com , a site that is used "as default" by many organisations as they have almost all currencies on Earth
IANAL but the tos seems rather strict http://www.oanda.com/site/terms-of-use
In Kubuntu 13.10 and recent updates on 13.04 there have been some changes to pykde. I currently don't have the time to properly test the plasmoid, but applying the patch below to ~/.kde/share/apps/plasma/plasmoids/currency-converter/contents/code/CurrencyConverter.py should fix it: https://github.com/tanghus/currency-converter-plasmoid/commit/f0203c8858ca2fa1cf1b2482a7611931fbeb2e84
I use this all the time, and I only have one criticism. I have it set to an Update interval of 60 minutes. When I start up I think it tries to update before the connection is ready and then sits and waits for 60 minutes before the next update. Of course I can, and do, right-click and Update now, but if it could try the first update after a delay it would be better I think. Andrew
Hi Great to see someone's actually using this plasmoid :) I haven't touched the code for like 2 years and am quite busy on other stuff. However the code is on github, and if you can patch it to do that, I will release an updated version https://github.com/tanghus/currency-converter-plasmoid
Thanks - wouldn't even know where to start :) All the best Andrew
all i get is: ImportError: No module named sipconfig trying to use this on KDE 4.8.4 running on openSUSE 12.1. any hints?
I believe sipconfig is distributed with PyQt4 and PyKDE4. Are you sure they are properly installed?
yes, and i do have a sipconfig.py file on my system: /usr/lib64/python3.2/site-packages/sipconfig.py
I *am* noticing two things: 1. currency-converter appears TWICE in the output of "plasmapkg -l" the error shows that stuff from python2.7 is used: lemmy@sai:~/Downloads> plasmoidviewer currency-converter Traceback (most recent call last): File "/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py", line 59, in init self.module = __import__(self.pluginName+'.'+relpath) File "/usr/share/kde4/apps/plasma_scriptengine_python/plasma_importer.py", line 107, in load_module exec code in mod.__dict__ File "/users/lemmy/.kde4/share/apps/plasma/plasmoids/currency-converter/contents/code/main.py", line 40, in <module> import PyKDE4.pykdeconfig File "/usr/lib64/python2.7/site-packages/PyKDE4/pykdeconfig.py", line 25, in <module> import sipconfig, PyQt4.pyqtconfig
solved... i had the python3 qt and kde packages, but not the python 2.7 versions. works now.
Ah, glad it worked out :-)
Quote:1. currency-converter appears TWICE in the output of "plasmapkg -l"
I see that as well for several plasmoids actually. "plasmoidviewer --list" shows the right output.
Quote:the error shows that stuff from python2.7 is used:
lemmy@sai:~/Downloads> plasmoidviewer currency-converter
Traceback (most recent call last):
(...)
File "/users/lemmy/.kde4/share/apps/plasma/plasmoids/currency-converter/contents/code/main.py", line 40, in <module>
import PyKDE4.pykdeconfig
It seems the import PyKDE4.pykdeconfig isn't necessary. Can you try to comment it out and see if it still works for you?
it is really nice to see the currencies in the desktop. but i have a suggestions how about this: 1. just display the favorite currencies. it is more neat i think. other currencies can be added from setting menu. 2. the currencies are from 2 or more sources and the results just like that either. for example: 1 Indian rupee V To: --- US Dollar V 1 AUS Dollar V To: --- US Dollar V 1 EURO V To: --- Swed. Krona V V = is the drop down button --- = is the result value 3. can be set to just display the actual result. for example: --- USD (INR) --- USD (AUD) --- SEK (EUR) 4. the source is from multiple sources, such like IMF, oanda, and others. 5. can download a simple history graph just like yahoo finance but more plasmoid manner. I got excited when see this plasmoid it's very future rich...:) keep up the good work..
Thanks for the nice words and sorry for the late reply. I have a new version of the Plasmoid which is almost ready to release. In that I have dropped the collapse/expand feature (didn't work properly) and instead it shows the latest result in a plasma tooltip on hover and the Applet on click (when it is docked in the panel). I comment your suggestions below: Quote:1. just display the favorite currencies. it is more neat i think. other currencies can be added from setting menu.
This is kind of how the new one will work, but only with one currency
Quote:2. the currencies are from 2 or more sources and the results just like that either. for example: (snipped)
It is my plan to have the most used currencies placed at the top of the drop down for easy access. This is about as far as I will go with this because I want to keep the Plasmoid as simple as possible.
Quote:4. the source is from multiple sources, such like IMF, oanda, and others.
This is definitely on my ToDo list allthough I hadn't written it down yet. Thanks :-)
Quote:5. can download a simple history graph just like yahoo finance but more plasmoid manner.
I'll have to think about this. I'm afraid it will be too complex especially when dealing with several web services. I could maybe provide a link to an online graph for the current currency pair.
Thanks for the comment and the good suggestions.
I like it! One feature however is necessary for usage with wireless: It should refresh when the link comes up (either automatically by notification or by polling, or on-click or something) Now it blocks with "no network connection" as soon as I log in, before my wireless has come on line, and I have to remove the plasmoid and re-install it to be able to use it.
Thanks for the comment. You are right about the refreshment on active link. I'd like to use Solid but not all of the signals are available in PyKDE (well, I haven't tested it on 4.4 yet). I'll have a look at it sometime and see what I can do, and maybe I'll have to use polling though I'm not very pleased with that. /Thomas
thanks (and quick too ;) Maybe the easiest (stop-gap) measure would be to refresh on-click then?
Yes, it would be really nice to have a button refreshing it when connection goes up!
It would be nice if I could "lock" the display. For example, when locked it would only display text of the last conversion (IE: "1 US Dollar = 46.8 Philippine Pesos"), but when unlocked the controls show and I can edit the amounts and change the currency types.
I'll have a look at it. For now I have no idea how to do this. The kde-bindings (scripting) is kinda limited, but maybe it's possible. Please enter it as an issue at: http://code.google.com/p/currency-converter-plasmoid/issues/list