Skip to content

Commit

Permalink
Exercise manipulations (#1685)
Browse files Browse the repository at this point in the history
* Don't change start position if item is not editable
* Reset draw action when reloading world model
* Lupdate
  • Loading branch information
IKhonakhbeeva authored Oct 23, 2023
1 parent b3d33cb commit 60bf9c5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class TWO_D_MODEL_EXPORT TwoDModelWidget : public QWidget

void setBackgroundMode();
void bringToFront();
void resetDrawAction();

QString editorId() const override;
bool supportsZooming() const override;
Expand Down
8 changes: 5 additions & 3 deletions plugins/robots/common/twoDModel/src/engine/items/ballItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ QPainterPath BallItem::shape() const

void BallItem::saveStartPosition()
{
mStartPosition = pos();
mStartRotation = rotation();
emit x1Changed(x1());
if (this->editable()) {
mStartPosition = pos();
mStartRotation = rotation();
emit x1Changed(x1());
}
}

void BallItem::returnToStartPosition()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ void SkittleItem::deserialize(const QDomElement &element)

void SkittleItem::saveStartPosition()
{
mStartPosition = pos();
mStartRotation = rotation();
emit x1Changed(x1());
if (this->editable()) {
mStartPosition = pos();
mStartRotation = rotation();
emit x1Changed(x1());
}
}

void SkittleItem::returnToStartPosition()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void TwoDModelEngineFacade::init(const kitBase::EventsForKitPluginInterface &eve
}

mView->loadXmls(worldModel);
mView->resetDrawAction();

loadReadOnlyFlags(logicalModel);
QLOG_DEBUG() << "Reloading 2D world done";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ void TwoDModelWidget::initPalette()
connect(imageTool, &QAction::triggered, this, [this](){ mUi->palette->unselect(); });
}

void TwoDModelWidget::resetDrawAction()
{
mUi->palette->unselect();
}

void TwoDModelWidget::initDetailsTab()
{
}
Expand Down
4 changes: 2 additions & 2 deletions qrtranslations/fr/plugins/robots/twoDModel_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
<context>
<name>twoDModel::engine::TwoDModelEngineFacade</name>
<message>
<location filename="../../../../plugins/robots/common/twoDModel/src/engine/twoDModelEngineFacade.cpp" line="+189"/>
<location filename="../../../../plugins/robots/common/twoDModel/src/engine/twoDModelEngineFacade.cpp" line="+190"/>
<source>Realistic physics&apos; must be turned on to enjoy skittles and balls</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -728,7 +728,7 @@
<context>
<name>twoDModel::view::TwoDModelWidget</name>
<message>
<location filename="../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="+318"/>
<location filename="../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="+323"/>
<source>Warning</source>
<translation>Attention</translation>
</message>
Expand Down
4 changes: 2 additions & 2 deletions qrtranslations/ru/plugins/robots/twoDModel_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@
<context>
<name>twoDModel::engine::TwoDModelEngineFacade</name>
<message>
<location filename="../../../../plugins/robots/common/twoDModel/src/engine/twoDModelEngineFacade.cpp" line="+189"/>
<location filename="../../../../plugins/robots/common/twoDModel/src/engine/twoDModelEngineFacade.cpp" line="+190"/>
<source>Realistic physics&apos; must be turned on to enjoy skittles and balls</source>
<translation>Реалистичная физика должна быть включена для взаимодействия с кеглями и мячами</translation>
</message>
Expand Down Expand Up @@ -1071,7 +1071,7 @@
<context>
<name>twoDModel::view::TwoDModelWidget</name>
<message>
<location filename="../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="+318"/>
<location filename="../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="+323"/>
<source>Warning</source>
<translation>Предупреждение</translation>
</message>
Expand Down

0 comments on commit 60bf9c5

Please sign in to comment.