Skip to content

Commit

Permalink
SimulationExperiment view: make sure that the GUI is properly initial…
Browse files Browse the repository at this point in the history
…ised when (re)loading a SED-ML file.
  • Loading branch information
agarny committed Sep 26, 2017
2 parents 9e0a5b1 + 2f74b8e commit 65e1241
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/downloads/index.js
Expand Up @@ -38,7 +38,7 @@ var jsonData = { "versions": [
],
"changes": [
{ "change": "<strong>Graph Panel widget:</strong> can now export a graph panel to various formats (e.g. PDF, PNG, SVG) (see issue <a href=\"https://github.com/opencor/opencor/issues/1123\">#1123</a>)." },
{ "change": "<strong>SimulationExperiment view:</strong> added support for the alpha channel in the colours used to customise a graph." }
{ "change": "<strong>SimulationExperiment view:</strong> added support for the alpha channel in the colours used to customise a graph. Made sure that the GUI is properly initialised when (re)loading a SED-ML file." }
]
},
{ "major": 0, "minor": 4, "patch": 1, "day": 20, "month": 5, "year": 2015, "type": 0,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/miscellaneous/Core/src/treeviewwidget.cpp
Expand Up @@ -289,7 +289,7 @@ void TreeViewWidget::startDrag(Qt::DropActions pSupportedActions)
if (drag->exec(pSupportedActions, realDefaultDropAction) == Qt::MoveAction) {
// We want to move the items
// Note: the following code is based on
// QAbstractItemViewPrivate::clearOrRemove...
// QAbstractItemViewPrivate::clearOrRemove()...

const QItemSelection selection = selectionModel()->selection();

Expand Down
Expand Up @@ -2415,7 +2415,6 @@ bool SimulationExperimentViewSimulationWidget::doFurtherInitialize()
int newNbOfGraphPanels = sedmlDocument->getNumOutputs();

graphPanelsWidget->setSizes(QIntList());
graphPanelsWidget->setActiveGraphPanel(graphPanelsWidget->graphPanels().first());

if (newNbOfGraphPanels > oldNbOfGraphPanels) {
for (uint i = 0, iMax = newNbOfGraphPanels-oldNbOfGraphPanels; i < iMax; ++i)
Expand All @@ -2425,6 +2424,8 @@ bool SimulationExperimentViewSimulationWidget::doFurtherInitialize()
graphPanelsWidget->removeCurrentGraphPanel();
}

graphPanelsWidget->setActiveGraphPanel(graphPanelsWidget->graphPanels().first());

// Customise our graphs widget

for (int i = 0; i < newNbOfGraphPanels; ++i) {
Expand Down
Expand Up @@ -288,7 +288,7 @@ void GraphPanelsWidget::setActiveGraphPanel(GraphPanelWidget *pGraphPanel)

// Make the given graph panel the active one

pGraphPanel->setActive(true);
pGraphPanel->setActive(true, true);
}

//==============================================================================
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/widget/GraphPanelWidget/src/graphpanelwidget.cpp
Expand Up @@ -233,9 +233,9 @@ void GraphPanelWidget::updateMarkerColor()

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

void GraphPanelWidget::setActive(const bool &pActive)
void GraphPanelWidget::setActive(const bool &pActive, const bool &pForce)
{
if (pActive == mActive)
if ((pActive == mActive) && !pForce)
return;

// Set the graph panel's active state
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/widget/GraphPanelWidget/src/graphpanelwidget.h
Expand Up @@ -64,7 +64,7 @@ class GRAPHPANELWIDGET_EXPORT GraphPanelWidget : public Core::Widget
virtual void retranslateUi();

bool isActive() const;
void setActive(const bool &pActive);
void setActive(const bool &pActive, const bool &pForce = false);

GraphPanelPlotWidget * plot() const;

Expand Down

0 comments on commit 65e1241

Please sign in to comment.