Skip to content

Commit 0933db4

Browse files
committed
Use new ComponentLibrary
1 parent 9e6c763 commit 0933db4

File tree

206 files changed

+1058
-912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+1058
-912
lines changed

CMakeLists.txt

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ set(SOURCES
8080
src/devices/device_esp32_higrow.cpp src/devices/device_esp32_higrow.h
8181
src/devices/device_ess_generic.cpp src/devices/device_ess_generic.h
8282
thirdparty/RC4/rc4.cpp thirdparty/RC4/rc4.h
83-
qml/qml.qrc
84-
qml/ComponentLibrary/ComponentLibrary.qrc
8583
thirdparty/IconLibrary/IconLibrary.qrc
8684
assets/assets.qrc
8785
assets/devices.qrc
@@ -103,6 +101,83 @@ qt_add_executable(${CMAKE_PROJECT_NAME}
103101
${SOURCES_DESKTOP}
104102
)
105103

104+
qt_add_qml_module(${CMAKE_PROJECT_NAME}
105+
URI ${CMAKE_PROJECT_NAME}
106+
QML_FILES
107+
qml/MobileApplication.qml
108+
qml/MobileHeader.qml
109+
qml/MobileDrawer.qml
110+
qml/MobileExit.qml
111+
qml/MobileMenu.qml
112+
qml/MobilePermissions.qml
113+
qml/DesktopApplication.qml
114+
qml/DesktopHeader.qml
115+
qml/PlantBrowser.qml
116+
qml/PlantScreen.qml
117+
qml/About.qml
118+
qml/Settings.qml
119+
qml/SettingsAdvanced.qml
120+
qml/Tutorial.qml
121+
qml/JournalWidget.qml
122+
qml/DeviceList.qml
123+
qml/DeviceListUnified.qml
124+
qml/DeviceListSplit.qml
125+
qml/DeviceBrowser.qml
126+
qml/DevicePlantSensor.qml
127+
qml/DevicePlantSensorData.qml
128+
qml/DevicePlantSensorHistory.qml
129+
qml/DevicePlantSensorCare.qml
130+
qml/PlantCareInfos.qml
131+
qml/PlantCareLimits.qml
132+
qml/PlantCareJournal.qml
133+
qml/DevicePlantSensorSettings.qml
134+
qml/DeviceThermometer.qml
135+
qml/DeviceEnvironmental.qml
136+
qml/widgets/DeviceWidget.qml
137+
qml/widgets/DeviceNearbyWidget.qml
138+
qml/widgets/SunAndMoonWidget.qml
139+
qml/widgets/DeviceBrowserWidget.qml
140+
qml/widgets/PlantBrowserWidget.qml
141+
qml/popups/PopupBackgroundUpdates.qml
142+
qml/popups/PopupBlacklistDevice.qml
143+
qml/popups/PopupCalibration.qml
144+
qml/popups/PopupDate.qml
145+
qml/popups/PopupDeleteData.qml
146+
qml/popups/PopupDeleteDevice.qml
147+
qml/charts/ChartHistory.qml
148+
qml/charts/ChartPlantDataAio.qml
149+
qml/charts/ChartThermometerMinMax.qml
150+
qml/charts/ChartThermometerMinMaxBar.qml
151+
qml/charts/ChartEnvironmentalVoc.qml
152+
qml/charts/ChartEnvironmentalVocBar.qml
153+
qml/components/ActionbarBluetooth.qml
154+
qml/components/ActionbarSelection.qml
155+
qml/components/ActionbarSync.qml
156+
qml/components/ActionMenuFixed.qml
157+
qml/components/AirQualityIndicator.qml
158+
qml/components/IndicatorsCompact.qml
159+
qml/components/IndicatorsSolid.qml
160+
qml/components/ItemEnvBox.qml
161+
qml/components/ItemWeatherBox.qml
162+
qml/components/ItemLoadData.qml
163+
qml/components/ItemNoBluetooth.qml
164+
qml/components/ItemNoPermissions.qml
165+
qml/components/ItemNoDevice.qml
166+
qml/components/ItemNoDeviceNearby.qml
167+
qml/components/ItemNoData.qml
168+
qml/components/ItemNoPlant.qml
169+
qml/components/ItemNoPlants.qml
170+
qml/components/ItemNoJournal.qml
171+
qml/components/LuxBox.qml
172+
qml/components/PlantCalendarWidget.qml
173+
qml/components/PlantHardinessWidget.qml
174+
qml/components/PlantSizeWidget.qml
175+
qml/components/SpinBoxHistory.qml
176+
qml/components_js/UtilsDeviceSensors.js
177+
qml/components_js/UtilsPlantDatabase.js
178+
qml/components_js/UtilsPlantJournal.js
179+
)
180+
106181
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE src/)
107182

108183
################################################################################
@@ -121,6 +196,7 @@ qt_add_translations(${CMAKE_PROJECT_NAME}
121196
################################################################################
122197

123198
# SingleApplication
199+
set(QAPPLICATION_CLASS QApplication)
124200
add_subdirectory(thirdparty/SingleApplication)
125201
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE SingleApplication)
126202

