forked from Silverfish/proton-bridge
feat(GODT-2772): use os browser instead of integrated one for external links (for now).
This commit is contained in:
@ -278,8 +278,6 @@ signals: // Signals received from the Go backend, to be forwarded to QML
|
|||||||
void hideMainWindow(); ///< Signal for the 'hideMainWindow' gRPC stream event.
|
void hideMainWindow(); ///< Signal for the 'hideMainWindow' gRPC stream event.
|
||||||
void showHelp(); ///< Signal for the 'showHelp' event (from the context menu).
|
void showHelp(); ///< Signal for the 'showHelp' event (from the context menu).
|
||||||
void showSettings(); ///< Signal for the 'showHelp' event (from the context menu).
|
void showSettings(); ///< Signal for the 'showHelp' event (from the context menu).
|
||||||
void showWebFrameWindow(QString const &url); ///< Signal the the 'showWebFrameWindow' event
|
|
||||||
void showWebFrameOverlay(QString const &url); ////< Signal for the 'showWebFrameOverlay' event.
|
|
||||||
void showWebFrameOverlayHTML(QString const &html); ///< Signal to display HTML content in a web frame overlay.
|
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 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 genericError(QString const &title, QString const &description); ///< Signal for the 'genericError' gRPC stream event.
|
||||||
|
|||||||
@ -130,6 +130,5 @@
|
|||||||
<file>qml/ConnectionModeSettings.qml</file>
|
<file>qml/ConnectionModeSettings.qml</file>
|
||||||
<file>qml/SplashScreen.qml</file>
|
<file>qml/SplashScreen.qml</file>
|
||||||
<file>qml/Status.qml</file>
|
<file>qml/Status.qml</file>
|
||||||
<file>qml/WebFrameWindow.qml</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@ -40,35 +40,12 @@ QtObject {
|
|||||||
function onHideMainWindow() {
|
function onHideMainWindow() {
|
||||||
mainWindow.hide();
|
mainWindow.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
target: Backend
|
|
||||||
}
|
|
||||||
WebFrameWindow {
|
|
||||||
id: webFrameWindow
|
|
||||||
colorScheme: ProtonStyle.currentStyle
|
|
||||||
flags: Qt.Tool
|
|
||||||
transientParent: mainWindow
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onShowWebFrameOverlay(url) {
|
|
||||||
mainWindow.showWebFrameOverlay(url);
|
|
||||||
}
|
|
||||||
function onShowWebFrameOverlayHTML(html) {
|
function onShowWebFrameOverlayHTML(html) {
|
||||||
mainWindow.showWebFrameOverlayHTML(html)
|
mainWindow.showWebFrameOverlayHTML(html)
|
||||||
}
|
}
|
||||||
function onShowWebFrameWindow(url) {
|
|
||||||
webFrameWindow.url = url;
|
|
||||||
webFrameWindow.show();
|
|
||||||
webFrameWindow.raise();
|
|
||||||
if (!webFrameWindow.active) {
|
|
||||||
webFrameWindow.requestActivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: Backend
|
target: Backend
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
property Notifications _notifications: Notifications {
|
property Notifications _notifications: Notifications {
|
||||||
id: notifications
|
id: notifications
|
||||||
frontendMain: mainWindow
|
frontendMain: mainWindow
|
||||||
|
|||||||
@ -104,7 +104,7 @@ SettingsView {
|
|||||||
type: Label.Caption
|
type: Label.Caption
|
||||||
|
|
||||||
onLinkActivated: function (link) {
|
onLinkActivated: function (link) {
|
||||||
Backend.showWebFrameOverlay(link)
|
Qt.openUrlExternally(link)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ ApplicationWindow {
|
|||||||
setupWizard.showClientConfig(user, address, justLoggedIn);
|
setupWizard.showClientConfig(user, address, justLoggedIn);
|
||||||
}
|
}
|
||||||
function showHelp() {
|
function showHelp() {
|
||||||
Backend.showWebFrameWindow("https://proton.me/support/bridge");
|
Qt.openUrlExternally("https://proton.me/support/bridge");
|
||||||
}
|
}
|
||||||
function showLocalCacheSettings() {
|
function showLocalCacheSettings() {
|
||||||
contentWrapper.showLocalCacheSettings();
|
contentWrapper.showLocalCacheSettings();
|
||||||
@ -67,11 +67,6 @@ ApplicationWindow {
|
|||||||
function showSettings() {
|
function showSettings() {
|
||||||
contentWrapper.showSettings();
|
contentWrapper.showSettings();
|
||||||
}
|
}
|
||||||
function showWebFrameOverlay(url) {
|
|
||||||
webFrameOverlay.visible = true;
|
|
||||||
webFrameOverlay.url = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showWebFrameOverlayHTML(html) {
|
function showWebFrameOverlayHTML(html) {
|
||||||
webFrameOverlay.loadHTML(html);
|
webFrameOverlay.loadHTML(html);
|
||||||
webFrameOverlay.visible = true;
|
webFrameOverlay.visible = true;
|
||||||
|
|||||||
@ -24,9 +24,6 @@ Item {
|
|||||||
property bool overlay: true
|
property bool overlay: true
|
||||||
property string url: ""
|
property string url: ""
|
||||||
|
|
||||||
function showBlankPage() {
|
|
||||||
webView.loadHtml("<!doctype html><meta charset=utf-8><title>blank</title>", "");
|
|
||||||
}
|
|
||||||
function loadHTML(html) {
|
function loadHTML(html) {
|
||||||
webView.loadHtml(html)
|
webView.loadHtml(html)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,7 @@ Rectangle {
|
|||||||
text: qsTr("Open guide")
|
text: qsTr("Open guide")
|
||||||
|
|
||||||
onClicked: function () {
|
onClicked: function () {
|
||||||
Backend.showWebFrameWindow(wizard.setupGuideLink());
|
Qt.openUrlExternally(wizard.setupGuideLink());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,35 +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.Controls
|
|
||||||
import Proton
|
|
||||||
|
|
||||||
Window {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property string url
|
|
||||||
property ColorScheme colorScheme
|
|
||||||
|
|
||||||
height: 600
|
|
||||||
minimumWidth: 600
|
|
||||||
width: 800
|
|
||||||
|
|
||||||
WebFrame {
|
|
||||||
id: frame
|
|
||||||
anchors.fill: parent
|
|
||||||
colorScheme: root.colorScheme
|
|
||||||
overlay: false
|
|
||||||
url: root.url
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user