[nostalgia/studio] Add save action and cleanup
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <ox/std/types.hpp>
|
||||
|
||||
#include "lib/context.hpp"
|
||||
#include "lib/plugin.hpp"
|
||||
#include "lib/project.hpp"
|
||||
|
||||
@@ -43,22 +44,6 @@ ox::Error model(T *io, NostalgiaStudioState *obj) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
struct NostalgiaStudioPluginDef {
|
||||
QString dir;
|
||||
QString libName;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
ox::Error model(T *io, NostalgiaStudioPluginDef *obj) {
|
||||
auto err = OxError(0);
|
||||
oxReturnError(io->setTypeInfo("NostalgiaStudioPluginDef", 2));
|
||||
oxReturnError(io->field("dir", &obj->dir));
|
||||
oxReturnError(io->field("lib_name", &obj->libName));
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
struct NostalgiaStudioProfile {
|
||||
QString appName;
|
||||
QString orgName;
|
||||
@@ -88,6 +73,7 @@ class MainWindow: public QMainWindow {
|
||||
NostalgiaStudioProfile m_profile;
|
||||
NostalgiaStudioState m_state;
|
||||
QAction *m_importAction = nullptr;
|
||||
QAction *m_saveAction = nullptr;
|
||||
Context m_ctx;
|
||||
QPointer<QMenu> m_viewMenu;
|
||||
QVector<QPointer<QDockWidget>> m_dockWidgets;
|
||||
@@ -97,6 +83,7 @@ class MainWindow: public QMainWindow {
|
||||
QPointer<OxFSModel> m_oxfsView = nullptr;
|
||||
QTabWidget *m_tabs = nullptr;
|
||||
QUndoGroup m_undoGroup;
|
||||
Editor* m_currentEditor = nullptr;
|
||||
|
||||
public:
|
||||
MainWindow(QString profilePath);
|
||||
@@ -110,8 +97,6 @@ class MainWindow: public QMainWindow {
|
||||
|
||||
void loadPlugin(QString path);
|
||||
|
||||
void setupDockWidgets();
|
||||
|
||||
void setupMenu();
|
||||
|
||||
void setupProjectExplorer();
|
||||
@@ -157,6 +142,8 @@ class MainWindow: public QMainWindow {
|
||||
|
||||
void openFileSlot(QModelIndex);
|
||||
|
||||
void saveFile();
|
||||
|
||||
void closeTab(int idx);
|
||||
|
||||
void moveTab(int from, int to);
|
||||
|
||||
Reference in New Issue
Block a user