diff --git a/gemini/qml/welcomepages/cloud/dropbox/DropboxWebView.qml b/gemini/qml/welcomepages/cloud/dropbox/DropboxWebView.qml index 3a21379746d..9f4bb7aa584 100644 --- a/gemini/qml/welcomepages/cloud/dropbox/DropboxWebView.qml +++ b/gemini/qml/welcomepages/cloud/dropbox/DropboxWebView.qml @@ -1,55 +1,55 @@ /* This file is part of the KDE project * Copyright (C) 2014 Dan Leinir Turthra Jensen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 -import QtWebKit 3.0 +import QtWebEngine 1.5 import org.kde.kirigami 2.1 as Kirigami import QtQuick.Controls 1.4 as QtControls -WebView { +WebEngineView { id: webView anchors.fill: parent // experimental.userAgent: "Mozilla/5.0 (Linux; U; like Android 4.0.3; ko-kr; Jolla Build/Alpha) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30" onLoadingChanged: { - if(status == WebView.LoadSucceededStatus) { + if(loadRequest.status == WebEngineView.LoadSucceededStatus) { tryingText.visible = false; - if(url.toString().length === 48) { controllerMIT.oauth_v1_access_token() } - // if(url.toString().length === 140) experimental.test.touchTap(webView, 100, 150) + if(loadRequest.url.toString().length === 48) { controllerMIT.oauth_v1_access_token() } + // if(loadRequest.url.toString().length === 140) experimental.test.touchTap(webView, 100, 150) } } Kirigami.Label { id: tryingText anchors.centerIn: parent; text: "Trying to load login page..." color: "Grey" z: 10 QtControls.BusyIndicator { id: b_indicator anchors { top: parent.verticalCenter topMargin: parent.font.pixelSize; horizontalCenter: parent.horizontalCenter } running: parent.visible; } } } diff --git a/gemini/qml/welcomepages/cloud/dropbox/LoginPage.qml b/gemini/qml/welcomepages/cloud/dropbox/LoginPage.qml index 6680beb10ba..6a02f7b0e14 100644 --- a/gemini/qml/welcomepages/cloud/dropbox/LoginPage.qml +++ b/gemini/qml/welcomepages/cloud/dropbox/LoginPage.qml @@ -1,50 +1,49 @@ /* This file is part of the KDE project * Copyright (C) 2014 Dan Leinir Turthra Jensen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 -import QtWebKit 3.0 import "../../../components" Page { anchors.fill: parent property string urlString : "https://www.dropbox.com/1/oauth/authorize?display=mobile&oauth_token="+ controllerMIT.oauth_token Component.onCompleted: { controllerMIT.oauth_v1_request_token() } DropboxWebView { id: webView } InfoBanner { id: i_infobanner; } Connections { target: controllerMIT onNetwork_error : { i_infobanner.show(error); console.debug("Network error while loading DropBox:\n" + error); } onAuthenticate_finished : { pageStack.pop(); } onOpen_oauth_authorize_page : { webView.url = "https://www.dropbox.com/1/oauth/authorize?display=mobile&oauth_token="+oauth_token } } } // TODO Handle error() code 3 (dns resolution error) and other no-network situations