rearch master
authorThomas L. Balzer <tbalzer2012@gmail.com>
Sun, 26 Nov 2023 23:48:38 +0000 (17:48 -0600)
committerThomas L. Balzer <tbalzer2012@gmail.com>
Sun, 26 Nov 2023 23:48:38 +0000 (17:48 -0600)
21 files changed:
CMakeLists.txt
Show.cpp [deleted file]
app/CMakeLists.txt [new file with mode: 0644]
app/src/main.cpp [moved from main.cpp with 79% similarity]
tlb/core/CMakeLists.txt [new file with mode: 0644]
tlb/core/include/AppManager.h [moved from AppManager.h with 100% similarity]
tlb/core/include/Show.h [moved from Show.h with 100% similarity]
tlb/core/include/Shows.h [moved from Shows.h with 100% similarity]
tlb/core/src/AppManager.cpp [moved from AppManager.cpp with 98% similarity]
tlb/core/src/Show.cpp [new file with mode: 0644]
tlb/core/src/Shows.cpp [moved from Shows.cpp with 99% similarity]
tlb/ui/CMakeLists.txt [new file with mode: 0644]
tlb/ui/qml/CardsList.qml [moved from CardsList.qml with 84% similarity]
tlb/ui/qml/Main.qml [moved from Main.qml with 82% similarity]
tlb/ui/qml/components/Episodes.qml [moved from components/Episodes.qml with 100% similarity]
tlb/ui/qml/templates/Page.qml [moved from templates/Page.qml with 99% similarity]
tlb/ui/qml/templates/TextWrapper.qml [moved from templates/TextWrapper.qml with 100% similarity]
tlb/ui/qml/views/Episodes.qml [moved from views/Episodes.qml with 65% similarity]
tlb/ui/qml/views/Search.qml [moved from views/Search.qml with 94% similarity]
tlb/ui/qml/views/Show.qml [moved from views/Show.qml with 96% similarity]
tlb/ui/qml/views/Summary.qml [moved from views/Summary.qml with 96% similarity]

