diff --git a/storybook/CMakeLists.txt b/storybook/CMakeLists.txt index 0dff70631d..a2d9e721cb 100644 --- a/storybook/CMakeLists.txt +++ b/storybook/CMakeLists.txt @@ -30,6 +30,29 @@ file(GLOB_RECURSE TEST_QML_FILES "qmlTests/*.qml") set(PROJECT_LIB "${PROJECT_NAME}Lib") +set(STATUSQ_DIR ../ui/StatusQ) +set(STATUSQ_HEADERS + ${STATUSQ_DIR}/include/StatusQ/statuswindow.h + ${STATUSQ_DIR}/include/StatusQ/typesregistration.h + ${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h +) + +set(STATUSQ_SOURCES + ${STATUSQ_DIR}/src/statuswindow.cpp + ${STATUSQ_DIR}/src/typesregistration.cpp + ${STATUSQ_DIR}/src/QClipboardProxy.cpp +) + +if(APPLE) + list(APPEND STATUSQ_SOURCES + ${STATUSQ_DIR}/src/statuswindow_osx.mm + ) +else() + list(APPEND STATUSQ_SOURCES + ${STATUSQ_DIR}/src/statuswindow_other.cpp + ) +endif() + add_library(${PROJECT_LIB} cachecleaner.cpp cachecleaner.h directorieswatcher.cpp directorieswatcher.h @@ -40,8 +63,11 @@ add_library(${PROJECT_LIB} figmalinkssource.cpp figmalinkssource.h modelutils.cpp modelutils.h sectionsdecoratormodel.cpp sectionsdecoratormodel.h + ${STATUSQ_HEADERS} ${STATUSQ_SOURCES} ) +target_include_directories(${PROJECT_LIB} PUBLIC ${STATUSQ_DIR}/include) + add_executable( ${PROJECT_NAME} main.cpp diff --git a/storybook/main.cpp b/storybook/main.cpp index 08e98ccb6c..8ec6de7662 100644 --- a/storybook/main.cpp +++ b/storybook/main.cpp @@ -8,6 +8,8 @@ #include "figmalinkssource.h" #include "sectionsdecoratormodel.h" +#include "StatusQ/typesregistration.h" + int main(int argc, char *argv[]) { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) @@ -42,6 +44,8 @@ int main(int argc, char *argv[]) qmlRegisterType("Storybook", 1, 0, "FigmaLinksSource"); qmlRegisterUncreatableType("Storybook", 1, 0, "FigmaLinks", ""); + registerStatusQTypes(); + auto watcherFactory = [additionalImportPaths](QQmlEngine*, QJSEngine*) { auto watcher = new DirectoriesWatcher(); watcher->addPaths(additionalImportPaths); diff --git a/vendor/DOtherSide/lib/include/DOtherSide/Status/QClipboardProxy.h b/ui/StatusQ/include/StatusQ/QClipboardProxy.h similarity index 98% rename from vendor/DOtherSide/lib/include/DOtherSide/Status/QClipboardProxy.h rename to ui/StatusQ/include/StatusQ/QClipboardProxy.h index 077b31a027..0cef650701 100644 --- a/vendor/DOtherSide/lib/include/DOtherSide/Status/QClipboardProxy.h +++ b/ui/StatusQ/include/StatusQ/QClipboardProxy.h @@ -1,6 +1,7 @@ #pragma once #include +#include class QClipboard; class QJSEngine; diff --git a/ui/StatusQ/sandbox/CMakeLists.txt b/ui/StatusQ/sandbox/CMakeLists.txt index 9d042cc0b1..a87082deb4 100644 --- a/ui/StatusQ/sandbox/CMakeLists.txt +++ b/ui/StatusQ/sandbox/CMakeLists.txt @@ -15,11 +15,13 @@ set(STATUSQ_DIR ..) set(STATUSQ_HEADERS ${STATUSQ_DIR}/include/StatusQ/statuswindow.h ${STATUSQ_DIR}/include/StatusQ/typesregistration.h + ${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h ) set(STATUSQ_SOURCES ${STATUSQ_DIR}/src/statuswindow.cpp ${STATUSQ_DIR}/src/typesregistration.cpp + ${STATUSQ_DIR}/src/QClipboardProxy.cpp ) if(APPLE) diff --git a/vendor/DOtherSide/lib/src/Status/QClipboardProxy.cpp b/ui/StatusQ/src/QClipboardProxy.cpp similarity index 96% rename from vendor/DOtherSide/lib/src/Status/QClipboardProxy.cpp rename to ui/StatusQ/src/QClipboardProxy.cpp index 8f4aca2bb1..c54b28f000 100644 --- a/vendor/DOtherSide/lib/src/Status/QClipboardProxy.cpp +++ b/ui/StatusQ/src/QClipboardProxy.cpp @@ -1,4 +1,4 @@ -#include "DOtherSide/Status/QClipboardProxy.h" +#include "StatusQ/QClipboardProxy.h" #include #include diff --git a/ui/StatusQ/src/typesregistration.cpp b/ui/StatusQ/src/typesregistration.cpp index 2549d8a33d..dba84ae889 100644 --- a/ui/StatusQ/src/typesregistration.cpp +++ b/ui/StatusQ/src/typesregistration.cpp @@ -1,10 +1,13 @@ #include "StatusQ/typesregistration.h" #include "StatusQ/statuswindow.h" +#include "StatusQ/QClipboardProxy.h" #include void registerStatusQTypes() { qmlRegisterType("StatusQ", 0 , 1, "StatusWindow"); + qmlRegisterSingletonType("StatusQ", 0 , 1, "QClipboardProxy", + &QClipboardProxy::qmlInstance); } diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 75bf59d050..7b86489407 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -4,6 +4,8 @@ import QtQuick.Layouts 1.13 import QtQuick.Dialogs 1.3 import DotherSide 0.1 +import StatusQ 0.1 + import utils 1.0 import shared 1.0 diff --git a/vendor/DOtherSide/lib/CMakeLists.txt b/vendor/DOtherSide/lib/CMakeLists.txt index 0698219c3b..5604fc81cb 100644 --- a/vendor/DOtherSide/lib/CMakeLists.txt +++ b/vendor/DOtherSide/lib/CMakeLists.txt @@ -22,11 +22,13 @@ macro(add_target name type) set(STATUSQ_HEADERS ${STATUSQ_DIR}/include/StatusQ/statuswindow.h ${STATUSQ_DIR}/include/StatusQ/typesregistration.h + ${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h ) set(STATUSQ_SOURCES ${STATUSQ_DIR}/src/statuswindow.cpp ${STATUSQ_DIR}/src/typesregistration.cpp + ${STATUSQ_DIR}/src/QClipboardProxy.cpp ) if(APPLE) diff --git a/vendor/DOtherSide/lib/src/DOtherSide.cpp b/vendor/DOtherSide/lib/src/DOtherSide.cpp index 814e2d7973..1fcb11dddd 100644 --- a/vendor/DOtherSide/lib/src/DOtherSide.cpp +++ b/vendor/DOtherSide/lib/src/DOtherSide.cpp @@ -72,10 +72,10 @@ #include "DOtherSide/Status/OSNotification.h" #include "DOtherSide/Status/KeychainManager.h" #include "DOtherSide/Status/SoundManager.h" -#include "DOtherSide/Status/QClipboardProxy.h" #include "DOtherSide/Status/RXValidator.h" #include "StatusQ/statuswindow.h" +#include "StatusQ/QClipboardProxy.h" #ifdef MONITORING #include @@ -91,8 +91,9 @@ void register_meta_types() qRegisterMetaType>(); qmlRegisterType("StatusQ", 0 , 1, "StatusWindow"); + qmlRegisterSingletonType("StatusQ", 0 , 1, "QClipboardProxy", &QClipboardProxy::qmlInstance); + qmlRegisterType("DotherSide", 0 , 1, "StatusSyntaxHighlighter"); - qmlRegisterSingletonType("DotherSide", 0 , 1, "QClipboardProxy", &QClipboardProxy::qmlInstance); qmlRegisterType("DotherSide", 0, 1, "RXValidator"); #ifdef MONITORING