Browse Source

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

that should be secured.
master
Sander van Grieken 3 years ago
parent
commit
0672ea20ab
  1. 2
      contrib/android/Dockerfile
  2. 2
      electrum/gui/qml/components/wizard/WCConfirmSeed.qml
  3. 2
      electrum/gui/qml/components/wizard/WCCreateSeed.qml
  4. 1
      electrum/gui/qml/components/wizard/WCHaveMasterKey.qml
  5. 1
      electrum/gui/qml/components/wizard/WCHaveSeed.qml
  6. 1
      electrum/gui/qml/components/wizard/WCImport.qml
  7. 7
      electrum/gui/qml/components/wizard/Wizard.qml
  8. 1
      electrum/gui/qml/components/wizard/WizardComponent.qml
  9. 14
      electrum/gui/qml/qeapp.py

2
contrib/android/Dockerfile

@ -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

2
electrum/gui/qml/components/wizard/WCConfirmSeed.qml

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

2
electrum/gui/qml/components/wizard/WCCreateSeed.qml

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

1
electrum/gui/qml/components/wizard/WCHaveMasterKey.qml

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

1
electrum/gui/qml/components/wizard/WCHaveSeed.qml

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

1
electrum/gui/qml/components/wizard/WCImport.qml

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

7
electrum/gui/qml/components/wizard/Wizard.qml

@ -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 {

1
electrum/gui/qml/components/wizard/WizardComponent.qml

@ -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

14
electrum/gui/qml/qeapp.py

@ -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):

Loading…
Cancel
Save