1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Fix website Wallpaper

Add https:// to wizard.
This commit is contained in:
Elias Steurer 2021-01-23 11:34:46 +01:00
parent 44f31a1fe4
commit c20f83756d
4 changed files with 10 additions and 6 deletions

View File

@ -64,7 +64,7 @@ WizardPage {
id: tfUrl id: tfUrl
Layout.fillWidth: true Layout.fillWidth: true
required: true required: true
placeholderText: qsTr("Website URL") text: "https://"
} }
Item { Item {

View File

@ -81,8 +81,7 @@ Rectangle {
break break
case Wallpaper.WallpaperType.Website: case Wallpaper.WallpaperType.Website:
loader.setSource("qrc:/WebsiteWallpaper.qml", { loader.setSource("qrc:/WebsiteWallpaper.qml", {
"source": Qt.resolvedUrl( "url": Wallpaper.fullContentPath
Wallpaper.fullContentPath)
}) })
fadeIn() fadeIn()
break break

View File

@ -6,7 +6,7 @@ import ScreenPlayWallpaper 1.0
Item { Item {
id: root id: root
property alias url: webView.url property string url
signal requestFadeIn signal requestFadeIn
@ -24,6 +24,7 @@ Item {
WebEngineView { WebEngineView {
id: webView id: webView
anchors.fill: parent anchors.fill: parent
url: root.url
onJavaScriptConsoleMessage: print(lineNumber, message) onJavaScriptConsoleMessage: print(lineNumber, message)
onLoadProgressChanged: { onLoadProgressChanged: {
if ((loadProgress === 100)) { if ((loadProgress === 100)) {

View File

@ -65,7 +65,7 @@ BaseWindow::BaseWindow(
QApplication::exit(-3); QApplication::exit(-3);
} }
if (!project.contains("file")) { if (!project.contains("file") && !project.contains("url")) {
qFatal("No file was specified inside the json object!"); qFatal("No file was specified inside the json object!");
QApplication::exit(-4); QApplication::exit(-4);
} }
@ -159,7 +159,11 @@ void BaseWindow::replaceWallpaper(
setVolume(volume); setVolume(volume);
setFillMode(fillMode); setFillMode(fillMode);
setType(parseWallpaperType(type)); setType(parseWallpaperType(type));
setFullContentPath("file:///" + absolutePath + "/" + file); if (type.contains("websiteWallpaper", Qt::CaseInsensitive)) {
setFullContentPath(file);
} else {
setFullContentPath("file:///" + absolutePath + "/" + file);
}
qInfo() << file; qInfo() << file;
if (m_type == WallpaperType::Qml || m_type == WallpaperType::Html) if (m_type == WallpaperType::Qml || m_type == WallpaperType::Html)