1
0

qml: implement toggle for android SECURE_FLAG and add marker to wizard pages

that should be secured.
This commit is contained in:
Sander van Grieken
2023-04-29 13:45:28 +02:00
parent 8a25d59ba6
commit 0672ea20ab
9 changed files with 30 additions and 1 deletions

View File

@@ -180,7 +180,7 @@ RUN cd /opt \
&& git remote add accumulator https://github.com/accumulator/python-for-android \
&& git fetch --all \
# commit: from branch accumulator/electrum_20210421d (note: careful with force-pushing! see #8162)
&& git checkout "087fc3c583d46bfb2dec54878ddea508afb27de6^{commit}" \
&& git checkout "052b9f7945bae557347fa4a4b418040d9da9eaff^{commit}" \
&& python3 -m pip install --no-build-isolation --no-dependencies --user -e .
# build env vars

View File

@@ -8,6 +8,8 @@ import ".."
import "../controls"
WizardComponent {
securePage: true
valid: false
function checkValid() {

View File

@@ -7,6 +7,8 @@ import org.electrum 1.0
import "../controls"
WizardComponent {
securePage: true
valid: seedtext.text != ''
function apply() {

View File

@@ -9,6 +9,7 @@ import "../controls"
WizardComponent {
id: root
securePage: true
valid: false

View File

@@ -9,6 +9,7 @@ import "../controls"
WizardComponent {
id: root
securePage: true
valid: false

View File

@@ -8,6 +8,7 @@ import "../controls"
WizardComponent {
id: root
securePage: true
valid: false

View File

@@ -2,6 +2,8 @@ import QtQuick 2.6
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.1
import org.electrum 1.0
import "../controls"
ElDialog {
@@ -141,6 +143,11 @@ ElDialog {
_setWizardData({})
}
Binding {
target: AppController
property: 'secureWindow'
value: pages.contentChildren[pages.currentIndex].securePage
}
}
ColumnLayout {

View File

@@ -11,6 +11,7 @@ Pane {
property bool valid
property bool last: false
property string title: ''
property bool securePage: false
leftPadding: constants.paddingXLarge
rightPadding: constants.paddingXLarge

View File

@@ -67,6 +67,7 @@ class QEAppController(BaseCrashReporter, QObject):
sendingBugreport = pyqtSignal()
sendingBugreportSuccess = pyqtSignal(str)
sendingBugreportFailure = pyqtSignal(str)
secureWindowChanged = pyqtSignal()
def __init__(self, qedaemon: 'QEDaemon', plugins: 'Plugins'):
BaseCrashReporter.__init__(self, None, None, None)
@@ -79,6 +80,7 @@ class QEAppController(BaseCrashReporter, QObject):
self._crash_user_text = ''
self._app_started = False
self._intent = ''
self._secureWindow = False
# set up notification queue and notification_timer
self.user_notification_queue = queue.Queue()
@@ -295,6 +297,18 @@ class QEAppController(BaseCrashReporter, QObject):
return
jview.performHapticFeedback(jHfc.VIRTUAL_KEY)
@pyqtProperty(bool, notify=secureWindowChanged)
def secureWindow(self):
return self._secureWindow
@secureWindow.setter
def secureWindow(self, secure):
if not self.isAndroid():
return
if self._secureWindow != secure:
jpythonActivity.setSecureWindow(secure)
self._secureWindow = secure
self.secureWindowChanged.emit()
class ElectrumQmlApplication(QGuiApplication):