1
0

feat(GODT-2772): client selector left pane tweaks.

This commit is contained in:
Xavier Michelon
2023-08-25 14:58:46 +02:00
parent c849762445
commit 53f5f9aa43
6 changed files with 19 additions and 24 deletions

View File

@ -28,7 +28,7 @@ Item {
property var notifications property var notifications
property var user property var user
signal showClientConfigurator(var user, string address) signal showClientConfigurator(var user, string address, bool justLoggedIn)
signal showLogin(var username) signal showLogin(var username)
Rectangle { Rectangle {
@ -129,7 +129,7 @@ Item {
onClicked: { onClicked: {
if (!root.user) if (!root.user)
return; return;
root.showClientConfigurator(root.user, user.addresses[0]); root.showClientConfigurator(root.user, user.addresses[0], false);
} }
} }
SettingsItem { SettingsItem {
@ -171,7 +171,7 @@ Item {
onClicked: { onClicked: {
if (!root.user) if (!root.user)
return; return;
root.showClientConfigurator(root.user, addressSelector.displayText); root.showClientConfigurator(root.user, addressSelector.displayText, false);
} }
} }
} }

View File

@ -24,7 +24,7 @@ Item {
signal closeWindow signal closeWindow
signal quitBridge signal quitBridge
signal showClientConfigurator(var user, string address) signal showClientConfigurator(var user, string address, bool justLoggedIn)
signal showLogin(var username) signal showLogin(var username)
function selectUser(userID) { function selectUser(userID) {
@ -336,8 +336,8 @@ Item {
return Backend.users.get(accounts.currentIndex); return Backend.users.get(accounts.currentIndex);
} }
onShowClientConfigurator: function (user, address) { onShowClientConfigurator: function (user, address, justLoggedIn) {
root.showClientConfigurator(user, address); root.showClientConfigurator(user, address, justLoggedIn);
} }
onShowLogin: function (username) { onShowLogin: function (username) {
root.showLogin(username); root.showLogin(username);

View File

@ -52,9 +52,9 @@ ApplicationWindow {
root.requestActivate(); root.requestActivate();
} }
} }
function showClientConfigurator(user, address) { function showClientConfigurator(user, address, justLoggedIn) {
contentLayout.currentIndex = 1; contentLayout.currentIndex = 1;
setupWizard.showClientConfig(user, address); setupWizard.showClientConfig(user, address, justLoggedIn);
} }
function showHelp() { function showHelp() {
Backend.showWebFrameWindow("https://proton.me/support/bridge"); Backend.showWebFrameWindow("https://proton.me/support/bridge");
@ -103,7 +103,7 @@ ApplicationWindow {
if (user.setupGuideSeen) { if (user.setupGuideSeen) {
return; return;
} }
root.showClientConfigurator(user, user.addresses[0]); root.showClientConfigurator(user, user.addresses[0], false);
} }
target: Backend.users target: Backend.users
@ -158,8 +158,8 @@ ApplicationWindow {
root.close(); root.close();
Backend.quit(); Backend.quit();
} }
onShowClientConfigurator: function (user, address) { onShowClientConfigurator: function (user, address, justLoggedIn) {
root.showClientConfigurator(user, address); root.showClientConfigurator(user, address, justLoggedIn);
} }
onShowLogin: function (username) { onShowLogin: function (username) {
root.showLogin(username); root.showLogin(username);

View File

@ -15,8 +15,7 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Controls.impl import QtQuick.Controls.impl
import QtWebEngine import QtWebView
Item { Item {
id: root id: root
@ -55,15 +54,11 @@ Item {
border.color: root.colorScheme.border_norm border.color: root.colorScheme.border_norm
border.width: overlay ? ProtonStyle.web_view_overley_border_width : 0 border.width: overlay ? ProtonStyle.web_view_overley_border_width : 0
WebEngineView { WebView {
id: webView id: webView
anchors.fill: parent anchors.fill: parent
anchors.margins: ProtonStyle.web_view_overley_border_width anchors.margins: ProtonStyle.web_view_overley_border_width
url: root.url url: root.url
onContextMenuRequested: function (request) {
request.accepted = true; // This prevent the default context menu from being presented.
}
} }
} }
Button { Button {

View File

@ -42,9 +42,9 @@ Item {
linkLabel1.setCallback(showUnderConstruction, qsTr("Why is there a yellow warning sign?")); linkLabel1.setCallback(showUnderConstruction, qsTr("Why is there a yellow warning sign?"));
linkLabel2.setCallback(wizard.showClientParams, qsTr("Configure Apple Mail manually")); linkLabel2.setCallback(wizard.showClientParams, qsTr("Configure Apple Mail manually"));
} }
function showClientSelector() { function showClientSelector(newAccount = true) {
titleLabel.text = ""; titleLabel.text = "";
descriptionLabel.text = qsTr("Bridge is now connected to Proton, and has already started downloading your messages. Lets now connect your email client to Bridge."); descriptionLabel.text = newAccount ? qsTr("Bridge is now connected to Proton, and has already started downloading your messages. Lets now connect your email client to Bridge.") : qsTr("Lets connect your email client to Bridge.");
linkLabel1.clear(); linkLabel1.clear();
linkLabel2.clear(); linkLabel2.clear();
iconSource = "/qml/icons/img-client-config-selector.svg"; iconSource = "/qml/icons/img-client-config-selector.svg";

View File

@ -45,7 +45,7 @@ Item {
signal wizardEnded signal wizardEnded
function _showClientConfig() { function _showClientConfig() {
showClientConfig(root.user, root.address); showClientConfig(root.user, root.address, false);
} }
function clientIconSource() { function clientIconSource() {
switch (client) { switch (client) {
@ -102,12 +102,12 @@ Item {
closeWizard(); closeWizard();
bugReportRequested(); bugReportRequested();
} }
function showClientConfig(user, address) { function showClientConfig(user, address, justLoggedIn) {
backAction = null; backAction = null;
root.user = user; root.user = user;
root.address = address; root.address = address;
rootStackLayout.currentIndex = SetupWizard.RootStack.TwoPanesView; rootStackLayout.currentIndex = SetupWizard.RootStack.TwoPanesView;
leftContent.showClientSelector(); leftContent.showClientSelector(justLoggedIn);
rightContent.currentIndex = SetupWizard.ContentStack.ClientConfigSelector; rightContent.currentIndex = SetupWizard.ContentStack.ClientConfigSelector;
} }
function showClientConfigEnd() { function showClientConfigEnd() {
@ -144,7 +144,7 @@ Item {
} }
let user = Backend.users.get(userIndex); let user = Backend.users.get(userIndex);
let address = user ? user.addresses[0] : ""; let address = user ? user.addresses[0] : "";
showClientConfig(user, address); showClientConfig(user, address, true);
} }
target: Backend target: Backend