From 4db79fc47f277698a7826ad0387b5029e9c5ba2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr> Date: Mon, 6 May 2019 15:57:31 +0200 Subject: [PATCH] ENH: add a deprecation status label for deprecated applications in QtWidgetMainWindow --- Modules/Wrappers/QtWidget/src/appmainwindow.ui | 7 +++++++ .../QtWidget/src/otbWrapperQtWidgetMainWindow.cxx | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Modules/Wrappers/QtWidget/src/appmainwindow.ui b/Modules/Wrappers/QtWidget/src/appmainwindow.ui index c376f1984f..45afb83aaf 100644 --- a/Modules/Wrappers/QtWidget/src/appmainwindow.ui +++ b/Modules/Wrappers/QtWidget/src/appmainwindow.ui @@ -34,6 +34,13 @@ <property name="bottomMargin"> <number>12</number> </property> + <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QLabel" name="deprecation"> + <property name="text"> + <string>Deprecation status</string> + </property> + </widget> + </item> <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetMainWindow.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetMainWindow.cxx index 93c3f459e2..f881e89988 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetMainWindow.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetMainWindow.cxx @@ -70,6 +70,18 @@ QtMainWindow::QtMainWindow(Application::Pointer app, QtWidgetView* gui, QWidget* // Setup the progress bar to observe the model ui->progressBar->SetModel(gui->GetModel()); + // Fill and display the deprecation status label if needed, or hide it. + if (app->IsDeprecated()) + { + ui->deprecation->setVisible(true); + ui->deprecation->setText("<font color='red'>This application is deprecated and will be removed in a future release.</font>"); + } + else + { + ui->deprecation->setVisible(false); + ui->deprecation->setText(""); + } + // Connect application progress text to the QLabel connect(ui->progressBar, &QtWidgetSimpleProgressReport::SetText, ui->message, &QLabel::setText); -- GitLab