diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx index 55993f9a5ddfec0dbbaa79b3ca99338c130a9899..075b15b31d2f0240c23d74fbdd919d064aa06845 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx @@ -47,7 +47,7 @@ void QtWidgetView::CreateGui() // Create a VBoxLayout with the header, the input widgets, and the footer QVBoxLayout *mainLayout = new QVBoxLayout(); QTabWidget *tab = new QTabWidget(); - + tab->addTab(CreateInputWidgets(), "Parameters"); QTextEdit *log = new QTextEdit(); connect( m_Model->GetLogOutput(), SIGNAL(NewContentLog(QString)), log, SLOT(append(QString) ) ); @@ -58,8 +58,13 @@ void QtWidgetView::CreateGui() tab->addTab(CreateDoc(), "Documentation"); mainLayout->addWidget(tab); + m_Message = new QLabel("<center><font color=\"#FF0000\">Select parameters</font></center>"); + connect( m_Model, SIGNAL(SetApplicationReady(bool)), this, SLOT(UpdateMessageAfterApplicationReady(bool)) ); + mainLayout->addWidget(m_Message); + QtWidgetSimpleProgressReport * progressReport = new QtWidgetSimpleProgressReport(m_Model); progressReport->SetApplication(m_Application); + QHBoxLayout *footLayout = new QHBoxLayout; footLayout->addWidget(progressReport); footLayout->addWidget(CreateFooter()); @@ -75,6 +80,18 @@ void QtWidgetView::CreateGui() this->setLayout(finalLayout); } +void QtWidgetView::UpdateMessageAfterExcuteClicked() +{ + m_Message->setText("<center><font color=\"#FF0000\">Running</font></center>"); +} + +void QtWidgetView::UpdateMessageAfterApplicationReady( bool val ) +{ + if(val == true) + m_Message->setText("<center><font color=\"#00FF00\">Ready to run</font></center>"); + else + m_Message->setText("<center><font color=\"#FF0000\">Select parameters</font></center>"); +} QWidget* QtWidgetView::CreateInputWidgets() { @@ -105,6 +122,7 @@ QWidget* QtWidgetView::CreateFooter() m_ExecButton->setText(QObject::tr("Execute")); connect( m_ExecButton, SIGNAL(clicked()), m_Model, SLOT(ExecuteAndWriteOutputSlot() ) ); connect( m_Model, SIGNAL(SetApplicationReady(bool)), m_ExecButton, SLOT(setEnabled(bool)) ); + connect( m_ExecButton, SIGNAL(clicked()), this, SLOT(UpdateMessageAfterExcuteClicked() ) ); m_QuitButton = new QPushButton(footerGroup); m_QuitButton->setText(QObject::tr("Quit")); diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h index a799527062a6df93c2c4b877cb81d6f2bafed721..af03f7d658a00e0756f377f70be28d7f7cc7454d 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h @@ -48,6 +48,10 @@ public: public slots: void CloseSlot(); +private slots: + void UpdateMessageAfterExcuteClicked(); + void UpdateMessageAfterApplicationReady(bool val); + signals: void QuitSignal(); @@ -77,6 +81,7 @@ private: QPushButton* m_ExecButton; QPushButton* m_QuitButton; + QLabel* m_Message; };