Exemplo n.º 1
0
void GPSTrackListWidget::khtmlMouseReleaseEvent(khtml::MouseReleaseEvent *e)
{
    QString status = jsStatusBarText();

    // If a new point to the map have been moved around the map, the Status
    // string is like : "(mkr:1, lat:25.5894748, lon:47.6897455478, alt:211)"
    if (status.startsWith(QString("(mkr:")))
        extractGPSPositionfromStatusbar(status);

    // If a new map zoom level have been selected, the Status
    // string is like : "newZoomLevel:5"
    if (status.startsWith(QString("newZoomLevel:")))
    {
        status.remove(0, 13);
        d->zoomLevel = status;
    }

    // If a new map type have been selected, the Status
    // string is like : "newMapType:G_SATELLITE_MAP"
    if (status.startsWith(QString("newMapType:")))
    {
        status.remove(0, 11);
        d->mapType = status;
    }

    KHTMLPart::khtmlMouseReleaseEvent(e);
}
Exemplo n.º 2
0
void GPSTrackListWidget::khtmlMouseMoveEvent(khtml::MouseMoveEvent *e)
{
    QString status = jsStatusBarText();

    // If a new point to the map is dragged around the map, the status bar
    // string is like : "(mkr:1, lat:25.5894748, lon:47.6897455478)"
    if (status.startsWith(QString("(mkr:")))
        extractGPSPositionfromStatusbar(status);

    KHTMLPart::khtmlMouseMoveEvent(e);
}
Exemplo n.º 3
0
void HTMLWidget::slotScanForJSMessages()
{
    const QString status = jsStatusBarText();

    if (status!=QLatin1String("(event)" ))
        return;

    kDebug()<<status;
    const QString eventBufferString = runScript(QLatin1String("kmapReadEventStrings();")).toString();
    if (eventBufferString.isEmpty())
        return;

    const QStringList events = eventBufferString.split(QLatin1Char( '|' ));

    emit(signalHTMLEvents(events));
}