dissimilarity index 88%
index 5f527da..58f01c1 100644 (file)
@@ -1,49 +1,19 @@
-cmake_minimum_required(VERSION 3.16)
-
-project(android-qt-sandbox VERSION 0.1 LANGUAGES CXX)
-
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
-find_package(Qt6 6.4 REQUIRED COMPONENTS Quick Sensors Svg Xml)
-
-qt_standard_project_setup()
-
-qt_add_executable(android-qt-sandbox
-    main.cpp AppManager.cpp Show.cpp Shows.cpp
-    MANUAL_FINALIZATION
-)
-
-qt_add_qml_module(android-qt-sandbox
-    URI tlb
-    VERSION 1.0
-    QML_FILES Main.qml CardsList.qml
-    views/Summary.qml views/Episodes.qml views/Show.qml views/Search.qml
-    templates/Page.qml templates/TextWrapper.qml
-    # RESOURCES Bluebubble.svg
-)
-
-# set_target_properties(android-qt-sandbox PROPERTIES
-#     MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
-#     MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
-#     MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
-#     MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
-#     MACOSX_BUNDLE TRUE
-#     WIN32_EXECUTABLE TRUE
-# )
-
-# set_property(TARGET android-qt-sandbox APPEND PROPERTY
-#     QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android
-# )
-
-target_compile_definitions(android-qt-sandbox
-    PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
-target_link_libraries(android-qt-sandbox
-    PRIVATE Qt6::Quick Qt6::Sensors Qt6::Svg Qt6::Xml)
-
-# install(TARGETS android-qt-sandbox
-#     BUNDLE DESTINATION .
-#     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-#     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-# )
-
-qt_finalize_executable(android-qt-sandbox)
+cmake_minimum_required(VERSION 3.16)
+
+# project(tlb-podcasts VERSION 0.1 LANGUAGES CXX)
+project(tlb-podcasts)
+
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_STANDARD 17)
+
+find_package(Qt6 6.4 REQUIRED COMPONENTS Quick Sensors Svg Xml)
+
+qt_standard_project_setup()
+
+add_subdirectory(tlb/core)
+add_subdirectory(tlb/ui)
+add_subdirectory(app)
+
+
+
+
diff --git a/Show.cpp b/Show.cpp
deleted file mode 100644 (file)
index a01a8ce..0000000
--- a/Show.cpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "Show.h"
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
new file mode 100644 (file)
index 0000000..bc176ca
--- /dev/null
@@ -0,0 +1,18 @@
+set(SRC_PREFIX src/)
+
+qt_add_executable(tlb-podcasts
+  ${SRC_PREFIX}/main.cpp
+  # MANUAL_FINALIZATION
+)
+
+target_compile_definitions(tlb-podcasts
+    PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
+target_link_libraries(tlb-podcasts
+  PRIVATE
+  # QT
+  Qt6::Quick Qt6::Sensors Qt6::Svg Qt6::Xml
+  # INTERNAL
+  tlbcore tlbui
+)
+
+# qt_finalize_executable(tlb-podcasts)
similarity index 79%
rename from main.cpp
rename to app/src/main.cpp
index 5faa074..6a9d160 100644 (file)
--- a/main.cpp
@@ -8,7 +8,10 @@
 #include <QUrl>
 #include <QFont>
 
-#include "AppManager.h"
+// #include <QtPlugin>
+// Q_IMPORT_PLUGIN(tlb.core)
+
+#include <AppManager.h>
 
 int main(int argc, char **argv)
 {
@@ -23,10 +26,10 @@ int main(int argc, char **argv)
   QGuiApplication::setFont(font);
   
   AppManager am(nullptr);
-  am.initializeView(QUrl("qrc:/tlb/Main.qml"));
+  am.initializeView(QUrl("qrc:/tlb/ui/qml/Main.qml"));
 
 #if 0 // if using a QQuickWindow
-  QQmlComponent rootComponent(view.engine(), "qrc:/tlb/Main.qml");
+  QQmlComponent rootComponent(view.engine(), "qrc:/tlb/ui/qml/Main.qml");
   if(rootComponent.status() != QQmlComponent::Ready){
     fprintf(stderr, "Main.qml failed to initialize!\n");
     foreach(const QQmlError &error, rootComponent.errors()){
diff --git a/tlb/core/CMakeLists.txt b/tlb/core/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9691a64
--- /dev/null
@@ -0,0 +1,34 @@
+qt_policy(SET QTP0001 NEW)
+
+set(SRC_PREFIX src/)
+set(SRC_FILES
+  AppManager.cpp Show.cpp Shows.cpp
+)
+list(TRANSFORM SRC_FILES PREPEND ${SRC_PREFIX})
+
+# needed due to separate folders
+set(HDR_PREFIX include/)
+set(HDR_FILES
+  AppManager.h Show.h Shows.h
+)
+list(TRANSFORM HDR_FILES PREPEND ${HDR_PREFIX})
+
+# can't link to shared
+# qt_add_plugin(tlbcore STATIC
+# qt_add_library(tlbcore STATIC
+#   ${HDR_FILES} ${SRC_FILES}
+# )
+qt_add_qml_module(tlbcore
+  URI tlb.core
+  VERSION 1.0
+  RESOURCE_PREFIX /
+  SOURCES ${HDR_FILES} ${SRC_FILES}
+)
+
+target_include_directories(tlbcore
+  PUBLIC include
+)
+target_compile_definitions(tlbcore
+    PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
+target_link_libraries(tlbcore
+    PRIVATE Qt6::Quick Qt6::Sensors Qt6::Svg Qt6::Xml)
similarity index 100%
rename from AppManager.h
rename to tlb/core/include/AppManager.h
similarity index 100%
rename from Show.h
rename to tlb/core/include/Show.h
similarity index 100%
rename from Shows.h
rename to tlb/core/include/Shows.h
similarity index 98%
rename from AppManager.cpp
rename to tlb/core/src/AppManager.cpp
index eaecd5b..9108f52 100644 (file)
@@ -1,4 +1,4 @@
-#include "AppManager.h"
+#include <AppManager.h>
 
 #include <stdio.h>
 #include <QFile>
diff --git a/tlb/core/src/Show.cpp b/tlb/core/src/Show.cpp
new file mode 100644 (file)
index 0000000..b03cc6a
--- /dev/null
@@ -0,0 +1 @@
+#include <Show.h>
similarity index 99%
rename from Shows.cpp
rename to tlb/core/src/Shows.cpp
index ad8ad76..aa71445 100644 (file)
--- a/Shows.cpp
@@ -1,4 +1,4 @@
-#include "Shows.h"
+#include <Shows.h>
 
 #include <QDir>
 #include <QFile>
diff --git a/tlb/ui/CMakeLists.txt b/tlb/ui/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9ce34ec
--- /dev/null
@@ -0,0 +1,20 @@
+qt_policy(SET QTP0001 NEW)
+
+set(QML_PREFIX qml/)
+set(qml_src
+  Main.qml CardsList.qml
+  views/Summary.qml views/Episodes.qml views/Show.qml views/Search.qml
+  templates/Page.qml templates/TextWrapper.qml
+)
+list(TRANSFORM qml_src PREPEND ${QML_PREFIX})
+
+qt_add_library(tlbui SHARED
+)
+
+qt_add_qml_module(tlbui
+  URI tlb.ui
+  VERSION 1.0
+  RESOURCE_PREFIX /
+  QML_FILES
+  ${qml_src}
+)
similarity index 84%
rename from CardsList.qml
rename to tlb/ui/qml/CardsList.qml
index de56caa..60208f3 100644 (file)
@@ -1,6 +1,7 @@
 import QtQuick 2.0
 
-import tlb 1.0
+import tlb.core 1.0
+import "qrc:/tlb/ui/qml/templates"
 
 /* Podcast App */
 /*  Views: */
@@ -21,11 +22,11 @@ Column {
     
     Repeater {
        model: [ {"display": "summary",
-                 "link"   : "qrc:/tlb/views/Summary.qml" },
+                 "link"   : "qrc:/tlb/ui/qml/views/Summary.qml" },
                 {"display": "episode list",
-                 "link"   : "qrc:/tlb/views/Episodes.qml"},
+                 "link"   : "qrc:/tlb/ui/qml/views/Episodes.qml"},
                 {"display": "search",
-                 "link"   : "qrc:/tlb/views/Search.qml"},
+                 "link"   : "qrc:/tlb/ui/qml/views/Search.qml"},
                 {"display": "categories",
                  "link"   : "error.qml"},
                 {"display": "refresh all",
similarity index 82%
rename from Main.qml
rename to tlb/ui/qml/Main.qml
index 8a44c6c..1153022 100644 (file)
--- a/Main.qml
@@ -1,5 +1,8 @@
 import QtQuick 2.0
 
+import "qrc:/tlb/ui/qml/templates"
+/* import tlb.ui 1.0 */
+
 /* SONY DISPLAY INFORMATION
  *  3840x1644, 643ppi (HUGE SCREEN)
  */
similarity index 99%
rename from templates/Page.qml
rename to tlb/ui/qml/templates/Page.qml
index 84eb59c..3ef636d 100644 (file)
@@ -1,6 +1,6 @@
 import QtQuick
 
-import tlb
+import tlb.core
 
 /*
  * This template is a full page in the system. Contains:
similarity index 65%
rename from views/Episodes.qml
rename to tlb/ui/qml/views/Episodes.qml
index 35d022c..51e2188 100644 (file)
@@ -1,7 +1,8 @@
 import QtQuick
 
 /* TODO */
-import "qrc:/tlb/templates"
+import "qrc:/tlb/ui/qml/templates"
+/* import tlb.ui 1.0 */
 
 Page {
     pageTitle: "Episode List"
similarity index 94%
rename from views/Search.qml
rename to tlb/ui/qml/views/Search.qml
index f95c8f0..7da5f7c 100644 (file)
@@ -1,7 +1,8 @@
 import QtQuick
 import QtQuick.Layouts
 
-import "qrc:/tlb/templates"
+import "qrc:/tlb/ui/qml/templates"
+/* import tlb.ui 1.0 */
 
 Page {
     id: root
similarity index 96%
rename from views/Show.qml
rename to tlb/ui/qml/views/Show.qml
index 5ea1676..6715b77 100644 (file)
@@ -1,8 +1,9 @@
 import QtQuick
 import QtQuick.Layouts
 
-import tlb
-import "qrc:/tlb/templates"
+import tlb.core
+import "qrc:/tlb/ui/qml/templates"
+/* import tlb.ui 1.0 */
 
 Page {
     pageTitle: "Show Details"
similarity index 96%
rename from views/Summary.qml
rename to tlb/ui/qml/views/Summary.qml
index b409c4d..335a43a 100644 (file)
@@ -1,8 +1,9 @@
 import QtQuick 2.0
 import QtQml.XmlListModel
 
-import tlb 1.0
-import "qrc:/tlb/templates"
+import tlb.core 1.0
+import "qrc:/tlb/ui/qml/templates"
+/* import tlb.ui 1.0 */
 
 /* This view provides a summary of all podcasts. */
 
@@ -62,7 +63,7 @@ Page {
            if(selectedTitle !== ""){
                AppManager.shows.selectedName = selectedTitle
                AppManager.shows.selected = selectedUrl;
-               AppManager.requestNewSource("qrc:/tlb/views/Show.qml")
+               AppManager.requestNewSource("qrc:/tlb/ui/qml/views/Show.qml")
            }
        }