Commit 476c71b6 authored by Michael Carpenter's avatar Michael Carpenter

Addition of Configuration View as a new , with toolbar button

parent 02f4a7ed
...@@ -168,6 +168,7 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -168,6 +168,7 @@ MainWindow::MainWindow(QWidget *parent):
customStatusBar = new QGCStatusBar(this); customStatusBar = new QGCStatusBar(this);
setStatusBar(customStatusBar); setStatusBar(customStatusBar);
statusBar()->setSizeGripEnabled(true); statusBar()->setSizeGripEnabled(true);
toolBar->addPerspectiveChangeAction(ui.actionConfiguration_2);
emit initStatusChanged("Building common widgets."); emit initStatusChanged("Building common widgets.");
...@@ -1058,6 +1059,7 @@ void MainWindow::connectCommonActions() ...@@ -1058,6 +1059,7 @@ void MainWindow::connectCommonActions()
if (currentView == VIEW_PILOT) ui.actionPilotsView->setChecked(true); if (currentView == VIEW_PILOT) ui.actionPilotsView->setChecked(true);
if (currentView == VIEW_SIMULATION) ui.actionSimulation_View->setChecked(true); if (currentView == VIEW_SIMULATION) ui.actionSimulation_View->setChecked(true);
if (currentView == VIEW_OPERATOR) ui.actionOperatorsView->setChecked(true); if (currentView == VIEW_OPERATOR) ui.actionOperatorsView->setChecked(true);
if (currentView == VIEW_CONFIGURATION) ui.actionConfiguration_2->setChecked(true);
if (currentView == VIEW_FIRMWAREUPDATE) ui.actionFirmwareUpdateView->setChecked(true); if (currentView == VIEW_FIRMWAREUPDATE) ui.actionFirmwareUpdateView->setChecked(true);
if (currentView == VIEW_UNCONNECTED) ui.actionUnconnectedView->setChecked(true); if (currentView == VIEW_UNCONNECTED) ui.actionUnconnectedView->setChecked(true);
...@@ -1089,6 +1091,7 @@ void MainWindow::connectCommonActions() ...@@ -1089,6 +1091,7 @@ void MainWindow::connectCommonActions()
connect(ui.actionEngineersView, SIGNAL(triggered()), this, SLOT(loadEngineerView())); connect(ui.actionEngineersView, SIGNAL(triggered()), this, SLOT(loadEngineerView()));
connect(ui.actionOperatorsView, SIGNAL(triggered()), this, SLOT(loadOperatorView())); connect(ui.actionOperatorsView, SIGNAL(triggered()), this, SLOT(loadOperatorView()));
connect(ui.actionUnconnectedView, SIGNAL(triggered()), this, SLOT(loadUnconnectedView())); connect(ui.actionUnconnectedView, SIGNAL(triggered()), this, SLOT(loadUnconnectedView()));
connect(ui.actionConfiguration_2,SIGNAL(triggered()),this,SLOT(loadConfigurationView()));
connect(ui.actionFirmwareUpdateView, SIGNAL(triggered()), this, SLOT(loadFirmwareUpdateView())); connect(ui.actionFirmwareUpdateView, SIGNAL(triggered()), this, SLOT(loadFirmwareUpdateView()));
connect(ui.actionMavlinkView, SIGNAL(triggered()), this, SLOT(loadMAVLinkView())); connect(ui.actionMavlinkView, SIGNAL(triggered()), this, SLOT(loadMAVLinkView()));
...@@ -1549,6 +1552,9 @@ void MainWindow::loadViewState() ...@@ -1549,6 +1552,9 @@ void MainWindow::loadViewState()
// Load defaults // Load defaults
switch (currentView) switch (currentView)
{ {
case VIEW_CONFIGURATION:
centerStack->setCurrentWidget(configWidget);
break;
case VIEW_ENGINEER: case VIEW_ENGINEER:
centerStack->setCurrentWidget(linechartWidget); centerStack->setCurrentWidget(linechartWidget);
controlDockWidget->hide(); controlDockWidget->hide();
...@@ -1704,6 +1710,16 @@ void MainWindow::loadOperatorView() ...@@ -1704,6 +1710,16 @@ void MainWindow::loadOperatorView()
loadViewState(); loadViewState();
} }
} }
void MainWindow::loadConfigurationView()
{
if (currentView != VIEW_CONFIGURATION)
{
storeViewState();
currentView = VIEW_CONFIGURATION;
ui.actionConfiguration_2->setChecked(true);
loadViewState();
}
}
void MainWindow::loadUnconnectedView() void MainWindow::loadUnconnectedView()
{ {
......
...@@ -155,6 +155,8 @@ public slots: ...@@ -155,6 +155,8 @@ public slots:
void stopVideoCapture(); void stopVideoCapture();
void saveScreen(); void saveScreen();
/** @brief Load configuration view */
void loadConfigurationView();
/** @brief Load default view when no MAV is connected */ /** @brief Load default view when no MAV is connected */
void loadUnconnectedView(); void loadUnconnectedView();
/** @brief Load view for pilot */ /** @brief Load view for pilot */
...@@ -265,6 +267,7 @@ protected: ...@@ -265,6 +267,7 @@ protected:
VIEW_SIMULATION, VIEW_SIMULATION,
VIEW_MAVLINK, VIEW_MAVLINK,
VIEW_FIRMWAREUPDATE, VIEW_FIRMWAREUPDATE,
VIEW_CONFIGURATION,
VIEW_UNCONNECTED, ///< View in unconnected mode, when no UAS is available VIEW_UNCONNECTED, ///< View in unconnected mode, when no UAS is available
VIEW_FULL ///< All widgets shown at once VIEW_FULL ///< All widgets shown at once
} VIEW_SECTIONS; } VIEW_SECTIONS;
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>800</width>
<height>22</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuMGround"> <widget class="QMenu" name="menuMGround">
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
<addaction name="actionOperatorsView"/> <addaction name="actionOperatorsView"/>
<addaction name="actionEngineersView"/> <addaction name="actionEngineersView"/>
<addaction name="actionPilotsView"/> <addaction name="actionPilotsView"/>
<addaction name="actionConfiguration_2"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionFirmwareUpdateView"/> <addaction name="actionFirmwareUpdateView"/>
<addaction name="actionMavlinkView"/> <addaction name="actionMavlinkView"/>
...@@ -468,6 +469,15 @@ ...@@ -468,6 +469,15 @@
<string>Open the simulation view</string> <string>Open the simulation view</string>
</property> </property>
</action> </action>
<action name="actionConfiguration_2">
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/categories/preferences-system.svg</normaloff>:/files/images/categories/preferences-system.svg</iconset>
</property>
<property name="text">
<string>Configuration</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources> <resources>
......
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