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).

6 Replies to “Marble Integration”

  1. The “small map”, as you call it, is a plugin. Just remove the plugin and it will go away.

  2. Really great. It’s nice and useful. I would keep the small map. If possible I would make it visible by hovering over a certain place in the map or would even try to make the whole map only visible if a certain place in the widget is touched. You could also consider to integrate the local time of the contact person. Might be very handy i.e. in business.

  3. As to the overviewmap: That’s a plugin.
    You can disable it e.g. like this (didn’t test the code, but you should be able to figure it out ;-):

    QList floatItemList = marbleWidget->floatItems();

    QList::const_iterator i;
    for (i = floatItemList.constBegin(); i != floatItemList.constEnd(); ++i)
    if ( (*i)->nameId() == “overviewmap” ) (*i)->setVisible( false )

    You might need to call “update()” ( or the much more expensive “updateChangedMap()” ) after that, but first try without it.

    if you prefer to have the zooming levels match the original zoom level for the tiles: that’s something we’d like to have added as a feature in MarbleWidget. Just join us on #kde-edu and discuss it with (“jmho”) who is responsible for the OSM support or discuss it with me (“tackat”).

  4. Oh and while I’m not sure how you mark the place of the person: You can use the GeoPainter API. Just get one by inheriting:

    virtual void MarbleWidget::customPaint( GeoPainter *painter );

    and then you can paint really fancy stuff using it’s methods. Look at the test plugin (marble/src/plugins/marble/test/MarbleTestPlugin.cpp):

    I’d suggest to use e.g.

    GeoDataPoint dennis(4.5, 51.1, 0.0, GeoDataPoint::Degree );

    painter->setPen( QColor( 99, 99, 0 ) );

    QRadialGradient radialGrad(QPointF(100, 100), 100);
    radialGrad.setColorAt(0, QColor( 198, 198, 198, 200 ) );
    radialGrad.setColorAt(0.5, QColor( 199, 198, 99, 200 ) );
    radialGrad.setColorAt( 1, Qt::white );
    radialGrad.setSpread( QGradient::ReflectSpread );

    QBrush gradientBrush( radialGrad );
    painter->setBrush( gradientBrush );

    painter->drawAnnotation ( dennis, “Dennis Nienhüser”, QSize(130, 50), 10, 30, 15, 15 );

    (Or just choose a better size for the annotation).

  5. Just some comments on the comments:

    Inge: Of course “removing the plugin” (as in removing the file) would make the plugin also disappear in the Marble application, so this is not a real choice. Better go with setting it invisible.

    OlJi: That’s indeed a good suggestion. However the size is definetely too big. So another option would be to make it smaller. That’s possible, too. Just choose the source code above to set the plugin invisible and replace

    if ( (*i)->nameId() == “overviewmap” ) (*i)->setVisible( false );


    if ( (*i)->nameId() == “overviewmap” ) (*i)->setSize( QSize( 60, 30 ) );

    As always the code I suggest has not been tested but you should be able to figure out how it really works.

Comments are closed.