From 45a27800b6f6829c2fcd63eaa69930c9faeeb35d Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 21 Dec 2020 23:40:46 -0600 Subject: [PATCH] [nostalgia/studio] Bundle default profile in studio executable --- Makefile | 6 ++---- src/nostalgia/studio/CMakeLists.txt | 1 + src/nostalgia/studio/main.cpp | 2 +- src/nostalgia/studio/mainwindow.hpp | 4 ++-- src/nostalgia/studio/studiorsrc.qrc | 6 ++++++ 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 src/nostalgia/studio/studiorsrc.qrc diff --git a/Makefile b/Makefile index b81daf20..c3b44f4e 100644 --- a/Makefile +++ b/Makefile @@ -26,11 +26,9 @@ endif ifeq ($(OS),darwin) NOSTALGIA_STUDIO=./dist/${CURRENT_BUILD}/nostalgia-studio.app/Contents/MacOS/nostalgia-studio - NOSTALGIA_STUDIO_PROFILE=dist/${CURRENT_BUILD}/nostalgia-studio.app/Contents/Resources/nostalgia-studio.json MGBA=/Applications/mGBA.app/Contents/MacOS/mGBA else NOSTALGIA_STUDIO=./dist/${CURRENT_BUILD}/bin/nostalgia-studio - NOSTALGIA_STUDIO_PROFILE=dist/${CURRENT_BUILD}/share/nostalgia-studio.json MGBA=mgba-qt endif @@ -59,7 +57,7 @@ run: install ${ENV_RUN} ./dist/${CURRENT_BUILD}/bin/nostalgia sample_project .PHONY: run-studio run-studio: install - ${ENV_RUN} ${NOSTALGIA_STUDIO} -profile ${NOSTALGIA_STUDIO_PROFILE} + ${ENV_RUN} ${NOSTALGIA_STUDIO} .PHONY: gba-run gba-run: pkg-gba ${MGBA} nostalgia.gba @@ -68,7 +66,7 @@ gdb: install ${ENV_RUN} gdb --args ./dist/${CURRENT_BUILD}/bin/nostalgia sample_project .PHONY: gdb-studio gdb-studio: install - ${ENV_RUN} gdb --args ${NOSTALGIA_STUDIO} -profile ${NOSTALGIA_STUDIO_PROFILE} + ${ENV_RUN} gdb --args ${NOSTALGIA_STUDIO} .PHONY: devenv-image devenv-image: diff --git a/src/nostalgia/studio/CMakeLists.txt b/src/nostalgia/studio/CMakeLists.txt index 2199ad93..41bec01f 100644 --- a/src/nostalgia/studio/CMakeLists.txt +++ b/src/nostalgia/studio/CMakeLists.txt @@ -10,6 +10,7 @@ add_executable( main.cpp mainwindow.cpp oxfstreeview.cpp + studiorsrc.qrc ) target_link_libraries( diff --git a/src/nostalgia/studio/main.cpp b/src/nostalgia/studio/main.cpp index dc56c6fb..207d57e4 100644 --- a/src/nostalgia/studio/main.cpp +++ b/src/nostalgia/studio/main.cpp @@ -16,7 +16,7 @@ using namespace nostalgia::studio; int main(int argc, char **args) { ox::ClArgs clargs(argc, const_cast(args)); - QString argProfilePath = clargs.getString("profile").c_str(); + QString argProfilePath = clargs.getString("profile", ":/profiles/nostalgia-studio.json").c_str(); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); diff --git a/src/nostalgia/studio/mainwindow.hpp b/src/nostalgia/studio/mainwindow.hpp index c30f0bb6..16725976 100644 --- a/src/nostalgia/studio/mainwindow.hpp +++ b/src/nostalgia/studio/mainwindow.hpp @@ -46,8 +46,8 @@ ox::Error model(T *io, NostalgiaStudioState *obj) { } struct NostalgiaStudioProfile { - QString appName = "Nostalgia Studio"; - QString orgName = "Drinking Tea"; + QString appName; + QString orgName; QVector modulesPath; }; diff --git a/src/nostalgia/studio/studiorsrc.qrc b/src/nostalgia/studio/studiorsrc.qrc new file mode 100644 index 00000000..c3f571e7 --- /dev/null +++ b/src/nostalgia/studio/studiorsrc.qrc @@ -0,0 +1,6 @@ + + + nostalgia-studio.json + nostalgia-studio-dev.json + +