From 1b3f2384efe3747051edeb995ad8bc1510ff14de Mon Sep 17 00:00:00 2001 From: joachimhgg <48200998+joachimhgg@users.noreply.github.com> Date: Fri, 17 Dec 2021 18:23:36 +0100 Subject: [PATCH] Fix-wiki-link (#4049) * fix blogpost * fix updated dialog * add wiki log --- docs/blog/Webots-2022-a-release.md | 2 +- src/webots/engine/WbSimulationWorld.cpp | 7 +++++++ src/webots/gui/WbUpdatedDialog.cpp | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/blog/Webots-2022-a-release.md b/docs/blog/Webots-2022-a-release.md index feb73a1e65b..be39e2fb4fe 100644 --- a/docs/blog/Webots-2022-a-release.md +++ b/docs/blog/Webots-2022-a-release.md @@ -42,7 +42,7 @@ We worked hard to convert all PROTOs and worlds distributed with Webots for you, A mechanism of backward compatibility has been implemented directly in Webots. Unfortunately, it was not possible to make it work in every cases. It will try to convert worlds and PROTOs at runtime, but PROTO changes cannot be saved. -We also wrote a [guide](https://github.com/cyberbotics/webots/wiki/FLU-and-ENU-conversion-guide) to help you convert your own PROTOs and worlds to use them in Webots R2022a. +We also wrote a [guide](https://github.com/cyberbotics/webots/wiki/How-to-adapt-your-world-or-PROTO-to-Webots-R2022a) to help you convert your own PROTOs and worlds to use them in Webots R2022a. We are aware that it is a major change and it can be annoying to convert your worlds and PROTOs to the new format. However, it is a worthwhile effort, especially if you work with ROS. diff --git a/src/webots/engine/WbSimulationWorld.cpp b/src/webots/engine/WbSimulationWorld.cpp index 4f7f74dfa0f..4d5d6f907ee 100644 --- a/src/webots/engine/WbSimulationWorld.cpp +++ b/src/webots/engine/WbSimulationWorld.cpp @@ -16,6 +16,7 @@ #include "WbBoundingSphere.hpp" #include "WbDownloader.hpp" +#include "WbLog.hpp" #include "WbMassChecker.hpp" #include "WbNodeOperations.hpp" #include "WbNodeUtilities.hpp" @@ -34,6 +35,7 @@ #include "WbSimulationState.hpp" #include "WbSoundEngine.hpp" #include "WbTemplateManager.hpp" +#include "WbTokenizer.hpp" #include "WbViewpoint.hpp" #include "WbWrenRenderingContext.hpp" @@ -139,6 +141,11 @@ WbSimulationWorld::WbSimulationWorld(WbProtoList *protos, WbTokenizer *tokenizer connect(worldInfo(), &WbWorldInfo::optimalThreadCountChanged, this, &WbSimulationWorld::updateNumberOfThreads); connect(worldInfo(), &WbWorldInfo::randomSeedChanged, this, &WbSimulationWorld::updateRandomSeed); + if (WbTokenizer::worldFileVersion() < WbVersion(2021, 1, 1)) + WbLog::info(tr("You are using a world from an old version of Webots. The backwards compability algorithm will try to " + "convert it. Refer to the wiki for more information: " + "https://github.com/cyberbotics/webots/wiki/How-to-adapt-your-world-or-PROTO-to-Webots-R2022a")); + WbNodeUtilities::fixBackwardCompatibility(WbWorld::instance()->root()); } diff --git a/src/webots/gui/WbUpdatedDialog.cpp b/src/webots/gui/WbUpdatedDialog.cpp index 5d6e0fadc52..c041821d897 100644 --- a/src/webots/gui/WbUpdatedDialog.cpp +++ b/src/webots/gui/WbUpdatedDialog.cpp @@ -51,8 +51,8 @@ WbUpdatedDialog::WbUpdatedDialog(QWidget *parent) : QDialog(parent) { "If your previous world or PROTO files include devices, geometries, or Webots PROTOs, " "then Webots will try to preserve the old behavior by rotating them. However, you may have to rotate some objects, " "fix bounding objects or adjust your controller by yourself.
Refer to the < a style = 'color: #5DADE2;' " - "href='https://github.com/cyberbotics/webots/wiki/" - "FLU-and-ENU-conversion-guide'>wiki for more information.

")); + "href='https://github.com/cyberbotics/webots/wiki/How-to-adapt-your-world-or-PROTO-to-Webots-R2022a'>wiki for more " + "information.

")); label->setOpenExternalLinks(true); label->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignTop); label->setStyleSheet("border: none");