[nostalgia/studio] Cleanup save hooks and add unsaved changes marker to tabs

This commit is contained in:
2020-03-11 00:20:40 -05:00
parent bf00ff0e41
commit 6ada347ec4
4 changed files with 44 additions and 19 deletions
+4 -4
View File
@@ -13,15 +13,12 @@ namespace nostalgia::studio {
Editor::Editor(QWidget *parent): QWidget(parent) {
}
void Editor::saveItem() {
}
QUndoStack *Editor::undoStack() {
return nullptr;
}
void Editor::save() {
save();
saveItem();
setUnsavedChanges(false);
}
@@ -30,4 +27,7 @@ void Editor::setUnsavedChanges(bool uc) {
emit unsavedChangesUpdate(uc);
}
void Editor::saveItem() {
}
}
+7 -6
View File
@@ -18,7 +18,7 @@ namespace nostalgia::studio {
class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
Q_OBJECT
private:
private:
bool m_unsavedChanges = false;
public:
@@ -31,11 +31,6 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
*/
virtual QString itemName() = 0;
/**
* Save changes to item being edited.
*/
virtual void saveItem();
/**
* Returns the undo stack holding changes to the item being edited.
*/
@@ -52,6 +47,12 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
*/
void setUnsavedChanges(bool);
protected:
/**
* Save changes to item being edited.
*/
virtual void saveItem();
signals:
void unsavedChangesUpdate(bool);