freesoftware, Kde, Planet

Some Fun with ktp-text-ui Plugins

KDE Telepathy 0.5 was released last month, introducing a brand new filtering plugin system for the text-ui. I didn’t have much time to work on KTp recently, due to my new job and to my new wife (no I don’t have an old one) but since in Randa people are slacking (evil grin), someone has to do some real work (laughing hard), so I’ve being playing a little with the text-ui and with the plugins.

Formatting Plugin

First of all, I fixed the formatting plugin. This allow you to format plain text, like Thunderbird Structured Text:

  • *this is bold*
  • _this is underlined_ (and not italics!)
  • /this is italics/
  • -this is strikethrough-

The plugin was disabled in 0.5 because it was broken (the regular expression detecting the tags to replace was not detecting correctly).
Beside fixing it, I modified it to avoid changing the text by removing the tags (i.e. ‘*’ or ‘/’). In this way, even though it might format some parts that user is probably not expecting to see formatted (for example some /*C comments*/), copy and paste will still work.
Moreover, I made it so that it will be very easy to add a configuration dialog to change its behaviour, so if you _really want this to be italics_, you will probably be able to configure it according to your needs in the future.

This plugin will be enabled by default in 0.6.

Syntax Highlighting Plugin

We often think about the final users, but sometimes we have to think about the developers 😉
So I wrote a syntax highlighting plugin using jquery-snippet

A few screenshots are better than thousand words, so…



Meanwhile David had another cool idea for the syntax highlighting plugin: include a kate part into the qtwebkit view (You can find some details about how he did that here). This is his result:

Both approaches work great, my approach is more integrated in the chat, but David’s approach is also quite interesting. We don’t know yet whether release just one of them or both… Opinions?

Anyway, in order not to try to highlight all the messages, at the moment code must be included in a block like [code lang='cpp']...[/code]. This can be a bit annoying. Moreover copying and pasting code in the chat-ui is boring. Something like pastebinit would be really useful. That’s why I started writing…

ktp-paste-contact

This a very simple tool but it is something I’m really proud of, and that shows the potential of Telepathy…
It is a simple command line tool that reads from stdin and sends everything as a single message to a telepathy contact.
it takes as parameters, the account to use, the contact to send it to, and an optional parameter --format <language>.
If this parameter is specified, then the message is automatically included in a [code lang='cpp']...[/code] block using the syntax specified.

A few ideas for using it…

  • git show | ktp-paste-contact --format diff --account <account> --contact <contact>
  • cat file.cpp | ktp-paste-contact --format cpp --account <account> --contact <contact>
  • echo "Hey dude, I'm so geek that I'm texting you from the command line" | ktp-paste-contact --account <account> --contact <contact>

You can find the code for the code-highlighting plugin in my clone repository for ktp-text-ui (kde:clones/ktp-text-ui/ddomenichelli/ktp-text-ui branch plugin-code) and for ktp-paste-contact on my brand new scratch repository (kde:scratch/ddomenichelli/ktp-paste-contact.git)

Enjoy it!


EDIT: I found a great way to convince your friend to block you! Perhaps it can be used against spammers 😛

while true; do echo "MUAHAHAHAHAHA" | ktp-paste-contact --account <account> --contact <contact>; sleep 5; done

freesoftware, GSoC, Kde, Planet

KDE Telepathy in GSoC 2012

We had several good proposals related to KDE Telepathy for Google Summer of Code 2012, but unfortunately we only got 2 slots! But hey, we got 2 slots! That’s great! 😀 Thanks to Google for organising and sponsoring it.

The first accepted project is “Message Filtering Plugin System” by Lasath Fernando (shocklateboy92), the author of the chat plasmoid that will be released in KDE Telepathy 0.4. He will be mentored by David Edmundson and

“will create a completely asynchronous modular and extensible system that enriches messages before they’re displayed to the user. These includes embedding images and videos from links, Translating messages, (re)-formatting them nicely, reading out loud etc.”

The second project is “Enhancement to peer-to-peer DBus for Telepathy DBus Tubes” by Puneet Goyal. Puneet worked on the Payment Detection use-case of project Alkimia in Season of KDE 2011. I will be his mentor for this interesting project which aim is to make it even easier to use D-Bus Tubes from any KDE application:

“When an application connects to a peer to peer dbus tube, it must know what exactly to look for. Even When it registers for another object, the other side of the tube must know about it. So the ideas is to create a class that could ease the object to register and unregister on the DBus Tubes, and to provide you with an interface similar to the one as a DBus Server.”

