Are you experienced?

Well I’m not, but I’m having a lot of fun :-)

My first two Plasmoids are very simple but gave me a brief look into the possibilities of the Plasma Workspace, and I had to ask a lot of newbie questions on plasma-devel which is a very responsive mailing list. I cannot remember any of my questions that have gone unanswered and most of them with very good solutions and/or answers.

My latest endeavor is a bit more challenging. Plasma doesn’t have a simple ListView so you’ll have to use a Plasma.ScrollWidget and implement the methods yourself. For me that was somewhat annoying primarily because I’m still fighting a stale battle with the Qt layouts :-)

Now I have to figure out how I’m gonna the cache Last.fm feed and all the pics that I’m downloading. For 3 reasons, the most important is of course performance, followed by the fact that the tests I’ve run on my crappy HW results in X pixmaps getting corrupted [*], and lastly that it’s a part of the Last.fm ToS

For now I use job = KIO.get(KUrl(url), KIO.NoReload, KIO.HideProgressInfo) and connect to job‘s signals to get the the feed and to download the thumbnail pics of the events I use KIO.file_copy(from, to). This basically works but how can I get the HTTP Headers? I need to know if I should reuse the data I already have or if I should download it again.

Regarding the actual caching I was considering using a combination of:

KStandardDirs::addResourceDir()

KIconLoader::KIconLoader(const QString &appname = QString(), KStandardDirs *dirs = 0, QObject *parent = 0)

KIcon (const QString &iconName, KIconLoader *iconLoader)

But I’m uncertain how to use them.

Comments are very welcome as I’m a bit stuck here.

[*] I have no idea what I’m talking about here, but I get black icons after running X number of tests :-/

And are no screen shots in this post as the work has mostly been "under the hood".

=-=-=-=-=
Powered by Blogilo

Posted in KDE, Plasma, Python. Tags: , , . 2 Comments »

Google Translator 0.4.2 released

Finally I got to update my Google Translator Plasmoid to version 0.4.2.

Changes since I last updated this blog includes:

  • 0.4.2
    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 ;-)
    The Plasmoid is now installed under the "Language" section.
  • 0.4.1
    Improved KIO handling to be able to handle longer text while at the same time limit text to 1200 characters to avoid errors on too long queries.
  • 0.4
    Added a "Swap languages" button.
    TransferJobs are no longer shown in KDE Notifier.
  • 0.3.2
    Languages weren’t sorted after change to KLocale.
  • 0.3.1
    Quick fix for layout error when adding Plasmoid.
  • 0.3
    Use KLocale for getting languages. This cuts down on code lines and it will i18n the language names. Also I don’t have to keep up with the number of Google translations. It’s now a race between Google and KDE ;-)
    Act on no network connection.
    Added nice little Google attribution logo :-)

2 new Plasmoids

For the last 2-3 weeks I have been working on a couple of scripted Plasmoids for KDE4.x written in Python. First I started with the Currency Converter which uses data from Yahoo! Finance. When it was sorta working I figured out that I could create a Google Translator Plasmoid using almost the same code, so now I’m maintaining them concurrently. Well – ’nuff said. Here ther are:

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: