From 9e5fa62382ebed621b8926a5f9cf10a778fd8278 Mon Sep 17 00:00:00 2001 From: Dominik Louven Date: Tue, 10 Mar 2020 20:20:31 +0100 Subject: [PATCH 01/15] Add checkbox to monitor settings dialog --- .../Monitors/MonitorsProjectSettingItem.qml | 47 ++++++++++++++++--- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml index 06a64541..59fd40eb 100644 --- a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml +++ b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml @@ -47,14 +47,49 @@ Item { var obj = JSON.parse(value.toString()) - if (obj["type"] === "slider") { - loader.sourceComponent = compSlider - loader.item.from = obj["from"] - loader.item.to = obj["to"] - loader.item.value = obj["value"] - loader.item.stepSize = obj["stepSize"] + + switch(obj["type"]){ + case "slider": + loader.sourceComponent = compSlider + loader.item.from = obj["from"] + loader.item.to = obj["to"] + loader.item.value = obj["value"] + loader.item.stepSize = obj["stepSize"] + break; + case "bool": + loader.sourceComponent = compCheckbox + loader.item.value = obj["value"] + break; } } + Component{ + id: compCheckbox + + Item { + id:root + anchors.fill: parent + property bool value + + CheckBox { + id: checkbox + checkable: true + checked: root.value + onCheckedChanged: { + var value = checkbox.checked + txtCheckboxValue.text = value; + ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,txtDescription.text,value) + } + } + Text { + id: txtCheckboxValue + anchors{ + right:parent.right + verticalCenter: parent.verticalCenter + } + } + } + } + Component { id: compSlider From c1d6dd4a5c055d26bc2c43578714679cc9b2cd3b Mon Sep 17 00:00:00 2001 From: Dominik Louven Date: Tue, 10 Mar 2020 20:21:13 +0100 Subject: [PATCH 02/15] Support override of display text for properties --- ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml index 59fd40eb..d1dd40c2 100644 --- a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml +++ b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml @@ -47,6 +47,7 @@ Item { var obj = JSON.parse(value.toString()) + txtDescription.text = obj["text"] switch(obj["type"]){ case "slider": @@ -77,7 +78,7 @@ Item { onCheckedChanged: { var value = checkbox.checked txtCheckboxValue.text = value; - ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,txtDescription.text,value) + ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,name,value) } } Text { @@ -113,7 +114,7 @@ Item { onValueChanged: { var value = Math.round(slider.value * 100) / 100; txtSliderValue.text = value; - ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,txtDescription.text,value) + ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,name,value) } } Text { From 053305a06e1c7802a6883d3cacf4654cfd065a49 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 12 Mar 2020 13:04:13 +0100 Subject: [PATCH 03/15] Fix accidental click of installed wallpaper by adding a MouseArea --- ScreenPlay/qml/Installed/Installed.qml | 3 +++ ScreenPlay/qml/Navigation/Navigation.qml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ScreenPlay/qml/Installed/Installed.qml b/ScreenPlay/qml/Installed/Installed.qml index 9cd3b0a5..56bf01cb 100644 --- a/ScreenPlay/qml/Installed/Installed.qml +++ b/ScreenPlay/qml/Installed/Installed.qml @@ -221,6 +221,9 @@ Item { right: parent.right left: parent.left } + MouseArea { + anchors.fill: parent + } TabBar { height: parent.height background: Item {} diff --git a/ScreenPlay/qml/Navigation/Navigation.qml b/ScreenPlay/qml/Navigation/Navigation.qml index 6bd23239..5cad077c 100644 --- a/ScreenPlay/qml/Navigation/Navigation.qml +++ b/ScreenPlay/qml/Navigation/Navigation.qml @@ -14,6 +14,10 @@ Rectangle { width: 1366 color: "#ffffff" + MouseArea { + anchors.fill: parent + } + signal changePage(string name) property var navArray: [navCreate, navWorkshop, navInstalled, navSettings, navCommunity] From d42ba8f5cf8170a2470888e9668494e482fd59ea Mon Sep 17 00:00:00 2001 From: Dominik Louven Date: Thu, 12 Mar 2020 17:56:37 +0100 Subject: [PATCH 04/15] Fix issue where not specifying a text field in wallpaper properties could lead to undefined behaviour --- ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml index d1dd40c2..75626548 100644 --- a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml +++ b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml @@ -47,7 +47,9 @@ Item { var obj = JSON.parse(value.toString()) - txtDescription.text = obj["text"] + if(obj["text"]){ + txtDescription.text = obj["text"] + } switch(obj["type"]){ case "slider": From c59fd98c40a520aa4331183737ee023a251c6851 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Fri, 13 Mar 2020 10:50:36 +0100 Subject: [PATCH 05/15] Add korean font to the install step --- ScreenPlay/ScreenPlay.pro | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ScreenPlay/ScreenPlay.pro b/ScreenPlay/ScreenPlay.pro index 07f92fa1..a1b65c8d 100644 --- a/ScreenPlay/ScreenPlay.pro +++ b/ScreenPlay/ScreenPlay.pro @@ -70,18 +70,22 @@ INCLUDEPATH += \ $$PWD/src/\ +CONFIG(debug, debug|release) { + install_assets.path = $${OUT_PWD}/assets/fonts +} else { + install_assets.path = $${OUT_PWD}/assets/fonts +} + +install_assets.files += $$PWD/assets/fonts/NotoSansCJKkr-Regular.otf + win32 { RC_ICONS += favicon.ico - - CONFIG(debug, debug|release) { install_it.path = $${OUT_PWD}/debug/ } else { install_it.path = $${OUT_PWD}/release/ } - - INCLUDEPATH += $$PWD/../Common/vcpkg/installed/x64-windows/include DEPENDPATH += $$PWD/../Common/vcpkg/installed/x64-windows/include @@ -154,5 +158,5 @@ unix { } -INSTALLS += install_it +INSTALLS += install_it install_assets From c9d7e3a62bb1df6e11fe293cf1ae73c0c461b827 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Fri, 13 Mar 2020 10:59:48 +0100 Subject: [PATCH 06/15] Fix VisualsPaused check for multiple monitors Fix inverted bool logic --- ScreenPlayWallpaper/WebView.qml | 2 +- ScreenPlayWallpaper/src/winwindow.cpp | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ScreenPlayWallpaper/WebView.qml b/ScreenPlayWallpaper/WebView.qml index eff963fb..336793dc 100644 --- a/ScreenPlayWallpaper/WebView.qml +++ b/ScreenPlayWallpaper/WebView.qml @@ -121,7 +121,7 @@ Item { onVisualsPausedChanged:{ if(window.checkWallpaperVisible){ - webView.visible = visualsPaused + webView.visible = !visualsPaused } } diff --git a/ScreenPlayWallpaper/src/winwindow.cpp b/ScreenPlayWallpaper/src/winwindow.cpp index bb25b646..f67a4aa0 100644 --- a/ScreenPlayWallpaper/src/winwindow.cpp +++ b/ScreenPlayWallpaper/src/winwindow.cpp @@ -313,9 +313,9 @@ void WinWindow::checkForFullScreenWindow() if ((dwStyle & WS_MAXIMIZE) != 0) { // do stuff - setVisualsPaused(false); - } else { setVisualsPaused(true); + } else { + setVisualsPaused(false); } return; @@ -330,22 +330,24 @@ void WinWindow::checkForFullScreenWindow() if (hFoundWnd != nullptr) { DWORD dwFlags = 0; HMONITOR monitor = MonitorFromWindow(hFoundWnd, dwFlags); + HMONITOR wallpaper = MonitorFromWindow(m_windowHandle, dwFlags); int monitorIndex = GetMonitorIndex(monitor); - // qDebug() << "Window found " << printWindowNameByhWnd(hFoundWnd) << monitorIndex << activeScreensList().at(0); + int wallpaperIndex = GetMonitorIndex(wallpaper); + // qDebug() << "Window found " << printWindowNameByhWnd(hFoundWnd) << monitorIndex << activeScreensList().at(0) << wallpaperIndex; // We do not support autopause for multi monitor wallpaper if (activeScreensList().length() == 1) { // If the window that has WS_MAXIMIZE is at the same monitor as this wallpaper - if (monitorIndex == activeScreensList().at(0)) { - // qDebug() << "monitorIndex" << monitorIndex; - setVisualsPaused(false); - } else { + if (monitorIndex == wallpaperIndex) { + //qDebug() << "monitorIndex" << monitorIndex; setVisualsPaused(true); + } else { + setVisualsPaused(false); } } } else { - setVisualsPaused(true); + setVisualsPaused(false); } } } From d23ebfbf02292fb9a6aafda9daa216a42416d931 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Fri, 13 Mar 2020 17:05:10 +0100 Subject: [PATCH 07/15] Fix some styling issues --- ScreenPlay/qml/Monitors/Monitors.qml | 11 +- .../Monitors/MonitorsProjectSettingItem.qml | 142 +++++++++++++----- 2 files changed, 112 insertions(+), 41 deletions(-) diff --git a/ScreenPlay/qml/Monitors/Monitors.qml b/ScreenPlay/qml/Monitors/Monitors.qml index 493b2db1..e8e09498 100644 --- a/ScreenPlay/qml/Monitors/Monitors.qml +++ b/ScreenPlay/qml/Monitors/Monitors.qml @@ -174,6 +174,7 @@ Item { } } + GridView { id: customPropertiesGridView boundsBehavior: Flickable.DragOverBounds @@ -188,13 +189,15 @@ Item { top: parent.top topMargin: 60 right: parent.right + rightMargin: 40 bottom: parent.bottom - margins: 30 + bottomMargin: 30 left: itmLeftWrapper.right } delegate: MonitorsProjectSettingItem { id: delegate + width: parent.width - 40 selectedMonitor: monitors.activeMonitorIndex } @@ -334,3 +337,9 @@ Item { } ] } + +/*##^## +Designer { + D{i:0;autoSize:true;height:768;width:1366} +} +##^##*/ diff --git a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml index 75626548..9256232c 100644 --- a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml +++ b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml @@ -1,33 +1,32 @@ import QtQuick 2.12 import QtQuick.Controls 2.3 import QtGraphicalEffects 1.0 +import QtQuick.Dialogs 1.2 import QtQuick.Controls.Material 2.2 import QtQuick.Layouts 1.3 + +import Settings 1.0 import ScreenPlay 1.0 -Item { + +Rectangle { id: delegate focus: true height: isHeadline ? 50 : 30 - width: 300 - property int selectedMonitor - anchors { - left: parent.left - leftMargin: isHeadline ? 0 : 25 - } - Text { id: txtDescription text: name width: 100 - font.pointSize: isHeadline ? 21 : 14 + font.pointSize: isHeadline ? 18 : 12 anchors.verticalCenter: parent.verticalCenter font.family: "Roboto" font.weight: Font.Normal - + color: isHeadline ? Qt.darker(Material.foreground) : Material.foreground + anchors { left: parent.left + leftMargin: isHeadline ? 0 : 25 } } @@ -47,29 +46,34 @@ Item { var obj = JSON.parse(value.toString()) - if(obj["text"]){ + if (obj["text"]) { txtDescription.text = obj["text"] } - switch(obj["type"]){ - case "slider": - loader.sourceComponent = compSlider - loader.item.from = obj["from"] - loader.item.to = obj["to"] - loader.item.value = obj["value"] - loader.item.stepSize = obj["stepSize"] - break; - case "bool": - loader.sourceComponent = compCheckbox - loader.item.value = obj["value"] - break; + switch (obj["type"]) { + case "slider": + loader.sourceComponent = compSlider + loader.item.from = obj["from"] + loader.item.to = obj["to"] + loader.item.value = obj["value"] + loader.item.stepSize = obj["stepSize"] + break + case "bool": + loader.sourceComponent = compCheckbox + loader.item.value = obj["value"] + break + case "color": + loader.sourceComponent = compColorpicker + loader.item.value = obj["value"] + break } } - Component{ + + Component { id: compCheckbox Item { - id:root + id: root anchors.fill: parent property bool value @@ -77,19 +81,58 @@ Item { id: checkbox checkable: true checked: root.value + anchors { + right: parent.right + verticalCenter: parent.verticalCenter + } onCheckedChanged: { - var value = checkbox.checked - txtCheckboxValue.text = value; - ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,name,value) + ScreenPlay.screenPlayManager.setWallpaperValue( + selectedMonitor, name, value) } } - Text { - id: txtCheckboxValue - anchors{ - right:parent.right + } + } + + Component { + id: compColorpicker + + Item { + id: root + anchors.fill: parent + property color value + + Button { + id: btnSetColor + text: qsTr("Set color") + onClicked: colorDialog.open() + anchors { + right: parent.right verticalCenter: parent.verticalCenter } } + Rectangle { + id: rctPreviewColor + radius: 3 + color: root.value + border.width: 1 + border.color: "gray" + width: parent.height + height: parent.height + anchors { + right: btnSetColor.left + rightMargin: 20 + verticalCenter: parent.verticalCenter + } + } + ColorDialog { + id: colorDialog + title: qsTr("Please choose a color") + onAccepted: { + rctPreviewColor.color = colorDialog.color + ScreenPlay.screenPlayManager.setWallpaperValue( + selectedMonitor, name, colorDialog.color) + } + } } } @@ -97,7 +140,7 @@ Item { id: compSlider Item { - id:root + id: root anchors.fill: parent property int from property int to @@ -105,24 +148,35 @@ Item { property int stepSize Slider { - id:slider + id: slider from: root.from to: root.to value: root.value stepSize: root.stepSize live: false - width: parent.width + + anchors { + verticalCenter: parent.verticalCenter + right:txtSliderValue.left + rightMargin: 20 + left:parent.left + leftMargin: 20 + } onValueChanged: { - var value = Math.round(slider.value * 100) / 100; - txtSliderValue.text = value; - ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,name,value) + var value = Math.round(slider.value * 100) / 100 + txtSliderValue.text = value + ScreenPlay.screenPlayManager.setWallpaperValue( + selectedMonitor, name, value) } } Text { id: txtSliderValue - anchors{ - right:parent.right + color: Material.foreground + horizontalAlignment: Text.AlignRight + font.family: ScreenPlay.settings.font + anchors { + right: parent.right verticalCenter: parent.verticalCenter } } @@ -132,6 +186,14 @@ Item { Loader { id: loader anchors.fill: parent + anchors.rightMargin: 10 } } } + +/*##^## +Designer { + D{i:0;height:50;width:400} +} +##^##*/ + From 0ebcf43e56723d16518c307cad5f473cc61b4823 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Fri, 13 Mar 2020 17:25:50 +0100 Subject: [PATCH 08/15] Add delay for setting up mouse hook. This is a workaround for a lag on startup for now. --- ScreenPlayWallpaper/src/winwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ScreenPlayWallpaper/src/winwindow.cpp b/ScreenPlayWallpaper/src/winwindow.cpp index f67a4aa0..e956422f 100644 --- a/ScreenPlayWallpaper/src/winwindow.cpp +++ b/ScreenPlayWallpaper/src/winwindow.cpp @@ -68,8 +68,6 @@ LRESULT __stdcall MouseHookCallback(int nCode, WPARAM wParam, LPARAM lParam) auto* app = QApplication::instance(); app->sendEvent(winGlobalHook, &eventRelease); - - qDebug() << mouseButton << mouseButtons; }); } @@ -144,7 +142,9 @@ WinWindow::WinWindow( m_checkForFullScreenWindowTimer.start(10); } - setupWindowMouseHook(); + QTimer::singleShot(1000,[this](){ + setupWindowMouseHook(); + }); } void WinWindow::setVisible(bool show) From 863edbd77bc0cc4bb238d672398b784e8c39800f Mon Sep 17 00:00:00 2001 From: Dominik Louven Date: Fri, 13 Mar 2020 17:53:00 +0100 Subject: [PATCH 09/15] Fix Checkbox and Colorpicker in Monitor Settings --- ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml index 315fd0a6..16466041 100644 --- a/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml +++ b/ScreenPlay/qml/Monitors/MonitorsProjectSettingItem.qml @@ -85,9 +85,9 @@ Rectangle { right: parent.right verticalCenter: parent.verticalCenter } - onCheckedChanged: { + onCheckedChanged: { ScreenPlay.screenPlayManager.setWallpaperValue( - selectedMonitor, name, value) + selectedMonitor, name, checkbox.checked) } } } @@ -129,8 +129,9 @@ Rectangle { title: qsTr("Please choose a color") onAccepted: { rctPreviewColor.color = colorDialog.color + let tmpColor = "'" + colorDialog.color.toString() + "'" ScreenPlay.screenPlayManager.setWallpaperValue( - selectedMonitor, name, colorDialog.color) + selectedMonitor, name, tmpColor) } } } From cf229fe07547ebd1268b2997ca2b25393e2ca45b Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 14 Mar 2020 13:58:44 +0100 Subject: [PATCH 10/15] Refactor fullscreen window check to use the same check on one or more monitors --- ScreenPlayWallpaper/src/winwindow.cpp | 60 +++++++++------------------ 1 file changed, 19 insertions(+), 41 deletions(-) diff --git a/ScreenPlayWallpaper/src/winwindow.cpp b/ScreenPlayWallpaper/src/winwindow.cpp index e956422f..3bbab13d 100644 --- a/ScreenPlayWallpaper/src/winwindow.cpp +++ b/ScreenPlayWallpaper/src/winwindow.cpp @@ -17,7 +17,6 @@ HHOOK mouseHook; QQuickView* winGlobalHook = nullptr; - LRESULT __stdcall MouseHookCallback(int nCode, WPARAM wParam, LPARAM lParam) { Qt::MouseButton mouseButton {}; @@ -142,8 +141,8 @@ WinWindow::WinWindow( m_checkForFullScreenWindowTimer.start(10); } - QTimer::singleShot(1000,[this](){ - setupWindowMouseHook(); + QTimer::singleShot(1000, [this]() { + setupWindowMouseHook(); }); } @@ -303,52 +302,31 @@ int GetMonitorIndex(HMONITOR hMonitor) void WinWindow::checkForFullScreenWindow() { - // If one screen: - { - auto hWnd = GetForegroundWindow(); - DWORD dwStyle = (DWORD)GetWindowLong(hWnd, GWL_STYLE); - int screensCount = QGuiApplication::screens().length(); - if (screensCount == 1) { + HWND hFoundWnd = nullptr; + EnumWindows(&FindTheDesiredWnd, reinterpret_cast(&hFoundWnd)); + // True if one window has WS_MAXIMIZE + if (hFoundWnd != nullptr) { + DWORD dwFlags = 0; + HMONITOR monitor = MonitorFromWindow(hFoundWnd, dwFlags); + HMONITOR wallpaper = MonitorFromWindow(m_windowHandle, dwFlags); + int monitorIndex = GetMonitorIndex(monitor); + int wallpaperIndex = GetMonitorIndex(wallpaper); + // qDebug() << "Window found " << printWindowNameByhWnd(hFoundWnd) << monitorIndex << activeScreensList().at(0) << wallpaperIndex; - if ((dwStyle & WS_MAXIMIZE) != 0) { - // do stuff + // We do not support autopause for multi monitor wallpaper + if (activeScreensList().length() == 1) { + // If the window that has WS_MAXIMIZE is at the same monitor as this wallpaper + if (monitorIndex == wallpaperIndex) { + //qDebug() << "monitorIndex" << monitorIndex; setVisualsPaused(true); } else { setVisualsPaused(false); } - - return; } - } - // If multiple screens: - { - HWND hFoundWnd = nullptr; - EnumWindows(&FindTheDesiredWnd, reinterpret_cast(&hFoundWnd)); - // True if one window has WS_MAXIMIZE - if (hFoundWnd != nullptr) { - DWORD dwFlags = 0; - HMONITOR monitor = MonitorFromWindow(hFoundWnd, dwFlags); - HMONITOR wallpaper = MonitorFromWindow(m_windowHandle, dwFlags); - int monitorIndex = GetMonitorIndex(monitor); - int wallpaperIndex = GetMonitorIndex(wallpaper); - // qDebug() << "Window found " << printWindowNameByhWnd(hFoundWnd) << monitorIndex << activeScreensList().at(0) << wallpaperIndex; - - // We do not support autopause for multi monitor wallpaper - if (activeScreensList().length() == 1) { - // If the window that has WS_MAXIMIZE is at the same monitor as this wallpaper - if (monitorIndex == wallpaperIndex) { - //qDebug() << "monitorIndex" << monitorIndex; - setVisualsPaused(true); - } else { - setVisualsPaused(false); - } - } - - } else { - setVisualsPaused(false); - } + } else { + setVisualsPaused(false); } } From c9acd574e3ebcf1209f033843e67cc44128bc592 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 14 Mar 2020 14:35:31 +0100 Subject: [PATCH 11/15] Fix profile path for loading and saving settings --- ScreenPlay/qml/Monitors/Monitors.qml | 1 + ScreenPlay/src/screenplaymanager.cpp | 6 +++--- ScreenPlay/src/settings.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ScreenPlay/qml/Monitors/Monitors.qml b/ScreenPlay/qml/Monitors/Monitors.qml index ef048801..3fcdba06 100644 --- a/ScreenPlay/qml/Monitors/Monitors.qml +++ b/ScreenPlay/qml/Monitors/Monitors.qml @@ -206,6 +206,7 @@ Item { ScrollBar.vertical: ScrollBar { snapMode: ScrollBar.SnapOnRelease + policy: ScrollBar.AlwaysOn } states: [ diff --git a/ScreenPlay/src/screenplaymanager.cpp b/ScreenPlay/src/screenplaymanager.cpp index f99dbb07..bb09f7d6 100644 --- a/ScreenPlay/src/screenplaymanager.cpp +++ b/ScreenPlay/src/screenplaymanager.cpp @@ -261,7 +261,7 @@ bool ScreenPlayManager::saveWallpaperProfile(const QString& profileName, const Q // Remove when implementing profiles Q_UNUSED(profileName) - QString absoluteProfilesFilePath = m_globalVariables->localSettingsPath().toLocalFile() + "/profiles.json"; + QString absoluteProfilesFilePath = m_globalVariables->localSettingsPath().toString() + "/profiles.json"; auto configOptional = Util::openJsonFileToObject(absoluteProfilesFilePath); if (!configOptional) { @@ -313,10 +313,10 @@ bool ScreenPlayManager::saveWallpaperProfile(const QString& profileName, const Q void ScreenPlayManager::loadWallpaperProfiles() { - auto configObj = Util::openJsonFileToObject(m_globalVariables->localSettingsPath().toLocalFile() + "/profiles.json"); + auto configObj = Util::openJsonFileToObject(m_globalVariables->localSettingsPath().toString() + "/profiles.json"); if (!configObj) { - qWarning() << "Could not load active profiles at path: " << m_globalVariables->localSettingsPath().toLocalFile() + "/profiles.json"; + qWarning() << "Could not load active profiles at path: " << m_globalVariables->localSettingsPath().toString() + "/profiles.json"; return; } diff --git a/ScreenPlay/src/settings.cpp b/ScreenPlay/src/settings.cpp index 76574755..eb548cb4 100644 --- a/ScreenPlay/src/settings.cpp +++ b/ScreenPlay/src/settings.cpp @@ -69,7 +69,7 @@ Settings::Settings(const shared_ptr& globalVariables, setAnonymousTelemetry(m_qSettings.value("AnonymousTelemetry", true).toBool()); // Wallpaper and Widgets config - QFile profilesFile(m_globalVariables->localSettingsPath().toLocalFile() + "/profiles.json"); + QFile profilesFile(m_globalVariables->localSettingsPath().toString() + "/profiles.json"); if (!profilesFile.exists()) { qInfo("No profiles.json found, creating default profiles.json"); qDebug() << profilesFile; @@ -122,7 +122,7 @@ Settings::Settings(const shared_ptr& globalVariables, */ void Settings::writeJsonFileFromResource(const QString& filename) { - QFile file(m_globalVariables->localSettingsPath().toLocalFile() + "/" + filename + ".json"); + QFile file(m_globalVariables->localSettingsPath().toString() + "/" + filename + ".json"); QFile defaultSettings(":/" + filename + ".json"); file.open(QIODevice::WriteOnly | QIODevice::Text); From 3b4356c1ad5ca4c67ba3294a72c27aace9957f55 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 14 Mar 2020 20:10:31 +0100 Subject: [PATCH 12/15] Add save for qmlWallpaper Fix removeAllWallpapers profiles path --- ScreenPlay/src/screenplaymanager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ScreenPlay/src/screenplaymanager.cpp b/ScreenPlay/src/screenplaymanager.cpp index bb09f7d6..0229f683 100644 --- a/ScreenPlay/src/screenplaymanager.cpp +++ b/ScreenPlay/src/screenplaymanager.cpp @@ -101,7 +101,18 @@ void ScreenPlayManager::createWallpaper( settings.insert("absolutePath", path); saveWallpaperProfile("default", settings); + return; } + if (saveToProfilesConfigFile && type == "qmlWallpaper") { + QJsonObject settings; + settings.insert("monitors", monitors); + settings.insert("type", type); + settings.insert("previewImage", previewImage); + settings.insert("absolutePath", path); + + saveWallpaperProfile("default", settings); + } + } /*! @@ -138,7 +149,7 @@ void ScreenPlayManager::removeAllWallpapers() m_screenPlayWallpapers.clear(); m_monitorListModel->clearActiveWallpaper(); - QString absoluteProfilesFilePath = m_globalVariables->localSettingsPath().toLocalFile() + "/profiles.json"; + QString absoluteProfilesFilePath = m_globalVariables->localSettingsPath().toString() + "/profiles.json"; auto configOptional = Util::openJsonFileToObject(absoluteProfilesFilePath); if (!configOptional) { From 67041df9906dfaecb5ad8be7c67b42aaadf67d6e Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 14 Mar 2020 20:23:32 +0100 Subject: [PATCH 13/15] Bump version to 0.10.0 --- ScreenPlay/app.cpp | 2 +- ScreenPlay/main.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ScreenPlay/app.cpp b/ScreenPlay/app.cpp index 598bfb12..ac9088e0 100644 --- a/ScreenPlay/app.cpp +++ b/ScreenPlay/app.cpp @@ -49,7 +49,7 @@ App::App() QGuiApplication::setOrganizationName("ScreenPlay"); QGuiApplication::setOrganizationDomain("screen-play.app"); QGuiApplication::setApplicationName("ScreenPlay"); - QGuiApplication::setApplicationVersion("0.9.0"); + QGuiApplication::setApplicationVersion("0.10.0"); QGuiApplication::setQuitOnLastWindowClosed(false); QtBreakpad::init(QDir::current().absolutePath()); diff --git a/ScreenPlay/main.qml b/ScreenPlay/main.qml index f2a9bac5..1b84403d 100644 --- a/ScreenPlay/main.qml +++ b/ScreenPlay/main.qml @@ -21,7 +21,7 @@ ApplicationWindow { visible: false width: 1400 height: 788 - title: "ScreenPlay Alpha - V0.9.0" + title: "ScreenPlay Alpha - V0.10.0" minimumHeight: 450 minimumWidth: 1050 From 5d0fcd8b6374a368c4ef2d300e48915319b906e5 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 19 Mar 2020 12:49:17 +0100 Subject: [PATCH 14/15] Remove none exisitng property --- .../qml/Create/Wizards/CreateEmptyWidget/CreateEmptyWidget.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScreenPlay/qml/Create/Wizards/CreateEmptyWidget/CreateEmptyWidget.qml b/ScreenPlay/qml/Create/Wizards/CreateEmptyWidget/CreateEmptyWidget.qml index 1a63dd87..b3349825 100644 --- a/ScreenPlay/qml/Create/Wizards/CreateEmptyWidget/CreateEmptyWidget.qml +++ b/ScreenPlay/qml/Create/Wizards/CreateEmptyWidget/CreateEmptyWidget.qml @@ -4,6 +4,7 @@ import QtQuick.Controls 2.14 import QtQuick.Layouts 1.14 import QtQuick.Dialogs 1.2 import ScreenPlay 1.0 +import Settings 1.0 import "../../../Common" @@ -159,7 +160,6 @@ Item { TagSelector { id: tagSelector Layout.fillWidth: true - font.family: ScreenPlay.settings.font } Item { From 422c4ef189af0f40a2db76f44406140bc28c46e2 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 19 Mar 2020 12:49:52 +0100 Subject: [PATCH 15/15] Add warning message for a potential bug where the wallpaper counter never resets --- ScreenPlay/src/screenplaymanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ScreenPlay/src/screenplaymanager.cpp b/ScreenPlay/src/screenplaymanager.cpp index 0229f683..d6611d0d 100644 --- a/ScreenPlay/src/screenplaymanager.cpp +++ b/ScreenPlay/src/screenplaymanager.cpp @@ -175,6 +175,8 @@ void ScreenPlayManager::removeAllWallpapers() Util::writeJsonObjectToFile(absoluteProfilesFilePath, newConfig); setActiveWallpaperCounter(0); + } else { + qWarning() << "Trying to remove all wallpapers while m_screenPlayWallpapers is not empty. Count: "<< m_screenPlayWallpapers.size(); } }