From 038f0ee493f04d3d962426c1468e8c812fd73d2f Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Wed, 1 Jan 2020 19:26:41 -0600 Subject: [PATCH] [nostalgia/studio] Move OxFSTreeView out of Studio lib --- src/nostalgia/studio/CMakeLists.txt | 1 + src/nostalgia/studio/lib/CMakeLists.txt | 2 -- src/nostalgia/studio/lib/plugin.hpp | 20 ++++++++++++++----- src/nostalgia/studio/mainwindow.cpp | 1 - src/nostalgia/studio/mainwindow.hpp | 3 ++- .../studio/{lib => }/oxfstreeview.cpp | 0 .../studio/{lib => }/oxfstreeview.hpp | 0 src/nostalgia/studio/studio.hpp | 1 - 8 files changed, 18 insertions(+), 10 deletions(-) rename src/nostalgia/studio/{lib => }/oxfstreeview.cpp (100%) rename src/nostalgia/studio/{lib => }/oxfstreeview.hpp (100%) diff --git a/src/nostalgia/studio/CMakeLists.txt b/src/nostalgia/studio/CMakeLists.txt index 75ae47d0..f3abd3e1 100644 --- a/src/nostalgia/studio/CMakeLists.txt +++ b/src/nostalgia/studio/CMakeLists.txt @@ -4,6 +4,7 @@ add_executable( nostalgia-studio MACOSX_BUNDLE main.cpp mainwindow.cpp + oxfstreeview.cpp ) target_link_libraries( diff --git a/src/nostalgia/studio/lib/CMakeLists.txt b/src/nostalgia/studio/lib/CMakeLists.txt index 6a9fa89d..a681330f 100644 --- a/src/nostalgia/studio/lib/CMakeLists.txt +++ b/src/nostalgia/studio/lib/CMakeLists.txt @@ -7,7 +7,6 @@ add_library( json_read.cpp json_write.cpp wizard.cpp - oxfstreeview.cpp plugin.cpp project.cpp ) @@ -30,7 +29,6 @@ install( json_read.hpp json_write.hpp wizard.hpp - oxfstreeview.hpp plugin.hpp project.hpp DESTINATION diff --git a/src/nostalgia/studio/lib/plugin.hpp b/src/nostalgia/studio/lib/plugin.hpp index e04f9ed0..0415c087 100644 --- a/src/nostalgia/studio/lib/plugin.hpp +++ b/src/nostalgia/studio/lib/plugin.hpp @@ -10,6 +10,7 @@ #include +#include #include #include @@ -19,11 +20,20 @@ namespace nostalgia::studio { -struct Context { - QString appName; - QString orgName; - QWidget *tabParent = nullptr; - const Project *project = nullptr; +struct Context: public QObject { + Q_OBJECT + + public: + QString appName; + QString orgName; + QWidget *tabParent = nullptr; + const Project *project = nullptr; + + signals: + void addToolBar(QToolBar *tb); + + void removeToolBar(QToolBar *tb); + }; struct EditorMaker { diff --git a/src/nostalgia/studio/mainwindow.cpp b/src/nostalgia/studio/mainwindow.cpp index b0ce104e..8694e7d9 100644 --- a/src/nostalgia/studio/mainwindow.cpp +++ b/src/nostalgia/studio/mainwindow.cpp @@ -24,7 +24,6 @@ #include "lib/editor.hpp" #include "lib/json.hpp" -#include "lib/oxfstreeview.hpp" #include "lib/project.hpp" #include "lib/wizard.hpp" diff --git a/src/nostalgia/studio/mainwindow.hpp b/src/nostalgia/studio/mainwindow.hpp index 9bbefd5c..ba13b95f 100644 --- a/src/nostalgia/studio/mainwindow.hpp +++ b/src/nostalgia/studio/mainwindow.hpp @@ -24,10 +24,11 @@ #include -#include "lib/oxfstreeview.hpp" #include "lib/plugin.hpp" #include "lib/project.hpp" +#include "oxfstreeview.hpp" + namespace nostalgia::studio { struct NostalgiaStudioState { diff --git a/src/nostalgia/studio/lib/oxfstreeview.cpp b/src/nostalgia/studio/oxfstreeview.cpp similarity index 100% rename from src/nostalgia/studio/lib/oxfstreeview.cpp rename to src/nostalgia/studio/oxfstreeview.cpp diff --git a/src/nostalgia/studio/lib/oxfstreeview.hpp b/src/nostalgia/studio/oxfstreeview.hpp similarity index 100% rename from src/nostalgia/studio/lib/oxfstreeview.hpp rename to src/nostalgia/studio/oxfstreeview.hpp diff --git a/src/nostalgia/studio/studio.hpp b/src/nostalgia/studio/studio.hpp index c8313f55..bfca30f8 100644 --- a/src/nostalgia/studio/studio.hpp +++ b/src/nostalgia/studio/studio.hpp @@ -12,5 +12,4 @@ #include "lib/json.hpp" #include "lib/plugin.hpp" #include "lib/project.hpp" -#include "lib/oxfstreeview.hpp" #include "lib/wizard.hpp"