@@ -142,8 +218,8 @@ add_subdirectory(thirdparty/SunAndMoon)
142218
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE SunAndMoon)
143219

144220
# ComponentLibrary
145-
#add_subdirectory(thirdparty/ComponentLibrary)
146-
#target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ComponentLibraryplugin)
221+
add_subdirectory(thirdparty/ComponentLibrary)
222+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ComponentLibraryplugin)
147223

148224
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE thirdparty/)
149225

qml/About.qml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import QtQuick
22
import QtQuick.Controls
33

4-
import ThemeEngine
5-
import "qrc:/utils/UtilsNumber.js" as UtilsNumber
4+
import ComponentLibrary
5+
import WatchFlower
66

77
Loader {
88
id: screenAbout
@@ -116,7 +116,7 @@ Loader {
116116
source: "qrc:/IconLibrary/material-symbols/link.svg"
117117
sourceSize: 28
118118
font.bold: true
119-
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
119+
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
120120

121121
onClicked: Qt.openUrlExternally("https://emeric.io/WatchFlower")
122122
}
@@ -129,7 +129,7 @@ Loader {
129129
source: "qrc:/IconLibrary/material-symbols/support.svg"
130130
sourceSize: 22
131131
font.bold: true
132-
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
132+
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
133133

134134
onClicked: Qt.openUrlExternally("https://emeric.io/WatchFlower/support.html")
135135
}
@@ -144,7 +144,7 @@ Loader {
144144
source: "qrc:/assets/gfx/logos/github.svg"
145145
sourceSize: 22
146146
font.bold: true
147-
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
147+
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
148148

149149
onClicked: Qt.openUrlExternally("https://github.com/emericg/WatchFlower")
150150
}
@@ -184,7 +184,7 @@ Loader {
184184
source: "qrc:/IconLibrary/material-symbols/link.svg"
185185
sourceSize: 28
186186
font.bold: true
187-
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
187+
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
188188

189189
onClicked: Qt.openUrlExternally("https://emeric.io/WatchFlower")
190190
}
@@ -197,7 +197,7 @@ Loader {
197197
source: "qrc:/IconLibrary/material-symbols/support.svg"
198198
sourceSize: 22
199199
font.bold: true
200-
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
200+
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
201201

202202
onClicked: Qt.openUrlExternally("https://emeric.io/WatchFlower/support.html")
203203
}

qml/ComponentLibrary/ComponentLibrary.qrc

Lines changed: 0 additions & 148 deletions
This file was deleted.

qml/DesktopApplication.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import QtQuick
22
import QtQuick.Controls
33
import QtQuick.Window
44

5-
import ThemeEngine
5+
import ComponentLibrary
6+
import WatchFlower
67
import DeviceUtils
78

89
ApplicationWindow {

qml/DesktopHeader.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import QtQuick
22

3-
import ThemeEngine
3+
import ComponentLibrary
4+
import WatchFlower
45

56
Rectangle {
67
id: appHeader

qml/DeviceBrowser.qml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import QtQuick
22
import QtQuick.Controls
33

4-
import ThemeEngine
4+
import ComponentLibrary
5+
import WatchFlower
56

67
Item {
78
id: deviceBrowser
@@ -370,7 +371,7 @@ Item {
370371
z: -1
371372
opacity: boxDevice.selected ? 0.5 : 0
372373
Behavior on opacity { OpacityAnimator { duration: 133 } }
373-
color: (Theme.currentTheme === ThemeEngine.THEME_SNOW) ? Theme.colorPrimary : Theme.colorHeader
374+
color: (Theme.currentTheme === Theme.THEME_SNOW) ? Theme.colorPrimary : Theme.colorHeader
374375
}
375376

376377
color: {

qml/DeviceEnvironmental.qml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import QtQuick
22
import QtQuick.Controls
33

4-
import ThemeEngine
4+
import ComponentLibrary
5+
import WatchFlower
56
import DeviceUtils
6-
import "qrc:/js/UtilsDeviceSensors.js" as UtilsDeviceSensors
77

88
Loader {
99
id: deviceEnvironmental
@@ -403,16 +403,16 @@ Loader {
403403
currentDevice.hasCoSensor || currentDevice.hasCo2Sensor) {
404404
if (primary === "hygrometer") {
405405
if (graphLoader.status !== Loader.Ready ||
406-
graphLoader.source !== "ChartThermometerMinMax.qml") {
407-
graphLoader.source = "ChartThermometerMinMax.qml"
406+
graphLoader.source !== "charts/ChartThermometerMinMax.qml") {
407+
graphLoader.source = "charts/ChartThermometerMinMax.qml"
408408
} else {
409409
envChart.loadGraph()
410410
envChart.updateGraph()
411411
}
412412
} else {
413413
if (graphLoader.status !== Loader.Ready ||
414-
graphLoader.source !== "ChartEnvironmentalVoc.qml") {
415-
graphLoader.source = "ChartEnvironmentalVoc.qml"
414+
graphLoader.source !== "charts/ChartEnvironmentalVoc.qml") {
415+
graphLoader.source = "charts/ChartEnvironmentalVoc.qml"
416416
} else {
417417
envChart.loadGraph()
418418
envChart.updateGraph()

0 commit comments

Comments
 (0)