Skip to content

Commit 57f572a

Browse files
authored
Use the scene settings after loading the interpreterCoreDefaultSettings.ini in SettingsManager, not when initializing the plugin (#2113)
* Use the scene settings after loading the interpreterCoreDefaultSettings in SettingsManager, not when initializing the plugin * Lupdate
1 parent cd1bdfa commit 57f572a

7 files changed

Lines changed: 30 additions & 27 deletions

File tree

plugins/robots/common/twoDModel/src/engine/view/parts/gridParameters.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ GridParameters::GridParameters(QWidget *parent)
4848
connect(mShowGridCheckBox, &QAbstractButton::toggled, mCellSize, &QWidget::setEnabled);
4949
connect(mShowGridCheckBox, &QAbstractButton::toggled, this, &GridParameters::showGrid);
5050
connect(mCellSize, &QAbstractSlider::valueChanged, this, &GridParameters::setCellSize);
51-
52-
const bool showGrid = qReal::SettingsManager::value("2dShowGrid").toBool();
53-
const qreal gridSize = qReal::SettingsManager::value("2dDefaultGridCellSize").toReal();
54-
mShowGridCheckBox->setChecked(showGrid);
55-
mCellSize->setValue(qRound(gridSize * scale));
5651
setLayout(layout);
5752

5853
// Bring the slider values closer to the step values (which should ideally be 0.1 of the unit of measurement)
@@ -89,6 +84,12 @@ void GridParameters::onGridParametersChangedOutside(qreal newCellSize)
8984

9085
GridParameters::~GridParameters() = default;
9186

87+
void GridParameters::setChecked(bool isGridEnabled)
88+
{
89+
mShowGridCheckBox->setChecked(isGridEnabled);
90+
showGrid(isGridEnabled);
91+
}
92+
9293
void GridParameters::showGrid(bool isGridEnabled)
9394
{
9495
qReal::SettingsManager::setValue("2dShowGrid", isGridEnabled);

plugins/robots/common/twoDModel/src/engine/view/parts/gridParameters.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class GridParameters : public QFrame
3434

3535
public Q_SLOTS:
3636
void showGrid(bool isGridEnabled);
37+
void setChecked(bool isGridEnabled);
3738
void setCellSize(int cellSizeValue);
3839
void onGridParametersChangedOutside(qreal newCellSize);
3940
void onSizeUnitChanged(const QSharedPointer<twoDModel::model::SizeUnit> &unit);

plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ void TwoDModelWidget::onFirstShow()
532532
enableRobotFollowing(SettingsManager::value("2dFollowingRobot").toBool());
533533
setCursorType(static_cast<CursorType>(SettingsManager::value("2dCursorType").toInt()));
534534
setDetailsVisibility(SettingsManager::value("2d_detailsVisible").toBool());
535+
mUi->gridParametersBox->setChecked(qReal::SettingsManager::value("2dShowGrid").toBool());
535536
}
536537

537538
void TwoDModelWidget::centerOnRobot()

qrtranslations/es/plugins/robots/common/twoDModel_es.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,45 +1034,45 @@
10341034
<translation>Modo verificación: la solución será comprobada, se informará de errores</translation>
10351035
</message>
10361036
<message>
1037-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="554"/>
1037+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="555"/>
10381038
<source>Saving world and robot model</source>
10391039
<translation>Guardando modelo del mundo y del robot</translation>
10401040
</message>
10411041
<message>
1042-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="554"/>
1043-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="574"/>
1044-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="599"/>
1042+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="555"/>
1043+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="575"/>
1044+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="600"/>
10451045
<source>2D model saves (*.xml)</source>
10461046
<translation>Guardados del modelo 2D (*.xml)</translation>
10471047
</message>
10481048
<message>
1049-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="574"/>
1049+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="575"/>
10501050
<source>Loading world and robot model</source>
10511051
<translation>Cargando modelo del mundo y del robot</translation>
10521052
</message>
10531053
<message>
1054-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="599"/>
1054+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="600"/>
10551055
<source>Loading world without robot model</source>
10561056
<translation>Cargando modelo del mundo sin modelo de robot</translation>
10571057
</message>
10581058
<message>
1059-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="935"/>
1059+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="936"/>
10601060
<source>Hide details</source>
10611061
<translation>Ocultar detalles</translation>
10621062
</message>
10631063
<message>
1064-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="935"/>
1064+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="936"/>
10651065
<source>Show details</source>
10661066
<translation>Mostrar detalles</translation>
10671067
</message>
10681068
<message>
1069-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1144"/>
10701069
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1145"/>
1070+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1146"/>
10711071
<source>No wheel</source>
10721072
<translation>Ausente</translation>
10731073
</message>
10741074
<message>
1075-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1151"/>
1075+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1152"/>
10761076
<source>%1 (port %2)</source>
10771077
<translation>%1 (puerto %2)</translation>
10781078
</message>

qrtranslations/fr/plugins/robots/common/twoDModel_fr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@
10501050
<translation>Mode vérification : la solution sera vérifiée, les erreurs seront signalées</translation>
10511051
</message>
10521052
<message>
1053-
<location line="+62"/>
1053+
<location line="+63"/>
10541054
<source>Saving world and robot model</source>
10551055
<translation>Enregistrement des modèles du monde et du robot</translation>
10561056
</message>

qrtranslations/ru/plugins/robots/common/twoDModel_ru.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@
14011401
<translation>Режим проверки: проверка решения будет осуществляться, об ошибках будет сообщаться</translation>
14021402
</message>
14031403
<message>
1404-
<location line="+62"/>
1404+
<location line="+63"/>
14051405
<source>Saving world and robot model</source>
14061406
<translation>Сохранение модели мира</translation>
14071407
</message>

qrtranslations/vi/plugins/robots/common/twoDModel_vi.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,45 +1034,45 @@
10341034
<translation>Chế độ kiểm tra: lời giải sẽ được kiểm tra, các lỗi sẽ được báo cáo</translation>
10351035
</message>
10361036
<message>
1037-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="554"/>
1037+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="555"/>
10381038
<source>Saving world and robot model</source>
10391039
<translation>Đang lưu mô hình thế giới và robot</translation>
10401040
</message>
10411041
<message>
1042-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="554"/>
1043-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="574"/>
1044-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="599"/>
1042+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="555"/>
1043+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="575"/>
1044+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="600"/>
10451045
<source>2D model saves (*.xml)</source>
10461046
<translation>Tệp lưu mô hình 2D (*.xml)</translation>
10471047
</message>
10481048
<message>
1049-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="574"/>
1049+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="575"/>
10501050
<source>Loading world and robot model</source>
10511051
<translation>Đang tải mô hình thế giới và robot</translation>
10521052
</message>
10531053
<message>
1054-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="599"/>
1054+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="600"/>
10551055
<source>Loading world without robot model</source>
10561056
<translation>Đang tải mô hình thế giới mà không có mô hình robot</translation>
10571057
</message>
10581058
<message>
1059-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="935"/>
1059+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="936"/>
10601060
<source>Hide details</source>
10611061
<translation>Ẩn chi tiết</translation>
10621062
</message>
10631063
<message>
1064-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="935"/>
1064+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="936"/>
10651065
<source>Show details</source>
10661066
<translation>Hiển thị chi tiết</translation>
10671067
</message>
10681068
<message>
1069-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1144"/>
10701069
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1145"/>
1070+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1146"/>
10711071
<source>No wheel</source>
10721072
<translation>Không có bánh xe</translation>
10731073
</message>
10741074
<message>
1075-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1151"/>
1075+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp" line="1152"/>
10761076
<source>%1 (port %2)</source>
10771077
<translation>%1 (cổng %2)</translation>
10781078
</message>

0 commit comments

Comments
 (0)