Skip to content

Commit

Permalink
[Simulator] Set main window title based on radio type & flight mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaperno committed Feb 7, 2017
1 parent 7e1c05f commit cdf4335
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions companion/src/simulation/simulatormainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ SimulatorMainWindow::SimulatorMainWindow(QWidget *parent, SimulatorInterface * s
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);

m_simulatorWidget = new SimulatorDialog(this, m_simulator, flags);
setWindowTitle(m_simulatorWidget->windowTitle());

toggleRadioDocked(true);
createDockWidgets();
Expand Down Expand Up @@ -117,6 +118,7 @@ SimulatorMainWindow::SimulatorMainWindow(QWidget *parent, SimulatorInterface * s
if (m_simulatorWidget) {
connect(ui->actionScreenshot, &QAction::triggered, m_simulatorWidget, &SimulatorDialog::captureScreenshot);
connect(ui->actionReloadRadioData, &QAction::triggered, m_simulatorWidget, &SimulatorDialog::restart);
connect(m_simulatorWidget, &SimulatorDialog::windowTitleChanged, this, &SimulatorMainWindow::setWindowTitle);
}
if (m_outputsWidget)
connect(ui->actionReloadRadioData, &QAction::triggered, m_outputsWidget, &RadioOutputsWidget::restart);
Expand Down Expand Up @@ -409,6 +411,7 @@ void SimulatorMainWindow::toggleRadioDocked(bool dock)
m_simulatorDockWidget->move(newPos);
}

connect(m_simulatorWidget, &SimulatorDialog::windowTitleChanged, m_simulatorDockWidget, &QDockWidget::setWindowTitle);
connect(m_simulatorDockWidget, &QDockWidget::topLevelChanged, [this](bool top) {
showRadioDocked(!top);
});
Expand Down

0 comments on commit cdf4335

Please sign in to comment.