diff --git a/plugins/robots/checker/twoDModelRunner/runner.cpp b/plugins/robots/checker/twoDModelRunner/runner.cpp index 4184b98355..9d8b86976a 100644 --- a/plugins/robots/checker/twoDModelRunner/runner.cpp +++ b/plugins/robots/checker/twoDModelRunner/runner.cpp @@ -80,11 +80,12 @@ bool Runner::interpret(const QString &saveFile, const bool background /// GUI must be separated from logic and not appear here at all. QList twoDModelWindows; for (auto &&widget : QApplication::allWidgets()) { - if (background) { - widget->hide(); - } if (const auto twoDModelWindow = dynamic_cast(widget)) { twoDModelWindows << twoDModelWindow; + if (background) { + twoDModelWindow->setBackgroundMode(); + twoDModelWindow->hide(); + } } } diff --git a/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h b/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h index 3226b27050..79294ee049 100644 --- a/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h +++ b/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h @@ -99,6 +99,8 @@ class TWO_D_MODEL_EXPORT TwoDModelWidget : public QWidget /// In a compact mode 2D model window has less controls, they may seem in another way. void setCompactMode(bool enabled); + void setBackgroundMode(); + QString editorId() const override; bool supportsZooming() const override; void configure(QAction &zoomIn, QAction &zoomOut, QAction &undo, QAction &redo, QAction ©, QAction &paste @@ -259,6 +261,8 @@ private slots: bool mSensorsReadOnly {}; bool mRobotPositionReadOnly {}; + + bool mBackgroundMode {false}; }; } diff --git a/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp b/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp index a50334e9c1..b34f6dac05 100644 --- a/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp +++ b/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp @@ -953,6 +953,11 @@ void TwoDModelWidget::onDeviceConfigurationChanged(const QString &robotId } } +void TwoDModelWidget::setBackgroundMode() +{ + mBackgroundMode = true; +} + void TwoDModelWidget::bringToFront() { #ifdef Q_OS_DARWIN @@ -962,6 +967,10 @@ void TwoDModelWidget::bringToFront() return; #endif + if (mBackgroundMode) { + return; + } + if (isHidden()) { show(); } diff --git a/qrtranslations/fr/plugins/robots/twoDModelRunner_fr.ts b/qrtranslations/fr/plugins/robots/twoDModelRunner_fr.ts index 1b9f1c872b..deb6328dc9 100644 --- a/qrtranslations/fr/plugins/robots/twoDModelRunner_fr.ts +++ b/qrtranslations/fr/plugins/robots/twoDModelRunner_fr.ts @@ -67,7 +67,7 @@ In background mode the session will be terminated just after the execution ended twoDModel::Runner - + Robot console diff --git a/qrtranslations/fr/plugins/robots/twoDModel_fr.ts b/qrtranslations/fr/plugins/robots/twoDModel_fr.ts index 726ac50780..3c479f8543 100644 --- a/qrtranslations/fr/plugins/robots/twoDModel_fr.ts +++ b/qrtranslations/fr/plugins/robots/twoDModel_fr.ts @@ -749,7 +749,7 @@ - + No wheel Pas de roue diff --git a/qrtranslations/ru/plugins/robots/twoDModelRunner_ru.ts b/qrtranslations/ru/plugins/robots/twoDModelRunner_ru.ts index 8eb37c77c1..2034d86fb9 100644 --- a/qrtranslations/ru/plugins/robots/twoDModelRunner_ru.ts +++ b/qrtranslations/ru/plugins/robots/twoDModelRunner_ru.ts @@ -69,7 +69,7 @@ In background mode the session will be terminated just after the execution ended twoDModel::Runner - + Robot console Консоль робота diff --git a/qrtranslations/ru/plugins/robots/twoDModel_ru.ts b/qrtranslations/ru/plugins/robots/twoDModel_ru.ts index 95c405c194..c09c3fab1f 100644 --- a/qrtranslations/ru/plugins/robots/twoDModel_ru.ts +++ b/qrtranslations/ru/plugins/robots/twoDModel_ru.ts @@ -1100,7 +1100,7 @@ Показать детали - + No wheel Отсутствует