1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-07-18 18:48:28 +02:00

Merge remote-tracking branch 'origin/161-refactor-screenplaywallpaper-to-no-longer-inherit-from-basewindow' into 161-refactor-screenplaywallpaper-to-no-longer-inherit-from-basewindow

This commit is contained in:
Elias Steurer 2023-01-26 13:15:49 +01:00
commit c74ea74459
3 changed files with 44 additions and 15 deletions

24
.vscode/launch.json vendored
View File

@ -99,6 +99,30 @@
"program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.3.2_Clang_RelWithDebInfo/bin/ScreenPlayWallpaper.app/Contents/MacOS/ScreenPlayWallpaper",
"type": "cppdbg"
}
},
{
"name": "ScreenPlayWidget Debug",
"request": "launch",
"type": "cppvsdbg", // Must be set otherwise VSCode does not know we want to debug c++
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"internalConsoleOptions": "openOnSessionStart",
"windows": {
"environment": [
{
"name": "Path",
"value": "${env:Path};${workspaceFolder}\\..\\aqt\\6.4.2\\msvc2019_64\\bin\\;${workspaceFolder}\\..\\aqt\\6.4.2\\msvc2019_64\\modules\\;${workspaceFolder}\\..\\aqt\\6.4.2\\msvc2019_64\\qml\\;"
}
],
"type": "cppvsdbg",
"program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.4.2_MSVC_Debug/bin/ScreenPlayWidget.exe"
},
"osx": {
"MIMode": "lldb",
"program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.3.2_Clang_Debug/bin/ScreenPlayWidget.app/Contents/MacOS/ScreenPlayWidget",
"type": "cppdbg"
}
}
]
}

View File

@ -5,8 +5,15 @@ Item {
implicitWidth: 300
implicitHeight: 200
Rectangle {
id: background
anchors.fill:parent
opacity: 0.9
color: "#333333"
}
Text {
id: name
id: text
text: qsTr("My Widget 🚀")
anchors.centerIn: parent
}

View File

@ -23,10 +23,6 @@ bool ProjectFile::init()
return false;
// Required:
if (!obj.contains("description"))
return false;
description = obj.value("description").toString();
if (!obj.contains("file"))
return false;
file = obj.value("file").toString();
@ -38,7 +34,17 @@ bool ProjectFile::init()
if (!obj.contains("type"))
return false;
auto typeParsed = ScreenPlayUtil::getInstalledTypeFromString(obj.value("type").toString());
if (!typeParsed) {
qWarning() << "Type could not parsed from: " << *typeParsed;
return false;
}
type = typeParsed.value();
// Optional:
if (!obj.contains("description"))
description = obj.value("description").toString();
if (obj.contains("previewGIF"))
previewGIF = obj.value("previewGIF").toString();
@ -51,10 +57,8 @@ bool ProjectFile::init()
if (obj.contains("previewThumbnail")) {
preview = obj.value("previewThumbnail").toString();
} else {
if (!obj.contains("preview")) {
return false;
}
preview = obj.value("preview").toString();
if (obj.contains("preview"))
preview = obj.value("preview").toString();
}
if (obj.contains("tags")) {
@ -68,13 +72,7 @@ bool ProjectFile::init()
}
}
auto typeParsed = ScreenPlayUtil::getInstalledTypeFromString(obj.value("type").toString());
if (!typeParsed) {
qWarning() << "Type could not parsed from: " << *typeParsed;
return false;
}
type = typeParsed.value();
if (type == InstalledType::InstalledType::GifWallpaper) {
preview = previewGIF;
}