feat(GODT-2772): removed web frame.

This commit is contained in:
Xavier Michelon
2023-09-12 10:50:15 +02:00
parent c8cf90abfe
commit 139ad75394
9 changed files with 5 additions and 130 deletions

View File

@ -75,7 +75,7 @@ if(NOT UNIX)
set(CMAKE_INSTALL_BINDIR ".")
endif(NOT UNIX)
find_package(Qt6 COMPONENTS Core Quick Qml QuickControls2 Widgets Svg WebView REQUIRED)
find_package(Qt6 COMPONENTS Core Quick Qml QuickControls2 Widgets Svg REQUIRED)
qt_standard_project_setup()
set(CMAKE_AUTORCC ON)
message(STATUS "Using Qt ${Qt6_VERSION}")
@ -148,7 +148,6 @@ target_link_libraries(bridge-gui
Qt6::Qml
Qt6::QuickControls2
Qt6::Svg
Qt6::WebView
sentry::sentry
bridgepp
)

View File

@ -1099,28 +1099,6 @@ void QMLBackend::setUpdateTrayIcon(QString const &stateString, QString const &st
}
//****************************************************************************************************************************************************
/// \param[in] helpFileName The name of the help file with extension (e.g. "WhyBridge.html").
//****************************************************************************************************************************************************
void QMLBackend::showHelpOverlay(QString const &helpFileName) {
QDir const basePath(":/qml/Resources/Help");
QString const templatePath = basePath.filePath("Template.html");
QFile templateFile(templatePath);
if (!templateFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
app().log().error("Could not load help overlay HTML template");
return;
}
QFile helpFile(basePath.filePath(helpFileName));
if (!helpFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
app().log().error(QString("Could not load help overlay HTML file %1").arg(helpFileName));
return;
}
emit showWebFrameOverlayHTML(QString::fromUtf8(templateFile.readAll()).arg(QString::fromUtf8(helpFile.readAll())));
}
//****************************************************************************************************************************************************
/// \param[in] isOn Does bridge consider internet as on.
//****************************************************************************************************************************************************

View File

@ -211,7 +211,6 @@ public slots: // slots for functions that need to be processed locally.
void setErrorTrayIcon(QString const& stateString, QString const &statusIcon); ///< Set the tray icon to 'error' state.
void setWarnTrayIcon(QString const& stateString, QString const &statusIcon); ///< Set the tray icon to 'warn' state.
void setUpdateTrayIcon(QString const& stateString, QString const &statusIcon); ///< Set the tray icon to 'update' state.
void showHelpOverlay(QString const &helpFileName); ///< Slot triggering the display of help content as an overlay.
public slots: // slot for signals received from gRPC that need transformation instead of simple forwarding
void internetStatusChanged(bool isOn); ///< Check if bridge considers internet as on.
@ -278,7 +277,6 @@ signals: // Signals received from the Go backend, to be forwarded to QML
void hideMainWindow(); ///< Signal for the 'hideMainWindow' gRPC stream event.
void showHelp(); ///< Signal for the 'showHelp' event (from the context menu).
void showSettings(); ///< Signal for the 'showHelp' event (from the context menu).
void showWebFrameOverlayHTML(QString const &html); ///< Signal to display HTML content in a web frame overlay.
void selectUser(QString const& userID, bool forceShowWindow); ///< Signal emitted in order to selected a user with a given ID in the list.
void genericError(QString const &title, QString const &description); ///< Signal for the 'genericError' gRPC stream event.
void imapLoginWhileSignedOut(QString const& username); ///< Signal for the notification of IMAP login attempt on a signed out account.

View File

@ -107,7 +107,6 @@
<file>qml/Proton/TextArea.qml</file>
<file>qml/Proton/TextField.qml</file>
<file>qml/Proton/Toggle.qml</file>
<file>qml/Proton/WebFrame.qml</file>
<file>qml/QuestionItem.qml</file>
<file>qml/Resources/bug_report_flow.json</file>
<file>qml/Resources/Help/Template.html</file>

View File

@ -29,7 +29,6 @@
#include <bridgepp/Log/Log.h>
#include <bridgepp/Log/LogUtils.h>
#include <bridgepp/ProcessMonitor.h>
#include <QtWebView>
#ifdef Q_OS_MACOS
@ -285,7 +284,6 @@ int main(int argc, char *argv[]) {
QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); // must be called before instantiating the BridgeApp
}
QtWebView::initialize();
BridgeApp guiApp(argc, argv);
initSentry();
auto sentryCloser = qScopeGuard([] { sentry_close(); });

View File

@ -40,9 +40,6 @@ QtObject {
function onHideMainWindow() {
mainWindow.hide();
}
function onShowWebFrameOverlayHTML(html) {
mainWindow.showWebFrameOverlayHTML(html)
}
target: Backend
}
}

View File

