Skip to content

Commit

Permalink
fix(cpn): update main window menus and toolbars on fixing invalid mod…
Browse files Browse the repository at this point in the history
…els (#5890)
  • Loading branch information
elecpower authored Feb 11, 2025
1 parent 9a4b462 commit 4c071f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions companion/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ MdiChild * MainWindow::createMdiChild()
connect(child, &MdiChild::modified, this, &MainWindow::onSubwindowModified);
connect(child, &MdiChild::newStatusMessage, statusBar(), &QStatusBar::showMessage);
connect(child, &MdiChild::destroyed, win, &QMdiSubWindow::close);
connect(child, &MdiChild::navigationUpdated, this, &MainWindow::updateMenus);
connect(win, &QMdiSubWindow::destroyed, this, &MainWindow::updateWindowActions);

updateWindowActions();
Expand Down
2 changes: 2 additions & 0 deletions companion/src/mdichild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ void MdiChild::updateNavigation()
action[ACT_MDL_PRT]->setEnabled(singleModelSelected);
action[ACT_MDL_SIM]->setEnabled(singleModelSelected && !invalidModels());
action[ACT_MDL_ERR]->setEnabled(singleModelSelected && radioData.models[getCurrentModel()].modelErrors);

emit navigationUpdated();
}

void MdiChild::retranslateUi()
Expand Down
1 change: 1 addition & 0 deletions companion/src/mdichild.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class MdiChild : public QWidget
signals:
void modified();
void newStatusMessage(const QString & msg, const int duration);
void navigationUpdated();

protected:
virtual void changeEvent(QEvent * event);
Expand Down

0 comments on commit 4c071f6

Please sign in to comment.