Commit 5d57365a authored by lm's avatar lm

Working on main window cleanup

parent 18128431
...@@ -316,7 +316,7 @@ void MainWindow::buildCustomWidget() ...@@ -316,7 +316,7 @@ void MainWindow::buildCustomWidget()
ui.menuTools->addAction(showAction); ui.menuTools->addAction(showAction);
// Load visibility for view (default is off) // Load visibility for view (default is off)
dock->setVisible(tool->isVisible(currentView)); //dock->setVisible(tool->isVisible(currentView));
// Load dock widget location (default is bottom) // Load dock widget location (default is bottom)
Qt::DockWidgetArea location = static_cast <Qt::DockWidgetArea>(tool->getDockWidgetArea(currentView)); Qt::DockWidgetArea location = static_cast <Qt::DockWidgetArea>(tool->getDockWidgetArea(currentView));
...@@ -401,14 +401,6 @@ void MainWindow::buildCommonWidgets() ...@@ -401,14 +401,6 @@ void MainWindow::buildCommonWidgets()
addToCentralWidgetsMenu (dataplotWidget, "Logfile Plot", SLOT(showCentralWidget()),CENTRAL_DATA_PLOT); addToCentralWidgetsMenu (dataplotWidget, "Logfile Plot", SLOT(showCentralWidget()),CENTRAL_DATA_PLOT);
} }
// if (!linechartWidget) {
// // Center widgets
// linechartWidget = new Linecharts(this);
// linechartWidget->addSource(mavlinkDecoder);
// addToCentralWidgetsMenu(linechartWidget, tr("Realtime Plot"), SLOT(showCentralWidget()), CENTRAL_LINECHART);
// }
if (!hudWidget) { if (!hudWidget) {
hudWidget = new HUD(320, 240, this); hudWidget = new HUD(320, 240, this);
addToCentralWidgetsMenu(hudWidget, tr("Head Up Display"), SLOT(showCentralWidget()), CENTRAL_HUD); addToCentralWidgetsMenu(hudWidget, tr("Head Up Display"), SLOT(showCentralWidget()), CENTRAL_HUD);
...@@ -1390,7 +1382,7 @@ void MainWindow::connectSlugsActions() ...@@ -1390,7 +1382,7 @@ void MainWindow::connectSlugsActions()
void MainWindow::showHelp() void MainWindow::showHelp()
{ {
if(!QDesktopServices::openUrl(QUrl("http://qgroundcontrol.org/users/"))) { if(!QDesktopServices::openUrl(QUrl("http://qgroundcontrol.org/users/start"))) {
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setText("Could not open help in browser"); msgBox.setText("Could not open help in browser");
...@@ -1416,7 +1408,7 @@ void MainWindow::showCredits() ...@@ -1416,7 +1408,7 @@ void MainWindow::showCredits()
void MainWindow::showRoadMap() void MainWindow::showRoadMap()
{ {
if(!QDesktopServices::openUrl(QUrl("http://qgroundcontrol.org/roadmap/"))) { if(!QDesktopServices::openUrl(QUrl("http://qgroundcontrol.org/dev/roadmap"))) {
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setText("Could not open roadmap in browser"); msgBox.setText("Could not open roadmap in browser");
...@@ -1523,7 +1515,15 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -1523,7 +1515,15 @@ void MainWindow::UASCreated(UASInterface* uas)
// Connect the UAS to the full user interface // Connect the UAS to the full user interface
if (uas != NULL) { if (uas != NULL)
{
if (!linechartWidget) {
// Center widgets
linechartWidget = new Linecharts(this);
linechartWidget->addSource(mavlinkDecoder);
addToCentralWidgetsMenu(linechartWidget, tr("Realtime Plot"), SLOT(showCentralWidget()), CENTRAL_LINECHART);
}
// Set default settings // Set default settings
setDefaultSettingsForAp(); setDefaultSettingsForAp();
...@@ -1639,7 +1639,9 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -1639,7 +1639,9 @@ void MainWindow::UASCreated(UASInterface* uas)
break; break;
default: default:
case (MAV_AUTOPILOT_GENERIC): case (MAV_AUTOPILOT_GENERIC):
break;
case (MAV_AUTOPILOT_ARDUPILOTMEGA): case (MAV_AUTOPILOT_ARDUPILOTMEGA):
break;
case (MAV_AUTOPILOT_PIXHAWK): { case (MAV_AUTOPILOT_PIXHAWK): {
// Build Pixhawk Widgets // Build Pixhawk Widgets
buildPxWidgets(); buildPxWidgets();
...@@ -1716,7 +1718,8 @@ void MainWindow::clearView() ...@@ -1716,7 +1718,8 @@ void MainWindow::clearView()
QAction* temp; QAction* temp;
// Set tool widget visibility settings for this view // Set tool widget visibility settings for this view
foreach (int key, toolsMenuActions.keys()) { foreach (int key, toolsMenuActions.keys())
{
temp = toolsMenuActions[key]; temp = toolsMenuActions[key];
QString chKey = buildMenuKey (SUB_SECTION_CHECKED,static_cast<TOOLS_WIDGET_NAMES>(key), currentView); QString chKey = buildMenuKey (SUB_SECTION_CHECKED,static_cast<TOOLS_WIDGET_NAMES>(key), currentView);
...@@ -1923,7 +1926,7 @@ void MainWindow::presentView() ...@@ -1923,7 +1926,7 @@ void MainWindow::presentView()
} }
} }
this->setWindowState(windowStateVal); //this->setWindowState(windowStateVal);
this->show(); this->show();
} }
......
...@@ -273,7 +273,7 @@ protected: ...@@ -273,7 +273,7 @@ protected:
typedef enum _SETTINGS_SECTIONS { typedef enum _SETTINGS_SECTIONS {
SECTION_MENU, SECTION_MENU,
SUB_SECTION_CHECKED, SUB_SECTION_CHECKED,
SUB_SECTION_LOCATION, SUB_SECTION_LOCATION
} SETTINGS_SECTIONS; } SETTINGS_SECTIONS;
typedef enum _VIEW_SECTIONS { typedef enum _VIEW_SECTIONS {
...@@ -282,6 +282,7 @@ protected: ...@@ -282,6 +282,7 @@ protected:
VIEW_PILOT, VIEW_PILOT,
VIEW_MAVLINK, VIEW_MAVLINK,
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, mostly intended for multi-screen setups
} VIEW_SECTIONS; } VIEW_SECTIONS;
......
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