@@ -423,6 +423,36 @@ ThreeDViewer* MainWindow::getThreeDViewer()
423423}
424424#endif
425425
426+ /* !
427+ * \brief MainWindow::isModelingPerspectiveActive
428+ * Returns true if the Modeling perspective is active.
429+ * \return
430+ */
431+ bool MainWindow::isModelingPerspectiveActive ()
432+ {
433+ return mpPerspectiveTabbar->currentIndex () == 1 ;
434+ }
435+
436+ /* !
437+ * \brief MainWindow::isPlottingPerspectiveActive
438+ * Returns true if the Plotting perspective is active.
439+ * \return
440+ */
441+ bool MainWindow::isPlottingPerspectiveActive ()
442+ {
443+ return mpPerspectiveTabbar->currentIndex () == 2 ;
444+ }
445+
446+ /* !
447+ * \brief MainWindow::isDebuggingPerspectiveActive
448+ * Returns true if the Debugging perspective is active.
449+ * \return
450+ */
451+ bool MainWindow::isDebuggingPerspectiveActive ()
452+ {
453+ return mpPerspectiveTabbar->currentIndex () == 3 ;
454+ }
455+
426456/* !
427457 * \brief MainWindow::addRecentFile
428458 * Adds the currently opened file to the recentFilesList settings.
@@ -648,7 +678,7 @@ void MainWindow::openResultFiles(QStringList fileNames)
648678 QFileInfo fileInfo (fileName);
649679 QStringList list = mpOMCProxy->readSimulationResultVars (fileInfo.absoluteFilePath ());
650680 if (list.size () > 0 ) {
651- mpPerspectiveTabbar-> setCurrentIndex ( 2 );
681+ switchToPlottingPerspectiveSlot ( );
652682 mpVariablesWidget->insertVariablesItemsToTree (fileInfo.fileName (), fileInfo.absoluteDir ().absolutePath (), list, SimulationOptions ());
653683 }
654684 }
@@ -1432,6 +1462,46 @@ void MainWindow::showMessagesBrowser()
14321462 }
14331463}
14341464
1465+ /* !
1466+ * \brief MainWindow::switchToWelcomePerspectiveSlot
1467+ * Slot activated when Ctrl+f1 is clicked.
1468+ * Switches to welcome perspective.
1469+ */
1470+ void MainWindow::switchToWelcomePerspectiveSlot ()
1471+ {
1472+ mpPerspectiveTabbar->setCurrentIndex (0 );
1473+ }
1474+
1475+ /* !
1476+ * \brief MainWindow::switchToModelingPerspectiveSlot
1477+ * Slot activated when Ctrl+f2 is clicked.
1478+ * Switches to modeling perspective.
1479+ */
1480+ void MainWindow::switchToModelingPerspectiveSlot ()
1481+ {
1482+ mpPerspectiveTabbar->setCurrentIndex (1 );
1483+ }
1484+
1485+ /* !
1486+ * \brief MainWindow::switchToPlottingPerspectiveSlot
1487+ * Slot activated when Ctrl+f3 is clicked.
1488+ * Switches to plotting perspective.
1489+ */
1490+ void MainWindow::switchToPlottingPerspectiveSlot ()
1491+ {
1492+ mpPerspectiveTabbar->setCurrentIndex (2 );
1493+ }
1494+
1495+ /* !
1496+ * \brief MainWindow::switchToAlgorithmicDebuggingPerspectiveSlot
1497+ * Slot activated when Ctrl+f5 is clicked.
1498+ * Switches to algorithmic debugging perspective.
1499+ */
1500+ void MainWindow::switchToAlgorithmicDebuggingPerspectiveSlot ()
1501+ {
1502+ mpPerspectiveTabbar->setCurrentIndex (3 );
1503+ }
1504+
14351505/* !
14361506 * \brief MainWindow::showSearchBrowser
14371507 * Shows the Search Browser, selects the search text if any and sets the focus on it.
@@ -2982,46 +3052,6 @@ void MainWindow::autoSave()
29823052 autoSaveHelper (mpLibraryWidget->getLibraryTreeModel ()->getRootLibraryTreeItem ());
29833053}
29843054
2985- /* !
2986- * \brief MainWindow::switchToWelcomePerspectiveSlot
2987- * Slot activated when Ctrl+f1 is clicked.
2988- * Switches to welcome perspective.
2989- */
2990- void MainWindow::switchToWelcomePerspectiveSlot ()
2991- {
2992- mpPerspectiveTabbar->setCurrentIndex (0 );
2993- }
2994-
2995- /* !
2996- * \brief MainWindow::switchToModelingPerspectiveSlot
2997- * Slot activated when Ctrl+f2 is clicked.
2998- * Switches to modeling perspective.
2999- */
3000- void MainWindow::switchToModelingPerspectiveSlot ()
3001- {
3002- mpPerspectiveTabbar->setCurrentIndex (1 );
3003- }
3004-
3005- /* !
3006- * \brief MainWindow::switchToPlottingPerspectiveSlot
3007- * Slot activated when Ctrl+f3 is clicked.
3008- * Switches to plotting perspective.
3009- */
3010- void MainWindow::switchToPlottingPerspectiveSlot ()
3011- {
3012- mpPerspectiveTabbar->setCurrentIndex (2 );
3013- }
3014-
3015- /* !
3016- * \brief MainWindow::switchToAlgorithmicDebuggingPerspectiveSlot
3017- * Slot activated when Ctrl+f5 is clicked.
3018- * Switches to algorithmic debugging perspective.
3019- */
3020- void MainWindow::switchToAlgorithmicDebuggingPerspectiveSlot ()
3021- {
3022- mpPerspectiveTabbar->setCurrentIndex (3 );
3023- }
3024-
30253055/* !
30263056 * \brief MainWindow::showDebugConfigurationsDialog
30273057 * Slot activated when mpDebugConfigurationsAction triggered signal is raised.\n
0 commit comments