Skip to content

Commit

Permalink
Simulation Experiment view: don’t consider a SED-ML file as modified …
Browse files Browse the repository at this point in the history
…under certain conditions (#1626).
  • Loading branch information
agarny committed May 2, 2018
1 parent 609b4d5 commit a6ca926
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,13 @@ void SimulationExperimentViewSimulationWidget::initialize(bool pReloadingView)
}

setUpdatesEnabled(true);

// Keep track of the initial size of our different graph panels
// Note: we do this through a single shot to give time to be certain that
// the GUI is ready and that the size of our different graph panels is
// therefore final...

QTimer::singleShot(0, this, &SimulationExperimentViewSimulationWidget::finalFurtherInitialize);
}

//==============================================================================
Expand Down Expand Up @@ -2996,6 +3003,19 @@ bool SimulationExperimentViewSimulationWidget::furtherInitialize()

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

void SimulationExperimentViewSimulationWidget::finalFurtherInitialize()
{
// The GUI is all ready, so we can initialise mGraphPanelsWidgetSizes, as
// well as mGraphPanelPropertiesModified and mGraphsPropertiesModified by
// calling checkGraphPanelsAndGraphs()

mGraphPanelsWidgetSizes = mContentsWidget->graphPanelsWidget()->sizes();

checkGraphPanelsAndGraphs();
}

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

void SimulationExperimentViewSimulationWidget::initializeGui(bool pValidSimulationEnvironment)
{
// Show/hide some widgets based on whether we have a valid simulation
Expand Down Expand Up @@ -3682,20 +3702,6 @@ void SimulationExperimentViewSimulationWidget::updateGui(bool pCheckVisibility)
if (pCheckVisibility && !isVisible())
return;

// We need to update our GUI, which means that we can initialise
// mGraphPanelsWidgetSizes, if needed, as well as
// mGraphPanelPropertiesModified and mGraphsPropertiesModified by calling
// checkGraphPanelsAndGraphs()
// Note: we initialise mGraphPanelsWidgetSizes here since when we set our
// graph panels widget's sizes in furtherInitialize(), we don't end up
// with the final sizes since nothing is visible yet...

if (mGraphPanelsWidgetSizes.isEmpty()) {
mGraphPanelsWidgetSizes = mContentsWidget->graphPanelsWidget()->sizes();

checkGraphPanelsAndGraphs();
}

// Make sure that our graph panel and graphs widget's GUI is up to date

mContentsWidget->informationWidget()->graphPanelAndGraphsWidget()->updateGui();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ private slots:
void checkSimulationProperties();
void checkSolversProperties();
void checkGraphPanelsAndGraphs();

void finalFurtherInitialize();
};

//==============================================================================
Expand Down

0 comments on commit a6ca926

Please sign in to comment.