From d2317252a66732fb9752dd19d1bb05569ee8473d Mon Sep 17 00:00:00 2001 From: Bryant Date: Mon, 27 May 2013 20:04:20 -0700 Subject: [PATCH] Removed the UnconnectedUASInfoWidget class as it could be replaced with a simple QLabel with the same functionality. Also styled the NO UAS warning on the ReadOnly mission view so it looks good in both dark and light themes. --- files/styles/style-dark.css | 4 ++ files/styles/style-light.css | 4 ++ qgroundcontrol.pro | 3 -- src/ui/UnconnectedUASInfoWidget.cc | 14 ------- src/ui/UnconnectedUASInfoWidget.h | 22 ----------- src/ui/UnconnectedUASInfoWidget.ui | 59 ------------------------------ src/ui/WaypointList.cc | 11 +++++- src/ui/WaypointList.h | 3 -- 8 files changed, 17 insertions(+), 103 deletions(-) delete mode 100644 src/ui/UnconnectedUASInfoWidget.cc delete mode 100644 src/ui/UnconnectedUASInfoWidget.h delete mode 100644 src/ui/UnconnectedUASInfoWidget.ui diff --git a/files/styles/style-dark.css b/files/styles/style-dark.css index 5716d2734..82096cd6c 100644 --- a/files/styles/style-dark.css +++ b/files/styles/style-dark.css @@ -101,6 +101,10 @@ QLabel:disabled { color: #353535; } +QLabel#noUas { + font-size: 30pt; +} + QLabel#toolBarNameLabel { font: bold 16px; color: #3C7B9E; diff --git a/files/styles/style-light.css b/files/styles/style-light.css index 53499b001..83e3d68e6 100644 --- a/files/styles/style-light.css +++ b/files/styles/style-light.css @@ -101,6 +101,10 @@ QLabel:disabled { color: #AAA; } +QLabel#noUas { + font-size: 30pt; +} + QLabel#toolBarNameLabel { font: bold 16px; color: #3C7B9E; diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 04f691643..b3a4c0c3a 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -202,7 +202,6 @@ FORMS += src/ui/MainWindow.ui \ src/ui/QGCMAVLinkInspector.ui \ src/ui/WaypointViewOnlyView.ui \ src/ui/WaypointEditableView.ui \ - src/ui/UnconnectedUASInfoWidget.ui \ src/ui/mavlink/QGCMAVLinkMessageSender.ui \ src/ui/firmwareupdate/QGCFirmwareUpdateWidget.ui \ src/ui/QGCPluginHost.ui \ @@ -346,7 +345,6 @@ HEADERS += src/MG.h \ src/ui/WaypointViewOnlyView.h \ src/ui/WaypointViewOnlyView.h \ src/ui/WaypointEditableView.h \ - src/ui/UnconnectedUASInfoWidget.h \ src/ui/QGCRGBDView.h \ src/ui/mavlink/QGCMAVLinkMessageSender.h \ src/ui/firmwareupdate/QGCFirmwareUpdateWidget.h \ @@ -515,7 +513,6 @@ SOURCES += src/main.cc \ src/ui/MAVLinkDecoder.cc \ src/ui/WaypointViewOnlyView.cc \ src/ui/WaypointEditableView.cc \ - src/ui/UnconnectedUASInfoWidget.cc \ src/ui/QGCRGBDView.cc \ src/ui/mavlink/QGCMAVLinkMessageSender.cc \ src/ui/firmwareupdate/QGCFirmwareUpdateWidget.cc \ diff --git a/src/ui/UnconnectedUASInfoWidget.cc b/src/ui/UnconnectedUASInfoWidget.cc deleted file mode 100644 index 84b8e5ae1..000000000 --- a/src/ui/UnconnectedUASInfoWidget.cc +++ /dev/null @@ -1,14 +0,0 @@ -#include "UnconnectedUASInfoWidget.h" -#include "ui_UnconnectedUASInfoWidget.h" - -UnconnectedUASInfoWidget::UnconnectedUASInfoWidget(QWidget *parent) : - QGroupBox(parent), - ui(new Ui::UnconnectedUASInfoWidget) -{ - ui->setupUi(this); -} - -UnconnectedUASInfoWidget::~UnconnectedUASInfoWidget() -{ - delete ui; -} diff --git a/src/ui/UnconnectedUASInfoWidget.h b/src/ui/UnconnectedUASInfoWidget.h deleted file mode 100644 index ea349f857..000000000 --- a/src/ui/UnconnectedUASInfoWidget.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef UNCONNECTEDUASINFOWIDGET_H -#define UNCONNECTEDUASINFOWIDGET_H - -#include - -namespace Ui { - class UnconnectedUASInfoWidget; -} - -class UnconnectedUASInfoWidget : public QGroupBox -{ - Q_OBJECT - -public: - explicit UnconnectedUASInfoWidget(QWidget *parent = 0); - ~UnconnectedUASInfoWidget(); - -private: - Ui::UnconnectedUASInfoWidget *ui; -}; - -#endif // UNCONNECTEDUASINFOWIDGET_H diff --git a/src/ui/UnconnectedUASInfoWidget.ui b/src/ui/UnconnectedUASInfoWidget.ui deleted file mode 100644 index b87164620..000000000 --- a/src/ui/UnconnectedUASInfoWidget.ui +++ /dev/null @@ -1,59 +0,0 @@ - - - UnconnectedUASInfoWidget - - - - 0 - 0 - 279 - 114 - - - - - - - border:0; - - - - - - - - - 0 - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QTextEdit::AutoAll - - - false - - - true - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> -<tr> -<td style="border: none;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:20pt; font-weight:600; color:#b5b5b5;">NO UAV</span></p></td></tr></table></body></html> - - - - - - - - diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index b453f3463..faffdfae0 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -40,6 +40,7 @@ This file is part of the PIXHAWK project #include #include #include +#include WaypointList::WaypointList(QWidget *parent, UASWaypointManager* wpm) : QWidget(parent), @@ -108,8 +109,14 @@ WaypointList::WaypointList(QWidget *parent, UASWaypointManager* wpm) : m_ui->readButton->hide(); m_ui->refreshButton->hide(); //FIXME: The whole "Onboard Waypoints"-tab should be hidden, instead of "refresh" button - UnconnectedUASInfoWidget* inf = new UnconnectedUASInfoWidget(this); - viewOnlyListLayout->insertWidget(0, inf); //insert a "NO UAV" info into the Onboard Tab + // Insert a "NO UAV" info into the Onboard Tab + QLabel* noUas = new QLabel(this); + noUas->setObjectName("noUas"); + noUas->setText("NO UAS"); + noUas->setEnabled(false); + noUas->setAlignment(Qt::AlignCenter); + viewOnlyListLayout->insertWidget(0, noUas); + showOfflineWarning = true; } else { setUAS(static_cast(WPM->getUAS())); diff --git a/src/ui/WaypointList.h b/src/ui/WaypointList.h index 2871105c0..f5d39cb67 100644 --- a/src/ui/WaypointList.h +++ b/src/ui/WaypointList.h @@ -42,9 +42,6 @@ This file is part of the QGROUNDCONTROL project #include "UASInterface.h" #include "WaypointEditableView.h" #include "WaypointViewOnlyView.h" -#include "UnconnectedUASInfoWidget.h" -//#include "PopupMessage.h" - namespace Ui { -- 2.22.0