panel-dictionary

Plasma 4 Extensions

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

1
Become a Fan
7.3

Description:
Panel-dictionary is a dictionary plasmoid in the spirit of KDE 3's kdict panel applet. It gives you a text box in the panel in which you can type a word and get its definition in a dialog.

Panel-dictionary gives you a choice of backends, each with different capabilities.
Plasma dict dataengine
Command line dict client
Python-dictclient

Using the command line dict-client, it will use whatever you've set up in ~/.dictrc or /etc/dictd/dict.conf. Using the python-dictclient, you can specify a server to use.

This is my first plasmoid, written in Python; it probably needs a lot of work!

KNOWN ISSUES:
dict dataengine backend is just lacking. Not really much I can do about this.
background sizing issues when moved from the panel
Unicode only works with the dict client backend

If you want to contribute, you can check out the code at github:
https://github.com/alandmoore/panel-dictionary-plasmoid
Last changelog:

Version 0.3.2 2009-12-25
Added option to force definitions black-on-white.
Fixed Unicode support for dict-client backend (only) -- thanks kozakmamay
Version 0.3.1 2009-08-31
Fixed sizing issue when used in panel
Version 0.3 2009-08-27
Redesigned definition view with a tabbed interface
Matched words can be clicked to look them up
Removed useless blank context menu in combobox
Version 0.2 2009-08-25
Appearance configuration allows changing size of combobox and color of text
Improvements to output of dict commandline backend
dict command line backend allows server setting
added icons to config dialog

Version 0.1.1 - 2009-08-23
Fixed focus bug (thanks emdek!!!)

Version 0.1 - 2009-08-21

First release


Ratings & Comments

15 Comments

gravy

Unicode (UTF-8) output is broken http://img136.imageshack.us/img136/3834/90375194.png

admoore

What backend are you using?

gravy

dict client dict 1.11.1/rf on Linux 2.6.29-tuxonice-r3 dictd on localhost and dictd.xdsl.by give same result python-2.6

kozakmamay

Change line 183 of main.py from line = defs.pop(0); to line = unicode(defs.pop(0), "utf-8")

admoore

Thanks for the suggestion, I tried this but it doesn't seem to fix the problem. Did it work for you? The plasmoid still give me: UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 14: ordinal not in range(128) Not sure where or why this is happening.

admoore

wait, never mind; adding it to line 178 as well fixes unicode for the dict client backend. Unicode still crashes the python-dict backend, it looks like a shortcoming of the library itself.

downdiagonal

I've written a small python module that gets definitions using Google's "define: word" feature. You might find it useful. http://pastebin.com/f53f35361

admoore

Thanks for the info, I'll consider it.

Emdek

Quote:

combo box has a hard time acquiring and keeping focus when in the panel, especially when there is a maximized application on screen.
You could try mine method to give it (embedded line edit) focus, you can find it in Run Command applet. I'm not sure if it is easy to port it to Python, but you can at least try. ;-)

admoore

Thanks! I looked a lot at the RunCommand source, but I couldn't figure out exactly what what going on there. Did you just basically have to custom-build the combobox? I'll dig into it a little more and see if I can understand it.

Emdek

No (this if ror other reason), look at focusWidget() method. ;-)

admoore

Thanks. I checked it out, and read your post to plasma-devel, but I am not sure I get what's going on yet. Where does the scene() method come from (what class/library)? I couldn't find it in the API reference.

admoore

Ok, actually after some digging I managed to get your function ported to python, and (yay!) it works! ... sort of. It only gives focus to the widget if I click the area AROUND the combobox widget. If there was a signal that I could connect when the combobox is clicked, that would work. But according to all I can find, there isn't :-(. Short of subclassing QlineEdit and overriding its mousePressEvent, I'm not sure what else to do.

Emdek

There is no event filter available in bindings?

admoore

erm... maybe. I'll have to look into that. I'm pretty new to this API.

Pling
0 Affiliates
Details
license
version 0.3.2
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 1

More Plasma 4 Extensions from admoore:

TextLaunch
admoore
last update date: 14 years ago

Score 8.0

KliQTune
admoore
last update date: 14 years ago

Score 8.0

Other Plasma 4 Extensions:

Icon Tasks deb build
N00bun2
last update date: 13 years ago

Score 4.3

Prayer Times Plasmoid
riyad
last update date: 13 years ago

Score 5.2

KPrayertime4 Islamic Prayer Times
ahaq
last update date: 15 years ago

Score 4.4

Hostinfo
mgraesslin
last update date: 13 years ago

Score 4.7

Monitor QuadCore Russian
kuchumovn
last update date: 16 years ago

Score 5.0

blaKjaK
werevire
last update date: 15 years ago

Score 5.0