Route Printout Survey
Which features would you like to use when printing routes from Marble? Which information should be in the printout? What would mainly get in your way?
Routing with Marble
Being an avid biker, I often find myself assembling nice tours for upload on my N810. Usually that involves designing a round trip with Google Maps, downloading its .kml file, converting this to .gpx with the help of gpsbabel, copying the converted file to the N810 using scp and finally opening it in Maemo Mapper. Although working reliably, this process is tedious and cumbersome: The route is calculated on TeleAtlas data by Google and displayed on OpenStreetMap tiles in Maemo Mapper.
Ideally I want to use Marble instead; Prepare a route on my desktop PC, export it to my N900 (which replaces the by now broken N810) and have Marble on the N900 guide me on the tour. Admittedly it may be a long road to have that working smoothly, but the journey is the reward
Moving on in this direction, I committed some code earlier this evening that adds reverse geocoding support to Marble's new Online Routing feature (SVN trunk only). Those on the bleeding edge can now search for an arbitrary number of placemarks and calculate a route between them. Kudos to the openrouteservice.org team whose service we can use, the openstreetmap nominatim author for the great search and reverse geocode service and of course all the OSM mappers collecting the data.
Beware the fine print, though: Routing is limited to Europe currently and some obvious features in Marble are yet missing -- showing a route summary, print support, import/export of routes to kml/gpx. Last not least the code is young and not tested by too many people yet (please change that). I am happy to receive feedback and bug reports.
Other news say that KDE was accepted as an organization in Google's Summer of Code. By happy coincidence the KDE ideas pages lists a project Marble To Go with me as the mentor. If you think you are eligible for doing a Summer of Code project, maybe that one is for you. Give it a thought!
In the good tradition of finishing with some demo material, here is a short screencast to satisfy the "no pic, no care" crowd
Best watched fullscreen.
Routing in Marble using openrouteservice.org from Dennis Nienhüser on Vimeo.
If neither embedding the video nor the Vimeo page does work for you, use this page instead, please.
Short D-Bus tips
Dcop was a handy tool for instance to communicate with KDE applications from the shell. D-Bus allows for the same, and while searching for dbus equivalents for some old dcop commands I used I came up with some nice scripts that shall be backed up here now:
To get started, something simple: Lock the screen.
qdbus org.kde.krunner /ScreenSaver Lock
Use qdbusviewer to find more commands like that:

The SimulateUserActivity method highlighted in the screenshot above can be used for a nice wrapper script: Imagine you want to watch a movie or display a presentation and the application does not support disabling the screensaver itself. Use this little wrapper script to start the application:
#!/bin/bash
$* &
while jobs | grep -q Running
do
qdbus org.kde.krunner /ScreenSaver SimulateUserActivity
sleep 30
done
Save it as, let's say, /usr/local/bin/noscreensaver and use it to open mplayer, for example: noscreensaver mplayer (I am aware that mplayer has a -stop-xscreensaver parameter). As long as the application is running, every thirty seconds user input is simulated with a dbus call to prevent the screen saver from starting. Once the application is closed, the script itself closes as well and the screen saver is enabled again (if it was before).
The next script is a bit more complicated: Whenever a tinyurl gets copied to the clipboard, let's replace it with the link target. For instance, when copying http://tinyurl.com/5bz8v5 to the clipboard, I want it being replaced with http://planetkde.org instead. Here we go:
#/bin/bash
while true
do
if qdbus org.kde.klipper /klipper getClipboardContents | egrep -q '^(http://)?tinyurl.com/'
then
in="$(qdbus org.kde.klipper /klipper getClipboardContents)"
target="$(wget ${in} -O /dev/null 2>&1 | grep Location | sed 's/^Location: \([^ ]*\) .*$/\1/')"
qdbus org.kde.klipper /klipper setClipboardContents "${target}"
fi
sleep 1
done
The script however is not really suitable for every-day usage as it relies on polling for clipboard changes. If signals are available however, we can do fancy things like opening instant messages from a specific person directly:
#/bin/bash
dbus-monitor "type='signal',sender='org.kde.kopete',interface='org.kde.Kopete',path='/Kopete',member='contactChanged'" | awk '/string "/ {print $2; fflush() }' | sed -u 's/"//g' | while read contact
do
if [[ "$contact" == "${*}" ]]
then
if qdbus org.kde.kopete /Kopete contactProperties "$contact" | grep pending_messages: | grep -q '<p'
then
qdbus org.kde.kopete /Kopete openChat "$contact"
fi
fi
done
Save it as kopete-open-directly.bash, make it executable and call it like ./kopete-open-directly.bash <id-of-a-contact>
<id-of-a-contact> has to be a Kopete contact ID. To get a list of valid ones, run
qdbus org.kde.kopete /Kopete contacts | while read contact
do
qdbus org.kde.kopete /Kopete contactProperties "$contact" | grep display_name | sed "s/display_name:/${contact} <=> /"
done
If John has the Kopete ID MSNProtocol:me@someprovider.org:john@example.com for instance, executing kopete-open-directly.bash MSNProtocol:me@someprovider.org:john@example.com would open messages from John directly as long as the script is running.
Please notice that you might have to install some additional packages to get qdbusviewer, dbus-monitor, wget or other programs used in the scripts above. The D-Bus interfaces match todays SVN trunk, some of them might not be available in KDE 4.1 (the Kopete ones for example).
Marble Integration
Things are coming along nicely for the contacts plasmoid. While a short vacation slowed things down a bit, I worked on contact source abstraction in the last days which resulted in a kaddressbook integration. In the long run decibel/akonadi will take care of that as well, but for now you can choose among contacts from Kopete and the standard address book.
To work on something more visually pleasing, I gave marble a try this evening. The idea is to display all contacts with a known location (here provided by kaddressbook) in a common map. Thanks to the nice marble API, a first version is already done:

