From e73d90fbdedcb96adeecf7d48b9600844c4799c6 Mon Sep 17 00:00:00 2001 From: pip Date: Wed, 16 Jun 2010 13:12:28 +0000 Subject: [PATCH] Small bug fix. Main GCS Options still locks up :( git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@784 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../src/plugins/opmap/OPMapGadget.pluginspec | 3 ++- ground/src/plugins/opmap/opmap.qrc | 6 ++--- .../src/plugins/opmap/opmapgadgetfactory.cpp | 2 +- .../src/plugins/opmap/opmapgadgetwidget.cpp | 27 ++++++++++++------- ground/src/plugins/opmap/opmapgadgetwidget.h | 6 ++--- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/ground/src/plugins/opmap/OPMapGadget.pluginspec b/ground/src/plugins/opmap/OPMapGadget.pluginspec index 11863c31b..259641b14 100644 --- a/ground/src/plugins/opmap/OPMapGadget.pluginspec +++ b/ground/src/plugins/opmap/OPMapGadget.pluginspec @@ -1,8 +1,9 @@ + The OpenPilot Project (C) 2010 OpenPilot Project The GNU Public License (GPL) Version 3 - OPMap gadget! + OPMap Gadget! http://www.openpilot.org diff --git a/ground/src/plugins/opmap/opmap.qrc b/ground/src/plugins/opmap/opmap.qrc index 909914592..5a1287328 100644 --- a/ground/src/plugins/opmap/opmap.qrc +++ b/ground/src/plugins/opmap/opmap.qrc @@ -1,7 +1,7 @@ - - images/waypoint.png - images/uav.png + images/gcs.png + images/uav.png + images/waypoint.png diff --git a/ground/src/plugins/opmap/opmapgadgetfactory.cpp b/ground/src/plugins/opmap/opmapgadgetfactory.cpp index aaf11c9ef..3e30b8fca 100644 --- a/ground/src/plugins/opmap/opmapgadgetfactory.cpp +++ b/ground/src/plugins/opmap/opmapgadgetfactory.cpp @@ -43,7 +43,7 @@ OPMapGadgetFactory::~OPMapGadgetFactory() Core::IUAVGadget* OPMapGadgetFactory::createGadget(QWidget *parent) { OPMapGadgetWidget* gadgetWidget = new OPMapGadgetWidget(parent); - return new OPMapGadget(QString("MapGadget"), gadgetWidget, parent); + return new OPMapGadget(QString("OPMapGadget"), gadgetWidget, parent); } IUAVGadgetConfiguration *OPMapGadgetFactory::createConfiguration(const QByteArray &state) diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/src/plugins/opmap/opmapgadgetwidget.cpp index eb1a450ea..4570e34e6 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/src/plugins/opmap/opmapgadgetwidget.cpp @@ -45,17 +45,17 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); map = NULL; -// map = new mapcontrol::OPMapWidget(); -// map->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); -// map->setMinimumSize(64, 64); + // map = new mapcontrol::OPMapWidget(); + // map->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + // map->setMinimumSize(64, 64); PositionActual::DataFields data = m_positionActual->getData(); // get current position data -// QVBoxLayout *layout = new QVBoxLayout; -// layout->setSpacing(0); -// layout->setContentsMargins(0, 0, 0, 0); -// layout->addWidget(map); -// setLayout(layout); + // QVBoxLayout *layout = new QVBoxLayout; + // layout->setSpacing(0); + // layout->setContentsMargins(0, 0, 0, 0); + // layout->addWidget(map); + // setLayout(layout); // m_updateTimer = new QTimer(); // m_updateTimer->setInterval(250); @@ -76,19 +76,28 @@ OPMapGadgetWidget::~OPMapGadgetWidget() void OPMapGadgetWidget::setZoom(int value) { + if (map) + { // map->setZoom(value); // map->updateRequestNew(); + } } void OPMapGadgetWidget::setPosition(QPointF pos) { + if (map) + { // map->setView(pos); // map->updateRequestNew(); + } } void OPMapGadgetWidget::setMapProvider(QString provider) { + if (map) + { // map-> + } } // ************************************************************************************* @@ -107,7 +116,7 @@ void OPMapGadgetWidget::updatePosition() void OPMapGadgetWidget::resizeEvent(QResizeEvent *event) { -// map->resize(QSize(width(), height())); + if (map) map->resize(QSize(width(), height())); update(); QWidget::resizeEvent(event); } diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.h b/ground/src/plugins/opmap/opmapgadgetwidget.h index 70029b8b8..62d6b084c 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.h +++ b/ground/src/plugins/opmap/opmapgadgetwidget.h @@ -48,12 +48,12 @@ public: void setMapProvider(QString provider); public slots: -// void gcsButtonClick(); // added by cathy -// void uavButtonClick(bool checked); // added by cathy +// void gcsButtonClick(); +// void uavButtonClick(bool checked); protected: void resizeEvent(QResizeEvent *event); - void keyPressEvent(QKeyEvent* event); // added by cathy + void keyPressEvent(QKeyEvent* event); private slots: void updatePosition();