! * updates the state of actions, menus and toolbars (enabled or disabled) * on project changes (project closes and opens) */
| 1025 | * on project changes (project closes and opens) |
| 1026 | */ |
| 1027 | void MainWin::updateGUIOnProjectChanges() { |
| 1028 | // return; |
| 1029 | if (m_closing) |
| 1030 | return; |
| 1031 | |
| 1032 | auto* factory = this->guiFactory(); |
| 1033 | if (!m_dockManagerContent || !m_dockManagerContent->focusedDockWidget()) { |
| 1034 | factory->container(QLatin1String("spreadsheet"), this)->setEnabled(false); |
| 1035 | factory->container(QLatin1String("matrix"), this)->setEnabled(false); |
| 1036 | factory->container(QLatin1String("worksheet"), this)->setEnabled(false); |
| 1037 | factory->container(QLatin1String("datapicker"), this)->setEnabled(false); |
| 1038 | factory->container(QLatin1String("spreadsheet_toolbar"), this)->hide(); |
| 1039 | factory->container(QLatin1String("worksheet_toolbar"), this)->hide(); |
| 1040 | factory->container(QLatin1String("cartesian_plot_toolbar"), this)->hide(); |
| 1041 | factory->container(QLatin1String("datapicker_toolbar"), this)->hide(); |
| 1042 | #ifdef HAVE_CANTOR_LIBS |
| 1043 | factory->container(QLatin1String("notebook"), this)->setEnabled(false); |
| 1044 | factory->container(QLatin1String("notebook_toolbar"), this)->hide(); |
| 1045 | #endif |
| 1046 | } |
| 1047 | |
| 1048 | updateTitleBar(); |
| 1049 | |
| 1050 | // undo/redo actions are disabled in both cases - when the project is closed or opened |
| 1051 | m_undoAction->setEnabled(false); |
| 1052 | m_redoAction->setEnabled(false); |
| 1053 | } |
| 1054 | |
| 1055 | bool hasAction(const QList<QAction*>& actions) { |
| 1056 | for (const auto* action : actions) { |
nothing calls this directly
no test coverage detected