Skip to content

Commit

Permalink
Warn in onNew if there are unsaved changes
Browse files Browse the repository at this point in the history
Closes issue #185
  • Loading branch information
mkeeter committed Sep 13, 2017
1 parent 86655ff commit 2618d09
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/app/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,16 @@ QStringList App::nodePaths() const

void App::onNew()
{
graph->clear();
filename.clear();
undo_stack->clear();
if (undo_stack->isClean() || QMessageBox::question(
NULL, "Discard unsaved changes?",
"Discard unsaved changes?") == QMessageBox::Yes)
{
graph->clear();
filename.clear();
undo_stack->clear();

emit(filenameChanged(""));
emit(filenameChanged(""));
}
}

void App::onSave()
Expand Down

0 comments on commit 2618d09

Please sign in to comment.