mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 08:06:59 +00:00
GODT-1516: Return notification on missing keychain
This commit is contained in:
@ -55,6 +55,26 @@ Window {
|
|||||||
function getCursorPos() {
|
function getCursorPos() {
|
||||||
return BridgePreview.getCursorPos()
|
return BridgePreview.getCursorPos()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function restart() {
|
||||||
|
root.quit()
|
||||||
|
console.log("Restarting....")
|
||||||
|
root.openBridge()
|
||||||
|
}
|
||||||
|
|
||||||
|
function openBridge() {
|
||||||
|
bridge = bridgeComponent.createObject()
|
||||||
|
var showSetupGuide = false
|
||||||
|
if (showSetupGuide) {
|
||||||
|
var newUserObject = root.userComponent.createObject(root)
|
||||||
|
newUserObject.username = "LerooooyJenkins@protonmail.com"
|
||||||
|
newUserObject.loggedIn = true
|
||||||
|
newUserObject.setupGuideSeen = false
|
||||||
|
root.users.append( { object: newUserObject } )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function quit() {
|
function quit() {
|
||||||
if (bridge !== undefined && bridge !== null) {
|
if (bridge !== undefined && bridge !== null) {
|
||||||
bridge.destroy()
|
bridge.destroy()
|
||||||
@ -367,18 +387,7 @@ Window {
|
|||||||
|
|
||||||
text: "Open Bridge"
|
text: "Open Bridge"
|
||||||
enabled: bridge === undefined || bridge === null
|
enabled: bridge === undefined || bridge === null
|
||||||
onClicked: {
|
onClicked: root.openBridge()
|
||||||
bridge = bridgeComponent.createObject()
|
|
||||||
var showSetupGuide = false
|
|
||||||
if (showSetupGuide) {
|
|
||||||
var newUserObject = root.userComponent.createObject(root)
|
|
||||||
newUserObject.username = "LerooooyJenkins@protonmail.com"
|
|
||||||
newUserObject.loggedIn = true
|
|
||||||
newUserObject.setupGuideSeen = false
|
|
||||||
root.users.append( { object: newUserObject } )
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -589,7 +598,7 @@ Window {
|
|||||||
text: "No keychain"
|
text: "No keychain"
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.hasNoKeychain()
|
root.notifyHasNoKeychain()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -815,7 +824,7 @@ Window {
|
|||||||
root.changeKeychainFinished()
|
root.changeKeychainFinished()
|
||||||
}
|
}
|
||||||
signal changeKeychainFinished()
|
signal changeKeychainFinished()
|
||||||
signal hasNoKeychain()
|
signal notifyHasNoKeychain()
|
||||||
|
|
||||||
signal noActiveKeyForRecipient(string email)
|
signal noActiveKeyForRecipient(string email)
|
||||||
signal showMainWindow()
|
signal showMainWindow()
|
||||||
|
|||||||
@ -870,7 +870,7 @@ QtObject {
|
|||||||
|
|
||||||
property Notification noKeychain: Notification {
|
property Notification noKeychain: Notification {
|
||||||
title: qsTr("No keychain available")
|
title: qsTr("No keychain available")
|
||||||
description: qsTr("Bridge is not able to detected a supported password manager (pass or secret-service). Please install and setup supported password manager and restart the application.")
|
description: qsTr("Bridge is not able to detect a supported password manager (pass or secret-service). Please install and setup supported password manager and restart the application.")
|
||||||
brief: title
|
brief: title
|
||||||
icon: "./icons/ic-exclamation-circle-filled.svg"
|
icon: "./icons/ic-exclamation-circle-filled.svg"
|
||||||
type: Notification.NotificationType.Danger
|
type: Notification.NotificationType.Danger
|
||||||
@ -879,7 +879,7 @@ QtObject {
|
|||||||
Connections {
|
Connections {
|
||||||
target: root.backend
|
target: root.backend
|
||||||
|
|
||||||
onHasNoKeychain: {
|
onNotifyHasNoKeychain: {
|
||||||
root.noKeychain.active = true
|
root.noKeychain.active = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -891,6 +891,13 @@ QtObject {
|
|||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.backend.quit()
|
root.backend.quit()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
Action {
|
||||||
|
text: qsTr("Restart Bridge")
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
root.backend.restart()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,17 +35,19 @@ const (
|
|||||||
func init() { // nolint[noinit]
|
func init() { // nolint[noinit]
|
||||||
Helpers = make(map[string]helperConstructor)
|
Helpers = make(map[string]helperConstructor)
|
||||||
|
|
||||||
Helpers[SecretService] = newSecretServiceHelper
|
if isUsable(newSecretServiceHelper("")) {
|
||||||
|
Helpers[SecretService] = newSecretServiceHelper
|
||||||
|
}
|
||||||
|
|
||||||
if _, err := exec.LookPath("pass"); err == nil {
|
if _, err := exec.LookPath("pass"); err == nil && isUsable(newPassHelper("")) {
|
||||||
Helpers[Pass] = newPassHelper
|
Helpers[Pass] = newPassHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Pass is available, use it by default.
|
// If Pass is available, use it by default.
|
||||||
// Otherwise, if SecretService is available, use it by default.
|
// Otherwise, if SecretService is available, use it by default.
|
||||||
if _, ok := Helpers[Pass]; ok && isUsable(newPassHelper("")) {
|
if _, ok := Helpers[Pass]; ok {
|
||||||
defaultHelper = Pass
|
defaultHelper = Pass
|
||||||
} else if isUsable(newSecretServiceHelper("")) {
|
} else if _, ok := Helpers[SecretService]; ok {
|
||||||
defaultHelper = SecretService
|
defaultHelper = SecretService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user