diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index da0a84964439e6738ec2f5d6137421abeba92156..a8914b4dcf77af681282880d8f3967ed2ca9f34b 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -216,8 +216,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 actions; actions << ui.actionFlightView; @@ -228,10 +226,12 @@ void MainWindow::init() // Add actions for advanced users (displayed in dropdown under "advanced") QList advancedActions; - advancedActions << ui.actionSimulation_View; + advancedActions << ui.actionSimulationView; advancedActions << ui.actionEngineersView; toolBar->setPerspectiveChangeAdvancedActions(advancedActions); + } else { + ui.actionHardwareConfig->setText(tr("Hardware")); } customStatusBar = new QGCStatusBar(this); @@ -266,7 +266,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); @@ -435,10 +435,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() @@ -543,6 +543,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) { @@ -559,14 +568,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) { @@ -596,7 +598,7 @@ void MainWindow::buildCommonWidgets() } #endif -#if QGC_GOOGLE_EARTH_ENABLED +#ifdef QGC_GOOGLE_EARTH_ENABLED if (!googleEarthView) { googleEarthView = new SubMainWindow(this); @@ -1262,19 +1264,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) { @@ -1293,8 +1305,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) { @@ -1358,21 +1370,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 @@ -2049,7 +2056,7 @@ void MainWindow::loadSimulationView() { storeViewState(); currentView = VIEW_SIMULATION; - ui.actionSimulation_View->setChecked(true); + ui.actionSimulationView->setChecked(true); loadViewState(); } } diff --git a/src/ui/MainWindow.ui b/src/ui/MainWindow.ui index 3503841f65354c8a18259590a606994bd2f574a0..0eadd06077cb4dc1a59858bbed6590c4c7fcfa4d 100644 --- a/src/ui/MainWindow.ui +++ b/src/ui/MainWindow.ui @@ -51,7 +51,7 @@ 0 0 1024 - 22 + 21 @@ -95,13 +95,13 @@ Perspectives - + - + @@ -401,30 +401,21 @@ - - - :/files/images/status/software-update-available.svg:/files/images/status/software-update-available.svg - - - Firmware Update - - - Update the firmware of one of the connected autopilots - - - true + + false + - :/files/images/control/launch.svg:/files/images/control/launch.svg + :/files/images/status/software-update-available.svg:/files/images/status/software-update-available.svg - Simulation + Firmware Update - Open the simulation view + Update the firmware of one of the connected autopilots @@ -436,7 +427,7 @@ :/files/images/categories/preferences-system.svg:/files/images/categories/preferences-system.svg - Hardware + Config Configuration options of the vehicle. @@ -487,11 +478,17 @@ + + true + Google Earth + + true + Local 3D View