Skip to content

Commit

Permalink
Merge e0c4899 into afada80
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed May 17, 2019
2 parents afada80 + e0c4899 commit 81f6d63
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 73 deletions.
3 changes: 1 addition & 2 deletions doc/downloads/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ var jsonData = { "versions": [
}
],
"changes": [
{ "change": "<strong>SED-ML support:</strong> fixed our detection of SED-ML file (see issue <a href=\"https://github.com/opencor/opencor/issues/2082\">#2082</a>)." },
{ "change": "<strong>Simulation support:</strong> generalised the reporting of a simulation's issues (see issue <a href=\"https://github.com/opencor/opencor/issues/2080\">#2080</a>)." }
{ "change": "<strong>Simulation support:</strong> allow a remote SED-ML file to be run headless (see issue <a href=\"https://github.com/opencor/opencor/issues/2085\">#2085</a>)." }
]
},
{ "major": 0, "minor": 5, "patch": 0, "day": 15, "month": 10, "year": 2016, "type": 0, "license": 1,
Expand Down
23 changes: 23 additions & 0 deletions doc/downloads/previousSnapshots.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions doc/whatIsNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ var jsonData = { "versions": [
"entries": [
{ "type": "fixed", "description": "Files with a master attribute of \"1\" (rather than \"true\")." }
]
},
{ "type": "subCategory", "name": "Simulation support",
"entries": [
{ "type": "fixed", "description": "Issue with a remote SED-ML file being run headless." }
]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ bool RawCellmlViewWidget::validate(const QString &pFileName, QString &pExtra,

CellMLSupport::CellmlFile *cellmlFile = CellMLSupport::CellmlFileManager::instance()->cellmlFile(pFileName);
CellMLSupport::CellmlFileIssues cellmlFileIssues;
bool res = cellmlFile->isValid(editingWidget->editorWidget()->contents(), cellmlFileIssues, true);
bool res = cellmlFile->isValid(editingWidget->editorWidget()->contents(), cellmlFileIssues);

// Warn the user about the CellML issues being maybe for a(n)
// (in)direclty imported CellML file, should we be dealing with a CellML
Expand Down
30 changes: 15 additions & 15 deletions src/plugins/miscellaneous/Core/src/commonwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ void CommonWidget::showProgressBusyWidget()

//==============================================================================

void CommonWidget::setBusyWidgetProgress(double pProgress)
{
// Make sure that we have a busy widget

if (mBusyWidget == nullptr) {
return;
}

// Set the progress of our busy widget

mBusyWidget->setProgress(pProgress);
}

//==============================================================================

void CommonWidget::hideBusyWidget(bool pForceHiding)
{
// Make sure that we have a busy widget
Expand Down Expand Up @@ -199,21 +214,6 @@ void CommonWidget::resizeBusyWidget()

//==============================================================================

void CommonWidget::setBusyWidgetProgress(double pProgress)
{
// Make sure that we have a busy widget

if (mBusyWidget == nullptr) {
return;
}

// Set the progress of our busy widget

mBusyWidget->setProgress(pProgress);
}

//==============================================================================

void CommonWidget::processEvents()
{
// Process events, but only if our parent is visible and updates are enabled
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/miscellaneous/Core/src/commonwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,9 @@ class CORE_EXPORT CommonWidget
public slots:
void showBusyWidget();
void showProgressBusyWidget();

void setBusyWidgetProgress(double pProgress);
void hideBusyWidget(bool pForceHiding = false);

void resizeBusyWidget();

void setBusyWidgetProgress(double pProgress);
};

//==============================================================================
Expand Down
65 changes: 62 additions & 3 deletions src/plugins/miscellaneous/Core/src/coreguiutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,22 @@ namespace Core {

CentralWidget * centralWidget()
{
// Make sure that we have a main window, i.e. that we are running the GUI
// version of OpenCOR

if (mainWindow() == nullptr) {
return nullptr;
}

// Retrieve and return our central widget

static bool firstTime = true;
static CentralWidget *res = nullptr;

if (firstTime) {
for (auto object : mainWindow()->children()) {
if (strcmp(object->metaObject()->className(), "OpenCOR::Core::CentralWidget") == 0) {
res = qobject_cast<CentralWidget *>(object);
for (const auto &child : mainWindow()->children()) {
if (strcmp(child->metaObject()->className(), "OpenCOR::Core::CentralWidget") == 0) {
res = qobject_cast<CentralWidget *>(child);

break;
}
Expand All @@ -86,6 +93,58 @@ CentralWidget * centralWidget()

//==============================================================================

void showCentralBusyWidget()
{
// Show our central busy widget, if possible

CentralWidget *centralWidget = Core::centralWidget();

if (centralWidget != nullptr) {
centralWidget->showBusyWidget();
}
}

//==============================================================================

void showCentralProgressBusyWidget()
{
// Show our central progress busy widget, if possible

CentralWidget *centralWidget = Core::centralWidget();

if (centralWidget != nullptr) {
centralWidget->showProgressBusyWidget();
}
}

//==============================================================================

void setCentralBusyWidgetProgress(double pProgress)
{
// Set our central busy widget progress, if possible

CentralWidget *centralWidget = Core::centralWidget();

if (centralWidget != nullptr) {
centralWidget->setBusyWidgetProgress(pProgress);
}
}

//==============================================================================

void hideCentralBusyWidget()
{
// Hide our central busy widget, if possible

CentralWidget *centralWidget = Core::centralWidget();

if (centralWidget != nullptr) {
centralWidget->hideBusyWidget();
}
}

//==============================================================================

QString allFilters(const QStringList &pFilters)
{
QStringList filters = pFilters;
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/miscellaneous/Core/src/coreguiutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ class CORE_EXPORT StyledItemDelegate : public QStyledItemDelegate

CentralWidget CORE_EXPORT * centralWidget();

void CORE_EXPORT showCentralBusyWidget();
void CORE_EXPORT showCentralProgressBusyWidget();
void CORE_EXPORT setCentralBusyWidgetProgress(double pProgress);
void CORE_EXPORT hideCentralBusyWidget();

QString CORE_EXPORT getOpenFileName(const QString &pCaption,
const QStringList &pFilters = QStringList(),
QString *pSelectedFilter = nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ void SimulationExperimentViewSimulationWidget::initialize(bool pReloadingView)
bool isCombineArchive = mSimulation->fileType() == SimulationSupport::Simulation::FileType::CombineArchive;

if (isVisible() && (isSedmlFile || isCombineArchive)) {
Core::centralWidget()->showBusyWidget();
Core::showCentralBusyWidget();
}

processEvents();
Expand Down Expand Up @@ -3390,7 +3390,7 @@ bool SimulationExperimentViewSimulationWidget::import(const QString &pFileName,
if (problem == None) {
// Everything is fine, so do the actual import

Core::centralWidget()->showProgressBusyWidget();
Core::showCentralProgressBusyWidget();

DataStore::DataStoreImporter *dataStoreImporter = dataStoreInterface->dataStoreImporterInstance();

Expand Down Expand Up @@ -3502,7 +3502,7 @@ void SimulationExperimentViewSimulationWidget::simulationResultsExport()
if (dataStoreExportData != nullptr) {
// We have got the data we need, so do the actual export

Core::centralWidget()->showProgressBusyWidget();
Core::showCentralProgressBusyWidget();

DataStore::DataStoreExporter *dataStoreExporter = dataStoreInterface->dataStoreExporterInstance();

Expand Down Expand Up @@ -4468,7 +4468,7 @@ void SimulationExperimentViewSimulationWidget::dataStoreImportProgress(DataStore

// There has been some progress with our import, so update our busy widget

Core::centralWidget()->setBusyWidgetProgress(pProgress);
Core::setCentralBusyWidgetProgress(pProgress);
}

//==============================================================================
Expand All @@ -4486,7 +4486,7 @@ void SimulationExperimentViewSimulationWidget::dataStoreImportDone(DataStore::Da

// Hide our busy widget

Core::centralWidget()->hideBusyWidget();
Core::hideCentralBusyWidget();

// Let people know about any error that we came across

Expand All @@ -4508,7 +4508,7 @@ void SimulationExperimentViewSimulationWidget::dataStoreExportProgress(DataStore

// There has been some progress with our export, so update our busy widget

Core::centralWidget()->setBusyWidgetProgress(pProgress);
Core::setCentralBusyWidgetProgress(pProgress);
}

//==============================================================================
Expand All @@ -4520,7 +4520,7 @@ void SimulationExperimentViewSimulationWidget::dataStoreExportDone(DataStore::Da

// We are done with the export, so hide our busy widget

Core::centralWidget()->hideBusyWidget();
Core::hideCentralBusyWidget();

// Display the given error message, if any

Expand Down

0 comments on commit 81f6d63

Please sign in to comment.