We had to reject several good projects, because of the limited amount of slots, but if you are motivated to work on a project in KDE Telepathy you still have one chance[1]: Season of KDE (SoK)! SoK is similar to Google Summer of Code: you won’t be paid, but you will get a mentor, a very cool t-shirt and certificate! If you want to apply, you can have a look at KDE Telepathy ideas that we selected for GSoC but did not get a slot (“Telepathy setup for KDE multiplayer games” and “Collaborative editor“), check out some more ideas here or propose your own idea.


[1]Actually you have as many chance as you want to contribute even if you don’t want to take part to SoK! We have several junior jobs if you are (or want to become) a developer, and a few non-programming tasks that don’t require programming skill if you just want to help us!

Kde, Kubuntu, PPA

KDevelop 4 rc1 + plugins – Kubuntu Karmic

Kdevelop 4 and kdevplatform rc1 .deb packages for Kubuntu Karmic 9.10 (with kde 4.4.2 from ppa:kubuntu-ppa/backports) are available on my kdevelop PPA.

Kdevelop rc1 about dialog
Kdevelop rc1 about dialog

You can add my kdevelop PPA running:

sudo add-apt-repository ppa:daniele.domenichelli/kdevelop
sudo apt-get update

Then to install kdevelop, just run

sudo apt-get install kdevelop

or if you installed beta9 packages from my PPA, just run

sudo apt-get update
sudo apt-get upgrade

As usual, on the same ppa you’ll find some kdevelop plugins:

Official release candidates:

kdevelop-plugin-php (rc1)
kdevelop-plugin-php-docs (rc1)

Official betas + patches from svn:

kdevelop-plugin-executebrowser (beta1+svn)
kdevelop-plugin-executescript (beta1+svn)
kdevelop-plugin-xdebug (beta1+svn)

From KDE Playgroud (warning: Source is taken from svn and it’s not supposed to be released yet, so it might not work or might break kdevelop install, so use them only if you know what you are doing…)

kdevelop-plugin-extragear-upload
kdevelop-plugin-playground-bazaar (not building at the moment)
kdevelop-plugin-playground-controlflowgraph
kdevelop-plugin-playground-coverage
kdevelop-plugin-playground-css
kdevelop-plugin-playground-gettersetter
kdevelop-plugin-playground-git
kdevelop-plugin-playground-mercurial
kdevelop-plugin-playground-qtdesigner
kdevelop-plugin-playground-valgrind
kdevplatformveritas

Please report me any bug in plugin packaging (missing dependencies, etc.) but report to the kdevelop developers bugs related to the plugin itself.

Kde, Kubuntu, PPA

KDevelop 4 beta9 + plugins – Kubuntu Karmic

Kdevelop 4 and kdevplatform beta9 .deb packages for Kubuntu Karmic 9.10 (with kde 4.4.1 from ppa:kubuntu-ppa/backports) are available on my kdevelop PPA.

Kdevelop beta9 about dialog
Kdevelop beta9 about dialog

You can add my kdevelop PPA running:

sudo add-apt-repository ppa:daniele.domenichelli/kdevelop
sudo apt-get update

Then to install kdevelop, just run

sudo apt-get install kdevelop

or if you installed beta8 packages from my PPA, just run

sudo apt-get update
sudo apt-get upgrade

On the same ppa you’ll find some kdevelop plugins:

Official betas:

kdevelop-plugin-php (beta3)
kdevelop-plugin-php-docs (beta3)

Official betas + patches from svn:

kdevelop-plugin-executebrowser (beta1+svn)
kdevelop-plugin-executescript (beta1+svn)
kdevelop-plugin-xdebug (beta1+svn)

From KDE Playgroud (warning: Source is taken from svn and it’s not supposed to be released yet, so it might not work or might break kdevelop install, so use them only if you know what you are doing…)

kdevelop-plugin-playground-bazaar
kdevelop-plugin-playground-controlflowgraph
kdevelop-plugin-playground-coverage
kdevelop-plugin-playground-css
kdevelop-plugin-playground-gettersetter
kdevelop-plugin-playground-git
kdevelop-plugin-playground-mercurial
kdevelop-plugin-playground-valgrind
kdevplatformveritas
--- Edit: added right now
kdevelop-plugin-playground-qtdesigner
kdevelop-plugin-extragear-upload

Please report me any bug in plugin packaging (missing dependencies, etc.) but report to the kdevelop developers bugs related to the plugin itself.