Commit 7048ce94 authored by Lorenz Meier's avatar Lorenz Meier

Checkpoint: This is looking sweet

parent 1aa7b9b9
...@@ -358,6 +358,16 @@ QPushButton, QToolButton { ...@@ -358,6 +358,16 @@ QPushButton, QToolButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #777, stop: 1 #333); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #777, stop: 1 #333);
} }
QPushButton#advancedMenuButton, QPushButton#airframeMenuButton, QPushButton#firmwareMenuButton,
QPushButton#generalMenuButton, QPushButton#rcMenuButton, QPushButton#sensorMenuButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #333, stop: 1 #111);
border-radius: 5px;
min-height: 64px;
max-height: 64px;
min-width: 80px;
border: 1px solid #000000;
}
QPushButton#planePushButton, QPushButton#flyingWingPushButton, QPushButton#quadXPushButton, QPushButton#planePushButton, QPushButton#flyingWingPushButton, QPushButton#quadXPushButton,
QPushButton#quadPlusPushButton, QPushButton#hexaXPushButton, QPushButton#hexaPlusPushButton, QPushButton#quadPlusPushButton, QPushButton#hexaXPushButton, QPushButton#hexaPlusPushButton,
QPushButton#octoXPushButton, QPushButton#octoPlusPushButton, QPushButton#hPushButton { QPushButton#octoXPushButton, QPushButton#octoPlusPushButton, QPushButton#hPushButton {
...@@ -392,6 +402,12 @@ QWidget#containerWidget { ...@@ -392,6 +402,12 @@ QWidget#containerWidget {
border: 2px solid #CCCCCC; border: 2px solid #CCCCCC;
} }
QWidget#navBarWidget {
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #404040, stop:1 #727272);
border-radius: 0px;
border: 1px solid #222222;
}
QPushButton#connectButton, QPushButton#controlButton { QPushButton#connectButton, QPushButton#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154);
} }
......
...@@ -175,6 +175,11 @@ ...@@ -175,6 +175,11 @@
<file>files/images/px4/calibration/accel_z-.png</file> <file>files/images/px4/calibration/accel_z-.png</file>
<file>files/images/px4/calibration/accel_y+.png</file> <file>files/images/px4/calibration/accel_y+.png</file>
<file>files/images/px4/calibration/mag_calibration_figure8.png</file> <file>files/images/px4/calibration/mag_calibration_figure8.png</file>
<file>files/images/px4/menu/sensors.png</file>
<file>files/images/px4/menu/firmware_upgrade.png</file>
<file>files/images/px4/menu/plane.png</file>
<file>files/images/px4/menu/remote.png</file>
<file>files/images/px4/menu/cogwheels.png</file>
</qresource> </qresource>
<qresource prefix="/general"> <qresource prefix="/general">
<file alias="vera.ttf">files/styles/Vera.ttf</file> <file alias="vera.ttf">files/styles/Vera.ttf</file>
......
...@@ -18,8 +18,14 @@ QGCConfigView::QGCConfigView(QWidget *parent) : ...@@ -18,8 +18,14 @@ QGCConfigView::QGCConfigView(QWidget *parent) :
// The config screens are required for firmware uploading // The config screens are required for firmware uploading
if (MainWindow::instance()->getCustomMode() == MainWindow::CUSTOM_MODE_PX4) { if (MainWindow::instance()->getCustomMode() == MainWindow::CUSTOM_MODE_PX4) {
ui->gridLayout->removeWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(false);
delete ui->waitingLabel;
config = new QGCPX4VehicleConfig(); config = new QGCPX4VehicleConfig();
ui->gridLayout->addWidget(config); ui->gridLayout->addWidget(config);
} else { } else {
//don't show a configuration widget if no vehicle is connected //don't show a configuration widget if no vehicle is connected
//show a placeholder informational widget instead //show a placeholder informational widget instead
...@@ -37,6 +43,16 @@ void QGCConfigView::activeUASChanged(UASInterface* uas) ...@@ -37,6 +43,16 @@ void QGCConfigView::activeUASChanged(UASInterface* uas)
if (mav == uas) if (mav == uas)
return; return;
int type = -1;
if (mav)
type = mav->getAutopilotType();
mav = uas;
if (NULL != uas && type != uas->getAutopilotType()) {
ui->gridLayout->removeWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(false);
//remove all child widgets since they could contain stale data //remove all child widgets since they could contain stale data
//for example, when we switch from one PX4 UAS to another UAS //for example, when we switch from one PX4 UAS to another UAS
foreach (QObject* obj, ui->gridLayout->children()) { foreach (QObject* obj, ui->gridLayout->children()) {
...@@ -49,11 +65,6 @@ void QGCConfigView::activeUASChanged(UASInterface* uas) ...@@ -49,11 +65,6 @@ void QGCConfigView::activeUASChanged(UASInterface* uas)
} }
} }
mav = uas;
if (NULL != mav) {
ui->gridLayout->removeWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(false);
int autopilotType = mav->getAutopilotType(); int autopilotType = mav->getAutopilotType();
switch (autopilotType) { switch (autopilotType) {
case MAV_AUTOPILOT_PX4: case MAV_AUTOPILOT_PX4:
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="waitingLabel"> <widget class="QLabel" name="waitingLabel">
<property name="text"> <property name="text">
......
...@@ -89,6 +89,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) : ...@@ -89,6 +89,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
ui->airframeMenuButton->setEnabled(false); ui->airframeMenuButton->setEnabled(false);
ui->sensorMenuButton->setEnabled(false); ui->sensorMenuButton->setEnabled(false);
ui->rcMenuButton->setEnabled(false); ui->rcMenuButton->setEnabled(false);
ui->generalMenuButton->hide();
px4AirframeConfig = new QGCPX4AirframeConfig(this); px4AirframeConfig = new QGCPX4AirframeConfig(this);
ui->airframeLayout->addWidget(px4AirframeConfig); ui->airframeLayout->addWidget(px4AirframeConfig);
...@@ -554,7 +555,7 @@ void QGCPX4VehicleConfig::loadQgcConfig(bool primary) ...@@ -554,7 +555,7 @@ void QGCPX4VehicleConfig::loadQgcConfig(bool primary)
// Load tabs for general configuration // Load tabs for general configuration
foreach (QString dir,generaldir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) foreach (QString dir,generaldir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{ {
QPushButton *button = new QPushButton(ui->leftNavScrollAreaWidgetContents); QPushButton *button = new QPushButton(this);
connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked())); connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button); ui->navBarLayout->insertWidget(2,button);
button->setMinimumHeight(75); button->setMinimumHeight(75);
...@@ -598,7 +599,7 @@ void QGCPX4VehicleConfig::loadQgcConfig(bool primary) ...@@ -598,7 +599,7 @@ void QGCPX4VehicleConfig::loadQgcConfig(bool primary)
// Load additional tabs for vehicle specific configuration // Load additional tabs for vehicle specific configuration
foreach (QString dir,vehicledir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) foreach (QString dir,vehicledir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{ {
QPushButton *button = new QPushButton(ui->leftNavScrollAreaWidgetContents); QPushButton *button = new QPushButton(this);
connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked())); connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button); ui->navBarLayout->insertWidget(2,button);
......
...@@ -19,45 +19,49 @@ ...@@ -19,45 +19,49 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_11"> <layout class="QHBoxLayout" name="horizontalLayout_11" stretch="0,0">
<item> <property name="margin">
<widget class="QScrollArea" name="leftNavScrollArea"> <number>0</number>
<property name="minimumSize">
<size>
<width>135</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>135</width>
<height>16777215</height>
</size>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property> </property>
<widget class="QWidget" name="leftNavScrollAreaWidgetContents"> <item>
<property name="geometry"> <widget class="QWidget" name="navBarWidget" native="true">
<rect> <layout class="QHBoxLayout" name="horizontalLayout">
<x>0</x> <property name="margin">
<y>0</y> <number>0</number>
<width>133</width>
<height>886</height>
</rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item> <item>
<layout class="QVBoxLayout" name="navBarLayout"> <layout class="QVBoxLayout" name="navBarLayout">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetMinAndMaxSize</enum> <enum>QLayout::SetMinAndMaxSize</enum>
</property> </property>
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>24</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item> <item>
<widget class="QPushButton" name="firmwareMenuButton"> <widget class="QPushButton" name="firmwareMenuButton">
<property name="text"> <property name="text">
<string>Firmware <string>Firmware
Upgrade</string> Upgrade</string>
</property> </property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/menu/firmware_upgrade.png</normaloff>:/files/images/px4/menu/firmware_upgrade.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
...@@ -75,9 +79,19 @@ Upgrade</string> ...@@ -75,9 +79,19 @@ Upgrade</string>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>RC <string>Radio
Calibration</string> Calibration</string>
</property> </property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/menu/remote.png</normaloff>:/files/images/px4/menu/remote.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
...@@ -92,6 +106,16 @@ Calibration</string> ...@@ -92,6 +106,16 @@ Calibration</string>
<string>Sensor <string>Sensor
Calibration</string> Calibration</string>
</property> </property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/menu/sensors.png</normaloff>:/files/images/px4/menu/sensors.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
...@@ -100,6 +124,16 @@ Calibration</string> ...@@ -100,6 +124,16 @@ Calibration</string>
<string>Airframe <string>Airframe
Config</string> Config</string>
</property> </property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/menu/plane.png</normaloff>:/files/images/px4/menu/plane.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
...@@ -114,6 +148,16 @@ Config</string> ...@@ -114,6 +148,16 @@ Config</string>
<string>General <string>General
Config</string> Config</string>
</property> </property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/menu/cogwheels.png</normaloff>:/files/images/px4/menu/cogwheels.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
...@@ -128,6 +172,16 @@ Config</string> ...@@ -128,6 +172,16 @@ Config</string>
<string>Advanced <string>Advanced
Config</string> Config</string>
</property> </property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/menu/cogwheels.png</normaloff>:/files/images/px4/menu/cogwheels.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
...@@ -147,14 +201,13 @@ Config</string> ...@@ -147,14 +201,13 @@ Config</string>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>5</number>
</property> </property>
<widget class="QWidget" name="firmwareTab"> <widget class="QWidget" name="firmwareTab">
<layout class="QVBoxLayout" name="firmwareLayout"> <layout class="QVBoxLayout" name="firmwareLayout">
...@@ -1123,8 +1176,8 @@ Config</string> ...@@ -1123,8 +1176,8 @@ Config</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>597</width> <width>571</width>
<height>740</height> <height>764</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QVBoxLayout" name="verticalLayout_7">
...@@ -1253,6 +1306,8 @@ Config</string> ...@@ -1253,6 +1306,8 @@ Config</string>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="../../qgroundcontrol.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment