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.
  • Loading branch information
peci1 authored Nov 19, 2024
1 parent 9aefb58 commit a020ddf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
7 changes: 7 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,11 @@
void gazebo_shared::printVersion()
{
fprintf(stderr, "%s", GAZEBO_VERSION_HEADER);

char *ignoreEol = 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);
char *ignoreEol = 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 a020ddf

Please sign in to comment.