[nostalgia/studio] Add Export menu item and hook

This commit is contained in:
2020-03-24 21:42:42 -05:00
parent f90a6e30ea
commit 26747a6d0f
4 changed files with 55 additions and 7 deletions
+13 -2
View File
@@ -21,6 +21,7 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
private:
QUndoStack m_cmdStack;
bool m_unsavedChanges = false;
bool m_exportable = false;
public:
Editor(QWidget *parent);
@@ -32,6 +33,8 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
*/
virtual QString itemName() = 0;
virtual void exportFile();
/**
* Save changes to item being edited.
*/
@@ -39,15 +42,21 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
/**
* Sets indication of item being edited has unsaved changes. Also emits
* unsavedChangesUpdate signal.
* unsavedChangesChanged signal.
*/
void setUnsavedChanges(bool);
[[nodiscard]] bool unsavedChanges() noexcept;
/**
* Returns the undo stack holding changes to the item being edited.
*/
QUndoStack *undoStack();
void setExportable(bool);
bool exportable();
protected:
/**
* Save changes to item being edited.
@@ -55,7 +64,9 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
virtual void saveItem();
signals:
void unsavedChangesUpdate(bool);
void unsavedChangesChanged(bool);
void exportableChanged(bool);
};