[nostalgia/studio] Cleanup save hooks and add unsaved changes marker to tabs
This commit is contained in:
@@ -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() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user