diff --git a/ScreenPlay/qml/Create/Wizards/WebsiteWallpaper.qml b/ScreenPlay/qml/Create/Wizards/WebsiteWallpaper.qml index b6c05eda..19cddfd4 100644 --- a/ScreenPlay/qml/Create/Wizards/WebsiteWallpaper.qml +++ b/ScreenPlay/qml/Create/Wizards/WebsiteWallpaper.qml @@ -64,7 +64,7 @@ WizardPage { id: tfUrl Layout.fillWidth: true required: true - placeholderText: qsTr("Website URL") + text: "https://" } Item { diff --git a/ScreenPlayWallpaper/Wallpaper.qml b/ScreenPlayWallpaper/Wallpaper.qml index 19f766bd..b59fb627 100644 --- a/ScreenPlayWallpaper/Wallpaper.qml +++ b/ScreenPlayWallpaper/Wallpaper.qml @@ -81,8 +81,7 @@ Rectangle { break case Wallpaper.WallpaperType.Website: loader.setSource("qrc:/WebsiteWallpaper.qml", { - "source": Qt.resolvedUrl( - Wallpaper.fullContentPath) + "url": Wallpaper.fullContentPath }) fadeIn() break diff --git a/ScreenPlayWallpaper/WebsiteWallpaper.qml b/ScreenPlayWallpaper/WebsiteWallpaper.qml index aeb4bbaf..4bc366d5 100644 --- a/ScreenPlayWallpaper/WebsiteWallpaper.qml +++ b/ScreenPlayWallpaper/WebsiteWallpaper.qml @@ -6,7 +6,7 @@ import ScreenPlayWallpaper 1.0 Item { id: root - property alias url: webView.url + property string url signal requestFadeIn @@ -24,6 +24,7 @@ Item { WebEngineView { id: webView anchors.fill: parent + url: root.url onJavaScriptConsoleMessage: print(lineNumber, message) onLoadProgressChanged: { if ((loadProgress === 100)) { diff --git a/ScreenPlayWallpaper/src/basewindow.cpp b/ScreenPlayWallpaper/src/basewindow.cpp index eb829479..07326e1a 100644 --- a/ScreenPlayWallpaper/src/basewindow.cpp +++ b/ScreenPlayWallpaper/src/basewindow.cpp @@ -65,7 +65,7 @@ BaseWindow::BaseWindow( QApplication::exit(-3); } - if (!project.contains("file")) { + if (!project.contains("file") && !project.contains("url")) { qFatal("No file was specified inside the json object!"); QApplication::exit(-4); } @@ -159,7 +159,11 @@ void BaseWindow::replaceWallpaper( setVolume(volume); setFillMode(fillMode); setType(parseWallpaperType(type)); - setFullContentPath("file:///" + absolutePath + "/" + file); + if (type.contains("websiteWallpaper", Qt::CaseInsensitive)) { + setFullContentPath(file); + } else { + setFullContentPath("file:///" + absolutePath + "/" + file); + } qInfo() << file; if (m_type == WallpaperType::Qml || m_type == WallpaperType::Html)