[nostalgia/studio] Add Cut action hook

This commit is contained in:
2020-10-19 20:14:20 -05:00
parent 79acffcc29
commit 9effdad200
4 changed files with 41 additions and 0 deletions
+12
View File
@@ -13,6 +13,9 @@ namespace nostalgia::studio {
Editor::Editor(QWidget *parent): QWidget(parent) {
}
void Editor::cut() {
}
void Editor::copy() {
}
@@ -49,6 +52,15 @@ bool Editor::exportable() const {
return m_exportable;
}
void Editor::setCutEnabled(bool v) {
m_cutEnabled = v;
emit cutEnabledChanged(v);
}
bool Editor::cutEnabled() const {
return m_cutEnabled;
}
void Editor::setCopyEnabled(bool v) {
m_copyEnabled = v;
emit copyEnabledChanged(v);
+9
View File
@@ -22,6 +22,7 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
QUndoStack m_cmdStack;
bool m_unsavedChanges = false;
bool m_exportable = false;
bool m_cutEnabled = false;
bool m_copyEnabled = false;
bool m_pasteEnabled = false;
@@ -35,6 +36,8 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
*/
virtual QString itemName() const = 0;
virtual void cut();
virtual void copy();
virtual void paste();
@@ -63,6 +66,10 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
[[nodiscard]] bool exportable() const;
void setCutEnabled(bool);
[[nodiscard]] bool cutEnabled() const;
void setCopyEnabled(bool);
[[nodiscard]] bool copyEnabled() const;
@@ -82,6 +89,8 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
void exportableChanged(bool);
void cutEnabledChanged(bool);
void copyEnabledChanged(bool);
void pasteEnabledChanged(bool);