From 0f89c83865e11c136098e87c3e79ff50db83d3e9 Mon Sep 17 00:00:00 2001 From: Michael Carpenter Date: Tue, 18 Jun 2013 10:53:33 -0400 Subject: [PATCH] Some comment cleanup, and fix so when closing the main window, it also closes the item select window --- src/ui/uas/UASQuickView.cc | 71 +++++------------------------------- src/ui/uas/UASQuickView.h | 1 + src/ui/uas/UASQuickViewItemSelect.ui | 10 ++--- 3 files changed, 15 insertions(+), 67 deletions(-) diff --git a/src/ui/uas/UASQuickView.cc b/src/ui/uas/UASQuickView.cc index b6d0664..9bb5225 100644 --- a/src/ui/uas/UASQuickView.cc +++ b/src/ui/uas/UASQuickView.cc @@ -16,69 +16,8 @@ UASQuickView::UASQuickView(QWidget *parent) : QWidget(parent) } this->setContextMenuPolicy(Qt::ActionsContextMenu); - - /*{ - QAction *action = new QAction("latitude",this); - action->setCheckable(true); - action->setChecked(true); - connect(action,SIGNAL(toggled(bool)),this,SLOT(actionTriggered(bool))); - this->addAction(action); - UASQuickViewItem *item = new UASQuickViewItem(this); - item->setTitle("latitude"); - ui.verticalLayout->addWidget(item); - uasPropertyToLabelMap["latitude"] = item; - } - - { - QAction *action = new QAction("longitude",this); - action->setCheckable(true); - action->setChecked(true); - connect(action,SIGNAL(toggled(bool)),this,SLOT(actionTriggered(bool))); - this->addAction(action); - UASQuickViewItem *item = new UASQuickViewItem(this); - item->setTitle("longitude"); - ui.verticalLayout->addWidget(item); - uasPropertyToLabelMap["longitude"] = item; - } - - { - QAction *action = new QAction("altitude",this); - action->setCheckable(true); - action->setChecked(true); - connect(action,SIGNAL(toggled(bool)),this,SLOT(actionTriggered(bool))); - this->addAction(action); - UASQuickViewItem *item = new UASQuickViewItem(this); - item->setTitle("altitude"); - ui.verticalLayout->addWidget(item); - uasPropertyToLabelMap["altitude"] = item; - } - - { - QAction *action = new QAction("satelliteCount",this); - action->setCheckable(true); - action->setChecked(true); - connect(action,SIGNAL(toggled(bool)),this,SLOT(actionTriggered(bool))); - this->addAction(action); - UASQuickViewItem *item = new UASQuickViewItem(this); - item->setTitle("satelliteCount"); - ui.verticalLayout->addWidget(item); - uasPropertyToLabelMap["satelliteCount"] = item; - } - - { - QAction *action = new QAction("distToWaypoint",this); - action->setCheckable(true); - action->setChecked(true); - connect(action,SIGNAL(toggled(bool)),this,SLOT(actionTriggered(bool))); - this->addAction(action); - UASQuickViewItem *item = new UASQuickViewItem(this); - item->setTitle("distToWaypoint"); - ui.verticalLayout->addWidget(item); - uasPropertyToLabelMap["distToWaypoint"] = item; - }*/ - - //this->setSizePolicy(); loadSettings(); + //If we don't have any predefined settings, set some defaults. if (uasPropertyValueMap.size() == 0) { @@ -98,6 +37,14 @@ UASQuickView::UASQuickView(QWidget *parent) : QWidget(parent) connect(updateTimer,SIGNAL(timeout()),this,SLOT(updateTimerTick())); updateTimer->start(1000); } +UASQuickView::~UASQuickView() +{ + if (quickViewSelectDialog) + { + delete quickViewSelectDialog; + } +} + void UASQuickView::actionTriggered() { if (quickViewSelectDialog) diff --git a/src/ui/uas/UASQuickView.h b/src/ui/uas/UASQuickView.h index 7a709f2..4a0dc9b 100644 --- a/src/ui/uas/UASQuickView.h +++ b/src/ui/uas/UASQuickView.h @@ -15,6 +15,7 @@ class UASQuickView : public QWidget Q_OBJECT public: UASQuickView(QWidget *parent = 0); + ~UASQuickView(); void addSource(MAVLinkDecoder *decoder); private: UASInterface *uas; diff --git a/src/ui/uas/UASQuickViewItemSelect.ui b/src/ui/uas/UASQuickViewItemSelect.ui index 60cc410..5371e22 100644 --- a/src/ui/uas/UASQuickViewItemSelect.ui +++ b/src/ui/uas/UASQuickViewItemSelect.ui @@ -6,12 +6,12 @@ 0 0 - 851 - 192 + 947 + 248 - Form + Select Item @@ -24,8 +24,8 @@ 0 0 - 831 - 172 + 927 + 228