Commit 7982eb0f authored by Don Gagne's avatar Don Gagne

Reorder top level buttons, new VehicleSetup code

parent 59a34f58
......@@ -64,7 +64,7 @@ This file is part of the QGROUNDCONTROL project
#include "QGCTabbedInfoView.h"
#include "UASRawStatusView.h"
#include "PrimaryFlightDisplay.h"
#include <QGCConfigView.h>
#include "SetupView.h"
#include "SerialSettingsDialog.h"
#include "terminalconsole.h"
#include "menuactionhelper.h"
......@@ -198,9 +198,10 @@ void MainWindow::init()
// Add actions for average users (displayed next to each other)
QList<QAction*> actions;
actions << ui.actionSetup;
actions << ui.actionMissionView;
actions << ui.actionFlightView;
actions << ui.actionHardwareConfig;
actions << ui.actionEngineersView;
toolBar->setPerspectiveChangeActions(actions);
......@@ -324,9 +325,9 @@ void MainWindow::init()
// Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui
#ifdef Q_OS_MACX
ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Meta+1", 0));
ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Meta+2", 0));
ui.actionHardwareConfig->setShortcut(QApplication::translate("MainWindow", "Meta+3", 0));
ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Meta+1", 0));
ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Meta+2", 0));
ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Meta+3", 0));
ui.actionEngineersView->setShortcut(QApplication::translate("MainWindow", "Meta+4", 0));
ui.actionGoogleEarthView->setShortcut(QApplication::translate("MainWindow", "Meta+5", 0));
ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Meta+6", 0));
......@@ -335,9 +336,9 @@ void MainWindow::init()
ui.actionFirmwareUpdateView->setShortcut(QApplication::translate("MainWindow", "Meta+9", 0));
ui.actionFullscreen->setShortcut(QApplication::translate("MainWindow", "Meta+Return", 0));
#else
ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Ctrl+1", 0));
ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Ctrl+2", 0));
ui.actionHardwareConfig->setShortcut(QApplication::translate("MainWindow", "Ctrl+3", 0));
ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Ctrl+1", 0));
ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Ctrl+2", 0));
ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Ctrl+3", 0));
ui.actionEngineersView->setShortcut(QApplication::translate("MainWindow", "Ctrl+4", 0));
ui.actionGoogleEarthView->setShortcut(QApplication::translate("MainWindow", "Ctrl+5", 0));
ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Ctrl+6", 0));
......@@ -521,12 +522,12 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget(terminalView, VIEW_TERMINAL, tr("Terminal View"));
}
if (!configView)
if (!setupView)
{
configView = new SubMainWindow(this);
configView->setObjectName("VIEW_HARDWARE_CONFIG");
configView->setCentralWidget(new QGCConfigView(this));
addToCentralStackedWidget(configView, VIEW_HARDWARE_CONFIG, "Config");
setupView = new SubMainWindow(this);
setupView->setObjectName("VIEW_SETUP");
setupView->setCentralWidget(new SetupView(this));
addToCentralStackedWidget(setupView, VIEW_SETUP, "Setup");
}
if (!engineeringView)
......@@ -1153,7 +1154,7 @@ void MainWindow::connectCommonActions()
perspectives->addAction(ui.actionFlightView);
perspectives->addAction(ui.actionSimulationView);
perspectives->addAction(ui.actionMissionView);
perspectives->addAction(ui.actionHardwareConfig);
perspectives->addAction(ui.actionSetup);
perspectives->addAction(ui.actionTerminalView);
perspectives->addAction(ui.actionGoogleEarthView);
perspectives->addAction(ui.actionLocal3DView);
......@@ -1188,10 +1189,10 @@ void MainWindow::connectCommonActions()
ui.actionMissionView->setChecked(true);
ui.actionMissionView->activate(QAction::Trigger);
}
if (currentView == VIEW_HARDWARE_CONFIG)
if (currentView == VIEW_SETUP)
{
ui.actionHardwareConfig->setChecked(true);
ui.actionHardwareConfig->activate(QAction::Trigger);
ui.actionSetup->setChecked(true);
ui.actionSetup->activate(QAction::Trigger);
}
if (currentView == VIEW_SOFTWARE_CONFIG)
{
......@@ -1243,10 +1244,9 @@ void MainWindow::connectCommonActions()
connect(ui.actionSimulationView, SIGNAL(triggered()), this, SLOT(loadSimulationView()));
connect(ui.actionEngineersView, SIGNAL(triggered()), this, SLOT(loadEngineerView()));
connect(ui.actionMissionView, SIGNAL(triggered()), this, SLOT(loadOperatorView()));
connect(ui.actionHardwareConfig,SIGNAL(triggered()),this,SLOT(loadHardwareConfigView()));
connect(ui.actionSetup,SIGNAL(triggered()),this,SLOT(loadSetupView()));
connect(ui.actionGoogleEarthView, SIGNAL(triggered()), this, SLOT(loadGoogleEarthView()));
connect(ui.actionLocal3DView, SIGNAL(triggered()), this, SLOT(loadLocal3DView()));
connect(ui.actionHardwareConfig, SIGNAL(triggered()), this, SLOT(loadHardwareConfigView()));
connect(ui.actionSoftwareConfig,SIGNAL(triggered()),this,SLOT(loadSoftwareConfigView()));
connect(ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView()));
......@@ -1617,8 +1617,8 @@ void MainWindow::loadViewState()
// Load defaults
switch (currentView)
{
case VIEW_HARDWARE_CONFIG:
centerStack->setCurrentWidget(configView);
case VIEW_SETUP:
centerStack->setCurrentWidget(setupView);
break;
case VIEW_SOFTWARE_CONFIG:
if (softwareConfigView)
......@@ -1715,7 +1715,7 @@ void MainWindow::handleMisconfiguration(UASInterface* uas)
UASManager::instance()->setActiveUAS(uas);
// Flick to config view
loadHardwareConfigView();
loadSetupView();
}
}
......@@ -1740,13 +1740,13 @@ void MainWindow::loadOperatorView()
loadViewState();
}
}
void MainWindow::loadHardwareConfigView()
void MainWindow::loadSetupView()
{
if (currentView != VIEW_HARDWARE_CONFIG)
if (currentView != VIEW_SETUP)
{
storeViewState();
currentView = VIEW_HARDWARE_CONFIG;
ui.actionHardwareConfig->setChecked(true);
currentView = VIEW_SETUP;
ui.actionSetup->setChecked(true);
loadViewState();
}
}
......
......@@ -207,7 +207,7 @@ public slots:
void setAdvancedMode(bool isAdvancedMode);
void handleMisconfiguration(UASInterface* uas);
/** @brief Load configuration views */
void loadHardwareConfigView();
void loadSetupView();
void loadSoftwareConfigView();
/** @brief Load view for pilot */
void loadPilotView();
......@@ -319,7 +319,7 @@ protected:
VIEW_FLIGHT,
VIEW_SIMULATION,
VIEW_FIRMWAREUPDATE,
VIEW_HARDWARE_CONFIG,
VIEW_SETUP,
VIEW_SOFTWARE_CONFIG,
VIEW_TERMINAL,
VIEW_LOCAL3D,
......@@ -387,7 +387,7 @@ protected:
// Center widgets
QPointer<SubMainWindow> plannerView;
QPointer<SubMainWindow> pilotView;
QPointer<SubMainWindow> configView;
QPointer<SubMainWindow> setupView;
QPointer<SubMainWindow> softwareConfigView;
QPointer<SubMainWindow> engineeringView;
QPointer<SubMainWindow> simView;
......
......@@ -96,7 +96,7 @@
</property>
<addaction name="actionMissionView"/>
<addaction name="actionFlightView"/>
<addaction name="actionHardwareConfig"/>
<addaction name="actionSetup"/>
<addaction name="actionEngineersView"/>
<addaction name="actionGoogleEarthView"/>
<addaction name="actionLocal3DView"/>
......@@ -277,7 +277,7 @@
<normaloff>:/files/images/categories/applications-internet.svg</normaloff>:/files/images/categories/applications-internet.svg</iconset>
</property>
<property name="text">
<string>Mission</string>
<string>2. Plan</string>
</property>
</action>
<action name="actionEngineersView">
......@@ -289,7 +289,7 @@
<normaloff>:/files/images/apps/utilities-system-monitor.svg</normaloff>:/files/images/apps/utilities-system-monitor.svg</iconset>
</property>
<property name="text">
<string>Plot</string>
<string>4. Analyze</string>
</property>
</action>
<action name="actionMavlinkView">
......@@ -313,7 +313,7 @@
<normaloff>:/files/images/status/network-wireless-encrypted.svg</normaloff>:/files/images/status/network-wireless-encrypted.svg</iconset>
</property>
<property name="text">
<string>Instruments</string>
<string>3. Fly</string>
</property>
</action>
<action name="actionNewCustomWidget">
......@@ -428,7 +428,7 @@
<bool>false</bool>
</property>
</action>
<action name="actionHardwareConfig">
<action name="actionSetup">
<property name="checkable">
<bool>true</bool>
</property>
......@@ -437,10 +437,10 @@
<normaloff>:/files/images/categories/preferences-system.svg</normaloff>:/files/images/categories/preferences-system.svg</iconset>
</property>
<property name="text">
<string>Vehicle Setup</string>
<string>1. Setup</string>
</property>
<property name="toolTip">
<string>Hardware setup of the vehicle</string>
<string>Setup of the vehicle</string>
</property>
</action>
<action name="actionAdvanced_Mode">
......
......@@ -279,7 +279,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
// Add the first button.
QToolButton *first = new QToolButton(this);
first->setIcon(actions.first()->icon());
//first->setIcon(actions.first()->icon());
first->setText(actions.first()->text());
first->setToolTip(actions.first()->toolTip());
first->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
......@@ -298,7 +298,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
for (int i = 1; i < actions.count(); i++)
{
QToolButton *btn = new QToolButton(this);
btn->setIcon(actions.at(i)->icon());
//btn->setIcon(actions.at(i)->icon());
btn->setText(actions.at(i)->text());
btn->setToolTip(actions.at(i)->toolTip());
btn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
......
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