Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions plugins/robots/checker/twoDModelRunner/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<view::TwoDModelWidget *> twoDModelWindows;
for (auto &&widget : QApplication::allWidgets()) {
if (background) {
widget->hide();
}
if (const auto twoDModelWindow = dynamic_cast<view::TwoDModelWidget *>(widget)) {
twoDModelWindows << twoDModelWindow;
if (background) {
twoDModelWindow->setBackgroundMode();
twoDModelWindow->hide();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 &copy, QAction &paste
Expand Down Expand Up @@ -259,6 +261,8 @@ private slots:

bool mSensorsReadOnly {};
bool mRobotPositionReadOnly {};

bool mBackgroundMode {false};
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,11 @@ void TwoDModelWidget::onDeviceConfigurationChanged(const QString &robotId
}
}

void TwoDModelWidget::setBackgroundMode()
{
mBackgroundMode = true;
}

void TwoDModelWidget::bringToFront()
{
#ifdef Q_OS_DARWIN
Expand All @@ -962,6 +967,10 @@ void TwoDModelWidget::bringToFront()
return;
#endif

if (mBackgroundMode) {
return;
}

if (isHidden()) {
show();
}
Expand Down
2 changes: 1 addition & 1 deletion qrtranslations/fr/plugins/robots/twoDModelRunner_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ In background mode the session will be terminated just after the execution ended
<context>
<name>twoDModel::Runner</name>
<message>
<location filename="../../../../plugins/robots/checker/twoDModelRunner/runner.cpp" line="+171"/>
<location filename="../../../../plugins/robots/checker/twoDModelRunner/runner.cpp" line="+172"/>
<source>Robot console</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion qrtranslations/fr/plugins/robots/twoDModel_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+159"/>
<location line="+168"/>
<location line="+1"/>
<source>No wheel</source>
<translation>Pas de roue</translation>
Expand Down
2 changes: 1 addition & 1 deletion qrtranslations/ru/plugins/robots/twoDModelRunner_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ In background mode the session will be terminated just after the execution ended
<context>
<name>twoDModel::Runner</name>
<message>
<location filename="../../../../plugins/robots/checker/twoDModelRunner/runner.cpp" line="+171"/>
<location filename="../../../../plugins/robots/checker/twoDModelRunner/runner.cpp" line="+172"/>
<source>Robot console</source>
<translation>Консоль робота</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion qrtranslations/ru/plugins/robots/twoDModel_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@
<translation>Показать детали</translation>
</message>
<message>
<location line="+159"/>
<location line="+168"/>
<location line="+1"/>
<source>No wheel</source>
<translation>Отсутствует</translation>
Expand Down