Skip to content

Commit

Permalink
Fix crash if click after close file. Fix warning that 3 axis points e…
Browse files Browse the repository at this point in the history
…xist after one is deleted
  • Loading branch information
markummitchell-tu committed Oct 30, 2015
1 parent 90bc4cd commit a0d8c69
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engauge.pro.user.mmitchell
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2015-10-26T23:50:33. -->
<!-- Written by QtCreator 3.0.1, 2015-10-29T23:53:44. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
Expand Down
4 changes: 4 additions & 0 deletions src/Transformation/Transformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ void Transformation::update (bool fileIsLoaded,

updateTransformFromMatrices (ftor.matrixScreen(),
ftor.matrixGraph());
} else {

m_transformIsDefined = false;

}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1998,6 +1998,10 @@ void MainWindow::slotFileClose()
m_transformation,
selectedGraphCurve());

// Transition to empty state so an inadvertent mouse press does not trigger, for example,
// the creation of an axis point on a non-existent GraphicsScene (=crash)
m_digitizeStateContext->requestImmediateStateTransition (DIGITIZE_STATE_EMPTY);

// Remove screen objects
m_scene->resetOnLoad ();

Expand Down Expand Up @@ -2920,7 +2924,7 @@ void MainWindow::updateControls ()

m_menuFileOpenRecent->setEnabled ((m_actionRecentFiles.count () > 0) &&
(m_actionRecentFiles.at(0)->isVisible ())); // Need at least one visible recent file entry
m_actionClose->setEnabled (!m_engaugeFile.isEmpty ());
m_actionClose->setEnabled (!m_currentFile.isEmpty ());
m_actionSave->setEnabled (!m_engaugeFile.isEmpty ());
m_actionSaveAs->setEnabled (!m_currentFile.isEmpty ());
m_actionExport->setEnabled (!m_currentFile.isEmpty ());
Expand Down

0 comments on commit a0d8c69

Please sign in to comment.