[nostalgia/studio] Move undo stack to Editor
This commit is contained in:
@@ -13,10 +13,6 @@ namespace nostalgia::studio {
|
||||
Editor::Editor(QWidget *parent): QWidget(parent) {
|
||||
}
|
||||
|
||||
QUndoStack *Editor::undoStack() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Editor::save() {
|
||||
saveItem();
|
||||
setUnsavedChanges(false);
|
||||
@@ -27,6 +23,10 @@ void Editor::setUnsavedChanges(bool uc) {
|
||||
emit unsavedChangesUpdate(uc);
|
||||
}
|
||||
|
||||
QUndoStack *Editor::undoStack() {
|
||||
return &m_cmdStack;
|
||||
}
|
||||
|
||||
void Editor::saveItem() {
|
||||
}
|
||||
|
||||
|
@@ -19,6 +19,7 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
QUndoStack m_cmdStack;
|
||||
bool m_unsavedChanges = false;
|
||||
|
||||
public:
|
||||
@@ -31,11 +32,6 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
|
||||
*/
|
||||
virtual QString itemName() = 0;
|
||||
|
||||
/**
|
||||
* Returns the undo stack holding changes to the item being edited.
|
||||
*/
|
||||
virtual QUndoStack *undoStack();
|
||||
|
||||
/**
|
||||
* Save changes to item being edited.
|
||||
*/
|
||||
@@ -47,6 +43,11 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
|
||||
*/
|
||||
void setUnsavedChanges(bool);
|
||||
|
||||
/**
|
||||
* Returns the undo stack holding changes to the item being edited.
|
||||
*/
|
||||
QUndoStack *undoStack();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Save changes to item being edited.
|
||||
|
Reference in New Issue
Block a user