Skip to content

Commit

Permalink
Added environment variable GAZEBO_SUPPRESS_EOL_WARNING that disables …
Browse files Browse the repository at this point in the history
…EOL notices. (#3406)

Signed-off-by: Martin Pecka <[email protected]>
  • Loading branch information
peci1 authored Nov 25, 2024
1 parent 9aefb58 commit b360002
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
8 changes: 8 additions & 0 deletions gazebo/gazebo_shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*
*/
#include <cstdlib>

#include <sdf/sdf.hh>

#include "gazebo/transport/TransportIface.hh"
Expand All @@ -27,6 +29,12 @@
void gazebo_shared::printVersion()
{
fprintf(stderr, "%s", GAZEBO_VERSION_HEADER);

const char *ignoreEol =
gazebo::common::getEnv("GAZEBO_SUPPRESS_EOL_WARNING");
if (ignoreEol != nullptr && strncmp(ignoreEol, "1", 1) == 0)
return;

const char* msg = R"(
# # ####### ####### ### ##### #######
## # # # # # # # #
Expand Down
21 changes: 12 additions & 9 deletions gazebo/gui/MainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1678,15 +1678,18 @@ void MainWindow::ShowMenuBar(QMenuBar *_bar)
this->dataPtr->menuLayout->addWidget(this->dataPtr->menuBar);

if (!this->dataPtr->eolNotice) {
// Add Gazebo classic EOL notice label
this->dataPtr->eolNotice = new QLabel(this->dataPtr->menuBar);
this->dataPtr->eolNotice->setText(R"(<font color='#ff9966'>
This version of Gazebo reaches end-of-life in January 2025.
Consider <a style='color: #ffcc00'
href='https://gazebosim.org/docs/latest/gazebo_classic_migration/
'>migrating to the new Gazebo</a></font>)");
this->dataPtr->menuLayout->addStretch(1);
this->dataPtr->menuLayout->addWidget(this->dataPtr->eolNotice);
const char *ignoreEol = common::getEnv("GAZEBO_SUPPRESS_EOL_WARNING");
if (ignoreEol == nullptr || strncmp(ignoreEol, "1", 1) != 0) {
// Add Gazebo classic EOL notice label
this->dataPtr->eolNotice = new QLabel(this->dataPtr->menuBar);
this->dataPtr->eolNotice->setText(R"(<font color='#ff9966'>
This version of Gazebo reaches end-of-life in January 2025.
Consider <a style='color: #ffcc00'
href='https://gazebosim.org/docs/latest/gazebo_classic_migration/
'>migrating to the new Gazebo</a></font>)");
this->dataPtr->menuLayout->addStretch(1);
this->dataPtr->menuLayout->addWidget(this->dataPtr->eolNotice);
}
}


Expand Down

0 comments on commit b360002

Please sign in to comment.