Next things to do are making the marble contacts widget configurable and look less ugly (better zooming level, rounded corners, maybe remove the small map if possible).
Five minute guide to setup Eclipse for KDE development
Someone asked how to setup Eclipse for KDE development in my last copy/paste bug rant. Here's how I did, in short.
- Setup a working KDE development system according to Techbase, with cmakekde and all the good stuff.
- Download Eclipse 3.4 Ganymede, preferably the C++ one from eclipse.org, but any set containing CDT will do.
- Create /home/kde-devel/cmakekdeeclipse similarly to cmakekde (see the end for the content), make it executable (chmod +x)
- In Eclipse, File => New => Other => SVN => Checkout Projects from SVN. Checkout the KDE module you want to have in Eclipse. Use the C++ wizard when creating the project, set it to a Makefile project. You'll adjust that later (or use the Advanced Settings button directly).
- After the checkout, open the projects properties and choose the C++ Builder tab. Change the builder from make to /home/kde-devel/cmakekdeeclipse ${workspace_loc:/playground_plasma} and choose an existing, empty directory for the build directory.
Change playground_plasma to the name of your project. - Press Ok. If all went well, you can just hit the "Build" button now and it will just work (tm).
- Realize it took more than five minutes
Things to enjoy: Error and warning parser that will annotate faulty lines, a great indexer and content assistant, spell checking (that's actually useful), gdb integration, doxygen assistant, Bugzilla integration (sadly not working with KDE Bugzilla), IRC integration (needs communication framework), Subversion support (needs subclipse/subversive), code formatting and a whole lot more.
Last not least some random tweaks:
- Set the environment option LC_ALL to C in the preferences if the error/warning parser shows warnings as errors
- Disable klippers setting "Prevent empty clipboard" if copy/paste in Eclipse behaves weird
- Activate doxygen support in Window => Preferences => C/C++ => Editor
- Disable automatic builds
- Activate the (gnu) elf parser for gdb integration in Project Settings => C/C++ Build => Settings => Binary Parsers
And finally the cmakekdeeclipse script I use to invoke building:
#!/bin/bash
set -esrcFolder="${1}"
test -d "${srcFolder}"
source ~/.bashrc
cmake $srcFolder -DCMAKE_INSTALL_PREFIX=$KDEDIR -DCMAKE_BUILD_TYPE=debugfull
nice make -j3 VERBOSE=1
make install
No pic, no care?
Fixing copy/paste in Eclipse
Eclipse has grown up for C++ development and is what I'm using most of the time, even for KDE. One thing that was driving me crazy in the last days however was copying things to the clipboard: Often it didn't work on the first key press, but a second one was needed. Countless times later I was annoyed enough to ask Google for it and found this workaround. Now someone please enlighten me who to blame, Eclipse or Klipper. I guess this won't be a problem with the upcoming KDevelop 4.0, looking forward to it
People running KDE SVN with plasma/playground can enjoy an early version of the contacts plasmoid, I checked in the code earlier.
Leaving the mockup phase
Found some time this weekend to continue working on the contacts plasmoid and some basic functionality is now there. Kudos to the plasma team for the great API. The data engine now supports querying kopete, but is designed to support other contact backends in the future. Rumors say there's going to be a nepomuk backend, and sooner or later a decibel backend should take care of the rest (including kopete).
Besides writing the kopete backend (and extending the kopete dbus api a bit for that), I focused on building the plasmoid itself in a generic way. Think of it as a table where each row represents a contact and each column some kind of information or a way to interact with a contact. Rows are each their own object (to ease a later integration of extenders), and cells (information or actions) are created by a factory. This makes integration of new content and customization of the look very easy. See this screenshot:

Both plasmoids shown are instances of the contacts plasmoid and just differ in the configuration settings, which allow you to alter the contacts "table" to your liking:

This works nice so far (it's already possible to send messages from the input line shown in the first screenshot) and I plan to work on eye-candy (e.g. animations for changes) and more custom cells (like a clock showing a contact's local time, plasma is all about clocks after all
) next.
More interesting things will likely happen around akademy, stay tuned
Disclaimer: The code is not yet available in KDE SVN.
On a totally unrelated sidenote, dynamic playlists in amarok 2 rock!
Today is Kopete Bugday!
It's sunday, it's bugday, it is your favorite instant messaging application waiting for you! Please visit the second Kopete Bugday page on techbase for an introduction and instructions on how to help out. If you're looking for a quick way to contribute, please skim over the sections where a particular hardware/protocol/plugin combination is needed to verify a bug and see if one of them comes close to your setup: Bugday 1, Bugday 2.
Contacts Plasmoid Mockup revisited
Asking for feedback for the first contacts plasmoid mockup was a good idea: Going through all comments (thanks!) and talking to George Goldberg brought up some nice ideas to shape it up further. George works on decibel integration in his SoC project, which will result in a great foundation for a contacts plasmoid independent of a certain application and its representation of contacts.
This means that I'll try to design it in a more generic fashion, which also addresses the concerns of many commenters. Other suggestions I tried to address in the new mockup:
- Contact selection with a hover list might be slow and clutter the interface. Let's move it to the configuration dialog.
- The line edit should look better and might not be used at all. With integration of other applications (e.g. mail) this doesn't make too much sense anymore. I still like it for IM, maybe it can be moved into a popup as suggested.
- Searching for contacts could be integrated into krunner. George Goldberg will work on that in his SoC project.
- There should be a configuration interface. Things I plan to have in there is the selection of static contacts (favourite contacts always displayed) and dynamic ones (e.g. contacts recently talked to / mailed).
The revisited desktop version looks like this now (powered by gimp again):

The line edit to start a chat is gone atm, although I kind of like the idea of /chat Bob Hi actions.
Disclaimer: This is only a mockup.
Contacts Plasmoid mockup
One of the things I want to do for KDE 4.2 is a "Contacts" plasmoid: A Kopete-centered plasmoid that displays your contacts status and allows for a quick chat initiation. So far I have two mockups which I'd like feedback on -- please comment!
Before pasting those two mockups now, let me outline my plans for it:
I want it to
- facilitate starting a chat / sending that one-line message quickly
- let me quickly see the status [changes] of interesting contacts
- be useful both on the desktop and in a panel, with the usual plasma eye-candy
I do not want it to
- integrate other communication mechanisms than IM/Kopete
- display messages. This is what Kopete / KNotify / the Notify plasmoid do.
Now for the mockups, I did one showing it in the panel:

Another one shows it on the desktop:

Feedback from users, artists, usability people is greatly appreciated
Disclaimer: This is only a mockup, no (not much) code written yet.

