From 90f92722be7b746cd9069b3be9c9d357dd122a1e Mon Sep 17 00:00:00 2001 From: Mark Washeim Date: Tue, 1 Nov 2022 20:07:17 +0100 Subject: [PATCH] Modified to use modern WebView. --- .gitignore | 1 + qml/pages/LoginPage.qml | 20 ++++++++++++++------ rpm/harbour-tooterb.spec | 4 +++- rpm/harbour-tooterb.yaml | 3 ++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index e5f8bc2..23ca2a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.user README.md +harbour-tooterb.pro.user diff --git a/qml/pages/LoginPage.qml b/qml/pages/LoginPage.qml index 5227d13..5208f18 100644 --- a/qml/pages/LoginPage.qml +++ b/qml/pages/LoginPage.qml @@ -1,6 +1,8 @@ import QtQuick 2.0 -import QtWebKit 3.0 +// import QtWebKit 3.0 import Sailfish.Silica 1.0 +import Sailfish.WebView 1.0 +import Sailfish.WebEngine 1.0 import "../lib/API.js" as Logic @@ -90,17 +92,23 @@ Page { } } } - - SilicaWebView { + WebView { id: webView + + /* This will probably be required from 4.4 on. */ + Component.onCompleted: { + WebEngineSettings.setPreference("security.disable_cors_checks", true, WebEngineSettings.BoolPref) + WebEngineSettings.setPreference("security.fileuri.strict_origin_policy", false, WebEngineSettings.BoolPref) + } visible: false - opacity: 0 + //opacity: 0 anchors { top: parent.top left: parent.left right: parent.right bottom: parent.bottom } + onLoadingChanged: { console.log(url) if ( @@ -136,7 +144,7 @@ Page { } - switch (loadRequest.status) + /*switch (loadRequest.status) { case WebView.LoadSucceededStatus: opacity = 1 @@ -147,7 +155,7 @@ Page { default: //opacity = 0 break - } + }*/ } FadeAnimation on opacity {} diff --git a/rpm/harbour-tooterb.spec b/rpm/harbour-tooterb.spec index 4b290da..d6c4e9b 100644 --- a/rpm/harbour-tooterb.spec +++ b/rpm/harbour-tooterb.spec @@ -1,6 +1,6 @@ # # Do NOT Edit the Auto-generated Part! -# Generated by: spectacle version 0.27 +# Generated by: spectacle version 0.32 # Name: harbour-tooterb @@ -21,6 +21,8 @@ URL: http://example.org/ Source0: %{name}-%{version}.tar.bz2 Source100: harbour-tooterb.yaml Requires: sailfishsilica-qt5 >= 0.10.9 +Requires: nemo-qml-plugin-configuration-qt5 +Requires: nemo-qml-plugin-notifications-qt5 BuildRequires: pkgconfig(sailfishapp) >= 1.0.2 BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Qml) diff --git a/rpm/harbour-tooterb.yaml b/rpm/harbour-tooterb.yaml index 927cb80..078cba6 100644 --- a/rpm/harbour-tooterb.yaml +++ b/rpm/harbour-tooterb.yaml @@ -27,7 +27,8 @@ PkgConfigBR: - Qt5Quick - Qt5DBus - Qt5Multimedia - - nemonotifications-qt5 + #- nemonotifications-qt5 nemo-qml-plugin-notifications-qt5 + - nemo-qml-plugin-notifications-qt5-devel - openssl # Build dependencies without a pkgconfig setup can be listed here