1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

OP309/OP179/GCS - Fixes maps cache location not being selectable, now defaults to "C:\Users\name_of_user\AppData\Roaming\OpenPilot\mapscache" on windows, no idea where this goes on nix.

Also tried to fix crashes seen on Mac, but I'll need a Mac or a stack trace to do a better job.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3106 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
zedamota 2011-03-30 15:57:53 +00:00 committed by zedamota
parent b125e51251
commit 282661734e
8 changed files with 621 additions and 610 deletions

View File

@ -1,196 +1,200 @@
/**
******************************************************************************
*
* @file cache.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "cache.h"
namespace core {
Cache* Cache::m_pInstance=0;
Cache* Cache::Instance()
{
if(!m_pInstance)
m_pInstance=new Cache;
return m_pInstance;
}
void Cache::setCacheLocation(const QString& value)
{
cache=value;
routeCache = cache + "RouteCache" + QDir::separator();
geoCache = cache + "GeocoderCache"+ QDir::separator();
placemarkCache = cache + "PlacemarkCache" + QDir::separator();
ImageCache.setGtileCache(value);
}
QString Cache::CacheLocation()
{
return cache;
}
Cache::Cache()
{
if(cache.isNull()|cache.isEmpty())
{
cache=QDir::currentPath()+QDir::separator()+"mapscache"+QDir::separator();
setCacheLocation(cache);
}
}
QString Cache::GetGeocoderFromCache(const QString &urlEnd)
{
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"Entered GetGeocoderFromCache";
#endif
QString ret=QString::null;
QString filename=geoCache+QString(urlEnd)+".geo";
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache: Does file exist?:"<<filename;
#endif
QFileInfo File(filename);
if (File .exists())
{
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache:File exists!!";
#endif
QFile file(filename);
if (file.open(QIODevice::ReadOnly))
{
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream>>ret;
}
}
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache:Returning:"<<ret;
#endif
return ret;
}
void Cache::CacheGeocoder(const QString &urlEnd, const QString &content)
{
QString ret=QString::null;
QString filename=geoCache+QString(urlEnd)+".geo";
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Filename:"<<filename;
#endif //DEBUG_CACHE
QFileInfo File(filename);;
QDir dir=File.absoluteDir();
QString path=dir.absolutePath();
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Path:"<<path;
#endif //DEBUG_CACHE
if(!dir.exists())
{
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Cache path doesn't exist, try to create";
#endif //DEBUG_CACHE
if(!dir.mkpath(path))
{
#ifdef DEBUG_CACHE
qDebug()<<"GetGeocoderFromCache: Could not create path";
#endif //DEBUG_CACHE
}
}
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: OpenFile:"<<filename;
#endif //DEBUG_CACHE
QFile file(filename);
if (file.open(QIODevice::WriteOnly))
{
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: File Opened!!!:"<<filename;
#endif //DEBUG_CACHE
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream<<content;
}
}
QString Cache::GetPlacemarkFromCache(const QString &urlEnd)
{
#ifdef DEBUG_CACHE
qDebug()<<"Entered GetPlacemarkFromCache";
#endif //DEBUG_CACHE
QString ret=QString::null;
QString filename=placemarkCache+QString(urlEnd)+".plc";
#ifdef DEBUG_CACHE
qDebug()<<"GetPlacemarkFromCache: Does file exist?:"<<filename;
#endif //DEBUG_CACHE
QFileInfo File(filename);
if (File .exists())
{
#ifdef DEBUG_CACHE
qDebug()<<"GetPlacemarkFromCache:File exists!!";
#endif //DEBUG_CACHE
QFile file(filename);
if (file.open(QIODevice::ReadOnly))
{
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream>>ret;
}
}
#ifdef DEBUG_CACHE
qDebug()<<"GetPlacemarkFromCache:Returning:"<<ret;
#endif //DEBUG_CACHE
return ret;
}
void Cache::CachePlacemark(const QString &urlEnd, const QString &content)
{
QString ret=QString::null;
QString filename=placemarkCache+QString(urlEnd)+".plc";
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: Filename:"<<filename;
#endif //DEBUG_CACHE
QFileInfo File(filename);;
QDir dir=File.absoluteDir();
QString path=dir.absolutePath();
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: Path:"<<path;
#endif //DEBUG_CACHE
if(!dir.exists())
{
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: Cache path doesn't exist, try to create";
#endif //DEBUG_CACHE
if(!dir.mkpath(path))
{
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: Could not create path";
#endif //DEBUG_CACHE
}
}
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: OpenFile:"<<filename;
#endif //DEBUG_CACHE
QFile file(filename);
if (file.open(QIODevice::WriteOnly))
{
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: File Opened!!!:"<<filename;
#endif //DEBUG_CACHE
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream<<content;
}
}
}
/**
******************************************************************************
*
* @file cache.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "cache.h"
#include <QSettings>
namespace core {
Cache* Cache::m_pInstance=0;
Cache* Cache::Instance()
{
if(!m_pInstance)
m_pInstance=new Cache;
return m_pInstance;
}
void Cache::setCacheLocation(const QString& value)
{
cache=value;
routeCache = cache + "RouteCache" + QDir::separator();
geoCache = cache + "GeocoderCache"+ QDir::separator();
placemarkCache = cache + "PlacemarkCache" + QDir::separator();
ImageCache.setGtileCache(value);
}
QString Cache::CacheLocation()
{
return cache;
}
Cache::Cache()
{
if(cache.isNull()|cache.isEmpty())
{
QSettings set(QSettings::IniFormat, QSettings::UserScope,QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS"));
QDir dir(set.fileName());
QFileInfo f(dir.absolutePath());
f.dir().absolutePath();
cache=f.dir().absolutePath()+QDir::separator()+"mapscache"+QDir::separator();
setCacheLocation(cache);
}
}
QString Cache::GetGeocoderFromCache(const QString &urlEnd)
{
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"Entered GetGeocoderFromCache";
#endif
QString ret=QString::null;
QString filename=geoCache+QString(urlEnd)+".geo";
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache: Does file exist?:"<<filename;
#endif
QFileInfo File(filename);
if (File .exists())
{
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache:File exists!!";
#endif
QFile file(filename);
if (file.open(QIODevice::ReadOnly))
{
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream>>ret;
}
}
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache:Returning:"<<ret;
#endif
return ret;
}
void Cache::CacheGeocoder(const QString &urlEnd, const QString &content)
{
QString ret=QString::null;
QString filename=geoCache+QString(urlEnd)+".geo";
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Filename:"<<filename;
#endif //DEBUG_CACHE
QFileInfo File(filename);;
QDir dir=File.absoluteDir();
QString path=dir.absolutePath();
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Path:"<<path;
#endif //DEBUG_CACHE
if(!dir.exists())
{
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Cache path doesn't exist, try to create";
#endif //DEBUG_CACHE
if(!dir.mkpath(path))
{
#ifdef DEBUG_CACHE
qDebug()<<"GetGeocoderFromCache: Could not create path";
#endif //DEBUG_CACHE
}
}
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: OpenFile:"<<filename;
#endif //DEBUG_CACHE
QFile file(filename);
if (file.open(QIODevice::WriteOnly))
{
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: File Opened!!!:"<<filename;
#endif //DEBUG_CACHE
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream<<content;
}
}
QString Cache::GetPlacemarkFromCache(const QString &urlEnd)
{
#ifdef DEBUG_CACHE
qDebug()<<"Entered GetPlacemarkFromCache";
#endif //DEBUG_CACHE
QString ret=QString::null;
QString filename=placemarkCache+QString(urlEnd)+".plc";
#ifdef DEBUG_CACHE
qDebug()<<"GetPlacemarkFromCache: Does file exist?:"<<filename;
#endif //DEBUG_CACHE
QFileInfo File(filename);
if (File .exists())
{
#ifdef DEBUG_CACHE
qDebug()<<"GetPlacemarkFromCache:File exists!!";
#endif //DEBUG_CACHE
QFile file(filename);
if (file.open(QIODevice::ReadOnly))
{
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream>>ret;
}
}
#ifdef DEBUG_CACHE
qDebug()<<"GetPlacemarkFromCache:Returning:"<<ret;
#endif //DEBUG_CACHE
return ret;
}
void Cache::CachePlacemark(const QString &urlEnd, const QString &content)
{
QString ret=QString::null;
QString filename=placemarkCache+QString(urlEnd)+".plc";
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: Filename:"<<filename;
#endif //DEBUG_CACHE
QFileInfo File(filename);;
QDir dir=File.absoluteDir();
QString path=dir.absolutePath();
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: Path:"<<path;
#endif //DEBUG_CACHE
if(!dir.exists())
{
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: Cache path doesn't exist, try to create";
#endif //DEBUG_CACHE
if(!dir.mkpath(path))
{
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: Could not create path";
#endif //DEBUG_CACHE
}
}
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: OpenFile:"<<filename;
#endif //DEBUG_CACHE
QFile file(filename);
if (file.open(QIODevice::WriteOnly))
{
#ifdef DEBUG_CACHE
qDebug()<<"CachePlacemark: File Opened!!!:"<<filename;
#endif //DEBUG_CACHE
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream<<content;
}
}
}

View File

@ -26,36 +26,19 @@
*/
#include "pureimagecache.h"
#include <QDateTime>
#include <QSettings>
//#define DEBUG_PUREIMAGECACHE
namespace core {
qlonglong PureImageCache::ConnCounter=0;
PureImageCache::PureImageCache()
{
gtilecache=QDir::currentPath()+QDir::separator()+"mapscache"+QDir::separator();
QDir d;
if(!d.exists(gtilecache))
{
d.mkdir(gtilecache);
#ifdef DEBUG_PUREIMAGECACHE
qDebug()<<"Create Cache directory";
#endif //DEBUG_PUREIMAGECACHE
}
{
QString db=gtilecache+"Data.qmdb";
if(!QFileInfo(db).exists())
{
#ifdef DEBUG_PUREIMAGECACHE
qDebug()<<"Try to create EmptyDB";
#endif //DEBUG_PUREIMAGECACHE
CreateEmptyDB(db);
}
}
}
void PureImageCache::setGtileCache(const QString &value)
{
lock.lockForWrite();
gtilecache=value;
QDir d;
if(!d.exists(gtilecache))
@ -75,6 +58,7 @@ namespace core {
CreateEmptyDB(db);
}
}
lock.unlock();
}
QString PureImageCache::GtileCache()
{
@ -187,6 +171,9 @@ namespace core {
}
bool PureImageCache::PutImageToCache(const QByteArray &tile, const MapType::Types &type,const Point &pos,const int &zoom)
{
if(gtilecache.isEmpty()|gtilecache.isNull())
return false;
lock.lockForRead();
#ifdef DEBUG_PUREIMAGECACHE
qDebug()<<"PutImageToCache Start:";//<<pos;
#endif //DEBUG_PUREIMAGECACHE
@ -222,11 +209,15 @@ namespace core {
}
}
QSqlDatabase::removeDatabase(QString::number(id));
lock.unlock();
return true;
}
QByteArray PureImageCache::GetImageFromCache(MapType::Types type, Point pos, int zoom)
{
lock.lockForRead();
QByteArray ar;
if(gtilecache.isEmpty()|gtilecache.isNull())
return ar;
QString dir=gtilecache;
Mcounter.lock();
qlonglong id=++ConnCounter;
@ -260,10 +251,13 @@ namespace core {
}
}
QSqlDatabase::removeDatabase(QString::number(id));
lock.unlock();
return ar;
}
void PureImageCache::deleteOlderTiles(int const& days)
{
if(gtilecache.isEmpty()|gtilecache.isNull())
return;
QList<long> add;
bool ret=true;
QString dir=gtilecache;

View File

@ -41,7 +41,7 @@
#include "pureimage.h"
#include <QList>
#include <QMutex>
#include <QReadWriteLock>
namespace core {
class PureImageCache
{
@ -58,6 +58,7 @@ namespace core {
private:
QString gtilecache;
QMutex Mcounter;
QReadWriteLock lock;
static qlonglong ConnCounter;
};

View File

@ -80,7 +80,6 @@ namespace core {
void UrlFactory::setIsCorrectGoogleVersions(bool value)
{
isCorrectedGoogleVersions=value;
}
bool UrlFactory::IsCorrectGoogleVersions()
@ -90,6 +89,7 @@ namespace core {
void UrlFactory::TryCorrectGoogleVersions()
{
QMutexLocker locker(&mutex);
if(CorrectGoogleVersions && !IsCorrectGoogleVersions())
{
QNetworkReply *reply;

View File

@ -1,87 +1,88 @@
/**
******************************************************************************
*
* @file urlfactory.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef URLFACTORY_H
#define URLFACTORY_H
#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QNetworkAccessManager>
#include <QUrl>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include <QTimer>
#include <QCoreApplication>
#include "providerstrings.h"
#include "pureimagecache.h"
#include "../internals/pointlatlng.h"
#include "geodecoderstatus.h"
#include <QTime>
#include "cache.h"
#include "placemark.h"
#include <QTextCodec>
#include "cmath"
namespace core {
class UrlFactory: public QObject,public ProviderStrings
{
Q_OBJECT
public:
/// <summary>
/// Gets or sets the value of the User-agent HTTP header.
/// </summary>
QByteArray UserAgent;
QNetworkProxy Proxy;
UrlFactory();
~UrlFactory();
QString MakeImageUrl(const MapType::Types &type,const core::Point &pos,const int &zoom,const QString &language);
internals::PointLatLng GetLatLngFromGeodecoder(const QString &keywords,GeoCoderStatusCode::Types &status);
Placemark GetPlacemarkFromGeocoder(internals::PointLatLng location);
int Timeout;
private:
void GetSecGoogleWords(const core::Point &pos, QString &sec1, QString &sec2);
int GetServerNum(const core::Point &pos,const int &max) const;
void TryCorrectGoogleVersions();
bool isCorrectedGoogleVersions;
QString TileXYToQuadKey(const int &tileX,const int &tileY,const int &levelOfDetail) const;
bool CorrectGoogleVersions;
bool UseGeocoderCache; //TODO GetSet
bool UsePlacemarkCache;//TODO GetSet
static const double EarthRadiusKm;
double GetDistance(internals::PointLatLng p1,internals::PointLatLng p2);
protected:
static short timelapse;
QString LanguageStr;
bool IsCorrectGoogleVersions();
void setIsCorrectGoogleVersions(bool value);
QString MakeGeocoderUrl(QString keywords);
QString MakeReverseGeocoderUrl(internals::PointLatLng &pt,const QString &language);
internals::PointLatLng GetLatLngFromGeocoderUrl(const QString &url,const bool &useCache, GeoCoderStatusCode::Types &status);
Placemark GetPlacemarkFromReverseGeocoderUrl(const QString &url,const bool &useCache);
};
}
#endif // URLFACTORY_H
/**
******************************************************************************
*
* @file urlfactory.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef URLFACTORY_H
#define URLFACTORY_H
#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QNetworkAccessManager>
#include <QUrl>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include <QTimer>
#include <QCoreApplication>
#include "providerstrings.h"
#include "pureimagecache.h"
#include "../internals/pointlatlng.h"
#include "geodecoderstatus.h"
#include <QTime>
#include "cache.h"
#include "placemark.h"
#include <QTextCodec>
#include "cmath"
namespace core {
class UrlFactory: public QObject,public ProviderStrings
{
Q_OBJECT
public:
/// <summary>
/// Gets or sets the value of the User-agent HTTP header.
/// </summary>
QByteArray UserAgent;
QNetworkProxy Proxy;
UrlFactory();
~UrlFactory();
QString MakeImageUrl(const MapType::Types &type,const core::Point &pos,const int &zoom,const QString &language);
internals::PointLatLng GetLatLngFromGeodecoder(const QString &keywords,GeoCoderStatusCode::Types &status);
Placemark GetPlacemarkFromGeocoder(internals::PointLatLng location);
int Timeout;
private:
void GetSecGoogleWords(const core::Point &pos, QString &sec1, QString &sec2);
int GetServerNum(const core::Point &pos,const int &max) const;
void TryCorrectGoogleVersions();
bool isCorrectedGoogleVersions;
QString TileXYToQuadKey(const int &tileX,const int &tileY,const int &levelOfDetail) const;
bool CorrectGoogleVersions;
bool UseGeocoderCache; //TODO GetSet
bool UsePlacemarkCache;//TODO GetSet
static const double EarthRadiusKm;
double GetDistance(internals::PointLatLng p1,internals::PointLatLng p2);
QMutex mutex;
protected:
static short timelapse;
QString LanguageStr;
bool IsCorrectGoogleVersions();
void setIsCorrectGoogleVersions(bool value);
QString MakeGeocoderUrl(QString keywords);
QString MakeReverseGeocoderUrl(internals::PointLatLng &pt,const QString &language);
internals::PointLatLng GetLatLngFromGeocoderUrl(const QString &url,const bool &useCache, GeoCoderStatusCode::Types &status);
Placemark GetPlacemarkFromReverseGeocoderUrl(const QString &url,const bool &useCache);
};
}
#endif // URLFACTORY_H

View File

@ -1,97 +1,105 @@
/**
******************************************************************************
*
* @file opmapgadgetconfiguration.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup OPMapPlugin OpenPilot Map Plugin
* @{
* @brief The OpenPilot Map plugin
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "opmapgadgetconfiguration.h"
#include "utils/pathutils.h"
#include <QDir>
OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, QSettings* qSettings, QObject *parent) :
IUAVGadgetConfiguration(classId, parent),
m_mapProvider("GoogleHybrid"),
m_defaultZoom(2),
m_defaultLatitude(0),
m_defaultLongitude(0),
m_useOpenGL(false),
m_showTileGridLines(false),
m_accessMode("ServerAndCache"),
m_useMemoryCache(true),
m_cacheLocation(Utils::PathUtils().GetStoragePath() + "mapscache" + QDir::separator())
{
//if a saved configuration exists load it
if(qSettings != 0) {
QString mapProvider = qSettings->value("mapProvider").toString();
int zoom = qSettings->value("defaultZoom").toInt();
double latitude= qSettings->value("defaultLatitude").toDouble();
double longitude= qSettings->value("defaultLongitude").toDouble();
bool useOpenGL= qSettings->value("useOpenGL").toBool();
bool showTileGridLines= qSettings->value("showTileGridLines").toBool();
QString accessMode= qSettings->value("accessMode").toString();
bool useMemoryCache= qSettings->value("useMemoryCache").toBool();
QString cacheLocation= qSettings->value("cacheLocation").toString();
if (!mapProvider.isEmpty()) m_mapProvider = mapProvider;
m_defaultZoom = zoom;
m_defaultLatitude = latitude;
m_defaultLongitude = longitude;
m_useOpenGL = useOpenGL;
m_showTileGridLines = showTileGridLines;
if (!accessMode.isEmpty()) m_accessMode = accessMode;
m_useMemoryCache = useMemoryCache;
if (!cacheLocation.isEmpty()) m_cacheLocation = Utils::PathUtils().InsertStoragePath(cacheLocation);
}
}
IUAVGadgetConfiguration * OPMapGadgetConfiguration::clone()
{
OPMapGadgetConfiguration *m = new OPMapGadgetConfiguration(this->classId());
m->m_mapProvider = m_mapProvider;
m->m_defaultZoom = m_defaultZoom;
m->m_defaultLatitude = m_defaultLatitude;
m->m_defaultLongitude = m_defaultLongitude;
m->m_useOpenGL = m_useOpenGL;
m->m_showTileGridLines = m_showTileGridLines;
m->m_accessMode = m_accessMode;
m->m_useMemoryCache = m_useMemoryCache;
m->m_cacheLocation = m_cacheLocation;
return m;
}
void OPMapGadgetConfiguration::saveConfig(QSettings* qSettings) const {
qSettings->setValue("mapProvider", m_mapProvider);
qSettings->setValue("defaultZoom", m_defaultZoom);
qSettings->setValue("defaultLatitude", m_defaultLatitude);
qSettings->setValue("defaultLongitude", m_defaultLongitude);
qSettings->setValue("useOpenGL", m_useOpenGL);
qSettings->setValue("showTileGridLines", m_showTileGridLines);
qSettings->setValue("accessMode", m_accessMode);
qSettings->setValue("useMemoryCache", m_useMemoryCache);
qSettings->setValue("cacheLocation", Utils::PathUtils().RemoveStoragePath(m_cacheLocation));
}
/**
******************************************************************************
*
* @file opmapgadgetconfiguration.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup OPMapPlugin OpenPilot Map Plugin
* @{
* @brief The OpenPilot Map plugin
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "opmapgadgetconfiguration.h"
#include "utils/pathutils.h"
#include <QDir>
OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, QSettings* qSettings, QObject *parent) :
IUAVGadgetConfiguration(classId, parent),
m_mapProvider("GoogleHybrid"),
m_defaultZoom(2),
m_defaultLatitude(0),
m_defaultLongitude(0),
m_useOpenGL(false),
m_showTileGridLines(false),
m_accessMode("ServerAndCache"),
m_useMemoryCache(true),
m_cacheLocation(Utils::PathUtils().GetStoragePath() + "mapscache" + QDir::separator())
{
QSettings set(QSettings::IniFormat, QSettings::UserScope,QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS"));
QDir dir(set.fileName());
QFileInfo f(dir.absolutePath());
f.dir().absolutePath();
m_cacheLocation=f.dir().absolutePath()+QDir::separator() + "mapscache" + QDir::separator();
//if a saved configuration exists load it
if(qSettings != 0) {
QString mapProvider = qSettings->value("mapProvider").toString();
int zoom = qSettings->value("defaultZoom").toInt();
double latitude= qSettings->value("defaultLatitude").toDouble();
double longitude= qSettings->value("defaultLongitude").toDouble();
bool useOpenGL= qSettings->value("useOpenGL").toBool();
bool showTileGridLines= qSettings->value("showTileGridLines").toBool();
QString accessMode= qSettings->value("accessMode").toString();
bool useMemoryCache= qSettings->value("useMemoryCache").toBool();
QString cacheLocation= qSettings->value("cacheLocation").toString();
if (!mapProvider.isEmpty()) m_mapProvider = mapProvider;
m_defaultZoom = zoom;
m_defaultLatitude = latitude;
m_defaultLongitude = longitude;
m_useOpenGL = useOpenGL;
m_showTileGridLines = showTileGridLines;
if (!accessMode.isEmpty()) m_accessMode = accessMode;
m_useMemoryCache = useMemoryCache;
if (!cacheLocation.isEmpty()) m_cacheLocation = Utils::PathUtils().InsertStoragePath(cacheLocation);
}
}
IUAVGadgetConfiguration * OPMapGadgetConfiguration::clone()
{
OPMapGadgetConfiguration *m = new OPMapGadgetConfiguration(this->classId());
m->m_mapProvider = m_mapProvider;
m->m_defaultZoom = m_defaultZoom;
m->m_defaultLatitude = m_defaultLatitude;
m->m_defaultLongitude = m_defaultLongitude;
m->m_useOpenGL = m_useOpenGL;
m->m_showTileGridLines = m_showTileGridLines;
m->m_accessMode = m_accessMode;
m->m_useMemoryCache = m_useMemoryCache;
m->m_cacheLocation = m_cacheLocation;
return m;
}
void OPMapGadgetConfiguration::saveConfig(QSettings* qSettings) const {
qSettings->setValue("mapProvider", m_mapProvider);
qSettings->setValue("defaultZoom", m_defaultZoom);
qSettings->setValue("defaultLatitude", m_defaultLatitude);
qSettings->setValue("defaultLongitude", m_defaultLongitude);
qSettings->setValue("useOpenGL", m_useOpenGL);
qSettings->setValue("showTileGridLines", m_showTileGridLines);
qSettings->setValue("accessMode", m_accessMode);
qSettings->setValue("useMemoryCache", m_useMemoryCache);
qSettings->setValue("cacheLocation", Utils::PathUtils().RemoveStoragePath(m_cacheLocation));
}
void OPMapGadgetConfiguration::setCacheLocation(QString cacheLocation){
m_cacheLocation = cacheLocation;
}

View File

@ -1,90 +1,90 @@
/**
******************************************************************************
*
* @file opmapgadgetconfiguration.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup OPMapPlugin OpenPilot Map Plugin
* @{
* @brief The OpenPilot Map plugin
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef OPMAP_GADGETCONFIGURATION_H
#define OPMAP_GADGETCONFIGURATION_H
#include <coreplugin/iuavgadgetconfiguration.h>
#include <QtCore/QString>
using namespace Core;
class OPMapGadgetConfiguration : public IUAVGadgetConfiguration
{
Q_OBJECT
Q_PROPERTY(QString mapProvider READ mapProvider WRITE setMapProvider)
Q_PROPERTY(int zoommo READ zoom WRITE setZoom)
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL)
Q_PROPERTY(bool showTileGridLines READ showTileGridLines WRITE setShowTileGridLines)
Q_PROPERTY(QString accessMode READ accessMode WRITE setAccessMode)
Q_PROPERTY(bool useMemoryCache READ useMemoryCache WRITE setUseMemoryCache)
Q_PROPERTY(QString cacheLocation READ cacheLocation WRITE setCacheLocation)
public:
explicit OPMapGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0);
void saveConfig(QSettings* settings) const;
IUAVGadgetConfiguration *clone();
QString mapProvider() const { return m_mapProvider; }
int zoom() const { return m_defaultZoom; }
double latitude() const { return m_defaultLatitude; }
double longitude() const { return m_defaultLongitude; }
bool useOpenGL() const { return m_useOpenGL; }
bool showTileGridLines() const { return m_showTileGridLines; }
QString accessMode() const { return m_accessMode; }
bool useMemoryCache() const { return m_useMemoryCache; }
QString cacheLocation() const { return m_cacheLocation; }
public slots:
void setMapProvider(QString provider) { m_mapProvider = provider; }
void setZoom(int zoom) { m_defaultZoom = zoom; }
void setLatitude(double latitude) { m_defaultLatitude = latitude; }
void setLongitude(double longitude) { m_defaultLongitude = longitude; }
void setUseOpenGL(bool useOpenGL) { m_useOpenGL = useOpenGL; }
void setShowTileGridLines(bool showTileGridLines) { m_showTileGridLines = showTileGridLines; }
void setAccessMode(QString accessMode) { m_accessMode = accessMode; }
void setUseMemoryCache(bool useMemoryCache) { m_useMemoryCache = useMemoryCache; }
void setCacheLocation(QString cacheLocation) { m_cacheLocation = cacheLocation; }
private:
QString m_mapProvider;
int m_defaultZoom;
double m_defaultLatitude;
double m_defaultLongitude;
bool m_useOpenGL;
bool m_showTileGridLines;
QString m_accessMode;
bool m_useMemoryCache;
QString m_cacheLocation;
};
#endif // OPMAP_GADGETCONFIGURATION_H
/**
******************************************************************************
*
* @file opmapgadgetconfiguration.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup OPMapPlugin OpenPilot Map Plugin
* @{
* @brief The OpenPilot Map plugin
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef OPMAP_GADGETCONFIGURATION_H
#define OPMAP_GADGETCONFIGURATION_H
#include <coreplugin/iuavgadgetconfiguration.h>
#include <QtCore/QString>
using namespace Core;
class OPMapGadgetConfiguration : public IUAVGadgetConfiguration
{
Q_OBJECT
Q_PROPERTY(QString mapProvider READ mapProvider WRITE setMapProvider)
Q_PROPERTY(int zoommo READ zoom WRITE setZoom)
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL)
Q_PROPERTY(bool showTileGridLines READ showTileGridLines WRITE setShowTileGridLines)
Q_PROPERTY(QString accessMode READ accessMode WRITE setAccessMode)
Q_PROPERTY(bool useMemoryCache READ useMemoryCache WRITE setUseMemoryCache)
Q_PROPERTY(QString cacheLocation READ cacheLocation WRITE setCacheLocation)
public:
explicit OPMapGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0);
void saveConfig(QSettings* settings) const;
IUAVGadgetConfiguration *clone();
QString mapProvider() const { return m_mapProvider; }
int zoom() const { return m_defaultZoom; }
double latitude() const { return m_defaultLatitude; }
double longitude() const { return m_defaultLongitude; }
bool useOpenGL() const { return m_useOpenGL; }
bool showTileGridLines() const { return m_showTileGridLines; }
QString accessMode() const { return m_accessMode; }
bool useMemoryCache() const { return m_useMemoryCache; }
QString cacheLocation() const { return m_cacheLocation; }
public slots:
void setMapProvider(QString provider) { m_mapProvider = provider; }
void setZoom(int zoom) { m_defaultZoom = zoom; }
void setLatitude(double latitude) { m_defaultLatitude = latitude; }
void setLongitude(double longitude) { m_defaultLongitude = longitude; }
void setUseOpenGL(bool useOpenGL) { m_useOpenGL = useOpenGL; }
void setShowTileGridLines(bool showTileGridLines) { m_showTileGridLines = showTileGridLines; }
void setAccessMode(QString accessMode) { m_accessMode = accessMode; }
void setUseMemoryCache(bool useMemoryCache) { m_useMemoryCache = useMemoryCache; }
void setCacheLocation(QString cacheLocation);
private:
QString m_mapProvider;
int m_defaultZoom;
double m_defaultLatitude;
double m_defaultLongitude;
bool m_useOpenGL;
bool m_showTileGridLines;
QString m_accessMode;
bool m_useMemoryCache;
QString m_cacheLocation;
};
#endif // OPMAP_GADGETCONFIGURATION_H

View File

@ -1,118 +1,121 @@
/**
******************************************************************************
*
* @file opmapgadgetoptionspage.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup OPMapPlugin OpenPilot Map Plugin
* @{
* @brief The OpenPilot Map plugin
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "opmapgadgetoptionspage.h"
#include "opmapgadgetconfiguration.h"
#include <QtGui/QLabel>
#include <QtGui/QComboBox>
#include <QtGui/QSpinBox>
#include <QtGui/QDoubleSpinBox>
#include <QtGui/QHBoxLayout>
#include <QtGui/QVBoxLayout>
#include <QtGui/QFileDialog>
#include "opmapcontrol/opmapcontrol.h"
#include "utils/pathutils.h"
#include "ui_opmapgadgetoptionspage.h"
// *********************************************
OPMapGadgetOptionsPage::OPMapGadgetOptionsPage(OPMapGadgetConfiguration *config, QObject *parent) :
IOptionsPage(parent),
m_config(config)
{
}
QWidget *OPMapGadgetOptionsPage::createPage(QWidget *parent)
{
m_page = new Ui::OPMapGadgetOptionsPage();
QWidget *w = new QWidget(parent);
m_page->setupUi(w);
// populate the map provider combobox
m_page->providerComboBox->clear();
m_page->providerComboBox->addItems(mapcontrol::Helper::MapTypes());
// populate the access mode combobox
m_page->accessModeComboBox->clear();
m_page->accessModeComboBox->addItems(mapcontrol::Helper::AccessModeTypes());
int index = m_page->providerComboBox->findText(m_config->mapProvider());
index = (index >= 0) ? index : 0;
m_page->providerComboBox->setCurrentIndex(index);
m_page->zoomSpinBox->setValue(m_config->zoom());
m_page->latitudeSpinBox->setValue(m_config->latitude());
m_page->longitudeSpinBox->setValue(m_config->longitude());
m_page->checkBoxUseOpenGL->setChecked(m_config->useOpenGL());
m_page->checkBoxShowTileGridLines->setChecked(m_config->showTileGridLines());
index = m_page->accessModeComboBox->findText(m_config->accessMode());
index = (index >= 0) ? index : 0;
m_page->accessModeComboBox->setCurrentIndex(index);
m_page->checkBoxUseMemoryCache->setChecked(m_config->useMemoryCache());
m_page->lineEditCacheLocation->setExpectedKind(Utils::PathChooser::Directory);
m_page->lineEditCacheLocation->setPromptDialogTitle(tr("Choose Cache Directory"));
m_page->lineEditCacheLocation->setPath(m_config->cacheLocation());
connect(m_page->pushButtonCacheDefaults, SIGNAL(clicked()), this, SLOT(on_pushButtonCacheDefaults_clicked()));
return w;
}
void OPMapGadgetOptionsPage::on_pushButtonCacheDefaults_clicked()
{
int index = m_page->accessModeComboBox->findText("ServerAndCache");
index = (index >= 0) ? index : 0;
m_page->accessModeComboBox->setCurrentIndex(index);
m_page->checkBoxUseMemoryCache->setChecked(true);
m_page->lineEditCacheLocation->setPath(Utils::PathUtils().GetStoragePath() + "mapscache" + QDir::separator());
}
void OPMapGadgetOptionsPage::apply()
{
m_config->setMapProvider(m_page->providerComboBox->currentText());
m_config->setZoom(m_page->zoomSpinBox->value());
m_config->setLatitude(m_page->latitudeSpinBox->value());
m_config->setLongitude(m_page->longitudeSpinBox->value());
m_config->setUseOpenGL(m_page->checkBoxUseOpenGL->isChecked());
m_config->setShowTileGridLines(m_page->checkBoxShowTileGridLines->isChecked());
m_config->setAccessMode(m_page->accessModeComboBox->currentText());
m_config->setUseMemoryCache(m_page->checkBoxUseMemoryCache->isChecked());
m_config->setCacheLocation(m_page->lineEditCacheLocation->path());
}
void OPMapGadgetOptionsPage::finish()
{
delete m_page;
}
/**
******************************************************************************
*
* @file opmapgadgetoptionspage.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup OPMapPlugin OpenPilot Map Plugin
* @{
* @brief The OpenPilot Map plugin
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "opmapgadgetoptionspage.h"
#include "opmapgadgetconfiguration.h"
#include <QtGui/QLabel>
#include <QtGui/QComboBox>
#include <QtGui/QSpinBox>
#include <QtGui/QDoubleSpinBox>
#include <QtGui/QHBoxLayout>
#include <QtGui/QVBoxLayout>
#include <QtGui/QFileDialog>
#include "opmapcontrol/opmapcontrol.h"
#include "utils/pathutils.h"
#include "ui_opmapgadgetoptionspage.h"
// *********************************************
OPMapGadgetOptionsPage::OPMapGadgetOptionsPage(OPMapGadgetConfiguration *config, QObject *parent) :
IOptionsPage(parent),
m_config(config)
{
}
QWidget *OPMapGadgetOptionsPage::createPage(QWidget *parent)
{
m_page = new Ui::OPMapGadgetOptionsPage();
QWidget *w = new QWidget(parent);
m_page->setupUi(w);
// populate the map provider combobox
m_page->providerComboBox->clear();
m_page->providerComboBox->addItems(mapcontrol::Helper::MapTypes());
// populate the access mode combobox
m_page->accessModeComboBox->clear();
m_page->accessModeComboBox->addItems(mapcontrol::Helper::AccessModeTypes());
int index = m_page->providerComboBox->findText(m_config->mapProvider());
index = (index >= 0) ? index : 0;
m_page->providerComboBox->setCurrentIndex(index);
m_page->zoomSpinBox->setValue(m_config->zoom());
m_page->latitudeSpinBox->setValue(m_config->latitude());
m_page->longitudeSpinBox->setValue(m_config->longitude());
m_page->checkBoxUseOpenGL->setChecked(m_config->useOpenGL());
m_page->checkBoxShowTileGridLines->setChecked(m_config->showTileGridLines());
index = m_page->accessModeComboBox->findText(m_config->accessMode());
index = (index >= 0) ? index : 0;
m_page->accessModeComboBox->setCurrentIndex(index);
m_page->checkBoxUseMemoryCache->setChecked(m_config->useMemoryCache());
m_page->lineEditCacheLocation->setExpectedKind(Utils::PathChooser::Directory);
m_page->lineEditCacheLocation->setPromptDialogTitle(tr("Choose Cache Directory"));
m_page->lineEditCacheLocation->setPath(m_config->cacheLocation());
connect(m_page->pushButtonCacheDefaults, SIGNAL(clicked()), this, SLOT(on_pushButtonCacheDefaults_clicked()));
return w;
}
void OPMapGadgetOptionsPage::on_pushButtonCacheDefaults_clicked()
{
int index = m_page->accessModeComboBox->findText("ServerAndCache");
index = (index >= 0) ? index : 0;
m_page->accessModeComboBox->setCurrentIndex(index);
m_page->checkBoxUseMemoryCache->setChecked(true);
QSettings set(QSettings::IniFormat, QSettings::UserScope,QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS"));
QDir dir(set.fileName());
QFileInfo f(dir.absolutePath());
f.dir().absolutePath();
m_page->lineEditCacheLocation->setPath(f.dir().absolutePath()+QDir::separator() + "mapscache" + QDir::separator());
}
void OPMapGadgetOptionsPage::apply()
{
m_config->setMapProvider(m_page->providerComboBox->currentText());
m_config->setZoom(m_page->zoomSpinBox->value());
m_config->setLatitude(m_page->latitudeSpinBox->value());
m_config->setLongitude(m_page->longitudeSpinBox->value());
m_config->setUseOpenGL(m_page->checkBoxUseOpenGL->isChecked());
m_config->setShowTileGridLines(m_page->checkBoxShowTileGridLines->isChecked());
m_config->setAccessMode(m_page->accessModeComboBox->currentText());
m_config->setUseMemoryCache(m_page->checkBoxUseMemoryCache->isChecked());
m_config->setCacheLocation(m_page->lineEditCacheLocation->path());
}
void OPMapGadgetOptionsPage::finish()
{
delete m_page;
}