global: made every user action set a project "modified" state that will prevent

the main window from closing instantly
This commit is contained in:
itsmattkc
2020-03-03 14:33:45 +11:00
parent 0f5cd40c45
commit baf3fbde05
25 changed files with 377 additions and 238 deletions
+33
View File
@@ -0,0 +1,33 @@
#include "undocommand.h"
#include "core.h"
UndoCommand::UndoCommand(QUndoCommand *parent) :
QUndoCommand(parent)
{
}
void UndoCommand::redo()
{
redo_internal();
modified_ = Core::instance()->IsProjectModified();
Core::instance()->SetProjectModified(true);
}
void UndoCommand::undo()
{
undo_internal();
Core::instance()->SetProjectModified(modified_);
}
void UndoCommand::redo_internal()
{
QUndoCommand::redo();
}
void UndoCommand::undo_internal()
{
QUndoCommand::undo();
}