mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Added an 'Access Mode' option to the new map plug-in options page.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@888 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
c74eb2f0e9
commit
9f0d8795c8
@ -25,18 +25,83 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
#include "opmap_waypointeditor_dialog.h"
|
#include "opmap_waypointeditor_dialog.h"
|
||||||
#include "ui_opmap_waypointeditor_dialog.h"
|
#include "ui_opmap_waypointeditor_dialog.h"
|
||||||
|
|
||||||
#include "extensionsystem/pluginmanager.h"
|
#include "extensionsystem/pluginmanager.h"
|
||||||
|
|
||||||
|
// ***************************************************************
|
||||||
|
|
||||||
|
Waypoint::Waypoint()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF Waypoint::boundingRect() const
|
||||||
|
{
|
||||||
|
return QRectF(-6, -10, 12, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
QPainterPath Waypoint::shape() const
|
||||||
|
{
|
||||||
|
QPainterPath path;
|
||||||
|
path.addEllipse(QPointF(0, 0), 6, 10);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Waypoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
||||||
|
{
|
||||||
|
painter->setPen(Qt::black);
|
||||||
|
painter->setBrush(QColor(255, 0, 0, 128));
|
||||||
|
painter->drawEllipse(QPointF(0, 0), 6, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ***************************************************************
|
||||||
|
|
||||||
opmap_waypointeditor_dialog::opmap_waypointeditor_dialog(QWidget *parent) :
|
opmap_waypointeditor_dialog::opmap_waypointeditor_dialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::opmap_waypointeditor_dialog)
|
ui(new Ui::opmap_waypointeditor_dialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
setWindowFlags(Qt::Dialog);
|
setWindowFlags(Qt::Dialog);
|
||||||
|
|
||||||
|
view = ui->graphicsViewWaypointHeightAndTimeline;
|
||||||
|
|
||||||
|
scene = new QGraphicsScene(0, 0, 1800, 1000);
|
||||||
|
view->setScene(scene);
|
||||||
|
|
||||||
|
view->setRenderHint(QPainter::HighQualityAntialiasing);
|
||||||
|
//view->setDragMode(QGraphicsView::ScrollHandDrag);
|
||||||
|
|
||||||
|
// *****
|
||||||
|
// test
|
||||||
|
|
||||||
|
Waypoint *waypoint1 = new Waypoint;
|
||||||
|
waypoint1->setPos(scene->width() / 2, scene->height() / 2);
|
||||||
|
waypoint1->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
|
waypoint1->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
|
waypoint1->setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
|
||||||
|
waypoint1->setToolTip(tr("Waypoint 1"));
|
||||||
|
scene->addItem(waypoint1);
|
||||||
|
|
||||||
|
Waypoint *waypoint2 = new Waypoint;
|
||||||
|
waypoint2->setPos(scene->width() / 2 + 30, scene->height() / 2);
|
||||||
|
waypoint2->setFlag(QGraphicsItem::ItemIsMovable);
|
||||||
|
waypoint2->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
|
waypoint2->setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
|
||||||
|
waypoint2->setToolTip(tr("Waypoint 2"));
|
||||||
|
scene->addItem(waypoint2);
|
||||||
|
|
||||||
|
Waypoint *waypoint3 = new Waypoint;
|
||||||
|
waypoint3->setPos(scene->width() / 2 + 60, scene->height() / 2);
|
||||||
|
waypoint3->setFlag(QGraphicsItem::ItemIsMovable);
|
||||||
|
waypoint3->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
|
waypoint3->setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
|
||||||
|
waypoint3->setToolTip(tr("Waypoint 3"));
|
||||||
|
scene->addItem(waypoint3);
|
||||||
|
|
||||||
|
// *****
|
||||||
}
|
}
|
||||||
|
|
||||||
opmap_waypointeditor_dialog::~opmap_waypointeditor_dialog()
|
opmap_waypointeditor_dialog::~opmap_waypointeditor_dialog()
|
||||||
|
@ -31,6 +31,10 @@
|
|||||||
#include <QtGui/QWidget>
|
#include <QtGui/QWidget>
|
||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QDialog>
|
#include <QtGui/QDialog>
|
||||||
|
#include <QGraphicsView>
|
||||||
|
#include <QGraphicsScene>
|
||||||
|
#include <QGraphicsItem>
|
||||||
|
|
||||||
#include "uavobjects/uavobjectmanager.h"
|
#include "uavobjects/uavobjectmanager.h"
|
||||||
#include "uavobjects/positionactual.h"
|
#include "uavobjects/positionactual.h"
|
||||||
|
|
||||||
@ -38,7 +42,38 @@ namespace Ui {
|
|||||||
class opmap_waypointeditor_dialog;
|
class opmap_waypointeditor_dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class opmap_waypointeditor_dialog : public QDialog {
|
// ***************************************************************
|
||||||
|
|
||||||
|
class Waypoint : public QObject, public QGraphicsItem
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
Waypoint();
|
||||||
|
|
||||||
|
double latitude_degress;
|
||||||
|
double longitude_degress;
|
||||||
|
double height_feet;
|
||||||
|
double relative_time_seconds;
|
||||||
|
|
||||||
|
QRectF boundingRect() const;
|
||||||
|
QPainterPath shape() const;
|
||||||
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// void timerEvent(QTimerEvent *event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// qreal angle;
|
||||||
|
// qreal speed;
|
||||||
|
// qreal mouseEyeDirection;
|
||||||
|
// QColor color;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ***************************************************************
|
||||||
|
|
||||||
|
class opmap_waypointeditor_dialog : public QDialog
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
opmap_waypointeditor_dialog(QWidget *parent = 0);
|
opmap_waypointeditor_dialog(QWidget *parent = 0);
|
||||||
@ -48,7 +83,12 @@ protected:
|
|||||||
void changeEvent(QEvent *e);
|
void changeEvent(QEvent *e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QGraphicsView *view;
|
||||||
|
QGraphicsScene *scene;
|
||||||
|
|
||||||
Ui::opmap_waypointeditor_dialog *ui;
|
Ui::opmap_waypointeditor_dialog *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ***************************************************************
|
||||||
|
|
||||||
#endif // OPMAP_WAYPOINTEDITOR_DIALOG_H
|
#endif // OPMAP_WAYPOINTEDITOR_DIALOG_H
|
||||||
|
@ -7,13 +7,19 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>399</width>
|
<width>399</width>
|
||||||
<height>359</height>
|
<height>345</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>300</width>
|
<width>300</width>
|
||||||
<height>260</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -41,12 +47,24 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBoxWaypoints">
|
<widget class="QGroupBox" name="groupBoxWaypoints">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>130</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Waypoints</string>
|
<string>Waypoints</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTableWidget" name="tableWidgetWaypoints">
|
<widget class="QTableWidget" name="tableWidgetWaypoints">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="dragEnabled">
|
<property name="dragEnabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -78,7 +96,12 @@
|
|||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Relative Time</string>
|
<string>Time</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Pause Time</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -45,6 +45,7 @@ void OPMapGadget::loadConfiguration(IUAVGadgetConfiguration *config)
|
|||||||
m_widget->setMapProvider(m->mapProvider());
|
m_widget->setMapProvider(m->mapProvider());
|
||||||
m_widget->setZoom(m->zoom());
|
m_widget->setZoom(m->zoom());
|
||||||
m_widget->setPosition(QPointF(m->longitude(), m->latitude()));
|
m_widget->setPosition(QPointF(m->longitude(), m->latitude()));
|
||||||
|
m_widget->setAccessMode(m->accessMode());
|
||||||
m_widget->setUseMemoryCache(m->useMemoryCache());
|
m_widget->setUseMemoryCache(m->useMemoryCache());
|
||||||
m_widget->setCacheLocation(m->cacheLocation());
|
m_widget->setCacheLocation(m->cacheLocation());
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, const QByteA
|
|||||||
m_defaultZoom(2),
|
m_defaultZoom(2),
|
||||||
m_defaultLatitude(0),
|
m_defaultLatitude(0),
|
||||||
m_defaultLongitude(0),
|
m_defaultLongitude(0),
|
||||||
|
m_accessMode("ServerAndCache"),
|
||||||
m_useMemoryCache(true),
|
m_useMemoryCache(true),
|
||||||
m_cacheLocation(QDir::currentPath() + QDir::separator() + "mapscache" + QDir::separator())
|
m_cacheLocation(QDir::currentPath() + QDir::separator() + "mapscache" + QDir::separator())
|
||||||
{
|
{
|
||||||
@ -46,6 +47,7 @@ OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, const QByteA
|
|||||||
double latitude;
|
double latitude;
|
||||||
double longitude;
|
double longitude;
|
||||||
QString mapProvider;
|
QString mapProvider;
|
||||||
|
QString accessMode;
|
||||||
bool useMemoryCache;
|
bool useMemoryCache;
|
||||||
QString cacheLocation;
|
QString cacheLocation;
|
||||||
|
|
||||||
@ -53,6 +55,7 @@ OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, const QByteA
|
|||||||
stream >> latitude;
|
stream >> latitude;
|
||||||
stream >> longitude;
|
stream >> longitude;
|
||||||
stream >> mapProvider;
|
stream >> mapProvider;
|
||||||
|
stream >> accessMode;
|
||||||
stream >> useMemoryCache;
|
stream >> useMemoryCache;
|
||||||
stream >> cacheLocation;
|
stream >> cacheLocation;
|
||||||
|
|
||||||
@ -60,6 +63,7 @@ OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, const QByteA
|
|||||||
m_defaultLatitude = latitude;
|
m_defaultLatitude = latitude;
|
||||||
m_defaultLongitude = longitude;
|
m_defaultLongitude = longitude;
|
||||||
if (!mapProvider.isEmpty()) m_mapProvider = mapProvider;
|
if (!mapProvider.isEmpty()) m_mapProvider = mapProvider;
|
||||||
|
if (!accessMode.isEmpty()) m_accessMode = accessMode;
|
||||||
m_useMemoryCache = useMemoryCache;
|
m_useMemoryCache = useMemoryCache;
|
||||||
if (!cacheLocation.isEmpty()) m_cacheLocation = cacheLocation;
|
if (!cacheLocation.isEmpty()) m_cacheLocation = cacheLocation;
|
||||||
}
|
}
|
||||||
@ -73,6 +77,7 @@ IUAVGadgetConfiguration * OPMapGadgetConfiguration::clone()
|
|||||||
m->m_defaultLatitude = m_defaultLatitude;
|
m->m_defaultLatitude = m_defaultLatitude;
|
||||||
m->m_defaultLongitude = m_defaultLongitude;
|
m->m_defaultLongitude = m_defaultLongitude;
|
||||||
m->m_mapProvider = m_mapProvider;
|
m->m_mapProvider = m_mapProvider;
|
||||||
|
m->m_accessMode = m_accessMode;
|
||||||
m->m_useMemoryCache = m_useMemoryCache;
|
m->m_useMemoryCache = m_useMemoryCache;
|
||||||
m->m_cacheLocation = m_cacheLocation;
|
m->m_cacheLocation = m_cacheLocation;
|
||||||
|
|
||||||
@ -88,6 +93,7 @@ QByteArray OPMapGadgetConfiguration::saveState() const
|
|||||||
stream << m_defaultLatitude;
|
stream << m_defaultLatitude;
|
||||||
stream << m_defaultLongitude;
|
stream << m_defaultLongitude;
|
||||||
stream << m_mapProvider;
|
stream << m_mapProvider;
|
||||||
|
stream << m_accessMode;
|
||||||
stream << m_useMemoryCache;
|
stream << m_useMemoryCache;
|
||||||
stream << m_cacheLocation;
|
stream << m_cacheLocation;
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ Q_PROPERTY(QString mapProvider READ mapProvider WRITE setMapProvider)
|
|||||||
Q_PROPERTY(int zoommo READ zoom WRITE setZoom)
|
Q_PROPERTY(int zoommo READ zoom WRITE setZoom)
|
||||||
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
|
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
|
||||||
Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
|
Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
|
||||||
|
Q_PROPERTY(QString accessMode READ accessMode WRITE setAccessMode)
|
||||||
Q_PROPERTY(bool useMemoryCache READ useMemoryCache WRITE setUseMemoryCache)
|
Q_PROPERTY(bool useMemoryCache READ useMemoryCache WRITE setUseMemoryCache)
|
||||||
Q_PROPERTY(QString cacheLocation READ cacheLocation WRITE setCacheLocation)
|
Q_PROPERTY(QString cacheLocation READ cacheLocation WRITE setCacheLocation)
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ public:
|
|||||||
int zoom() const { return m_defaultZoom; }
|
int zoom() const { return m_defaultZoom; }
|
||||||
double latitude() const { return m_defaultLatitude; }
|
double latitude() const { return m_defaultLatitude; }
|
||||||
double longitude() const { return m_defaultLongitude; }
|
double longitude() const { return m_defaultLongitude; }
|
||||||
|
QString accessMode() const { return m_accessMode; }
|
||||||
bool useMemoryCache() const { return m_useMemoryCache; }
|
bool useMemoryCache() const { return m_useMemoryCache; }
|
||||||
QString cacheLocation() const { return m_cacheLocation; }
|
QString cacheLocation() const { return m_cacheLocation; }
|
||||||
|
|
||||||
@ -61,6 +63,7 @@ public slots:
|
|||||||
void setZoom(int zoom) { m_defaultZoom = zoom; }
|
void setZoom(int zoom) { m_defaultZoom = zoom; }
|
||||||
void setLatitude(double latitude) { m_defaultLatitude = latitude; }
|
void setLatitude(double latitude) { m_defaultLatitude = latitude; }
|
||||||
void setLongitude(double longitude) { m_defaultLongitude = longitude; }
|
void setLongitude(double longitude) { m_defaultLongitude = longitude; }
|
||||||
|
void setAccessMode(QString accessMode) { m_accessMode = accessMode; }
|
||||||
void setUseMemoryCache(bool useMemoryCache) { m_useMemoryCache = useMemoryCache; }
|
void setUseMemoryCache(bool useMemoryCache) { m_useMemoryCache = useMemoryCache; }
|
||||||
void setCacheLocation(QString cacheLocation) { m_cacheLocation = cacheLocation; }
|
void setCacheLocation(QString cacheLocation) { m_cacheLocation = cacheLocation; }
|
||||||
|
|
||||||
@ -69,6 +72,7 @@ private:
|
|||||||
int m_defaultZoom;
|
int m_defaultZoom;
|
||||||
double m_defaultLatitude;
|
double m_defaultLatitude;
|
||||||
double m_defaultLongitude;
|
double m_defaultLongitude;
|
||||||
|
QString m_accessMode;
|
||||||
bool m_useMemoryCache;
|
bool m_useMemoryCache;
|
||||||
QString m_cacheLocation;
|
QString m_cacheLocation;
|
||||||
|
|
||||||
|
@ -57,12 +57,22 @@ QWidget *OPMapGadgetOptionsPage::createPage(QWidget *parent)
|
|||||||
m_page->providerComboBox->clear();
|
m_page->providerComboBox->clear();
|
||||||
m_page->providerComboBox->addItems(mapcontrol::Helper::MapTypes());
|
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());
|
int index = m_page->providerComboBox->findText(m_config->mapProvider());
|
||||||
index = (index >= 0) ? index : 0;
|
index = (index >= 0) ? index : 0;
|
||||||
m_page->providerComboBox->setCurrentIndex(index);
|
m_page->providerComboBox->setCurrentIndex(index);
|
||||||
|
|
||||||
m_page->zoomSpinBox->setValue(m_config->zoom());
|
m_page->zoomSpinBox->setValue(m_config->zoom());
|
||||||
m_page->latitudeSpinBox->setValue(m_config->latitude());
|
m_page->latitudeSpinBox->setValue(m_config->latitude());
|
||||||
m_page->longitudeSpinBox->setValue(m_config->longitude());
|
m_page->longitudeSpinBox->setValue(m_config->longitude());
|
||||||
|
|
||||||
|
index = m_page->accessModeComboBox->findText(m_config->accessMode());
|
||||||
|
index = (index >= 0) ? index : 0;
|
||||||
|
m_page->accessModeComboBox->setCurrentIndex(index);
|
||||||
|
|
||||||
m_page->pushButtonUseMemoryCache->setChecked(m_config->useMemoryCache());
|
m_page->pushButtonUseMemoryCache->setChecked(m_config->useMemoryCache());
|
||||||
m_page->lineEditCacheLocation->setText(m_config->cacheLocation());
|
m_page->lineEditCacheLocation->setText(m_config->cacheLocation());
|
||||||
|
|
||||||
@ -87,7 +97,12 @@ void OPMapGadgetOptionsPage::on_pushButtonCacheLocation_clicked()
|
|||||||
|
|
||||||
void OPMapGadgetOptionsPage::on_pushButtonCacheDefaults_clicked()
|
void OPMapGadgetOptionsPage::on_pushButtonCacheDefaults_clicked()
|
||||||
{
|
{
|
||||||
|
int index = m_page->accessModeComboBox->findText("ServerAndCache");
|
||||||
|
index = (index >= 0) ? index : 0;
|
||||||
|
m_page->accessModeComboBox->setCurrentIndex(index);
|
||||||
|
|
||||||
m_page->pushButtonUseMemoryCache->setChecked(true);
|
m_page->pushButtonUseMemoryCache->setChecked(true);
|
||||||
|
|
||||||
m_page->lineEditCacheLocation->setText(QDir::currentPath() + QDir::separator() + "mapscache" + QDir::separator());
|
m_page->lineEditCacheLocation->setText(QDir::currentPath() + QDir::separator() + "mapscache" + QDir::separator());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,6 +112,7 @@ void OPMapGadgetOptionsPage::apply()
|
|||||||
m_config->setZoom(m_page->zoomSpinBox->value());
|
m_config->setZoom(m_page->zoomSpinBox->value());
|
||||||
m_config->setLatitude(m_page->latitudeSpinBox->value());
|
m_config->setLatitude(m_page->latitudeSpinBox->value());
|
||||||
m_config->setLongitude(m_page->longitudeSpinBox->value());
|
m_config->setLongitude(m_page->longitudeSpinBox->value());
|
||||||
|
m_config->setAccessMode(m_page->accessModeComboBox->currentText());
|
||||||
m_config->setUseMemoryCache(m_page->pushButtonUseMemoryCache->isChecked());
|
m_config->setUseMemoryCache(m_page->pushButtonUseMemoryCache->isChecked());
|
||||||
m_config->setCacheLocation(m_page->lineEditCacheLocation->text());
|
m_config->setCacheLocation(m_page->lineEditCacheLocation->text());
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>521</width>
|
<width>521</width>
|
||||||
<height>315</height>
|
<height>373</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -21,49 +21,159 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
<number>0</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="4" column="0">
|
<item row="1" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item>
|
<item row="0" column="1">
|
||||||
<widget class="QPushButton" name="pushButtonCacheDefaults">
|
<widget class="QComboBox" name="providerComboBox">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="cursor">
|
<property name="cursor">
|
||||||
<cursorShape>OpenHandCursor</cursorShape>
|
<cursorShape>OpenHandCursor</cursorShape>
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string> Default </string>
|
<string>Map provider </string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="alignment">
|
||||||
<bool>false</bool>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="0">
|
||||||
<spacer name="horizontalSpacer">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="orientation">
|
<property name="text">
|
||||||
<enum>Qt::Horizontal</enum>
|
<string>Default latitude </string>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="alignment">
|
||||||
<size>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="latitudeSpinBox">
|
||||||
|
<property name="decimals">
|
||||||
|
<number>8</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-90.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>90.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default longitude </string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="3">
|
||||||
|
<widget class="QDoubleSpinBox" name="longitudeSpinBox">
|
||||||
|
<property name="decimals">
|
||||||
|
<number>8</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-180.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>180.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default zoom </string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<widget class="QSpinBox" name="zoomSpinBox">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>18</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QCheckBox" name="checkBoxShowGrid">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Grid</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QCheckBox" name="checkBoxUseOpenGL">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Use OpenGL</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>Server and Cache</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<item row="0" column="5">
|
||||||
|
<widget class="QComboBox" name="accessModeComboBox">
|
||||||
|
<property name="cursor">
|
||||||
|
<cursorShape>OpenHandCursor</cursorShape>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="4">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>Access Mode </string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
<widget class="QPushButton" name="pushButtonUseMemoryCache">
|
<widget class="QPushButton" name="pushButtonUseMemoryCache">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
@ -101,112 +211,62 @@ stop: 0 rgba(180, 190, 220, 255), stop: 1 rgba(200, 230, 255, 255));*/
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="0" column="0">
|
||||||
</item>
|
<widget class="QPushButton" name="pushButtonCacheDefaults">
|
||||||
<item row="2" column="0">
|
<property name="sizePolicy">
|
||||||
<widget class="Line" name="line">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<property name="orientation">
|
<horstretch>0</horstretch>
|
||||||
<enum>Qt::Horizontal</enum>
|
<verstretch>0</verstretch>
|
||||||
</property>
|
</sizepolicy>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="providerComboBox">
|
|
||||||
<property name="cursor">
|
<property name="cursor">
|
||||||
<cursorShape>OpenHandCursor</cursorShape>
|
<cursorShape>OpenHandCursor</cursorShape>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Map provider</string>
|
<string> Default </string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="checkable">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="0" column="3">
|
||||||
<widget class="QLabel" name="label_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Default zoom</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="sizeHint" stdset="0">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QSpinBox" name="zoomSpinBox">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="maximum">
|
<property name="orientation">
|
||||||
<number>18</number>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeType">
|
||||||
</item>
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Default latitude</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="sizeHint" stdset="0">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QDoubleSpinBox" name="latitudeSpinBox">
|
|
||||||
<property name="decimals">
|
|
||||||
<number>8</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-90.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>90.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>Default longitude</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QDoubleSpinBox" name="longitudeSpinBox">
|
|
||||||
<property name="decimals">
|
|
||||||
<number>8</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-180.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>180.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
|
@ -556,6 +556,12 @@ void OPMapGadgetWidget::setMapProvider(QString provider)
|
|||||||
m_map->SetMapType(mapcontrol::Helper::MapTypeFromString(provider));
|
m_map->SetMapType(mapcontrol::Helper::MapTypeFromString(provider));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OPMapGadgetWidget::setAccessMode(QString accessMode)
|
||||||
|
{
|
||||||
|
if (m_map)
|
||||||
|
m_map->configuration->SetAccessMode(mapcontrol::Helper::AccessModeFromString(accessMode));
|
||||||
|
}
|
||||||
|
|
||||||
void OPMapGadgetWidget::setUseMemoryCache(bool useMemoryCache)
|
void OPMapGadgetWidget::setUseMemoryCache(bool useMemoryCache)
|
||||||
{
|
{
|
||||||
if (m_map)
|
if (m_map)
|
||||||
|
@ -55,6 +55,7 @@ public:
|
|||||||
void setZoom(int value);
|
void setZoom(int value);
|
||||||
void setPosition(QPointF pos);
|
void setPosition(QPointF pos);
|
||||||
void setMapProvider(QString provider);
|
void setMapProvider(QString provider);
|
||||||
|
void setAccessMode(QString accessMode);
|
||||||
void setUseMemoryCache(bool useMemoryCache);
|
void setUseMemoryCache(bool useMemoryCache);
|
||||||
void setCacheLocation(QString cacheLocation);
|
void setCacheLocation(QString cacheLocation);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user