From 8acb17b06853ca8cafa01c136a99e47def817d1e Mon Sep 17 00:00:00 2001 From: Armel Thoni Date: Fri, 14 Apr 2023 16:21:56 +0200 Subject: [PATCH] Devstudio improvements for ware board and migration * improved stylecheck compliance for ware board and migration * added functional board refresh after file/folder delete from ware explorer * unified strings for ware migration * changed interace structure for board --- src/apps/openfluid-devstudio/MainWindow.cpp | 2 + src/openfluid/ui/config.hpp.in | 6 + src/openfluid/ui/waresdev/CMakeLists.txt | 13 +- .../ui/waresdev/GroupStatusMessagesWidget.cpp | 105 ------ .../ui/waresdev/GroupStatusMessagesWidget.hpp | 88 ----- .../ui/waresdev/GroupStatusMessagesWidget.ui | 42 --- .../ui/waresdev/MigrationSetupDialog.cpp | 4 +- .../ui/waresdev/SignalMigrationListener.hpp | 255 -------------- .../ui/waresdev/WareDashboardStatusWidget.cpp | 232 ------------- .../ui/waresdev/WareMigrationListener.cpp | 324 ++++++++++++++++++ .../ui/waresdev/WareMigrationListener.hpp | 139 ++++++++ src/openfluid/ui/waresdev/WareSrcExplorer.cpp | 25 +- src/openfluid/ui/waresdev/WareSrcExplorer.hpp | 2 + src/openfluid/ui/waresdev/WareSrcWidget.cpp | 22 +- src/openfluid/ui/waresdev/WareSrcWidget.hpp | 11 +- .../ui/waresdev/WareSrcWidgetCollection.cpp | 150 ++++---- .../ui/waresdev/WareSrcWidgetCollection.hpp | 21 +- .../ui/waresdev/WareStatusDashboardWidget.cpp | 224 ++++++++++++ ...dget.hpp => WareStatusDashboardWidget.hpp} | 30 +- ...Widget.ui => WareStatusDashboardWidget.ui} | 77 +++-- ...ageWidget.cpp => WareStatusItemWidget.cpp} | 75 ++-- ...ageWidget.hpp => WareStatusItemWidget.hpp} | 22 +- ...ssageWidget.ui => WareStatusItemWidget.ui} | 4 +- 23 files changed, 981 insertions(+), 892 deletions(-) delete mode 100644 src/openfluid/ui/waresdev/GroupStatusMessagesWidget.cpp delete mode 100644 src/openfluid/ui/waresdev/GroupStatusMessagesWidget.hpp delete mode 100644 src/openfluid/ui/waresdev/GroupStatusMessagesWidget.ui delete mode 100644 src/openfluid/ui/waresdev/SignalMigrationListener.hpp delete mode 100644 src/openfluid/ui/waresdev/WareDashboardStatusWidget.cpp create mode 100644 src/openfluid/ui/waresdev/WareMigrationListener.cpp create mode 100644 src/openfluid/ui/waresdev/WareMigrationListener.hpp create mode 100644 src/openfluid/ui/waresdev/WareStatusDashboardWidget.cpp rename src/openfluid/ui/waresdev/{WareDashboardStatusWidget.hpp => WareStatusDashboardWidget.hpp} (72%) rename src/openfluid/ui/waresdev/{WareDashboardStatusWidget.ui => WareStatusDashboardWidget.ui} (71%) rename src/openfluid/ui/waresdev/{StatusButtonMessageWidget.cpp => WareStatusItemWidget.cpp} (62%) rename src/openfluid/ui/waresdev/{StatusButtonMessageWidget.hpp => WareStatusItemWidget.hpp} (76%) rename src/openfluid/ui/waresdev/{StatusButtonMessageWidget.ui => WareStatusItemWidget.ui} (97%) diff --git a/src/apps/openfluid-devstudio/MainWindow.cpp b/src/apps/openfluid-devstudio/MainWindow.cpp index 4df128995..6128f87d6 100644 --- a/src/apps/openfluid-devstudio/MainWindow.cpp +++ b/src/apps/openfluid-devstudio/MainWindow.cpp @@ -277,6 +277,8 @@ QToolButton::menu-button:pressed, QToolButton::menu-button:hover { mp_WidgetsCollection, SLOT(closeEditor(const QString&))); connect(Explorer, SIGNAL(folderDeleted(const QString&, const QString&, const bool)), mp_WidgetsCollection, SLOT(closeEditorsInFolderFromWare(const QString&, const QString&, const bool))); + connect(Explorer, SIGNAL(wareChanged(const QString&)), + mp_WidgetsCollection, SLOT(onWareChange(const QString&))); } connect(mp_WidgetsCollection, SIGNAL(currentTabChanged(const QString&)), diff --git a/src/openfluid/ui/config.hpp.in b/src/openfluid/ui/config.hpp.in index 7f0b01d5d..09283701c 100644 --- a/src/openfluid/ui/config.hpp.in +++ b/src/openfluid/ui/config.hpp.in @@ -33,6 +33,7 @@ @file config.hpp @author Jean-Christophe FABRE + @author Armel THÖNI */ @@ -63,6 +64,11 @@ const char* const PLACEHOLDER_REQUIRED = QT_TRANSLATE_NOOP("openfluid::ui::confi const QString LINEMARKER_ERRCOLOR = "#FFA3A3"; const QString LINEMARKER_WARNCOLOR = "#FFD6A3"; +const QString STATUS_ERRCOLOR = "#B31717"; +const QString STATUS_WARNCOLOR = "#E3A740"; +const QString STATUS_OKCOLOR = "#55B332"; +const QString STATUS_DISABLEDCOLOR = "#757575"; + const int EXIT_CODE_FOR_RESTART = -8121186; diff --git a/src/openfluid/ui/waresdev/CMakeLists.txt b/src/openfluid/ui/waresdev/CMakeLists.txt index 41af0c4de..509e810ae 100644 --- a/src/openfluid/ui/waresdev/CMakeLists.txt +++ b/src/openfluid/ui/waresdev/CMakeLists.txt @@ -21,9 +21,10 @@ SET(OPENFLUID_UI_WARESDEV_CPP WareSrcUIContainer.cpp WorkspaceDevDashboardDialog.cpp WorkspaceDevWaresWidget.cpp WorkspaceDevGitWidget.cpp WorkspaceDevActionsWidget.cpp WorkspaceDevProcessDialog.cpp CompletionProvider.cpp + WareMigrationListener.cpp MigrationSetupDialog.cpp - WareDashboardStatusWidget.cpp - GroupStatusMessagesWidget.cpp StatusButtonMessageWidget.cpp) + WareStatusDashboardWidget.cpp + WareStatusItemWidget.cpp) SET(OPENFLUID_UI_WARESDEV_HPP WareSrcUIContainer.hpp WareSrcMsgStream.hpp @@ -48,10 +49,10 @@ SET(OPENFLUID_UI_WARESDEV_HPP WareSrcUIContainer.hpp WorkspaceDevDashboardDialog.hpp WorkspaceDevWaresWidget.hpp WorkspaceDevGitWidget.hpp WorkspaceDevActionsWidget.hpp WorkspaceDevProcessDialog.hpp CompletionProvider.hpp - SignalMigrationListener.hpp + WareMigrationListener.hpp MigrationSetupDialog.hpp - WareDashboardStatusWidget.hpp - GroupStatusMessagesWidget.hpp StatusButtonMessageWidget.hpp) + WareStatusDashboardWidget.hpp + WareStatusItemWidget.hpp) QT5_WRAP_UI(OPENFLUID_UI_WARESDEV_UI WareSrcWidget.ui WareExplorerDialog.ui WareBuildOptionsWidget.ui WareBuildOptionsDialog.ui EmptyPage.ui CppPage.ui CMakeConfigPage.ui @@ -61,7 +62,7 @@ QT5_WRAP_UI(OPENFLUID_UI_WARESDEV_UI WareSrcWidget.ui WareExplorerDialog.ui Ware WorkspaceDevProcessDialog.ui WorkspaceDevDashboardDialog.ui WorkspaceDevWaresWidget.ui WorkspaceDevGitWidget.ui MigrationSetupDialog.ui - WareDashboardStatusWidget.ui GroupStatusMessagesWidget.ui StatusButtonMessageWidget.ui) + WareStatusDashboardWidget.ui WareStatusItemWidget.ui) #QT5_ADD_RESOURCES(OPENFLUID_UI_WARESDEV_RC resources/openfluiduiwaresdev.qrc) diff --git a/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.cpp b/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.cpp deleted file mode 100644 index 1c315c70d..000000000 --- a/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - - This file is part of OpenFLUID software - Copyright(c) 2007, INRA - Montpellier SupAgro - - - == GNU General Public License Usage == - - OpenFLUID is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFLUID is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenFLUID. If not, see . - - - == Other Usage == - - Other Usage means a use of OpenFLUID that is inconsistent with the GPL - license, and requires a written agreement between You and INRA. - Licensees for Other Usage of OpenFLUID may use this file in accordance - with the terms contained in the written agreement between You and INRA. - -*/ - - -/** - @file GroupStatusMessagesWidget.cpp - - @author Jean-Christophe FABRE - @author Armel THÖNI -*/ - - -#include -#include - -#include "ui_GroupStatusMessagesWidget.h" - - -namespace openfluid { namespace ui { namespace waresdev { - - -GroupStatusMessagesWidget::GroupStatusMessagesWidget(const QString& Category, QWidget* Parent): - QWidget(Parent), ui(new Ui::GroupStatusMessagesWidget) -{ - ui->setupUi(this); - - setVisible(false); - -} - - -// ===================================================================== -// ===================================================================== - - -GroupStatusMessagesWidget::~GroupStatusMessagesWidget() -{ - delete ui; -} - - -// ===================================================================== -// ===================================================================== - - -void GroupStatusMessagesWidget::clear() -{ - setVisible(false); - while (QLayoutItem* item = layout()->takeAt(0)) - { - if (item->widget()) - { - delete item->widget(); - } - delete item; - } -} - - -// ===================================================================== -// ===================================================================== - - -void GroupStatusMessagesWidget::addMessage(openfluid::waresdev::WareSrcChecker::ReportingData::ReportingItem Item) -{ - setVisible(true); - StatusButtonMessageWidget* MessageWidget = new StatusButtonMessageWidget(Item); - layout()->addWidget(MessageWidget); - - // TOIMPL store widget in list (or in dedicated widget so that clear operation is easier) - // TOIMPL fix message (dyn version?) - - connect(MessageWidget, SIGNAL(actionTriggered(QString)), this, SIGNAL(actionTriggered(QString))); - // TOIMPL disconnect at clear step (requires widget storage with info about signal) -} - -} } } // namespaces diff --git a/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.hpp b/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.hpp deleted file mode 100644 index e2ed0e2a8..000000000 --- a/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - - This file is part of OpenFLUID software - Copyright(c) 2007, INRA - Montpellier SupAgro - - - == GNU General Public License Usage == - - OpenFLUID is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFLUID is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenFLUID. If not, see . - - - == Other Usage == - - Other Usage means a use of OpenFLUID that is inconsistent with the GPL - license, and requires a written agreement between You and INRA. - Licensees for Other Usage of OpenFLUID may use this file in accordance - with the terms contained in the written agreement between You and INRA. - -*/ - - -/** - @file GroupStatusMessagesWidget.hpp - - @author Jean-Christophe FABRE - @author Armel THÖNI -*/ - - -#ifndef __OPENFLUID_UIWARESDEV_GROUPSTATUSMESSAGESWIDGET_HPP__ -#define __OPENFLUID_UIWARESDEV_GROUPSTATUSMESSAGESWIDGET_HPP__ - - -#include - -#include - - -namespace Ui -{ - class GroupStatusMessagesWidget; -} - - -namespace openfluid { namespace ui { namespace waresdev { - -class GroupStatusMessagesWidget : public QWidget -{ - Q_OBJECT; - - private: - - Ui::GroupStatusMessagesWidget* ui; - - - signals: - - void actionTriggered(const QString& ActionCode); - - - public: - - GroupStatusMessagesWidget(const QString& Category, QWidget* Parent = nullptr); - - ~GroupStatusMessagesWidget(); - - void clear(); - - void addMessage(openfluid::waresdev::WareSrcChecker::ReportingData::ReportingItem Item); - -}; - - -} } } // namespaces - - -#endif /* __OPENFLUID_UIWARESDEV_GROUPSTATUSMESSAGESWIDGET_HPP__ */ diff --git a/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.ui b/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.ui deleted file mode 100644 index da49f77cd..000000000 --- a/src/openfluid/ui/waresdev/GroupStatusMessagesWidget.ui +++ /dev/null @@ -1,42 +0,0 @@ - - - GroupStatusMessagesWidget - - - - 0 - 0 - 114 - 19 - - - - - 0 - 0 - - - - Form - - - - 2 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - diff --git a/src/openfluid/ui/waresdev/MigrationSetupDialog.cpp b/src/openfluid/ui/waresdev/MigrationSetupDialog.cpp index 0adb4da80..6f33edd41 100644 --- a/src/openfluid/ui/waresdev/MigrationSetupDialog.cpp +++ b/src/openfluid/ui/waresdev/MigrationSetupDialog.cpp @@ -38,7 +38,7 @@ #include -#include +#include #include "ui_MigrationSetupDialog.h" @@ -67,7 +67,7 @@ MigrationSetupDialog::~MigrationSetupDialog() // ===================================================================== -bool MigrationSetupDialog::isNewBranchChecked() // TOIMPL use this data for checkout +bool MigrationSetupDialog::isNewBranchChecked() { return ui->checkoutCheckbox->isChecked(); } diff --git a/src/openfluid/ui/waresdev/SignalMigrationListener.hpp b/src/openfluid/ui/waresdev/SignalMigrationListener.hpp deleted file mode 100644 index be888b513..000000000 --- a/src/openfluid/ui/waresdev/SignalMigrationListener.hpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - - This file is part of OpenFLUID software - Copyright(c) 2007, INRA - Montpellier SupAgro - - - == GNU General Public License Usage == - - OpenFLUID is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFLUID is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenFLUID. If not, see . - - - == Other Usage == - - Other Usage means a use of OpenFLUID that is inconsistent with the GPL - license, and requires a written agreement between You and INRA. - Licensees for Other Usage of OpenFLUID may use this file in accordance - with the terms contained in the written agreement between You and INRA. - -*/ - - -/** - @file SignalMigrationListener.hpp - - @author Jean-Christophe FABRE -*/ - - -#ifndef __OPENFLUID_UIWARESDEV_SIGNALMIGRATIONLISTENER_HPP__ -#define __OPENFLUID_UIWARESDEV_SIGNALMIGRATIONLISTENER_HPP__ - - -#include -#include - -#include -#include - - -namespace openfluid { namespace ui { namespace waresdev { - - -class SignalMigrationListener : public QObject, public openfluid::waresdev::WareSrcMigratorListener -{ - Q_OBJECT; - - private: - - bool m_Verbose = false; - - bool m_IsFirstStageMsg = true; - QString m_CurrentMsg = ""; - - int m_Progress = 0; - double m_ProgressRatio = 100/8; //TOIMPL variabilize steps ? - - void flushMsg(std::string channel="info") - { - if (channel == "info") - { - info(m_CurrentMsg); - } - else if (channel == "error") - { - error(m_CurrentMsg); - } - else - { - throw openfluid::base::FrameworkException(OPENFLUID_CODE_LOCATION, - "Channel not recognized"); - } - m_CurrentMsg = ""; - } - - void incrementProgress() - { - m_Progress += m_ProgressRatio; - emit progressed(m_Progress); - } - - - void displayStatus(const openfluid::base::Listener::Status& Status) - { - m_CurrentMsg += " "; - - switch (Status) - { - case openfluid::base::Listener::Status::ERROR_STATUS : - m_CurrentMsg += "[Error]"; - flushMsg("error"); - break; - case openfluid::base::Listener::Status::OK_STATUS : - m_CurrentMsg += "[OK]"; - flushMsg("info"); - break; - case openfluid::base::Listener::Status::WARNING_STATUS : - m_CurrentMsg += "[Warning]"; - flushMsg("info"); //TOIMPL add warning channel - break; - } - - - }; - - void displayStartMsg(const std::string& Msg) - { - - m_CurrentMsg += QString::fromStdString("-- " + Msg); - if (m_Verbose) - { - m_CurrentMsg += " :"; - } - - m_IsFirstStageMsg = true; - } - - signals: - - void info(QString Message); - - void warning(QString Message); - - void error(QString Message); - - void progressed(int Value); - - void finished(); - - public: - - CPPCLASS_DEFAULT_FIVE(SignalMigrationListener) - - void setVerbose(bool Enabled) - { - m_Verbose = Enabled; - } - - void onPrecheckStart() - { - displayStartMsg("Preliminary checks"); - } - - void onPrecheckEnd(openfluid::base::Listener::Status Status) - { - displayStatus(Status); - incrementProgress(); - } - - void onPrepareStart() - { - displayStartMsg("Preparation"); - } - - void onPrepareEnd(openfluid::base::Listener::Status Status) - { - displayStatus(Status); - incrementProgress(); - } - - void onProcessSignatureStart() - { - displayStartMsg("Processing ware signature"); - } - - void onProcessSignatureEnd(openfluid::base::Listener::Status Status) - { - displayStatus(Status); - incrementProgress(); - } - - void onProcessCMakeConfigStart() - { - displayStartMsg("Processing CMake configuration"); - } - - void onProcessCMakeConfigEnd(openfluid::base::Listener::Status Status) - { - displayStatus(Status); - } - - void onCreateStructureStart() - { - displayStartMsg("Creating new ware structure"); - } - - void onCreateStructureEnd(openfluid::base::Listener::Status Status) - { - displayStatus(Status); - incrementProgress(); - } - - void onDispatchFilesStart() - { - displayStartMsg("Dispatching"); - } - - void onDispatchFilesEnd(openfluid::base::Listener::Status Status) - { - displayStatus(Status); - incrementProgress(); - } - - void onCleanSrcFilesStart() - { - displayStartMsg("Cleaning files"); - } - - void onCleanSrcFilesEnd(openfluid::base::Listener::Status Status) - { - displayStatus(Status); - incrementProgress(); - } - - void onDocStart() - { - displayStartMsg("Processing doc"); - } - - void onDocEnd(openfluid::base::Listener::Status Status) - { - displayStatus(Status); - incrementProgress(); - } - - void stageMessage(const std::string& Msg) - { - if (m_Verbose) - { - if (!m_IsFirstStageMsg) - { - m_CurrentMsg += ","; - } - m_CurrentMsg += QString::fromStdString(" " + Msg); - } - m_IsFirstStageMsg = false; - } - -}; - - -} } } // namespaces - - -#endif /* __OPENFLUID_UIWARESDEV_SIGNALMIGRATIONLISTENER_HPP__ */ diff --git a/src/openfluid/ui/waresdev/WareDashboardStatusWidget.cpp b/src/openfluid/ui/waresdev/WareDashboardStatusWidget.cpp deleted file mode 100644 index e8349ba4d..000000000 --- a/src/openfluid/ui/waresdev/WareDashboardStatusWidget.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - - This file is part of OpenFLUID software - Copyright(c) 2007, INRA - Montpellier SupAgro - - - == GNU General Public License Usage == - - OpenFLUID is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFLUID is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenFLUID. If not, see . - - - == Other Usage == - - Other Usage means a use of OpenFLUID that is inconsistent with the GPL - license, and requires a written agreement between You and INRA. - Licensees for Other Usage of OpenFLUID may use this file in accordance - with the terms contained in the written agreement between You and INRA. - -*/ - - -/** - @file WareDashboardStatusWidget.cpp - - @author Jean-Christophe FABRE - @author Armel THÖNI - */ - - -#include - -#include // DIRTYCODE - -#include -#include -#include - -#include "ui_WareDashboardStatusWidget.h" - - -namespace openfluid { namespace ui { namespace waresdev { - -WareDashboardStatusWidget::WareDashboardStatusWidget(QWidget* Parent, const std::string& WarePath): - QWidget(Parent), ui(new Ui::WareDashboardStatusWidget), m_WarePath(WarePath), m_TitleColor("green") -{ - // TOIMPL refactor classes about dashboard - - ui->setupUi(this); - - ui->TitleLabel->setStyleSheet("background-color:white; font:bold;"); - ui->TitleLabel->setElideMode(Qt::ElideRight); - - ui->NoMessageLabel->setStyleSheet("font:italic;"); - - ui->InnerWidget->setStyleSheet(QString("#InnerWidget " - "{background-color: white;}")); - - ui->ContentsScrollArea->setStyleSheet("QFrame {background-color: white;}"); - - ui->ContentsWidget->setStyleSheet("background-color: white;"); - - - QVBoxLayout* Layout = new QVBoxLayout; - - Layout->setContentsMargins(0,0,0,0); - Layout->setSpacing(0); - - ui->ContentsWidget->setLayout(Layout); - - - // TOIMPL replace by only one category widget containing all data - std::list OrderedCategories; - mp_MessagesWidgets["base"] = new GroupStatusMessagesWidget("",this); // TODO remove name? remove group level? - OrderedCategories.push_back("base"); - - mp_MessagesWidgets["structure"] = new GroupStatusMessagesWidget(tr("structure"),this); - OrderedCategories.push_back("structure"); - - mp_MessagesWidgets["metainfo"] = new GroupStatusMessagesWidget(tr("metainfo"),this); - OrderedCategories.push_back("metainfo"); - - mp_MessagesWidgets["code"] = new GroupStatusMessagesWidget(tr("code"),this); - OrderedCategories.push_back("code"); - - for (const auto& c : OrderedCategories) - { - ((QBoxLayout*)ui->ContentsWidget->layout())->addWidget(mp_MessagesWidgets[c], 0,Qt::AlignTop); - connect(mp_MessagesWidgets[c], SIGNAL(actionTriggered(QString)), this, SLOT(onActionTriggered(QString))); - } - - ((QBoxLayout*)ui->ContentsWidget->layout())->addStretch(); - - refresh(); // TOIMPL refresh at file save (connect in parent as slot) - // TODO (advanced: see if watcher catches external change) -} - - -// ===================================================================== -// ===================================================================== - - -WareDashboardStatusWidget::~WareDashboardStatusWidget() -{ - delete ui; -} - - -// ===================================================================== -// ===================================================================== - - -void WareDashboardStatusWidget::refresh() -{ - try // DIRTYCODE improve try/catch filtering - { - // TOIMPL first clean existing data - mp_MessagesWidgets; - - auto Checker = openfluid::waresdev::WareSrcChecker(m_WarePath); //TOIMPL check is checker for qstring/qstring? - auto Report = Checker.performCheck(true); - - setLevel(Report.getStatus()); - - for (const auto& CatItems : mp_MessagesWidgets) // TOIMPL refactor this to iterate on real categories from report - { - CatItems.second->clear(); - - for (const auto& Item : Report.Categories[CatItems.first].Items) - { - // TOIMPL Externalize structure computation - if (Item.Status == openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus::WARNING || - Item.Status == openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus::ERROR) - { - /*QString Message = QString::fromStdString(Item.Message); - QString ActionCode = ""; - if (Item.Message == "version_iscorrect" && - Item.Status == openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus::ERROR) - { - Message = "Ware version is below current OpenFLUID version"; // TOIMPL replace by global dict? - ActionCode = "migration"; - }*/ - //CatItems.second->addMessage(Message, Item.Status, ActionCode); - CatItems.second->addMessage(Item); - } - } - } - } - catch (std::exception& E) - { - std::cout << "WareSrcChecker error for ware " << m_WarePath << ": " << std::string(E.what()) << std::endl; - setLevel(openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus::DISABLED); - //throw openfluid::base::FrameworkException(OPENFLUID_CODE_LOCATION, std::string(E.what())); - // DIRTYCODE better way to transmit error - } -} - - -// ===================================================================== -// ===================================================================== - - -void WareDashboardStatusWidget::onActionTriggered(const QString& ActionCode) -{ - if (ActionCode == "migration") - { - emit migrationRequested(); - } - else - { - // TOIMPL Raise error saying that ActionCode is not recognized - } -} - - -// ===================================================================== -// ===================================================================== - - -void WareDashboardStatusWidget::setLevel(const openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus Level) -{ - // TOIMPL change visual to remove colored background and change color of text to severity level - if (Level == openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus::OK) - { - ui->TitleLabel->setText(tr("No issue")); - ui->NoMessageLabel->setVisible(false); // TOIMPL totally remove widget? not if shared widget - m_TitleColor = "#55B332"; - } - else if (Level == openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus::WARNING) - { - ui->TitleLabel->setText(tr("Warnings raised")); - ui->NoMessageLabel->setVisible(false); - m_TitleColor = "#E3A740"; - } - else if (Level == openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus::ERROR) - { - ui->TitleLabel->setText(tr("Issues detected")); - ui->NoMessageLabel->setVisible(false); - m_TitleColor = "#B31717"; - } - else - { - ui->TitleLabel->setText(tr("Check is disabled")); - ui->NoMessageLabel->setVisible(false); - m_TitleColor = "#757575"; - } - - applyStyleSheet(); -} - - -// ===================================================================== -// ===================================================================== - - -void WareDashboardStatusWidget::applyStyleSheet() -{ - ui->TitleLabel->setStyleSheet("color:"+m_TitleColor+"; font:bold;"); -} - - -} } } // namespaces diff --git a/src/openfluid/ui/waresdev/WareMigrationListener.cpp b/src/openfluid/ui/waresdev/WareMigrationListener.cpp new file mode 100644 index 000000000..28b3333c7 --- /dev/null +++ b/src/openfluid/ui/waresdev/WareMigrationListener.cpp @@ -0,0 +1,324 @@ +/* + + This file is part of OpenFLUID software + Copyright(c) 2007, INRA - Montpellier SupAgro + + + == GNU General Public License Usage == + + OpenFLUID is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFLUID is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenFLUID. If not, see . + + + == Other Usage == + + Other Usage means a use of OpenFLUID that is inconsistent with the GPL + license, and requires a written agreement between You and INRA. + Licensees for Other Usage of OpenFLUID may use this file in accordance + with the terms contained in the written agreement between You and INRA. + +*/ + + +/** + @file WareMigrationListener.cpp + + @author Jean-Christophe FABRE + @author Armel THÖNI +*/ + + +#include +#include + +#include + + +namespace openfluid { namespace ui { namespace waresdev { + + +void WareMigrationListener::flushMsg(const std::string& Channel) +{ + if (Channel == "info") + { + info(m_CurrentMsg); + } + else if (Channel == "warning") + { + warning(m_CurrentMsg); + } + else if (Channel == "error") + { + error(m_CurrentMsg); + } + else + { + throw openfluid::base::FrameworkException(OPENFLUID_CODE_LOCATION, + "Channel not recognized"); + } + m_CurrentMsg = ""; +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::incrementProgress() +{ + m_Progress += m_ProgressRatio; + emit progressed(m_Progress); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::displayStatus(const openfluid::base::Listener::Status& Status) +{ + m_CurrentMsg += " "; + + switch (Status) + { + case openfluid::base::Listener::Status::ERROR_STATUS : + m_CurrentMsg += "[Error]"; + flushMsg("error"); + break; + case openfluid::base::Listener::Status::OK_STATUS : + m_CurrentMsg += "[OK]"; + flushMsg("info"); + break; + case openfluid::base::Listener::Status::WARNING_STATUS : + m_CurrentMsg += "[Warning]"; + flushMsg("warning"); + break; + } + +}; + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::displayStartMsg(const std::string& Msg) +{ + + m_CurrentMsg += QString::fromStdString("-- " + std::string(Msg)); + if (m_Verbose) + { + m_CurrentMsg += " :"; + } + + m_IsFirstStageMsg = true; +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::setVerbose(bool Enabled) +{ + m_Verbose = Enabled; +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onPrecheckStart() +{ + displayStartMsg("Preliminary checks"); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onPrecheckEnd(openfluid::base::Listener::Status Status) +{ + displayStatus(Status); + incrementProgress(); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onPrepareStart() +{ + displayStartMsg("Preparation"); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onPrepareEnd(openfluid::base::Listener::Status Status) +{ + displayStatus(Status); + incrementProgress(); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onProcessSignatureStart() +{ + displayStartMsg("Processing ware signature"); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onProcessSignatureEnd(openfluid::base::Listener::Status Status) +{ + displayStatus(Status); + incrementProgress(); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onProcessCMakeConfigStart() +{ + displayStartMsg("Processing CMake configuration"); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onProcessCMakeConfigEnd(openfluid::base::Listener::Status Status) +{ + displayStatus(Status); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onCreateStructureStart() +{ + displayStartMsg("Creating new ware structure"); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onCreateStructureEnd(openfluid::base::Listener::Status Status) +{ + displayStatus(Status); + incrementProgress(); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onDispatchFilesStart() +{ + displayStartMsg("Dispatching"); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onDispatchFilesEnd(openfluid::base::Listener::Status Status) +{ + displayStatus(Status); + incrementProgress(); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onCleanSrcFilesStart() +{ + displayStartMsg("Cleaning files"); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onCleanSrcFilesEnd(openfluid::base::Listener::Status Status) +{ + displayStatus(Status); + incrementProgress(); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onDocStart() +{ + displayStartMsg("Processing doc"); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::onDocEnd(openfluid::base::Listener::Status Status) +{ + displayStatus(Status); + incrementProgress(); +} + + +// ===================================================================== +// ===================================================================== + + +void WareMigrationListener::stageMessage(const std::string& Msg) +{ + if (m_Verbose) + { + if (!m_IsFirstStageMsg) + { + m_CurrentMsg += ","; + } + m_CurrentMsg += QString::fromStdString(" " + Msg); + } + m_IsFirstStageMsg = false; +} + + +} } } // namespaces + diff --git a/src/openfluid/ui/waresdev/WareMigrationListener.hpp b/src/openfluid/ui/waresdev/WareMigrationListener.hpp new file mode 100644 index 000000000..634ba617f --- /dev/null +++ b/src/openfluid/ui/waresdev/WareMigrationListener.hpp @@ -0,0 +1,139 @@ +/* + + This file is part of OpenFLUID software + Copyright(c) 2007, INRA - Montpellier SupAgro + + + == GNU General Public License Usage == + + OpenFLUID is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFLUID is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenFLUID. If not, see . + + + == Other Usage == + + Other Usage means a use of OpenFLUID that is inconsistent with the GPL + license, and requires a written agreement between You and INRA. + Licensees for Other Usage of OpenFLUID may use this file in accordance + with the terms contained in the written agreement between You and INRA. + +*/ + + +/** + @file WareMigrationListener.hpp + + @author Jean-Christophe FABRE + @author Armel THÖNI +*/ + + +#ifndef __OPENFLUID_UIWARESDEV_WAREMIGRATIONLISTENER_HPP__ +#define __OPENFLUID_UIWARESDEV_WAREMIGRATIONLISTENER_HPP__ + + +#include +#include + +#include + +#include +#include +#include + + +namespace openfluid { namespace ui { namespace waresdev { + + +class WareMigrationListener : public QObject, public openfluid::waresdev::WareSrcMigratorListener +{ + Q_OBJECT; + + private: + + bool m_Verbose = false; + + bool m_IsFirstStageMsg = true; + QString m_CurrentMsg = ""; + + int m_Progress = 0; + double m_ProgressRatio = 100/8; //Compute percent since there are 8 steps + + void flushMsg(const std::string& Channel="info"); + + void incrementProgress(); + + void displayStatus(const openfluid::base::Listener::Status& Status); + + void displayStartMsg(const std::string& Msg); + + + signals: + + void info(QString Message); + + void warning(QString Message); + + void error(QString Message); + + void progressed(int Value); + + void finished(); + + + public: + + CPPCLASS_DEFAULT_FIVE(WareMigrationListener) + + void setVerbose(bool Enabled); + + void onPrecheckStart(); + + void onPrecheckEnd(openfluid::base::Listener::Status Status); + + void onPrepareStart(); + + void onPrepareEnd(openfluid::base::Listener::Status Status); + + void onProcessSignatureStart(); + + void onProcessSignatureEnd(openfluid::base::Listener::Status Status); + + void onProcessCMakeConfigStart(); + + void onProcessCMakeConfigEnd(openfluid::base::Listener::Status Status); + + void onCreateStructureStart(); + + void onCreateStructureEnd(openfluid::base::Listener::Status Status); + + void onDispatchFilesStart(); + + void onDispatchFilesEnd(openfluid::base::Listener::Status Status); + + void onCleanSrcFilesStart(); + + void onCleanSrcFilesEnd(openfluid::base::Listener::Status Status); + + void onDocStart(); + + void onDocEnd(openfluid::base::Listener::Status Status); + + void stageMessage(const std::string& Msg); +}; + + +} } } // namespaces + + +#endif /* __OPENFLUID_UIWARESDEV_WAREMIGRATIONLISTENER_HPP__ */ diff --git a/src/openfluid/ui/waresdev/WareSrcExplorer.cpp b/src/openfluid/ui/waresdev/WareSrcExplorer.cpp index 6f6542db0..83b8c3cf6 100644 --- a/src/openfluid/ui/waresdev/WareSrcExplorer.cpp +++ b/src/openfluid/ui/waresdev/WareSrcExplorer.cpp @@ -404,6 +404,12 @@ void WareSrcExplorer::onNewFileAsked() if (!FilePath.isEmpty()) { emit fileOpeningAsked(FilePath); + + QString WarePath = + QString::fromStdString( + openfluid::waresdev::WareSrcEnquirer::getWareInfoFromPath(FilePath.toStdString()).AbsoluteWarePath + ); + emit wareChanged(WarePath); } } @@ -448,6 +454,7 @@ void WareSrcExplorer::onNewFolderAsked() { QDir(FocusDirPath).mkdir(NewPath); setCurrentPath(NewPath); + emit wareChanged(WarePath); } } @@ -641,7 +648,11 @@ void WareSrcExplorer::onDeleteFolderAsked() } emit folderDeleted(WarePath, CurrentPath, false); - if (!QDir(CurrentPath).removeRecursively()) + if (QDir(CurrentPath).removeRecursively()) + { + emit wareChanged(WarePath); + } + else { // TODO reopen tabs? hard to know which one was open QMessageBox::critical(0, tr("Error"), tr("Unable to remove the folder \"%1\"").arg(CurrentPath)); @@ -669,7 +680,17 @@ void WareSrcExplorer::onDeleteFileAsked() } emit fileDeleted(CurrentPath); - if (!QDir().remove(CurrentPath)) + + if (QDir().remove(CurrentPath)) + { + QString WarePath = + QString::fromStdString( + openfluid::waresdev::WareSrcEnquirer::getWareInfoFromPath(CurrentPath.toStdString()).AbsoluteWarePath + ); + + emit wareChanged(WarePath); + } + else { // TODO reopen tab? QMessageBox::critical(0, tr("Error"), tr("Unable to remove the file \"%1\"").arg(CurrentPath)); diff --git a/src/openfluid/ui/waresdev/WareSrcExplorer.hpp b/src/openfluid/ui/waresdev/WareSrcExplorer.hpp index d73962063..ab52fe56c 100644 --- a/src/openfluid/ui/waresdev/WareSrcExplorer.hpp +++ b/src/openfluid/ui/waresdev/WareSrcExplorer.hpp @@ -136,6 +136,8 @@ class OPENFLUID_API WareSrcExplorer: public QTreeView void folderDeleted(const QString& WarePath, const QString& FolderPath, const bool Confirm); + void wareChanged(const QString& WarePath); + public: diff --git a/src/openfluid/ui/waresdev/WareSrcWidget.cpp b/src/openfluid/ui/waresdev/WareSrcWidget.cpp index 180394606..00c9d0f65 100644 --- a/src/openfluid/ui/waresdev/WareSrcWidget.cpp +++ b/src/openfluid/ui/waresdev/WareSrcWidget.cpp @@ -197,10 +197,10 @@ QToolButton { // BOARD TAB - mp_Board = new openfluid::ui::waresdev::WareDashboardStatusWidget(this, m_Container.getAbsolutePath()); + mp_Board = new openfluid::ui::waresdev::WareStatusDashboardWidget(this, m_Container.getAbsolutePath()); m_TabIndexByName["Board"] = ui->tabWidget->addTab(mp_Board, "Board"); - connect(mp_Board, SIGNAL(migrationRequested()), this, SLOT(onMigrationRequested())); + connect(mp_Board, SIGNAL(operationRequested(const QString&)), this, SLOT(onOperationRequested(const QString&))); // MESSAGES TAB mp_MessagesWidget = new openfluid::ui::waresdev::WareSrcMsgViewer(this); @@ -341,9 +341,9 @@ void WareSrcWidget::onOpenExternalToolRequested() // ===================================================================== -void WareSrcWidget::onMigrationRequested() +void WareSrcWidget::onOperationRequested(const QString& OperationCode) { - emit migrationRequestedOnWare(QString::fromStdString(m_Container.getAbsolutePath())); + emit operationRequestedOnWare(OperationCode, QString::fromStdString(m_Container.getAbsolutePath())); } @@ -767,6 +767,16 @@ bool WareSrcWidget::isWareProcessRunning() const // ===================================================================== +void WareSrcWidget::onWareChange() +{ + mp_Board->refresh(); +} + + +// ===================================================================== +// ===================================================================== + + void WareSrcWidget::saveCurrentEditor() { if (WareFileEditor* Editor = currentEditor()) @@ -774,7 +784,9 @@ void WareSrcWidget::saveCurrentEditor() Editor->saveContent(); ui->tabWidget->setCurrentIndex(m_TabIndexByName["Board"]); - mp_Board->refresh(); + + onWareChange(); + // TOIMPL emit wareChanged for other ware changes through watcher } } diff --git a/src/openfluid/ui/waresdev/WareSrcWidget.hpp b/src/openfluid/ui/waresdev/WareSrcWidget.hpp index d8df7a43a..09670756c 100644 --- a/src/openfluid/ui/waresdev/WareSrcWidget.hpp +++ b/src/openfluid/ui/waresdev/WareSrcWidget.hpp @@ -34,6 +34,7 @@ @author Aline LIBRES @author Jean-Christophe Fabre + @author Armel THÖNI */ #ifndef __OPENFLUID_UIWARESDEV_WARESRCWIDGET_HPP__ @@ -43,7 +44,7 @@ #include #include -#include +#include #include #include #include @@ -100,7 +101,7 @@ class OPENFLUID_API WareSrcWidget: public QWidget std::map m_TabIndexByName; - openfluid::ui::waresdev::WareDashboardStatusWidget* mp_Board; + openfluid::ui::waresdev::WareStatusDashboardWidget* mp_Board; openfluid::ui::waresdev::WareSrcMsgViewer* mp_MessagesWidget; @@ -169,7 +170,7 @@ class OPENFLUID_API WareSrcWidget: public QWidget void buildFinished(openfluid::ware::WareType Type, const QString& ID); - void migrationRequestedOnWare(const QString& WarePath); + void operationRequestedOnWare(const QString& OperationCode, const QString& WarePath); public slots: @@ -196,7 +197,7 @@ class OPENFLUID_API WareSrcWidget: public QWidget void onOpenExternalToolRequested(); - void onMigrationRequested(); + void onOperationRequested(const QString& ActionCode); void newFile(); @@ -204,6 +205,8 @@ class OPENFLUID_API WareSrcWidget: public QWidget void openFile(); + void onWareChange(); + /** @param TopDirectory The path to the topmost directory where may be saved the file, an empty string meaning this ware directory diff --git a/src/openfluid/ui/waresdev/WareSrcWidgetCollection.cpp b/src/openfluid/ui/waresdev/WareSrcWidgetCollection.cpp index 7aa21dcc3..9bc23f45a 100644 --- a/src/openfluid/ui/waresdev/WareSrcWidgetCollection.cpp +++ b/src/openfluid/ui/waresdev/WareSrcWidgetCollection.cpp @@ -62,7 +62,7 @@ #include #include #include -#include +#include namespace openfluid { namespace ui { namespace waresdev { @@ -72,7 +72,7 @@ WareSrcWidgetCollection::WareSrcWidgetCollection(QTabWidget* TabWidget, bool IsS mp_TabWidget(TabWidget), m_IsStandalone(IsStandalone), mp_Manager(openfluid::base::WorkspaceManager::instance()), mp_FindReplaceDialog(0) { - StatusButtonMessageWidget::populateReportItemLabels(); + WareStatusItemWidget::populateReportItemLabels(); connect(mp_TabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(onCloseWareTabRequested(int))); connect(mp_TabWidget, SIGNAL(currentChanged(int)), this, SLOT(onCurrentTabChanged(int))); @@ -161,8 +161,8 @@ bool WareSrcWidgetCollection::openPath(const QString& Path) connect(Widget, SIGNAL(buildFinished(openfluid::ware::WareType, const QString&)), this, SLOT(notifyBuildFinished(openfluid::ware::WareType, const QString&))); - connect(Widget, SIGNAL(migrationRequestedOnWare(const QString&)), - this, SLOT(onMigrationRequestedOnWare(const QString&))); + connect(Widget, SIGNAL(operationRequestedOnWare(const QString&, const QString&)), + this, SLOT(onOperationRequestedOnWare(const QString&, const QString&))); } if (Info.IsWareFile) @@ -243,82 +243,90 @@ bool WareSrcWidgetCollection::requestWareTabClosing(WareSrcWidget* Ware) // ===================================================================== -void WareSrcWidgetCollection::onMigrationRequestedOnWare(const QString& WarePath) +void WareSrcWidgetCollection::onOperationRequestedOnWare(const QString& OperationCode, const QString& WarePath) { - QMap::iterator it = m_WareSrcWidgetByPath.find(WarePath); - if (it == m_WareSrcWidgetByPath.end()) + if (OperationCode == "migration") { - // TOIMPL add message if not found - - QMessageBox::warning(nullptr, - tr("Migration failure"), - tr("Ware requested not found"), - QMessageBox::Close,QMessageBox::Close); - return; - } + QMap::iterator it = m_WareSrcWidgetByPath.find(WarePath); + if (it == m_WareSrcWidgetByPath.end()) + { + QMessageBox::warning(nullptr, + tr("Migration failure"), + tr("Ware requested not found"), + QMessageBox::Close,QMessageBox::Close); + return; + } - MigrationSetupDialog MigrationSetup; - bool Proceed = true; - if (!MigrationSetup.exec()) - { - Proceed = false; - } + MigrationSetupDialog MigrationSetup; + bool Proceed = true; + if (!MigrationSetup.exec()) + { + Proceed = false; + } - // try to close ware tab before migration - if (Proceed && !requestWareTabClosing(it.value())) - { - Proceed = false; - } + // try to close ware tab before migration + if (Proceed && !requestWareTabClosing(it.value())) + { + Proceed = false; + } - if (!Proceed) - { + if (!Proceed) + { + QMessageBox::warning(it.value(), + tr("Migration failure"), + tr("Migration cancelled by user."), + QMessageBox::Close,QMessageBox::Close); + return; + } + + + openfluid::ui::waresdev::WaresSrcIOProgressDialog ProgressDialog(tr("Ware migration"), false, mp_TabWidget); + + MigrationWorker* MWorker = new MigrationWorker(WarePath, + MigrationSetup.isVerbose(), + MigrationSetup.isNewBranchChecked()); - QMessageBox::warning(it.value(), - tr("Migration failure"), - tr("Migration cancelled by user."), - QMessageBox::Close,QMessageBox::Close); - return; - } - - - openfluid::ui::waresdev::WaresSrcIOProgressDialog ProgressDialog(tr("Ware migration"), false, mp_TabWidget); - - MigrationWorker* MWorker = new MigrationWorker(WarePath, MigrationSetup.isVerbose(), MigrationSetup.isNewBranchChecked()); + try + { - try - { + QThread* Thread = new QThread(); - QThread* Thread = new QThread(); + MWorker->moveToThread(Thread); - MWorker->moveToThread(Thread); + connect(Thread, SIGNAL(started()), MWorker, SLOT(run())); + connect(Thread, SIGNAL(finished()), Thread, SLOT(deleteLater())); + connect(MWorker, SIGNAL(finished(bool, const QString&)), MWorker, SLOT(deleteLater())); + connect(MWorker, SIGNAL(finished(bool, const QString&)), Thread, SLOT(quit())); + + connect(MWorker, SIGNAL(finished(bool, const QString&)), &ProgressDialog, + SLOT(finish(bool, const QString&))); + connect(MWorker, SIGNAL(info(const QString&)), &ProgressDialog, + SLOT(writeInfo(const QString&))); + connect(MWorker, SIGNAL(warning(const QString&)), &ProgressDialog, + SLOT(writeWarning(const QString&))); + connect(MWorker, SIGNAL(error(const QString&)), &ProgressDialog, + SLOT(writeError(const QString&))); + connect(MWorker, SIGNAL(progressed(const int)), &ProgressDialog, + SLOT(progress(const int))); + + Thread->start(); - connect(Thread, SIGNAL(started()), MWorker, SLOT(run())); - connect(Thread, SIGNAL(finished()), Thread, SLOT(deleteLater())); - connect(MWorker, SIGNAL(finished(bool, const QString&)), MWorker, SLOT(deleteLater())); - connect(MWorker, SIGNAL(finished(bool, const QString&)), Thread, SLOT(quit())); - - connect(MWorker, SIGNAL(finished(bool, const QString&)), &ProgressDialog, - SLOT(finish(bool, const QString&))); - connect(MWorker, SIGNAL(info(const QString&)), &ProgressDialog, - SLOT(writeInfo(const QString&))); - connect(MWorker, SIGNAL(error(const QString&)), &ProgressDialog, - SLOT(writeError(const QString&))); - connect(MWorker, SIGNAL(progressed(const int)), &ProgressDialog, - SLOT(progress(const int))); + } + catch (std::exception& e) + { + ProgressDialog.writeError(e.what()); + } - Thread->start(); + ProgressDialog.exec(); + // reopen ware + openPath(WarePath); } - catch (std::exception& e) + else { - ProgressDialog.writeError(e.what()); + throw openfluid::base::FrameworkException(OPENFLUID_CODE_LOCATION, "Custom action not recognized"); } - ProgressDialog.exec(); - - // reopen ware - openPath(WarePath); - } @@ -1417,6 +1425,20 @@ void WareSrcWidgetCollection::updateEditorsSettings() // ===================================================================== +void WareSrcWidgetCollection::onWareChange(const QString& WarePath) +{ + openfluid::ui::waresdev::WareSrcFiletypeManager::instance()->updateStyles(); + for (WareSrcWidget* Ware : m_WareSrcWidgetByPath.values()) + { + Ware->onWareChange(); // can not be set as signal/slot connexion because of asymetrical relationship + } +} + + +// ===================================================================== +// ===================================================================== + + void WareSrcWidgetCollection::notifyConfigureLaunched(openfluid::ware::WareType Type, const QString& ID) { emit configureLaunched(Type,ID); diff --git a/src/openfluid/ui/waresdev/WareSrcWidgetCollection.hpp b/src/openfluid/ui/waresdev/WareSrcWidgetCollection.hpp index 354897f5c..dd5bb99e8 100644 --- a/src/openfluid/ui/waresdev/WareSrcWidgetCollection.hpp +++ b/src/openfluid/ui/waresdev/WareSrcWidgetCollection.hpp @@ -35,6 +35,7 @@ @author Aline LIBRES @author Jean-Christophe Fabre + @author Armel THÖNI */ @@ -53,10 +54,9 @@ #include #include #include +#include #include -#include "SignalMigrationListener.hpp" - class QTabWidget; @@ -93,6 +93,8 @@ class MigrationWorker : public QObject void info(const QString& Message); + void warning(const QString& Message); + void error(const QString& Message); void progressed(int Value); @@ -101,12 +103,14 @@ class MigrationWorker : public QObject void run() { - auto Listener = std::make_unique(); + auto Listener = std::make_unique(); Listener->setVerbose(m_Verbose); connect(Listener.get(), SIGNAL(info(const QString&)), this, SIGNAL(info(const QString&))); + connect(Listener.get(), SIGNAL(warning(const QString&)), this, + SIGNAL(warning(const QString&))); connect(Listener.get(), SIGNAL(error(const QString&)), this, SIGNAL(error(const QString&))); connect(Listener.get(), SIGNAL(progressed(int)), this, @@ -132,13 +136,12 @@ class MigrationWorker : public QObject emit error(tr("Unable to checkout branch corresponding to current OpenFLUID version branch.")); } } - - emit finished(true, "Migration performed"); - + emit finished(true, "Migration succeeded"); } catch (std::exception& e) { - emit finished(false, e.what()); + emit error(e.what()); + emit finished(false, "Migration failed"); } } @@ -179,7 +182,7 @@ class OPENFLUID_API WareSrcWidgetCollection: public QObject void notifyBuildFinished(openfluid::ware::WareType Type, const QString& ID); - void onMigrationRequestedOnWare(const QString& WarePath); + void onOperationRequestedOnWare(const QString& OperationCode, const QString& WarePath); private: @@ -316,6 +319,8 @@ class OPENFLUID_API WareSrcWidgetCollection: public QObject void updateEditorsSettings(); + void onWareChange(const QString& WarePath); + public: diff --git a/src/openfluid/ui/waresdev/WareStatusDashboardWidget.cpp b/src/openfluid/ui/waresdev/WareStatusDashboardWidget.cpp new file mode 100644 index 000000000..b80d85ac5 --- /dev/null +++ b/src/openfluid/ui/waresdev/WareStatusDashboardWidget.cpp @@ -0,0 +1,224 @@ +/* + + This file is part of OpenFLUID software + Copyright(c) 2007, INRA - Montpellier SupAgro + + + == GNU General Public License Usage == + + OpenFLUID is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFLUID is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenFLUID. If not, see . + + + == Other Usage == + + Other Usage means a use of OpenFLUID that is inconsistent with the GPL + license, and requires a written agreement between You and INRA. + Licensees for Other Usage of OpenFLUID may use this file in accordance + with the terms contained in the written agreement between You and INRA. + +*/ + + +/** + @file WareStatusDashboardWidget.cpp + + @author Jean-Christophe FABRE + @author Armel THÖNI + */ + + +#include + +#include +#include +#include +#include +#include + +#include "ui_WareStatusDashboardWidget.h" + + +namespace openfluid { namespace ui { namespace waresdev { + + +using ReportingData = openfluid::waresdev::WareSrcChecker::ReportingData; + + +WareStatusDashboardWidget::WareStatusDashboardWidget(QWidget* Parent, const std::string& WarePath): + QWidget(Parent), ui(new Ui::WareStatusDashboardWidget), m_WarePath(WarePath), m_TitleColor("green") +{ + ui->setupUi(this); + + ui->TitleLabel->setStyleSheet("background-color:white; font:bold;"); + ui->TitleLabel->setElideMode(Qt::ElideRight); + + ui->InnerWidget->setStyleSheet(QString("#InnerWidget " + "{background-color: white;}")); + + ui->ContentsScrollArea->setStyleSheet("QFrame {background-color: white;}"); + + ui->ContentsWidget->setStyleSheet("background-color: white;"); + + + QVBoxLayout* Layout = new QVBoxLayout; + Layout->setContentsMargins(0,0,0,0); + Layout->setSpacing(0); + ui->ContentsWidget->setLayout(Layout); + + mp_MessageContainer = new QWidget(this); + QVBoxLayout* MessageLayout = new QVBoxLayout; + MessageLayout->setContentsMargins(0,0,0,0); + MessageLayout->setSpacing(0); + mp_MessageContainer->setLayout(MessageLayout); + + ((QBoxLayout*)ui->ContentsWidget->layout())->addWidget(mp_MessageContainer, 0,Qt::AlignTop); + + ((QBoxLayout*)ui->ContentsWidget->layout())->addStretch(); + + refresh(); + // TODO (advanced: see if watcher catches external change) +} + + +// ===================================================================== +// ===================================================================== + + +WareStatusDashboardWidget::~WareStatusDashboardWidget() +{ + delete ui; +} + + +// ===================================================================== +// ===================================================================== + + +void WareStatusDashboardWidget::addMessage(openfluid::waresdev::WareSrcChecker::ReportingData::ReportingItem Item) +{ + WareStatusItemWidget* MessageWidget = new WareStatusItemWidget(Item); + mp_MessageContainer->layout()->addWidget(MessageWidget); + + connect(MessageWidget, SIGNAL(actionTriggered(QString)), this, SLOT(onActionTriggered(QString))); +} + + +// ===================================================================== +// ===================================================================== + + +void WareStatusDashboardWidget::clear() +{ + while (QLayoutItem* item = mp_MessageContainer->layout()->takeAt(0)) + { + if (item->widget()) + { + delete item->widget(); + } + delete item; + } +} + + +// ===================================================================== +// ===================================================================== + + +void WareStatusDashboardWidget::refresh() +{ + // First clean existing data + clear(); + + try // TOIMPL improve try/catch filtering + { + auto Checker = openfluid::waresdev::WareSrcChecker(m_WarePath); + auto Report = Checker.performCheck(true); + + setLevel(Report.getStatus()); + + // TODO check order? + for (const auto& CatItems : Report.Categories) + { + + for (const auto& Item : CatItems.second.Items) + { + if (Item.Status == ReportingData::ReportingStatus::WARNING || + Item.Status == ReportingData::ReportingStatus::ERROR) + { + addMessage(Item); + } + } + } + } + catch (std::exception& E) + { + std::string ErrorMsg = "WareSrcChecker error: " + std::string(E.what()); + setLevel(ReportingData::ReportingStatus::DISABLED); + ui->TitleLabel->setToolTip(QString::fromStdString(ErrorMsg)); + } +} + + +// ===================================================================== +// ===================================================================== + + +void WareStatusDashboardWidget::onActionTriggered(const QString& ActionCode) +{ + emit operationRequested(ActionCode); +} + + +// ===================================================================== +// ===================================================================== + + +void WareStatusDashboardWidget::setLevel(const ReportingData::ReportingStatus Level) +{ + if (Level == ReportingData::ReportingStatus::OK) + { + ui->TitleLabel->setText(tr("No issue")); + m_TitleColor = openfluid::ui::config::STATUS_OKCOLOR; + } + else if (Level == ReportingData::ReportingStatus::WARNING) + { + ui->TitleLabel->setText(tr("Warnings raised")); + m_TitleColor = openfluid::ui::config::STATUS_WARNCOLOR; + } + else if (Level == ReportingData::ReportingStatus::ERROR) + { + ui->TitleLabel->setText(tr("Issues detected")); + m_TitleColor = openfluid::ui::config::STATUS_ERRCOLOR; + } + else + { + ui->TitleLabel->setText(tr("Check is disabled")); + m_TitleColor = openfluid::ui::config::STATUS_DISABLEDCOLOR; + } + + applyStyleSheet(); +} + + +// ===================================================================== +// ===================================================================== + + +void WareStatusDashboardWidget::applyStyleSheet() +{ + ui->TitleLabel->setStyleSheet("color:"+m_TitleColor+"; font:bold;"); +} + + +} } } // namespaces diff --git a/src/openfluid/ui/waresdev/WareDashboardStatusWidget.hpp b/src/openfluid/ui/waresdev/WareStatusDashboardWidget.hpp similarity index 72% rename from src/openfluid/ui/waresdev/WareDashboardStatusWidget.hpp rename to src/openfluid/ui/waresdev/WareStatusDashboardWidget.hpp index 977efe07b..a8b73a03d 100644 --- a/src/openfluid/ui/waresdev/WareDashboardStatusWidget.hpp +++ b/src/openfluid/ui/waresdev/WareStatusDashboardWidget.hpp @@ -31,67 +31,73 @@ /** - @file WareDashboardStatusWidget.hpp + @file WareStatusDashboardWidget.hpp @author Jean-Christophe FABRE @author Armel THÖNI */ -#ifndef __OPENFLUID_UIWARESDEV_DSDASHBOARDSTATUSWIDGET_HPP__ -#define __OPENFLUID_UIWARESDEV_DSDASHBOARDSTATUSWIDGET_HPP__ +#ifndef __OPENFLUID_UIWARESDEV_WARESTATUSDASHBOARDWIDGET_HPP__ +#define __OPENFLUID_UIWARESDEV_WARESTATUSDASHBOARDWIDGET_HPP__ #include #include #include -#include namespace Ui { - class WareDashboardStatusWidget; + class WareStatusDashboardWidget; } namespace openfluid { namespace ui { namespace waresdev { -class WareDashboardStatusWidget : public QWidget +class WareStatusDashboardWidget : public QWidget { Q_OBJECT; private: - Ui::WareDashboardStatusWidget* ui; + Ui::WareStatusDashboardWidget* ui; std::string m_WarePath; QString m_TitleColor; - std::map mp_MessagesWidgets; + QWidget* mp_MessageContainer; void setLevel(const openfluid::waresdev::WareSrcChecker::ReportingData::ReportingStatus Level); void applyStyleSheet(); + void addMessage(openfluid::waresdev::WareSrcChecker::ReportingData::ReportingItem Item); + + void clear(); + + public slots: void refresh(); void onActionTriggered(const QString& ActionCode); + signals: - void migrationRequested(); + void operationRequested(const QString& ActionCode); + public: - WareDashboardStatusWidget(QWidget* Parent, const std::string& WarePath); + WareStatusDashboardWidget(QWidget* Parent, const std::string& WarePath); - ~WareDashboardStatusWidget(); + ~WareStatusDashboardWidget(); }; } } } // namespaces -#endif /* __OPENFLUID_UIWARESDEV_DSDASHBOARDSTATUSWIDGET_HPP__ */ +#endif /* __OPENFLUID_UIWARESDEV_WARESTATUSDASHBOARDWIDGET_HPP__ */ diff --git a/src/openfluid/ui/waresdev/WareDashboardStatusWidget.ui b/src/openfluid/ui/waresdev/WareStatusDashboardWidget.ui similarity index 71% rename from src/openfluid/ui/waresdev/WareDashboardStatusWidget.ui rename to src/openfluid/ui/waresdev/WareStatusDashboardWidget.ui index 9a70f73ab..0ae2ef28e 100644 --- a/src/openfluid/ui/waresdev/WareDashboardStatusWidget.ui +++ b/src/openfluid/ui/waresdev/WareStatusDashboardWidget.ui @@ -1,7 +1,7 @@ - WareDashboardStatusWidget - + WareStatusDashboardWidget + 0 @@ -29,7 +29,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -44,12 +53,30 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 - + + 9 + + + 9 + + + 9 + + 9 @@ -75,39 +102,29 @@ QFrame::Raised - + 0 - + + QLayout::SetMinimumSize + + + 6 + + + 6 + + + 6 + + 6 - - - - - 0 - 0 - - - - - 0 - 40 - - - - No problem detected - - - Qt::AlignBottom|Qt::AlignHCenter - - - - + 0 0 diff --git a/src/openfluid/ui/waresdev/StatusButtonMessageWidget.cpp b/src/openfluid/ui/waresdev/WareStatusItemWidget.cpp similarity index 62% rename from src/openfluid/ui/waresdev/StatusButtonMessageWidget.cpp rename to src/openfluid/ui/waresdev/WareStatusItemWidget.cpp index b40028a85..55a101e4d 100644 --- a/src/openfluid/ui/waresdev/StatusButtonMessageWidget.cpp +++ b/src/openfluid/ui/waresdev/WareStatusItemWidget.cpp @@ -31,7 +31,7 @@ /** - @file StatusButtonMessageWidget.cpp + @file WareStatusItemWidget.cpp @author Armel THÖNI */ @@ -39,39 +39,62 @@ #include -#include "ui_StatusButtonMessageWidget.h" -#include "StatusButtonMessageWidget.hpp" +#include "ui_WareStatusItemWidget.h" +#include "WareStatusItemWidget.hpp" namespace openfluid { namespace ui { namespace waresdev { -typedef openfluid::waresdev::WareSrcChecker::ReportingData ReportingData; // DIRTYCODE redundant +using ReportingData = openfluid::waresdev::WareSrcChecker::ReportingData; + std::map, - QString> StatusButtonMessageWidget::s_LabelForReportItem; + QString> WareStatusItemWidget::ms_LabelForReportItem; std::map, - std::pair> StatusButtonMessageWidget::s_ActionForReportItem; + std::pair> WareStatusItemWidget::ms_ActionForReportItem; // ===================================================================== // ===================================================================== -void StatusButtonMessageWidget::populateReportItemLabels() // FIXME: check if tr works with static functions +void WareStatusItemWidget::populateReportItemLabels() { - s_LabelForReportItem[std::make_pair( - "version_iscorrect", ReportingData::ReportingStatus::ERROR)] = \ - tr("Ware version is below current OpenFLUID version"); - s_LabelForReportItem[std::make_pair( + ms_LabelForReportItem[std::make_pair( + "cmakelists_exists", ReportingData::ReportingStatus::ERROR)] = \ + tr("'CMakeLists.txt' file does not exist."); + ms_LabelForReportItem[std::make_pair( + "readme_exists", ReportingData::ReportingStatus::WARNING)] = \ + tr("Readme file does not exist"); + ms_LabelForReportItem[std::make_pair( + "srcdir_exists", ReportingData::ReportingStatus::WARNING)] = \ + tr("'src' directory does not exist"); + ms_LabelForReportItem[std::make_pair( + "docdir_exists", ReportingData::ReportingStatus::WARNING)] = \ + tr("'doc' directory does not exist"); + ms_LabelForReportItem[std::make_pair( + "testsdir_exists", ReportingData::ReportingStatus::WARNING)] = \ + tr("'tests' directory does not exist"); + + ms_LabelForReportItem[std::make_pair( + "file_iscorrect", ReportingData::ReportingStatus::ERROR)] = \ + tr("Metadata can not be read"); + ms_LabelForReportItem[std::make_pair( "migration_isclean", ReportingData::ReportingStatus::WARNING)] = \ tr("Comments from migration remain in code"); + ms_LabelForReportItem[std::make_pair( + "rootdir_exists", ReportingData::ReportingStatus::ERROR)] = \ + tr(""); + ms_LabelForReportItem[std::make_pair( + "version_iscorrect", ReportingData::ReportingStatus::ERROR)] = \ + tr("Ware version is below current OpenFLUID version"); - s_ActionForReportItem[std::make_pair( + ms_ActionForReportItem[std::make_pair( "version_iscorrect", ReportingData::ReportingStatus::ERROR)] = \ std::pair("migration", tr("Try to migrate the ware")); - s_ActionForReportItem[std::make_pair( + ms_ActionForReportItem[std::make_pair( "migration_isclean", ReportingData::ReportingStatus::WARNING)] = \ std::pair("", tr("Look for '[MIGRATION]' comments in CMakeLists.txt and main cpp file.")); } @@ -81,8 +104,8 @@ void StatusButtonMessageWidget::populateReportItemLabels() // FIXME: check if tr // ===================================================================== -StatusButtonMessageWidget::StatusButtonMessageWidget(const ReportingData::ReportingItem& Item, QWidget* Parent) : - QWidget(Parent), ui(new Ui::StatusButtonMessageWidget) +WareStatusItemWidget::WareStatusItemWidget(const ReportingData::ReportingItem& Item, QWidget* Parent) : + QWidget(Parent), ui(new Ui::WareStatusItemWidget) { ui->setupUi(this); @@ -106,15 +129,19 @@ StatusButtonMessageWidget::StatusButtonMessageWidget(const ReportingData::Report if (m_ActionCode.isEmpty()) { ui->FixButton->setVisible(false); - if (!ActionLabel.isEmpty()) + if (ActionLabel.isEmpty()) + { + ui->HelpLabel->setVisible(false); + } + else { ui->HelpLabel->setText(ActionLabel); } } else { - ui->HelpLabel->setVisible(false); ui->FixButton->setText(ActionLabel); + ui->HelpLabel->setVisible(false); connect(ui->FixButton, SIGNAL(pressed()), this, SLOT(onButtonPressed())); } } @@ -124,7 +151,7 @@ StatusButtonMessageWidget::StatusButtonMessageWidget(const ReportingData::Report // ===================================================================== -void StatusButtonMessageWidget::onButtonPressed() +void WareStatusItemWidget::onButtonPressed() { emit actionTriggered(m_ActionCode); } @@ -134,7 +161,7 @@ void StatusButtonMessageWidget::onButtonPressed() // ===================================================================== -StatusButtonMessageWidget::~StatusButtonMessageWidget() +WareStatusItemWidget::~WareStatusItemWidget() { delete ui; } @@ -144,7 +171,7 @@ StatusButtonMessageWidget::~StatusButtonMessageWidget() // ===================================================================== -void StatusButtonMessageWidget::setStatusLevel(const ReportingData::ReportingStatus Level) +void WareStatusItemWidget::setStatusLevel(const ReportingData::ReportingStatus Level) { if (Level == ReportingData::ReportingStatus::WARNING) { @@ -165,10 +192,10 @@ void StatusButtonMessageWidget::setStatusLevel(const ReportingData::ReportingSta // ===================================================================== -QString StatusButtonMessageWidget::getLabelForItem(const ReportingData::ReportingItem& Item) +QString WareStatusItemWidget::getLabelForItem(const ReportingData::ReportingItem& Item) { QString Label = ""; - for (auto KeyValue : s_LabelForReportItem) + for (auto KeyValue : ms_LabelForReportItem) { if (KeyValue.first.first == Item.Message && KeyValue.first.second == Item.Status) { @@ -183,11 +210,11 @@ QString StatusButtonMessageWidget::getLabelForItem(const ReportingData::Reportin // ===================================================================== -std::optional> StatusButtonMessageWidget::getActionForItem(const +std::optional> WareStatusItemWidget::getActionForItem(const ReportingData::ReportingItem& Item) { QString Label = ""; - for (auto KeyValue : s_ActionForReportItem) + for (auto KeyValue : ms_ActionForReportItem) { if (KeyValue.first.first == Item.Message && KeyValue.first.second == Item.Status) { diff --git a/src/openfluid/ui/waresdev/StatusButtonMessageWidget.hpp b/src/openfluid/ui/waresdev/WareStatusItemWidget.hpp similarity index 76% rename from src/openfluid/ui/waresdev/StatusButtonMessageWidget.hpp rename to src/openfluid/ui/waresdev/WareStatusItemWidget.hpp index a1b959408..bc851fb16 100644 --- a/src/openfluid/ui/waresdev/StatusButtonMessageWidget.hpp +++ b/src/openfluid/ui/waresdev/WareStatusItemWidget.hpp @@ -31,14 +31,14 @@ /** - @file StatusButtonMessageWidget.hpp + @file WareStatusItemWidget.hpp @author Armel THÖNI */ -#ifndef __OPENFLUID_UIWARESDEV_STATUSBUTTONMESSAGEWIDGET_HPP__ -#define __OPENFLUID_UIWARESDEV_STATUSBUTTONMESSAGEWIDGET_HPP__ +#ifndef __OPENFLUID_UIWARESDEV_WARESTATUSITEMWIDGET_HPP__ +#define __OPENFLUID_UIWARESDEV_WARESTATUSITEMWIDGET_HPP__ #include @@ -50,13 +50,13 @@ namespace Ui { - class StatusButtonMessageWidget; + class WareStatusItemWidget; } namespace openfluid { namespace ui { namespace waresdev { -class StatusButtonMessageWidget : public QWidget +class WareStatusItemWidget : public QWidget { Q_OBJECT; @@ -65,11 +65,11 @@ class StatusButtonMessageWidget : public QWidget typedef openfluid::waresdev::WareSrcChecker::ReportingData ReportingData; static std::map, - QString> s_LabelForReportItem; // translatable text for each report item + QString> ms_LabelForReportItem; // translatable text for each report item static std::map, - std::pair> s_ActionForReportItem; // action code and translatable button message + std::pair> ms_ActionForReportItem; // action code and translatable button message - Ui::StatusButtonMessageWidget* ui; + Ui::WareStatusItemWidget* ui; QString m_ActionCode; @@ -94,10 +94,10 @@ class StatusButtonMessageWidget : public QWidget static void populateReportItemLabels(); - StatusButtonMessageWidget(const ReportingData::ReportingItem& Item, + WareStatusItemWidget(const ReportingData::ReportingItem& Item, QWidget* Parent = nullptr); - ~StatusButtonMessageWidget(); + ~WareStatusItemWidget(); }; @@ -105,4 +105,4 @@ class StatusButtonMessageWidget : public QWidget } } } // namespaces -#endif /* __OPENFLUID_UIWARESDEV_STATUSBUTTONMESSAGEWIDGET_HPP__ */ +#endif /* __OPENFLUID_UIWARESDEV_WARESTATUSITEMWIDGET_HPP__ */ diff --git a/src/openfluid/ui/waresdev/StatusButtonMessageWidget.ui b/src/openfluid/ui/waresdev/WareStatusItemWidget.ui similarity index 97% rename from src/openfluid/ui/waresdev/StatusButtonMessageWidget.ui rename to src/openfluid/ui/waresdev/WareStatusItemWidget.ui index 89adb66f8..d9f0699c3 100644 --- a/src/openfluid/ui/waresdev/StatusButtonMessageWidget.ui +++ b/src/openfluid/ui/waresdev/WareStatusItemWidget.ui @@ -1,7 +1,7 @@ - StatusButtonMessageWidget - + WareStatusItemWidget + 0