@ -67,10 +67,6 @@ ApplicationWindow {
function showSettings() {
contentWrapper.showSettings();
}
function showWebFrameOverlayHTML(html) {
webFrameOverlay.loadHTML(html);
webFrameOverlay.visible = true;
}
colorScheme: ProtonStyle.currentStyle
height: ProtonStyle.window_default_height
@ -178,14 +174,6 @@ ApplicationWindow {
}
}
}
WebFrame {
id: webFrameOverlay
anchors.fill: parent
colorScheme: root.colorScheme
overlay: true
url: ""
visible: false
}
NotificationPopups {
colorScheme: root.colorScheme
mainWindow: root

View File

@ -1,83 +0,0 @@
// Copyright (c) 2023 Proton AG
// This file is part of Proton Mail Bridge.
// Proton Mail Bridge 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 3 of the License, or
// (at your option) any later version.
// Proton Mail Bridge 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 Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.impl
import QtWebView
Item {
id: root
property ColorScheme colorScheme
property bool overlay: true
property string url: ""
function loadHTML(html) {
webView.loadHtml(html)
}
Rectangle {
anchors.fill: parent
color: "#000"
opacity: ProtonStyle.web_view_overlay_opacity
visible: overlay
}
Rectangle {
anchors.fill: parent
anchors.bottomMargin: overlay ? ProtonStyle.web_view_overlay_vertical_margin : 0
anchors.leftMargin: overlay ? ProtonStyle.web_view_overlay_horizontal_margin : 0
anchors.rightMargin: overlay ? ProtonStyle.web_view_overlay_horizontal_margin : 0
anchors.topMargin: overlay ? ProtonStyle.web_view_overlay_vertical_margin : 0
color: root.colorScheme.background_norm
radius: ProtonStyle.web_view_corner_radius
ColumnLayout {
anchors.bottomMargin: 0
anchors.fill: parent
anchors.leftMargin: overlay ? ProtonStyle.web_view_overlay_horizontal_padding : 0
anchors.rightMargin: overlay ? ProtonStyle.web_view_overlay_horizontal_padding : 0
anchors.topMargin: overlay ? ProtonStyle.web_view_overlay_vertical_padding : 0
spacing: 0
Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
border.color: root.colorScheme.border_norm
border.width: overlay ? ProtonStyle.web_view_overley_border_width : 0
WebView {
id: webView
anchors.fill: parent
anchors.margins: ProtonStyle.web_view_overley_border_width
url: root.url
}
}
Button {
Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: ProtonStyle.web_view_overlay_button_vertical_margin
Layout.preferredWidth: ProtonStyle.web_view_button_width
Layout.topMargin: ProtonStyle.web_view_overlay_button_vertical_margin
colorScheme: root.colorScheme
text: qsTr("Close")
visible: overlay
onClicked: {
root.url = "";
root.visible = false;
}
}
}
}
}

View File

@ -26,7 +26,8 @@ Item {
function showAppleMailAutoconfigCertificateInstall() {
showAppleMailAutoconfigCommon();
descriptionLabel.text = qsTr("Apple Mail configuration is mostly automated, but in order to work, Bridge needs to install a certificate in your keychain.");
linkLabel1.setCallback(function() { Backend.showHelpOverlay("WhyCertificate.html"); }, qsTr("Why is this certificate needed?"), false);
linkLabel1.setLink("https://proton.me/support/bridge", qsTr("Why is this certificate needed?"), true); ///< TODO GODT-2772: replace link with link to KB article.
linkLabel2.clear();
}
function showAppleMailAutoconfigCommon() {
titleLabel.text = "";
@ -39,7 +40,7 @@ Item {
function showAppleMailAutoconfigProfileInstall() {
showAppleMailAutoconfigCommon();
descriptionLabel.text = qsTr("The final step before you can start using Apple Mail is to install the Bridge server profile in the system preferences.\n\nAdding a server profile is necessary to ensure that your Mac can receive and send Proton Mails.");
linkLabel1.setCallback(function() { Backend.showHelpOverlay("WhyProfileWarning.html"); }, qsTr("Why is there a yellow warning sign?"), false);
linkLabel1.setLink("https://proton.me/support/bridge", qsTr("Why is there a yellow warning sign?"), true); ///< TODO GODT-2772: replace link with link to KB article.
linkLabel2.setCallback(wizard.showClientParams, qsTr("Configure Apple Mail manually"), false);
}
function showClientSelector(newAccount = true) {
@ -63,7 +64,7 @@ Item {
function showOnboarding() {
titleLabel.text = (Backend.users.count === 0) ? qsTr("Welcome to\nProton Mail Bridge") : qsTr("Add a Proton Mail account");
descriptionLabel.text = qsTr("Bridge is the gateway between your Proton account and your email client. It runs in the background and encrypts and decrypts your messages seamlessly. ");
linkLabel1.setCallback(function() { Backend.showHelpOverlay("WhyBridge.html"); }, qsTr("Why do I need Bridge?"), false);
linkLabel1.setLink("https://proton.me/support/bridge", qsTr("Why do I need Bridge?"), true); ///< TODO GODT-2772: replace link with link to KB article.
linkLabel2.clear();
root.iconSource = "/qml/icons/img-welcome.svg";
root.iconHeight = 148;