Commit a082814a authored by Lorenz Meier's avatar Lorenz Meier

Merge branch 'master' of github.com:mavlink/qgroundcontrol into mavlink-ftp

parents 4d85f0b5 8714e12a
......@@ -217,8 +217,6 @@ void MainWindow::init()
toolBar = new QGCToolBar(this);
this->addToolBar(toolBar);
ui.actionHardwareConfig->setText(tr("Config"));
// Add actions for average users (displayed next to each other)
QList<QAction*> actions;
actions << ui.actionFlightView;
......@@ -229,10 +227,12 @@ void MainWindow::init()
// Add actions for advanced users (displayed in dropdown under "advanced")
QList<QAction*> advancedActions;
advancedActions << ui.actionSimulation_View;
advancedActions << ui.actionSimulationView;
advancedActions << ui.actionEngineersView;
toolBar->setPerspectiveChangeAdvancedActions(advancedActions);
} else {
ui.actionHardwareConfig->setText(tr("Hardware"));
}
customStatusBar = new QGCStatusBar(this);
......@@ -267,7 +267,7 @@ void MainWindow::init()
apmToolBar->setFlightPlanViewAction(ui.actionMissionView);
apmToolBar->setHardwareViewAction(ui.actionHardwareConfig);
apmToolBar->setSoftwareViewAction(ui.actionSoftwareConfig);
apmToolBar->setSimulationViewAction(ui.actionSimulation_View);
apmToolBar->setSimulationViewAction(ui.actionSimulationView);
apmToolBar->setTerminalViewAction(ui.actionTerminalView);
QDockWidget *widget = new QDockWidget(tr("APM Tool Bar"),this);
......@@ -436,10 +436,10 @@ QString MainWindow::getWindowStateKey()
{
if (UASManager::instance()->getActiveUAS())
{
return QString::number(currentView)+"_windowstate_" + UASManager::instance()->getActiveUAS()->getAutopilotTypeName();
return QString::number(currentView)+"_windowstate_" + QString::number(getCustomMode()) + "_" + UASManager::instance()->getActiveUAS()->getAutopilotTypeName();
}
else
return QString::number(currentView)+"_windowstate";
return QString::number(currentView)+"_windowstate_" + QString::number(getCustomMode());
}
QString MainWindow::getWindowGeometryKey()
......@@ -544,6 +544,15 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget(pilotView, VIEW_FLIGHT, "Pilot");
}
if (!terminalView)
{
terminalView = new SubMainWindow(this);
terminalView->setObjectName("VIEW_TERMINAL");
TerminalConsole *terminalConsole = new TerminalConsole(this);
terminalView->setCentralWidget(terminalConsole);
addToCentralStackedWidget(terminalView, VIEW_TERMINAL, tr("Terminal View"));
}
if (getCustomMode() == CUSTOM_MODE_APM) {
if (!configView)
{
......@@ -560,14 +569,7 @@ void MainWindow::buildCommonWidgets()
softwareConfigView->setCentralWidget(new ApmSoftwareConfig(this));
addToCentralStackedWidget(softwareConfigView, VIEW_SOFTWARE_CONFIG, "Software");
}
if (!terminalView)
{
terminalView = new SubMainWindow(this);
terminalView->setObjectName("VIEW_TERMINAL");
TerminalConsole *terminalConsole = new TerminalConsole(this);
terminalView->setCentralWidget(terminalConsole);
addToCentralStackedWidget(terminalView, VIEW_TERMINAL, tr("Terminal View"));
}
} else {
if (!configView)
{
......@@ -597,7 +599,7 @@ void MainWindow::buildCommonWidgets()
}
#endif
#if QGC_GOOGLE_EARTH_ENABLED
#ifdef QGC_GOOGLE_EARTH_ENABLED
if (!googleEarthView)
{
googleEarthView = new SubMainWindow(this);
......@@ -1264,19 +1266,29 @@ void MainWindow::connectCommonActions()
perspectives->addAction(ui.actionEngineersView);
perspectives->addAction(ui.actionMavlinkView);
perspectives->addAction(ui.actionFlightView);
perspectives->addAction(ui.actionSimulation_View);
perspectives->addAction(ui.actionSimulationView);
perspectives->addAction(ui.actionMissionView);
//perspectives->addAction(ui.actionConfiguration_2);
perspectives->addAction(ui.actionHardwareConfig);
if (getCustomMode() == CUSTOM_MODE_APM) {
perspectives->addAction(ui.actionSoftwareConfig);
}
perspectives->addAction(ui.actionSoftwareConfig);
perspectives->addAction(ui.actionTerminalView);
perspectives->addAction(ui.actionUnconnectedView);
perspectives->addAction(ui.actionGoogleEarthView);
perspectives->addAction(ui.actionLocal3DView);
perspectives->setExclusive(true);
/* Hide the actions that are not relevant */
ui.actionSoftwareConfig->setVisible(getCustomMode() == CUSTOM_MODE_APM);
#ifndef QGC_MAVGEN_ENABLED
ui.actionMavlinkView->setVisible(false);
#endif
#ifndef QGC_GOOGLE_EARTH_ENABLED
ui.actionGoogleEarthView->setVisible(false);
#endif
#ifndef QGC_OSG_ENABLED
ui.actionLocal3DView->setVisible(false);
#endif
// Mark the right one as selected
if (currentView == VIEW_ENGINEER)
{
......@@ -1295,8 +1307,8 @@ void MainWindow::connectCommonActions()
}
if (currentView == VIEW_SIMULATION)
{
ui.actionSimulation_View->setChecked(true);
ui.actionSimulation_View->activate(QAction::Trigger);
ui.actionSimulationView->setChecked(true);
ui.actionSimulationView->activate(QAction::Trigger);
}
if (currentView == VIEW_MISSION)
{
......@@ -1360,21 +1372,16 @@ void MainWindow::connectCommonActions()
// Views actions
connect(ui.actionFlightView, SIGNAL(triggered()), this, SLOT(loadPilotView()));
connect(ui.actionSimulation_View, SIGNAL(triggered()), this, SLOT(loadSimulationView()));
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.actionUnconnectedView, SIGNAL(triggered()), this, SLOT(loadUnconnectedView()));
connect(ui.actionHardwareConfig,SIGNAL(triggered()),this,SLOT(loadHardwareConfigView()));
connect(ui.actionGoogleEarthView, SIGNAL(triggered()), this, SLOT(loadGoogleEarthView()));
connect(ui.actionLocal3DView, SIGNAL(triggered()), this, SLOT(loadLocal3DView()));
connect(ui.actionSimulationView, SIGNAL(triggered()), this, SLOT(loadSimulationView()));
connect(ui.actionHardwareConfig, SIGNAL(triggered()), this, SLOT(loadHardwareConfigView()));
if (getCustomMode() == CUSTOM_MODE_APM) {
connect(ui.actionSoftwareConfig,SIGNAL(triggered()),this,SLOT(loadSoftwareConfigView()));
connect(ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView()));
}
connect(ui.actionSoftwareConfig,SIGNAL(triggered()),this,SLOT(loadSoftwareConfigView()));
connect(ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView()));
connect(ui.actionMavlinkView, SIGNAL(triggered()), this, SLOT(loadMAVLinkView()));
// Help Actions
......@@ -2051,7 +2058,7 @@ void MainWindow::loadSimulationView()
{
storeViewState();
currentView = VIEW_SIMULATION;
ui.actionSimulation_View->setChecked(true);
ui.actionSimulationView->setChecked(true);
loadViewState();
}
}
......
......@@ -51,7 +51,7 @@
<x>0</x>
<y>0</y>
<width>1024</width>
<height>22</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuMGround">
......@@ -95,13 +95,13 @@
<property name="title">
<string>Perspectives</string>
</property>
<addaction name="actionMissionView"/>
<addaction name="actionFlightView"/>
<addaction name="actionMissionView"/>
<addaction name="actionHardwareConfig"/>
<addaction name="actionSoftwareConfig"/>
<addaction name="actionTerminalView"/>
<addaction name="actionEngineersView"/>
<addaction name="actionSimulationView"/>
<addaction name="actionEngineersView"/>
<addaction name="actionGoogleEarthView"/>
<addaction name="actionLocal3DView"/>
<addaction name="separator"/>
......@@ -401,30 +401,21 @@
</property>
</action>
<action name="actionFirmwareUpdateView">
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/status/software-update-available.svg</normaloff>:/files/images/status/software-update-available.svg</iconset>
</property>
<property name="text">
<string>Firmware Update</string>
</property>
<property name="toolTip">
<string>Update the firmware of one of the connected autopilots</string>
</property>
</action>
<action name="actionSimulation_View">
<property name="checkable">
<bool>true</bool>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/control/launch.svg</normaloff>:/files/images/control/launch.svg</iconset>
<normaloff>:/files/images/status/software-update-available.svg</normaloff>:/files/images/status/software-update-available.svg</iconset>
</property>
<property name="text">
<string>Simulation</string>
<string>Firmware Update</string>
</property>
<property name="toolTip">
<string>Open the simulation view</string>
<string>Update the firmware of one of the connected autopilots</string>
</property>
</action>
<action name="actionHardwareConfig">
......@@ -436,7 +427,7 @@
<normaloff>:/files/images/categories/preferences-system.svg</normaloff>:/files/images/categories/preferences-system.svg</iconset>
</property>
<property name="text">
<string>Hardware</string>
<string>Config</string>
</property>
<property name="toolTip">
<string>Configuration options of the vehicle.</string>
......@@ -487,11 +478,17 @@
</property>
</action>
<action name="actionGoogleEarthView">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Google Earth</string>
</property>
</action>
<action name="actionLocal3DView">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Local 3D View</string>
</property>
......
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