Browse Source

Merge remote-tracking branch 'remotes/accumulator/qt6'

For the "qml" gui (used on Android), this upgrades the qt version from 5.15 to 6.4.

PR https://github.com/spesmilo/electrum/pull/8545
master
SomberNight 2 years ago
parent
commit
5ba156fcad
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 1
      .cirrus.yml
  2. 3
      .gitignore
  3. 55
      contrib/android/Dockerfile
  4. 4
      contrib/android/apt.sources.list
  5. 1
      contrib/android/build.sh
  6. 37
      contrib/android/buildozer_qml.spec
  7. 10
      contrib/android/make_apk.sh
  8. 4
      contrib/android/p4a_recipes/Pillow/__init__.py
  9. 4
      contrib/android/p4a_recipes/libffi/__init__.py
  10. 4
      contrib/android/p4a_recipes/libiconv/__init__.py
  11. 6
      contrib/android/p4a_recipes/pyjnius/__init__.py
  12. 18
      contrib/android/p4a_recipes/pyqt5/__init__.py
  13. 18
      contrib/android/p4a_recipes/pyqt5sip/__init__.py
  14. 18
      contrib/android/p4a_recipes/pyqt6/__init__.py
  15. 18
      contrib/android/p4a_recipes/pyqt6sip/__init__.py
  16. 4
      contrib/android/p4a_recipes/pyqt_builder/__init__.py
  17. 16
      contrib/android/p4a_recipes/qt5/__init__.py
  18. 19
      contrib/android/p4a_recipes/qt6/__init__.py
  19. 6
      contrib/android/p4a_recipes/sip/__init__.py
  20. 4
      contrib/android/p4a_recipes/sqlite3/__init__.py
  21. 13
      contrib/android/p4a_recipes/tomli/__init__.py
  22. 2
      contrib/freeze_containers_distro.sh
  23. 7
      electrum/gui/common_qt/plugins.py
  24. 2
      electrum/gui/default_lang.py
  25. 26
      electrum/gui/qml/__init__.py
  26. 36
      electrum/gui/qml/android_res/layout/scanner_layout.xml
  27. 2
      electrum/gui/qml/auth.py
  28. 8
      electrum/gui/qml/components/About.qml
  29. 10
      electrum/gui/qml/components/AddressDetails.qml
  30. 10
      electrum/gui/qml/components/Addresses.qml
  31. 8
      electrum/gui/qml/components/BIP39RecoveryDialog.qml
  32. 8
      electrum/gui/qml/components/BalanceDetails.qml
  33. 8
      electrum/gui/qml/components/ChannelBackups.qml
  34. 8
      electrum/gui/qml/components/ChannelDetails.qml
  35. 8
      electrum/gui/qml/components/ChannelOpenProgressDialog.qml
  36. 8
      electrum/gui/qml/components/Channels.qml
  37. 12
      electrum/gui/qml/components/CloseChannelDialog.qml
  38. 8
      electrum/gui/qml/components/ConfirmTxDialog.qml
  39. 6
      electrum/gui/qml/components/Constants.qml
  40. 8
      electrum/gui/qml/components/CpfpBumpFeeDialog.qml
  41. 10
      electrum/gui/qml/components/ExceptionDialog.qml
  42. 8
      electrum/gui/qml/components/ExportTxDialog.qml
  43. 8
      electrum/gui/qml/components/GenericShareDialog.qml
  44. 10
      electrum/gui/qml/components/History.qml
  45. 6
      electrum/gui/qml/components/ImportAddressesKeysDialog.qml
  46. 6
      electrum/gui/qml/components/ImportChannelBackupDialog.qml
  47. 8
      electrum/gui/qml/components/InvoiceDialog.qml
  48. 12
      electrum/gui/qml/components/Invoices.qml
  49. 8
      electrum/gui/qml/components/LightningPaymentDetails.qml
  50. 8
      electrum/gui/qml/components/LightningPaymentProgressDialog.qml
  51. 8
      electrum/gui/qml/components/LnurlPayRequestDialog.qml
  52. 8
      electrum/gui/qml/components/LoadingWalletDialog.qml
  53. 8
      electrum/gui/qml/components/MessageDialog.qml
  54. 8
      electrum/gui/qml/components/NetworkOverview.qml
  55. 6
      electrum/gui/qml/components/NewWalletWizard.qml
  56. 10
      electrum/gui/qml/components/NotificationPopup.qml
  57. 25
      electrum/gui/qml/components/OpenChannelDialog.qml
  58. 8
      electrum/gui/qml/components/OpenWalletDialog.qml
  59. 8
      electrum/gui/qml/components/OtpDialog.qml
  60. 8
      electrum/gui/qml/components/PasswordDialog.qml
  61. 8
      electrum/gui/qml/components/Pin.qml
  62. 8
      electrum/gui/qml/components/Preferences.qml
  63. 8
      electrum/gui/qml/components/ProxyConfigDialog.qml
  64. 8
      electrum/gui/qml/components/RbfBumpFeeDialog.qml
  65. 8
      electrum/gui/qml/components/RbfCancelDialog.qml
  66. 24
      electrum/gui/qml/components/ReceiveDetailsDialog.qml
  67. 10
      electrum/gui/qml/components/ReceiveDialog.qml
  68. 12
      electrum/gui/qml/components/ReceiveRequests.qml
  69. 13
      electrum/gui/qml/components/ScanDialog.qml
  70. 26
      electrum/gui/qml/components/SendDialog.qml
  71. 8
      electrum/gui/qml/components/ServerConfigDialog.qml
  72. 6
      electrum/gui/qml/components/ServerConnectWizard.qml
  73. 8
      electrum/gui/qml/components/SignVerifyMessageDialog.qml
  74. 8
      electrum/gui/qml/components/SwapDialog.qml
  75. 10
      electrum/gui/qml/components/TxDetails.qml
  76. 8
      electrum/gui/qml/components/WalletDetails.qml
  77. 110
      electrum/gui/qml/components/WalletMainView.qml
  78. 8
      electrum/gui/qml/components/WalletSummary.qml
  79. 15
      electrum/gui/qml/components/Wallets.qml
  80. 8
      electrum/gui/qml/components/controls/AddressDelegate.qml
  81. 8
      electrum/gui/qml/components/controls/BalanceSummary.qml
  82. 4
      electrum/gui/qml/components/controls/BtcField.qml
  83. 8
      electrum/gui/qml/components/controls/ButtonContainer.qml
  84. 8
      electrum/gui/qml/components/controls/ChannelBar.qml
  85. 8
      electrum/gui/qml/components/controls/ChannelDelegate.qml
  86. 4
      electrum/gui/qml/components/controls/ElComboBox.qml
  87. 17
      electrum/gui/qml/components/controls/ElDialog.qml
  88. 39
      electrum/gui/qml/components/controls/ElListView.qml
  89. 4
      electrum/gui/qml/components/controls/FeeMethodComboBox.qml
  90. 4
      electrum/gui/qml/components/controls/FiatField.qml
  91. 10
      electrum/gui/qml/components/controls/FlatButton.qml
  92. 8
      electrum/gui/qml/components/controls/FormattedAmount.qml
  93. 6
      electrum/gui/qml/components/controls/Heading.qml
  94. 10
      electrum/gui/qml/components/controls/HistoryItemDelegate.qml
  95. 8
      electrum/gui/qml/components/controls/InfoTextArea.qml
  96. 12
      electrum/gui/qml/components/controls/InvoiceDelegate.qml
  97. 2
      electrum/gui/qml/components/controls/LightningNetworkStatusIndicator.qml
  98. 6
      electrum/gui/qml/components/controls/OnchainNetworkStatusIndicator.qml
  99. 4
      electrum/gui/qml/components/controls/PaneInsetBackground.qml
  100. 6
      electrum/gui/qml/components/controls/PasswordField.qml
  101. Some files were not shown because too many files have changed in this diff Show More

1
.cirrus.yml

@ -182,6 +182,7 @@ task:
task: task:
name: "build: Android (QML $APK_ARCH)" name: "build: Android (QML $APK_ARCH)"
timeout_in: 90m
container: container:
dockerfile: contrib/android/Dockerfile dockerfile: contrib/android/Dockerfile
cpu: 8 cpu: 8

3
.gitignore vendored

@ -12,8 +12,7 @@ electrum/locale/
packages packages
env/ env/
.buildozer .buildozer
.buildozer_kivy/ .buildozer_*/
.buildozer_qml/
bin/ bin/
/app.fil /app.fil
.idea .idea

55
contrib/android/Dockerfile

@ -1,6 +1,6 @@
# based on https://github.com/kivy/python-for-android/blob/master/Dockerfile # based on https://github.com/kivy/python-for-android/blob/master/Dockerfile
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8 FROM debian:bookworm@sha256:d568e251e460295a8743e9d5ef7de673c5a8f9027db11f4e666e96fb5bed708e
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
@ -31,12 +31,12 @@ RUN apt -y update -qq \
ENV ANDROID_NDK_HOME="${ANDROID_HOME}/android-ndk" ENV ANDROID_NDK_HOME="${ANDROID_HOME}/android-ndk"
ENV ANDROID_NDK_VERSION="22b" ENV ANDROID_NDK_VERSION="23b"
ENV ANDROID_NDK_HASH="ac3a0421e76f71dd330d0cd55f9d99b9ac864c4c034fc67e0d671d022d4e806b" ENV ANDROID_NDK_HASH="c6e97f9c8cfe5b7be0a9e6c15af8e7a179475b7ded23e2d1c1fa0945d6fb4382"
ENV ANDROID_NDK_HOME_V="${ANDROID_NDK_HOME}-r${ANDROID_NDK_VERSION}" ENV ANDROID_NDK_HOME_V="${ANDROID_NDK_HOME}-r${ANDROID_NDK_VERSION}"
# get the latest version from https://developer.android.com/ndk/downloads/index.html # get the latest version from https://developer.android.com/ndk/downloads/index.html
ENV ANDROID_NDK_ARCHIVE="android-ndk-r${ANDROID_NDK_VERSION}-linux-x86_64.zip" ENV ANDROID_NDK_ARCHIVE="android-ndk-r${ANDROID_NDK_VERSION}-linux.zip"
ENV ANDROID_NDK_DL_URL="https://dl.google.com/android/repository/${ANDROID_NDK_ARCHIVE}" ENV ANDROID_NDK_DL_URL="https://dl.google.com/android/repository/${ANDROID_NDK_ARCHIVE}"
# download and install Android NDK # download and install Android NDK
@ -53,9 +53,8 @@ RUN curl --location --progress-bar \
ENV ANDROID_SDK_HOME="${ANDROID_HOME}/android-sdk" ENV ANDROID_SDK_HOME="${ANDROID_HOME}/android-sdk"
# get the latest version from https://developer.android.com/studio/index.html # get the latest version from https://developer.android.com/studio/index.html
ENV ANDROID_SDK_TOOLS_VERSION="8092744" ENV ANDROID_SDK_TOOLS_VERSION="9477386"
ENV ANDROID_SDK_BUILD_TOOLS_VERSION="30.0.3" ENV ANDROID_SDK_HASH="bd1aa17c7ef10066949c88dc6c9c8d536be27f992a1f3b5a584f9bd2ba5646a0"
ENV ANDROID_SDK_HASH="d71f75333d79c9c6ef5c39d3456c6c58c613de30e6a751ea0dbd433e8f8b9cbf"
ENV ANDROID_SDK_TOOLS_ARCHIVE="commandlinetools-linux-${ANDROID_SDK_TOOLS_VERSION}_latest.zip" ENV ANDROID_SDK_TOOLS_ARCHIVE="commandlinetools-linux-${ANDROID_SDK_TOOLS_VERSION}_latest.zip"
ENV ANDROID_SDK_TOOLS_DL_URL="https://dl.google.com/android/repository/${ANDROID_SDK_TOOLS_ARCHIVE}" ENV ANDROID_SDK_TOOLS_DL_URL="https://dl.google.com/android/repository/${ANDROID_SDK_TOOLS_ARCHIVE}"
ENV ANDROID_SDK_MANAGER="${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_HOME}" ENV ANDROID_SDK_MANAGER="${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_HOME}"
@ -77,19 +76,22 @@ RUN mkdir --parents "${ANDROID_SDK_HOME}/.android/" \
# accept Android licenses (JDK necessary!) # accept Android licenses (JDK necessary!)
RUN apt -y update -qq \ RUN apt -y update -qq \
&& apt -y install -qq --no-install-recommends --allow-downgrades \ && apt -y install -qq --no-install-recommends --allow-downgrades \
openjdk-11-jdk-headless \ openjdk-17-jdk-headless \
&& apt -y autoremove && apt -y autoremove
RUN yes | ${ANDROID_SDK_MANAGER} --licenses > /dev/null RUN yes | ${ANDROID_SDK_MANAGER} --licenses > /dev/null
ENV ANDROID_SDK_BUILD_TOOLS_VERSION="31.0.0"
# download platforms, API, build tools # download platforms, API, build tools
RUN ${ANDROID_SDK_MANAGER} "platforms;android-30" > /dev/null && \ RUN ${ANDROID_SDK_MANAGER} "platforms;android-31" > /dev/null && \
${ANDROID_SDK_MANAGER} "build-tools;${ANDROID_SDK_BUILD_TOOLS_VERSION}" > /dev/null && \ ${ANDROID_SDK_MANAGER} "build-tools;${ANDROID_SDK_BUILD_TOOLS_VERSION}" > /dev/null && \
${ANDROID_SDK_MANAGER} "extras;android;m2repository" > /dev/null && \ ${ANDROID_SDK_MANAGER} "extras;android;m2repository" > /dev/null && \
chmod +x "${ANDROID_SDK_HOME}/cmdline-tools/bin/avdmanager" chmod +x "${ANDROID_SDK_HOME}/cmdline-tools/bin/avdmanager"
# download ANT # download ANT
ENV APACHE_ANT_VERSION="1.9.4" ENV APACHE_ANT_VERSION="1.10.13"
ENV APACHE_ANT_HASH="66d3edcbb0eba11387705cd89178ffb65e55cd53f13ca35c1bb983c0f9992540" ENV APACHE_ANT_HASH="776be4a5704158f00ef3f23c0327546e38159389bc8f39abbfe114913f88bab1"
ENV APACHE_ANT_ARCHIVE="apache-ant-${APACHE_ANT_VERSION}-bin.tar.gz" ENV APACHE_ANT_ARCHIVE="apache-ant-${APACHE_ANT_VERSION}-bin.tar.gz"
ENV APACHE_ANT_DL_URL="https://archive.apache.org/dist/ant/binaries/${APACHE_ANT_ARCHIVE}" ENV APACHE_ANT_DL_URL="https://archive.apache.org/dist/ant/binaries/${APACHE_ANT_ARCHIVE}"
ENV APACHE_ANT_HOME="${ANDROID_HOME}/apache-ant" ENV APACHE_ANT_HOME="${ANDROID_HOME}/apache-ant"
@ -139,6 +141,15 @@ RUN apt -y update -qq \
&& apt -y autoremove \ && apt -y autoremove \
&& apt -y clean && apt -y clean
# cross compile deps for Qt6
RUN apt -y update -qq \
&& apt -y install -qq --no-install-recommends --allow-downgrades \
libopengl-dev \
libegl-dev \
dos2unix \
&& apt -y autoremove \
&& apt -y clean
# create new user to avoid using root; but with sudo access and no password for convenience. # create new user to avoid using root; but with sudo access and no password for convenience.
ARG UID=1000 ARG UID=1000
@ -154,12 +165,16 @@ RUN chown --recursive ${USER} ${WORK_DIR} ${ANDROID_SDK_HOME}
RUN chown ${USER} /opt RUN chown ${USER} /opt
USER ${USER} USER ${USER}
# venv, VIRTUAL_ENV is used by buildozer to indicate a venv environemnt
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
COPY contrib/deterministic-build/requirements-build-base.txt /opt/deterministic-build/ COPY contrib/deterministic-build/requirements-build-base.txt /opt/deterministic-build/
COPY contrib/deterministic-build/requirements-build-android.txt /opt/deterministic-build/ COPY contrib/deterministic-build/requirements-build-android.txt /opt/deterministic-build/
RUN python3 -m pip install --no-build-isolation --no-dependencies --user \ RUN /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies \
-r /opt/deterministic-build/requirements-build-base.txt -r /opt/deterministic-build/requirements-build-base.txt
RUN python3 -m pip install --no-build-isolation --no-dependencies --no-binary :all: --user \ RUN /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies --no-binary :all: \
-r /opt/deterministic-build/requirements-build-android.txt -r /opt/deterministic-build/requirements-build-android.txt
# install buildozer # install buildozer
@ -167,10 +182,11 @@ RUN cd /opt \
&& git clone https://github.com/kivy/buildozer \ && git clone https://github.com/kivy/buildozer \
&& cd buildozer \ && cd buildozer \
&& git remote add sombernight https://github.com/SomberNight/buildozer \ && git remote add sombernight https://github.com/SomberNight/buildozer \
&& git remote add accumulator https://github.com/accumulator/buildozer \
&& git fetch --all \ && git fetch --all \
# commit: from branch sombernight/electrum_20210421 (note: careful with force-pushing! see #8162) # commit: from branch electrum-qt6 (note: careful with force-pushing! see #8162) \
&& git checkout "6f03256e8312f8d1e5a6da3a2a1bf06e2738325e^{commit}" \ && git checkout "ce4f2257249fdf4ff1f4cb8983fd7ac44174a274^{commit}" \
&& python3 -m pip install --no-build-isolation --no-dependencies --user -e . && /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies -e .
# install python-for-android # install python-for-android
RUN cd /opt \ RUN cd /opt \
@ -179,9 +195,10 @@ RUN cd /opt \
&& git remote add sombernight https://github.com/SomberNight/python-for-android \ && git remote add sombernight https://github.com/SomberNight/python-for-android \
&& git remote add accumulator https://github.com/accumulator/python-for-android \ && git remote add accumulator https://github.com/accumulator/python-for-android \
&& git fetch --all \ && git fetch --all \
# commit: from branch accumulator/electrum_20210421d (note: careful with force-pushing! see #8162) # commit: from branch accumulator/qt6-wip (note: careful with force-pushing! see #8162) \
&& git checkout "052b9f7945bae557347fa4a4b418040d9da9eaff^{commit}" \ #
&& python3 -m pip install --no-build-isolation --no-dependencies --user -e . && git checkout "eb4a3522373e0b4e2749b8a8bc965ff51355ea35^{commit}" \
&& /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies -e .
# build env vars # build env vars
ENV USE_SDK_WRAPPER=1 ENV USE_SDK_WRAPPER=1

4
contrib/android/apt.sources.list

@ -1,2 +1,2 @@
deb https://snapshot.debian.org/archive/debian/20230317T205011Z/ bullseye main deb https://snapshot.debian.org/archive/debian/20230629T090352Z/ bookworm main
deb-src https://snapshot.debian.org/archive/debian/20230317T205011Z/ bullseye main deb-src https://snapshot.debian.org/archive/debian/20230629T090352Z/ bookworm main

1
contrib/android/build.sh

@ -48,7 +48,6 @@ docker build \
--file "$CONTRIB_ANDROID/Dockerfile" \ --file "$CONTRIB_ANDROID/Dockerfile" \
"$PROJECT_ROOT" "$PROJECT_ROOT"
# maybe do fresh clone # maybe do fresh clone
if [ ! -z "$ELECBUILD_COMMIT" ] ; then if [ ! -z "$ELECBUILD_COMMIT" ] ; then
info "ELECBUILD_COMMIT=$ELECBUILD_COMMIT. doing fresh clone and git checkout." info "ELECBUILD_COMMIT=$ELECBUILD_COMMIT. doing fresh clone and git checkout."

37
contrib/android/buildozer_qml.spec

@ -24,6 +24,7 @@ source.exclude_dirs = bin, build, dist, contrib, env,
electrum/www, electrum/www,
electrum/gui/qt, electrum/gui/qt,
electrum/gui/kivy, electrum/gui/kivy,
electrum/plugins/payserver,
packages/qdarkstyle, packages/qdarkstyle,
packages/qtpy, packages/qtpy,
packages/bin, packages/bin,
@ -55,8 +56,8 @@ requirements =
libffi, libffi,
libsecp256k1, libsecp256k1,
cryptography, cryptography,
pyqt5sip, pyqt6sip,
pyqt5, pyqt6,
pillow, pillow,
libzbar libzbar
@ -84,22 +85,22 @@ android.permissions = INTERNET, CAMERA, WRITE_EXTERNAL_STORAGE
# (int) Android API to use (compileSdkVersion) # (int) Android API to use (compileSdkVersion)
# note: when changing, Dockerfile also needs to be changed to install corresponding build tools # note: when changing, Dockerfile also needs to be changed to install corresponding build tools
android.api = 30 android.api = 31
# (int) Android targetSdkVersion # (int) Android targetSdkVersion
android.target_sdk_version = 31 android.target_sdk_version = 33
# (int) Minimum API required. You will need to set the android.ndk_api to be as low as this value. # (int) Minimum API required. You will need to set the android.ndk_api to be as low as this value.
android.minapi = 21 android.minapi = 21
# (str) Android NDK version to use # (str) Android NDK version to use
android.ndk = 22b android.ndk = 23b
# (int) Android NDK API to use (optional). This is the minimum API your app will support. # (int) Android NDK API to use (optional). This is the minimum API your app will support.
android.ndk_api = 21 android.ndk_api = 21
# (bool) Use --private data storage (True) or --dir public storage (False) # (bool) Use --private data storage (True) or --dir public storage (False)
android.private_storage = True #android.private_storage = True
# (str) Android NDK directory (if empty, it will be automatically downloaded.) # (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = /opt/android/android-ndk android.ndk_path = /opt/android/android-ndk
@ -137,9 +138,25 @@ android.add_jars = .buildozer/android/platform/*/build/libs_collections/Electrum
# (list) List of Java files to add to the android project (can be java or a # (list) List of Java files to add to the android project (can be java or a
# directory containing the files) # directory containing the files)
# android.add_src = ... android.add_src = electrum/gui/qml/java_classes/
# android.add_activities = ...
android.gradle_dependencies = com.android.support:support-compat:28.0.0 android.gradle_dependencies =
com.android.support:support-compat:28.0.0,
me.dm7.barcodescanner:zxing:1.9.8
android.add_activities = org.electrum.qr.SimpleScannerActivity
# (list) Put these files or directories in the apk res directory.
# The option may be used in three ways, the value may contain one or zero ':'
# Some examples:
# 1) A file to add to resources, legal resource names contain ['a-z','0-9','_']
# android.add_resources = my_icons/all-inclusive.png:drawable/all_inclusive.png
# 2) A directory, here 'legal_icons' must contain resources of one kind
# android.add_resources = legal_icons:drawable
# 3) A directory, here 'legal_resources' must contain one or more directories,
# each of a resource kind: drawable, xml, etc...
# android.add_resources = legal_resources
android.add_resources = electrum/gui/qml/android_res/layout:layout
# (str) python-for-android branch to use, if not master, useful to try # (str) python-for-android branch to use, if not master, useful to try
# not yet merged features. # not yet merged features.
@ -199,7 +216,7 @@ p4a.local_recipes = %(source.dir)s/contrib/android/p4a_recipes/
#p4a.hook = #p4a.hook =
# (str) Bootstrap to use for android builds # (str) Bootstrap to use for android builds
p4a.bootstrap = qt5 p4a.bootstrap = qt6
# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask) # (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port = #p4a.port =

10
contrib/android/make_apk.sh

@ -90,16 +90,16 @@ fi
if [[ "$2" == "all" ]] ; then if [[ "$2" == "all" ]] ; then
# build all apks # build all apks
# FIXME failures are not propagated out: we should fail the script if any arch build fails # FIXME failures are not propagated out: we should fail the script if any arch build fails
export APP_ANDROID_ARCH=armeabi-v7a export APP_ANDROID_ARCHS=armeabi-v7a
make $TARGET make $TARGET
export APP_ANDROID_ARCH=arm64-v8a export APP_ANDROID_ARCHS=arm64-v8a
make $TARGET make $TARGET
#export APP_ANDROID_ARCH=x86 #export APP_ANDROID_ARCHS=x86
#make $TARGET #make $TARGET
export APP_ANDROID_ARCH=x86_64 export APP_ANDROID_ARCHS=x86_64
make $TARGET make $TARGET
else else
export APP_ANDROID_ARCH=$2 export APP_ANDROID_ARCHS=$2
make $TARGET make $TARGET
fi fi

4
contrib/android/p4a_recipes/Pillow/__init__.py

@ -6,13 +6,13 @@ from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py')) util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert PillowRecipe._version == "7.0.0" assert PillowRecipe._version == "8.4.0"
assert PillowRecipe.depends == ['png', 'jpeg', 'freetype', 'setuptools', 'python3'] assert PillowRecipe.depends == ['png', 'jpeg', 'freetype', 'setuptools', 'python3']
assert PillowRecipe.python_depends == [] assert PillowRecipe.python_depends == []
class PillowRecipePinned(util.InheritedRecipeMixin, PillowRecipe): class PillowRecipePinned(util.InheritedRecipeMixin, PillowRecipe):
sha512sum = "187173a525d4f3f01b4898633263b53a311f337aa7b159c64f79ba8c7006fd44798a058e7cc5d8f1116bad008e4142ff303456692329fe73b0e115ef5c225d73" sha512sum = "d395f69ccb37c52a3b6f45836700ffbc3173afae31848cc61d7b47db88ca1594541023beb9a14fd9067aca664e182c7d6e3300ab3e3095c31afe8dcbc6e08233"
recipe = PillowRecipePinned() recipe = PillowRecipePinned()

4
contrib/android/p4a_recipes/libffi/__init__.py

@ -6,13 +6,13 @@ from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py')) util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert LibffiRecipe._version == "v3.3" assert LibffiRecipe._version == "v3.4.2"
assert LibffiRecipe.depends == [] assert LibffiRecipe.depends == []
assert LibffiRecipe.python_depends == [] assert LibffiRecipe.python_depends == []
class LibffiRecipePinned(util.InheritedRecipeMixin, LibffiRecipe): class LibffiRecipePinned(util.InheritedRecipeMixin, LibffiRecipe):
sha512sum = "62798fb31ba65fa2a0e1f71dd3daca30edcf745dc562c6f8e7126e54db92572cc63f5aa36d927dd08375bb6f38a2380ebe6c5735f35990681878fc78fc9dbc83" sha512sum = "d399319efcca375fe901b05722e25eca31d11a4261c6a5d5079480bbc552d4e4b42de2026912689d3b2f886ebb3c8bebbea47102e38a2f6acbc526b8d5bba388"
recipe = LibffiRecipePinned() recipe = LibffiRecipePinned()

4
contrib/android/p4a_recipes/libiconv/__init__.py

@ -6,13 +6,13 @@ from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py')) util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert LibIconvRecipe._version == "1.15" assert LibIconvRecipe._version == "1.16"
assert LibIconvRecipe.depends == [] assert LibIconvRecipe.depends == []
assert LibIconvRecipe.python_depends == [] assert LibIconvRecipe.python_depends == []
class LibIconvRecipePinned(util.InheritedRecipeMixin, LibIconvRecipe): class LibIconvRecipePinned(util.InheritedRecipeMixin, LibIconvRecipe):
sha512sum = "1233fe3ca09341b53354fd4bfe342a7589181145a1232c9919583a8c9979636855839049f3406f253a9d9829908816bb71fd6d34dd544ba290d6f04251376b1a" sha512sum = "365dac0b34b4255a0066e8033a8b3db4bdb94b9b57a9dca17ebf2d779139fe935caf51a465d17fd8ae229ec4b926f3f7025264f37243432075e5583925bb77b7"
recipe = LibIconvRecipePinned() recipe = LibIconvRecipePinned()

6
contrib/android/p4a_recipes/pyjnius/__init__.py

@ -6,13 +6,13 @@ from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py')) util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert PyjniusRecipe._version == "1.3.0" assert PyjniusRecipe._version == "1.5.0"
assert PyjniusRecipe.depends == [('genericndkbuild', 'sdl2', 'qt5'), 'six', 'python3'] assert PyjniusRecipe.depends == [('genericndkbuild', 'sdl2', 'qt6'), 'six', 'python3']
assert PyjniusRecipe.python_depends == [] assert PyjniusRecipe.python_depends == []
class PyjniusRecipePinned(util.InheritedRecipeMixin, PyjniusRecipe): class PyjniusRecipePinned(util.InheritedRecipeMixin, PyjniusRecipe):
sha512sum = "5a3475afcda5afbef6e1a67bab508e3c24bd564efda5ac38ae7669d39b4bfdbfaaa83f435f26d39b3d849d3a167a9c136c9ac6b2bfcc0bda09ef1c00aa66cf25" sha512sum = "e47ff08bdcda8fc9ef9617fc84515a85404d77cfce3ede3e190ae21221837a4275840e14976271f38eb5d514682d22eab5d83d8ca94dbf3a6b47d4effa109790"
recipe = PyjniusRecipePinned() recipe = PyjniusRecipePinned()

18
contrib/android/p4a_recipes/pyqt5/__init__.py

@ -1,18 +0,0 @@
import os
from pythonforandroid.recipes.pyqt5 import PyQt5Recipe
from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert PyQt5Recipe._version == "5.15.9"
assert PyQt5Recipe.depends == ['qt5', 'pyjnius', 'setuptools', 'pyqt5sip', 'hostpython3', 'pyqt_builder']
assert PyQt5Recipe.python_depends == []
class PyQt5RecipePinned(util.InheritedRecipeMixin, PyQt5Recipe):
sha512sum = "1c07d93aefe1c24e80851eb4631b80a99e7ba06e823181325456edb90285d3d22417a9f7d4c3ff9c6195bd801e7dc2bbabf0587af844a5e4b0a410c4611d119e"
recipe = PyQt5RecipePinned()

18
contrib/android/p4a_recipes/pyqt5sip/__init__.py

@ -1,18 +0,0 @@
import os
from pythonforandroid.recipes.pyqt5sip import PyQt5SipRecipe
from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert PyQt5SipRecipe._version == "12.11.1"
assert PyQt5SipRecipe.depends == ['setuptools', 'python3']
assert PyQt5SipRecipe.python_depends == []
class PyQt5SipRecipePinned(util.InheritedRecipeMixin, PyQt5SipRecipe):
sha512sum = "9a24b6e8356fdb1070672ee37e5f4259d72a75bb60376ad0946274331ae29a6cceb98a6c5a278bf5e8015a3d493c925bacab8593ef02c310ff3773bd3ee46a5d"
recipe = PyQt5SipRecipePinned()

18
contrib/android/p4a_recipes/pyqt6/__init__.py

@ -0,0 +1,18 @@
import os
from pythonforandroid.recipes.pyqt6 import PyQt6Recipe
from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert PyQt6Recipe._version == "6.4.2"
assert PyQt6Recipe.depends == ['qt6', 'pyjnius', 'setuptools', 'pyqt6sip', 'hostpython3', 'pyqt_builder']
assert PyQt6Recipe.python_depends == []
class PyQt6RecipePinned(util.InheritedRecipeMixin, PyQt6Recipe):
sha512sum = "51e5f0d028ee7984876da1653cb135d61e2c402f18b939a92477888cc7c86d3bc2889477403dee6b3d9f66519ee3236d344323493b4c2c2e658e1637b10e53bf"
recipe = PyQt6RecipePinned()

18
contrib/android/p4a_recipes/pyqt6sip/__init__.py

@ -0,0 +1,18 @@
import os
from pythonforandroid.recipes.pyqt6sip import PyQt6SipRecipe
from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert PyQt6SipRecipe._version == "13.5.1"
assert PyQt6SipRecipe.depends == ['setuptools', 'python3']
assert PyQt6SipRecipe.python_depends == []
class PyQt6SipRecipePinned(util.InheritedRecipeMixin, PyQt6SipRecipe):
sha512sum = "1e4170d167a326afe6df86e4a35e209299548054981cb2e5d56da234ef9db4d8594bcb05b6be363c3bc6252776ae9de63d589a3d9f33fba8250d39cdb5e9061a"
recipe = PyQt6SipRecipePinned()

4
contrib/android/p4a_recipes/pyqt_builder/__init__.py

@ -1,13 +1,13 @@
from pythonforandroid.recipes.pyqt_builder import PyQtBuilderRecipe from pythonforandroid.recipes.pyqt_builder import PyQtBuilderRecipe
assert PyQtBuilderRecipe._version == "1.14.1" assert PyQtBuilderRecipe._version == "1.15.1"
assert PyQtBuilderRecipe.depends == ["sip", "packaging", "python3"] assert PyQtBuilderRecipe.depends == ["sip", "packaging", "python3"]
assert PyQtBuilderRecipe.python_depends == [] assert PyQtBuilderRecipe.python_depends == []
class PyQtBuilderRecipePinned(PyQtBuilderRecipe): class PyQtBuilderRecipePinned(PyQtBuilderRecipe):
sha512sum = "4de9be2c42f38fbc22d46a31dd6da37c02620bb112a674ef846a4eb7f862715852e1d7328da1e0d0e33f78475166fe3c690e710e18bfeb48f840f137831a2182" sha512sum = "61ee73b6bb922c04739da60025ab50d35d345d2e298943305fcbd3926cda31d732cc5e5b0dbfc39f5eb85c0f0b091b8c3f5fee00dcc240d7849c5c4191c1368a"
recipe = PyQtBuilderRecipePinned() recipe = PyQtBuilderRecipePinned()

16
contrib/android/p4a_recipes/qt5/__init__.py

@ -1,16 +0,0 @@
import os
from pythonforandroid.recipes.qt5 import Qt5Recipe
from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert Qt5Recipe._version == "95254e52c658729e80f741324045034c15ce9cb0"
assert Qt5Recipe.depends == ['python3']
assert Qt5Recipe.python_depends == []
class Qt5RecipePinned(util.InheritedRecipeMixin, Qt5Recipe):
pass
recipe = Qt5RecipePinned()

19
contrib/android/p4a_recipes/qt6/__init__.py

@ -0,0 +1,19 @@
import os
from pythonforandroid.recipes.qt6 import Qt6Recipe
from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert Qt6Recipe._version == "6.4.3"
# assert Qt6Recipe._version == "6.5.3"
assert Qt6Recipe.depends == ['python3', 'hostqt6']
assert Qt6Recipe.python_depends == []
class Qt6RecipePinned(util.InheritedRecipeMixin, Qt6Recipe):
sha512sum = "0bdbe8b9a43390c98cf19e851ec5394bc78438d227cf9d0d7a3748aee9a32a7f14fc46f52d4fa283819f21413567080aee7225c566af5278557f5e1992674da3"
# sha512sum = "ca8ea3b81c121886636988275f7fa8ae6d19f7be02669e63ab19b4285b611057a41279db9532c25ae87baa3904b010e1db68b899cd0eda17a5a8d3d87098b4d5"
recipe = Qt6RecipePinned()

6
contrib/android/p4a_recipes/sip/__init__.py

@ -1,13 +1,13 @@
from pythonforandroid.recipes.sip import SipRecipe from pythonforandroid.recipes.sip import SipRecipe
assert SipRecipe._version == "6.7.7" assert SipRecipe._version == "6.7.9"
assert SipRecipe.depends == ["setuptools", "packaging", "toml", "ply", "python3"], SipRecipe.depends assert SipRecipe.depends == ["setuptools", "packaging", "tomli", "ply", "python3"], SipRecipe.depends
assert SipRecipe.python_depends == [] assert SipRecipe.python_depends == []
class SipRecipePinned(SipRecipe): class SipRecipePinned(SipRecipe):
sha512sum = "b41a1e53e8bad1fca08eda2c89b8a7cabe6cb9e54d0ddeba0c718499b0288633fb6b90128d54f3df2420e20bb217d3df224750d30e865487d2b0a640fba82444" sha512sum = "bb9d0d0d92002b6fd33f7e8ebe8cd62456dacc16b5734b73760b1ba14fb9b1f2b9b6640b40196c6cf5f345e1afde48bdef39675c4d3480041771325d4cf3c233"
recipe = SipRecipePinned() recipe = SipRecipePinned()

4
contrib/android/p4a_recipes/sqlite3/__init__.py

@ -6,13 +6,13 @@ from pythonforandroid.util import load_source
util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py')) util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py'))
assert Sqlite3Recipe._version == "3.34.1" assert Sqlite3Recipe._version == "3.35.5"
assert Sqlite3Recipe.depends == [] assert Sqlite3Recipe.depends == []
assert Sqlite3Recipe.python_depends == [] assert Sqlite3Recipe.python_depends == []
class Sqlite3RecipePinned(util.InheritedRecipeMixin, Sqlite3Recipe): class Sqlite3RecipePinned(util.InheritedRecipeMixin, Sqlite3Recipe):
sha512sum = "8a936f1c34fc9036cadf5bd53f9ee594135c2efdef1d2c82bd4fdf3e0218afde710fc4c436cfc992687d008e6086a697da0487352ed88809d677e05d824940dd" sha512sum = "9684fee89224f0c975c280cb6b2c64adb040334bc5517dfe0e354b0557459fa3ae642c4289a7a5265f65b3ad5b6747db8068a1e5172fbb8edec7f6d964ecbb20"
recipe = Sqlite3RecipePinned() recipe = Sqlite3RecipePinned()

13
contrib/android/p4a_recipes/tomli/__init__.py

@ -0,0 +1,13 @@
from pythonforandroid.recipes.tomli import TomliRecipe
assert TomliRecipe._version == "2.0.1"
assert TomliRecipe.depends == ["setuptools", "python3"]
assert TomliRecipe.python_depends == []
class TomliRecipePinned(TomliRecipe):
sha512sum = "fd410039e255e2b3359e999d69a5a2d38b9b89b77e8557f734f2621dfbd5e1207e13aecc11589197ec22594c022f07f41b4cfe486a3a719281a595c95fd19ecf"
recipe = TomliRecipePinned()

2
contrib/freeze_containers_distro.sh

@ -7,7 +7,7 @@ set -e
DEBIAN_SNAPSHOT_BASE="https://snapshot.debian.org/archive/debian/" DEBIAN_SNAPSHOT_BASE="https://snapshot.debian.org/archive/debian/"
DEBIAN_APPIMAGE_DISTRO="buster" # should match build-linux/appimage Dockerfile base DEBIAN_APPIMAGE_DISTRO="buster" # should match build-linux/appimage Dockerfile base
DEBIAN_WINE_DISTRO="bullseye" # should match build-wine Dockerfile base DEBIAN_WINE_DISTRO="bullseye" # should match build-wine Dockerfile base
DEBIAN_ANDROID_DISTRO="bullseye" # should match android Dockerfile base DEBIAN_ANDROID_DISTRO="bookworm" # should match android Dockerfile base
contrib=$(dirname "$0") contrib=$(dirname "$0")

7
electrum/gui/common_qt/plugins.py

@ -1,4 +1,9 @@
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject import sys
if getattr(sys, '_GUI_QT_VERSION') == 5: # FIXME: remove when both desktop and mobile are Qt6
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject
else:
from PyQt6.QtCore import pyqtSignal, pyqtProperty, QObject
from electrum.logging import get_logger from electrum.logging import get_logger

2
electrum/gui/default_lang.py

@ -24,7 +24,7 @@ def get_default_language(*, gui_name: Optional[str] = None) -> str:
name = QLocale.system().name() name = QLocale.system().name()
return name if name in languages else "en_UK" return name if name in languages else "en_UK"
elif gui_name == "qml": elif gui_name == "qml":
from PyQt5.QtCore import QLocale from PyQt6.QtCore import QLocale
# On Android QLocale does not return the system locale # On Android QLocale does not return the system locale
try: try:
name = str(jLocale.getDefault().toString()) name = str(jLocale.getDefault().toString())

26
electrum/gui/qml/__init__.py

@ -5,17 +5,18 @@ import threading
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
try: try:
import PyQt5 import PyQt6
except Exception: except Exception:
sys.exit("Error: Could not import PyQt5 on Linux systems, you may try 'sudo apt-get install python3-pyqt5'") sys.exit("Error: Could not import PyQt6. On Linux systems, you may try 'sudo apt-get install python3-pyqt6'")
try: try:
import PyQt5.QtQml import PyQt6.QtQml
except Exception: except Exception:
sys.exit("Error: Could not import PyQt5.QtQml on Linux systems, you may try 'sudo apt-get install python3-pyqt5.qtquick'") sys.exit("Error: Could not import PyQt6.QtQml. On Linux systems, you may try 'sudo apt-get install python3-pyqt6.qtquick'")
from PyQt5.QtCore import (Qt, QCoreApplication, QLocale, QTranslator, QTimer, QT_VERSION_STR, PYQT_VERSION_STR) from PyQt6.QtCore import (Qt, QCoreApplication, QLocale, QTranslator, QTimer, QT_VERSION_STR, PYQT_VERSION_STR)
from PyQt5.QtGui import QGuiApplication from PyQt6.QtGui import QGuiApplication
sys._GUI_QT_VERSION = 6 # used by gui/common_qt
from electrum.i18n import _ from electrum.i18n import _
from electrum.plugin import run_hook from electrum.plugin import run_hook
@ -40,7 +41,6 @@ class ElectrumTranslator(QTranslator):
class ElectrumGui(BaseElectrumGui, Logger): class ElectrumGui(BaseElectrumGui, Logger):
@profiler @profiler
def __init__(self, config: 'SimpleConfig', daemon: 'Daemon', plugins: 'Plugins'): def __init__(self, config: 'SimpleConfig', daemon: 'Daemon', plugins: 'Plugins'):
BaseElectrumGui.__init__(self, config=config, daemon=daemon, plugins=plugins) BaseElectrumGui.__init__(self, config=config, daemon=daemon, plugins=plugins)
@ -63,13 +63,11 @@ class ElectrumGui(BaseElectrumGui, Logger):
# GC-ed when windows are closed # GC-ed when windows are closed
#network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer, #network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer,
# ElectrumWindow], interval=5)]) # ElectrumWindow], interval=5)])
QCoreApplication.setAttribute(Qt.AA_X11InitThreads)
if hasattr(Qt, "AA_ShareOpenGLContexts"): if hasattr(Qt, "AA_ShareOpenGLContexts"):
QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts) QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts)
if hasattr(QGuiApplication, 'setDesktopFileName'): if hasattr(QGuiApplication, 'setDesktopFileName'):
QGuiApplication.setDesktopFileName('electrum.desktop') QGuiApplication.setDesktopFileName('electrum.desktop')
if hasattr(Qt, "AA_EnableHighDpiScaling"):
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
if "QT_QUICK_CONTROLS_STYLE" not in os.environ: if "QT_QUICK_CONTROLS_STYLE" not in os.environ:
os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material" os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material"
@ -100,10 +98,14 @@ class ElectrumGui(BaseElectrumGui, Logger):
return return
self.timer.start() self.timer.start()
signal.signal(signal.SIGINT, lambda *args: self.stop()) signal.signal(signal.SIGINT, lambda *args: self._handle_sigint())
self.logger.info('Entering main loop') self.logger.info('Entering main loop')
self.app.exec_() self.app.exec()
def _handle_sigint(self):
self.app.appController.wantClose = True
self.stop()
def stop(self): def stop(self):
self.logger.info('closing GUI') self.logger.info('closing GUI')

36
electrum/gui/qml/android_res/layout/scanner_layout.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/hint"
android:layout_gravity="center|top"
android:gravity="center"
android:text="Scan a QR code."
android:layout_width="wrap_content"
android:textColor="#ffffff"
android:shadowColor="#000000"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"
android:textSize="15sp"
android:padding="14dp"
android:layout_height="wrap_content" />
<Button
android:id="@+id/paste_btn"
android:layout_gravity="center|bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Paste from clipboard" />
</FrameLayout>

2
electrum/gui/qml/auth.py

@ -1,6 +1,6 @@
from functools import wraps, partial from functools import wraps, partial
from PyQt5.QtCore import pyqtSignal, pyqtSlot from PyQt6.QtCore import pyqtSignal, pyqtSlot
from electrum.logging import get_logger from electrum.logging import get_logger

8
electrum/gui/qml/components/About.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
Pane { Pane {
objectName: 'About' objectName: 'About'

10
electrum/gui/qml/components/AddressDetails.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0
@ -310,7 +310,7 @@ Pane {
address: root.address address: root.address
onFrozenChanged: addressDetailsChanged() onFrozenChanged: addressDetailsChanged()
onLabelChanged: addressDetailsChanged() onLabelChanged: addressDetailsChanged()
onAuthRequired: { onAuthRequired: (method, authMessage) => {
app.handleAuthRequired(addressdetails, method, authMessage) app.handleAuthRequired(addressdetails, method, authMessage)
} }
} }

10
electrum/gui/qml/components/Addresses.qml

@ -1,8 +1,8 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQml.Models 2.2 import QtQml.Models
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/BIP39RecoveryDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/BalanceDetails.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/ChannelBackups.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/ChannelDetails.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/ChannelOpenProgressDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/Channels.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

12
electrum/gui/qml/components/CloseChannelDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0
@ -202,7 +202,7 @@ ElDialog {
wallet: Daemon.currentWallet wallet: Daemon.currentWallet
channelid: dialog.channelid channelid: dialog.channelid
onAuthRequired: { onAuthRequired: (method, authMessage) => {
app.handleAuthRequired(channeldetails, method, authMessage) app.handleAuthRequired(channeldetails, method, authMessage)
} }
@ -228,7 +228,7 @@ ElDialog {
dialog.close() dialog.close()
} }
onChannelCloseFailed: { onChannelCloseFailed: (message) => {
errorText.text = message errorText.text = message
} }
} }

8
electrum/gui/qml/components/ConfirmTxDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

6
electrum/gui/qml/components/Constants.qml

@ -1,8 +1,8 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls.Material 2.0 import QtQuick.Controls
import QtQuick.Controls.Material
Item { Item {
readonly property int paddingTiny: 4 //deprecated
readonly property int paddingXXSmall: 4 readonly property int paddingXXSmall: 4
readonly property int paddingXSmall: 6 readonly property int paddingXSmall: 6
readonly property int paddingSmall: 8 readonly property int paddingSmall: 8

8
electrum/gui/qml/components/CpfpBumpFeeDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

10
electrum/gui/qml/components/ExceptionDialog.qml

@ -1,9 +1,9 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQml 2.6 import QtQml
import "controls" import "controls"

8
electrum/gui/qml/components/ExportTxDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import "controls" import "controls"

8
electrum/gui/qml/components/GenericShareDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import "controls" import "controls"

10
electrum/gui/qml/components/History.qml

@ -1,8 +1,8 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQml.Models 2.2 import QtQml.Models
import org.electrum 1.0 import org.electrum 1.0

6
electrum/gui/qml/components/ImportAddressesKeysDialog.qml

@ -1,6 +1,6 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import org.electrum 1.0 import org.electrum 1.0

6
electrum/gui/qml/components/ImportChannelBackupDialog.qml

@ -1,6 +1,6 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/InvoiceDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.12 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

12
electrum/gui/qml/components/Invoices.qml

@ -1,9 +1,9 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQml.Models 2.1 import QtQml.Models
import QtQml 2.6 import QtQml
import "controls" import "controls"

8
electrum/gui/qml/components/LightningPaymentDetails.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/LightningPaymentProgressDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/LnurlPayRequestDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/LoadingWalletDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/MessageDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import "controls" import "controls"

8
electrum/gui/qml/components/NetworkOverview.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import "controls" import "controls"

6
electrum/gui/qml/components/NewWalletWizard.qml

@ -1,6 +1,6 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.1 import QtQuick.Controls
import org.electrum 1.0 import org.electrum 1.0

10
electrum/gui/qml/components/NotificationPopup.qml

@ -1,8 +1,8 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQuick.Controls.Material.impl 2.12 import QtQuick.Controls.Material.impl
Item { Item {
id: root id: root

25
electrum/gui/qml/components/OpenChannelDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0
@ -212,16 +212,19 @@ ElDialog {
ChannelOpener { ChannelOpener {
id: channelopener id: channelopener
wallet: Daemon.currentWallet wallet: Daemon.currentWallet
onAuthRequired: { onAuthRequired: (method, authMessage) => {
app.handleAuthRequired(channelopener, method, authMessage) app.handleAuthRequired(channelopener, method, authMessage)
} }
onValidationError: { onValidationError: (code, message) => {
if (code == 'invalid_nodeid') { if (code == 'invalid_nodeid') {
var dialog = app.messageDialog.createObject(app, { title: qsTr('Error'), 'text': message }) var dialog = app.messageDialog.createObject(app, {
title: qsTr('Error'),
text: message
})
dialog.open() dialog.open()
} }
} }
onConflictingBackup: { onConflictingBackup: (message) => {
var dialog = app.messageDialog.createObject(app, { 'text': message, 'yesno': true }) var dialog = app.messageDialog.createObject(app, { 'text': message, 'yesno': true })
dialog.open() dialog.open()
dialog.accepted.connect(function() { dialog.accepted.connect(function() {
@ -237,17 +240,17 @@ ElDialog {
}) })
dialog.open() dialog.open()
} }
onChannelOpening: { onChannelOpening: (peer) => {
console.log('Channel is opening') console.log('Channel is opening')
app.channelOpenProgressDialog.reset() app.channelOpenProgressDialog.reset()
app.channelOpenProgressDialog.peer = peer app.channelOpenProgressDialog.peer = peer
app.channelOpenProgressDialog.open() app.channelOpenProgressDialog.open()
} }
onChannelOpenError: { onChannelOpenError: (message) => {
app.channelOpenProgressDialog.state = 'failed' app.channelOpenProgressDialog.state = 'failed'
app.channelOpenProgressDialog.error = message app.channelOpenProgressDialog.error = message
} }
onChannelOpenSuccess: { onChannelOpenSuccess: (cid, has_onchain_backup, min_depth, tx_complete) => {
var message = qsTr('Channel established.') + ' ' var message = qsTr('Channel established.') + ' '
+ qsTr('This channel will be usable after %1 confirmations').arg(min_depth) + qsTr('This channel will be usable after %1 confirmations').arg(min_depth)
if (!tx_complete) { if (!tx_complete) {

8
electrum/gui/qml/components/OpenWalletDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/OtpDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/PasswordDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/Pin.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/Preferences.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/ProxyConfigDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/RbfBumpFeeDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/RbfCancelDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

24
electrum/gui/qml/components/ReceiveDetailsDialog.qml

@ -1,8 +1,8 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQml.Models 2.1 import QtQml.Models
import org.electrum 1.0 import org.electrum 1.0
@ -55,33 +55,33 @@ ElDialog {
BtcField { BtcField {
id: amountBtc id: amountBtc
fiatfield: amountFiat fiatfield: amountFiat
Layout.preferredWidth: parent.width /3 Layout.fillWidth: true
} }
Label { Label {
Layout.columnSpan: 2
Layout.rightMargin: constants.paddingXLarge
text: Config.baseUnit text: Config.baseUnit
color: Material.accentColor color: Material.accentColor
} }
Item { width: 1; height: 1; Layout.fillWidth: true }
Item { visible: Daemon.fx.enabled; width: 1; height: 1 } Item { visible: Daemon.fx.enabled; width: 1; height: 1 }
FiatField { FiatField {
id: amountFiat id: amountFiat
Layout.fillWidth: true
btcfield: amountBtc btcfield: amountBtc
visible: Daemon.fx.enabled visible: Daemon.fx.enabled
Layout.preferredWidth: parent.width /3
} }
Label { Label {
Layout.columnSpan: 2
Layout.rightMargin: constants.paddingXLarge
visible: Daemon.fx.enabled visible: Daemon.fx.enabled
text: Daemon.fx.fiatCurrency text: Daemon.fx.fiatCurrency
color: Material.accentColor color: Material.accentColor
} }
Item { visible: Daemon.fx.enabled; width: 1; height: 1; Layout.fillWidth: true }
Label { Label {
text: qsTr('Expires after') text: qsTr('Expires after')
Layout.fillWidth: false Layout.fillWidth: false
@ -89,7 +89,7 @@ ElDialog {
RequestExpiryComboBox { RequestExpiryComboBox {
id: expires id: expires
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
} }

10
electrum/gui/qml/components/ReceiveDialog.qml

@ -1,8 +1,8 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQml.Models 2.1 import QtQml.Models
import org.electrum 1.0 import org.electrum 1.0

12
electrum/gui/qml/components/ReceiveRequests.qml

@ -1,9 +1,9 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQml.Models 2.1 import QtQml.Models
import QtQml 2.6 import QtQml
import org.electrum 1.0 import org.electrum 1.0

13
electrum/gui/qml/components/ScanDialog.qml

@ -1,9 +1,10 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import "controls" import "controls"
// currently not used on android, kept for future use when qt6 camera stops crashing
ElDialog { ElDialog {
id: scanDialog id: scanDialog
@ -20,11 +21,17 @@ ElDialog {
header: null header: null
topPadding: 0 // dialog needs topPadding override topPadding: 0 // dialog needs topPadding override
function doClose() {
qrscan.stop()
Qt.callLater(doReject)
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 0 spacing: 0
QRScan { QRScan {
id: qrscan
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
hint: scanDialog.hint hint: scanDialog.hint

26
electrum/gui/qml/components/SendDialog.qml

@ -1,12 +1,13 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0
import "controls" import "controls"
// currently not used on android, kept for future use when qt6 camera stops crashing
ElDialog { ElDialog {
id: dialog id: dialog
@ -19,6 +20,11 @@ ElDialog {
padding: 0 padding: 0
topPadding: 0 topPadding: 0
onAboutToHide: {
console.log('about to hide')
qrscan.stop()
}
function restart() { function restart() {
qrscan.restart() qrscan.restart()
} }
@ -34,6 +40,13 @@ ElDialog {
} }
} }
// override
function doClose() {
console.log('SendDialog doClose override') // doesn't trigger when going back??
qrscan.stop()
Qt.callLater(doReject)
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 0 spacing: 0
@ -55,7 +68,10 @@ ElDialog {
Layout.preferredWidth: 1 Layout.preferredWidth: 1
icon.source: '../../icons/copy_bw.png' icon.source: '../../icons/copy_bw.png'
text: qsTr('Paste') text: qsTr('Paste')
onClicked: dialog.dispatch(AppController.clipboardToText()) onClicked: {
qrscan.stop()
dialog.dispatch(AppController.clipboardToText())
}
} }
} }

8
electrum/gui/qml/components/ServerConfigDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

6
electrum/gui/qml/components/ServerConnectWizard.qml

@ -1,6 +1,6 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import "wizard" import "wizard"

8
electrum/gui/qml/components/SignVerifyMessageDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/SwapDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

10
electrum/gui/qml/components/TxDetails.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0
@ -399,7 +399,7 @@ Pane {
id: txdetails id: txdetails
wallet: Daemon.currentWallet wallet: Daemon.currentWallet
onLabelChanged: root.detailsChanged() onLabelChanged: root.detailsChanged()
onConfirmRemoveLocalTx: { onConfirmRemoveLocalTx: (message) => {
var dialog = app.messageDialog.createObject(app, { text: message, yesno: true }) var dialog = app.messageDialog.createObject(app, { text: message, yesno: true })
dialog.accepted.connect(function() { dialog.accepted.connect(function() {
txdetails.removeLocalTx(true) txdetails.removeLocalTx(true)

8
electrum/gui/qml/components/WalletDetails.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

110
electrum/gui/qml/components/WalletMainView.qml

@ -1,8 +1,8 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import QtQml 2.6 import QtQml
import org.electrum 1.0 import org.electrum 1.0
@ -34,20 +34,56 @@ Item {
} }
function openSendDialog() { function openSendDialog() {
_sendDialog = sendDialog.createObject(mainView, {invoiceParser: invoiceParser}) // Qt based send dialog if not on android
_sendDialog.open() if (!AppController.isAndroid()) {
_sendDialog = qtSendDialog.createObject(mainView, {invoiceParser: invoiceParser})
_sendDialog.open()
return
}
// Android based send dialog if on android
var scanner = app.scanDialog.createObject(mainView, {
hint: qsTr('Scan an Invoice, an Address, an LNURL-pay, a PSBT or a Channel backup'),
})
scanner.onFound.connect(function() {
var data = scanner.scanData
data = data.trim()
if (bitcoin.isRawTx(data)) {
app.stack.push(Qt.resolvedUrl('TxDetails.qml'), { rawtx: data })
} else if (Daemon.currentWallet.isValidChannelBackup(data)) {
var dialog = app.messageDialog.createObject(app, {
title: qsTr('Import Channel backup?'),
yesno: true
})
dialog.accepted.connect(function() {
Daemon.currentWallet.importChannelBackup(data)
})
dialog.open()
} else {
invoiceParser.recipient = data
}
//scanner.destroy() // TODO
})
scanner.open()
} }
function closeSendDialog() { function closeSendDialog() {
if (_sendDialog) { if (!AppController.isAndroid()) {
_sendDialog.close() if (_sendDialog) {
_sendDialog = null _sendDialog.doClose()
_sendDialog = null
}
} }
} }
function restartSendDialog() { function restartSendDialog() {
if (_sendDialog) { if (!AppController.isAndroid()) {
_sendDialog.restart() if (_sendDialog) {
_sendDialog.restart()
}
return
} else {
openSendDialog()
} }
} }
@ -86,6 +122,11 @@ Item {
dialog.open() dialog.open()
} }
function createRequest(lightning_only, reuse_address) {
var qamt = Config.unitsToSats(_request_amount)
Daemon.currentWallet.createRequest(qamt, _request_description, _request_expiry, lightning_only, reuse_address)
}
property QtObject menu: Menu { property QtObject menu: Menu {
id: menu id: menu
@ -264,16 +305,20 @@ Item {
InvoiceParser { InvoiceParser {
id: invoiceParser id: invoiceParser
wallet: Daemon.currentWallet wallet: Daemon.currentWallet
onValidationError: { onValidationError: (code, message) => {
var dialog = app.messageDialog.createObject(app, { text: message }) var dialog = app.messageDialog.createObject(app, {
text: message
})
dialog.closed.connect(function() { dialog.closed.connect(function() {
restartSendDialog() restartSendDialog()
}) })
dialog.open() dialog.open()
} }
onValidationWarning: { onValidationWarning: (code, message) => {
if (code == 'no_channels') { if (code == 'no_channels') {
var dialog = app.messageDialog.createObject(app, { text: message }) var dialog = app.messageDialog.createObject(app, {
text: message
})
dialog.closed.connect(function() { dialog.closed.connect(function() {
restartSendDialog() restartSendDialog()
}) })
@ -284,22 +329,36 @@ Item {
} }
onValidationSuccess: { onValidationSuccess: {
closeSendDialog() closeSendDialog()
var dialog = invoiceDialog.createObject(app, { invoice: invoiceParser, payImmediately: invoiceParser.isLnurlPay }) var dialog = invoiceDialog.createObject(app, {
invoice: invoiceParser,
payImmediately: invoiceParser.isLnurlPay
})
dialog.open() dialog.open()
} }
onInvoiceCreateError: console.log(code + ' ' + message) onInvoiceCreateError: (code, message) => {
console.log(code + ' ' + message)
}
onLnurlRetrieved: { onLnurlRetrieved: {
closeSendDialog() closeSendDialog()
var dialog = lnurlPayDialog.createObject(app, { invoiceParser: invoiceParser }) var dialog = lnurlPayDialog.createObject(app, {
invoiceParser: invoiceParser
})
dialog.open() dialog.open()
} }
onLnurlError: { onLnurlError: (code, message) => {
var dialog = app.messageDialog.createObject(app, { title: qsTr('Error'), text: message }) var dialog = app.messageDialog.createObject(app, {
title: qsTr('Error'),
text: message }
)
dialog.open() dialog.open()
} }
} }
Bitcoin {
id: bitcoin
}
Connections { Connections {
target: AppController target: AppController
function onUriReceived(uri) { function onUriReceived(uri) {
@ -406,7 +465,7 @@ Item {
} }
Component { Component {
id: sendDialog id: qtSendDialog
SendDialog { SendDialog {
width: parent.width width: parent.width
height: parent.height height: parent.height
@ -433,11 +492,6 @@ Item {
} }
} }
function createRequest(lightning_only, reuse_address) {
var qamt = Config.unitsToSats(_request_amount)
Daemon.currentWallet.createRequest(qamt, _request_description, _request_expiry, lightning_only, reuse_address)
}
Component { Component {
id: receiveDetailsDialog id: receiveDetailsDialog
@ -477,7 +531,7 @@ Item {
finalizer: TxFinalizer { finalizer: TxFinalizer {
wallet: Daemon.currentWallet wallet: Daemon.currentWallet
canRbf: true canRbf: true
onFinished: { onFinished: (signed, saved, complete) => {
if (!complete) { if (!complete) {
var msg var msg
if (wallet.isWatchOnly) { if (wallet.isWatchOnly) {

8
electrum/gui/qml/components/WalletSummary.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.5 import QtQuick.Layouts
import QtQuick.Controls 2.12 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

15
electrum/gui/qml/components/Wallets.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0
@ -27,12 +27,11 @@ Pane {
ColumnLayout { ColumnLayout {
id: rootLayout id: rootLayout
width: parent.width anchors.fill: parent
height: parent.height
spacing: 0 spacing: 0
ColumnLayout { ColumnLayout {
Layout.preferredWidth: parent.width Layout.fillWidth: true
Layout.margins: constants.paddingLarge Layout.margins: constants.paddingLarge
Heading { Heading {
@ -41,7 +40,7 @@ Pane {
Frame { Frame {
id: detailsFrame id: detailsFrame
Layout.preferredWidth: parent.width Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
verticalPadding: 0 verticalPadding: 0
horizontalPadding: 0 horizontalPadding: 0

8
electrum/gui/qml/components/controls/AddressDelegate.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/controls/BalanceSummary.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
Item { Item {
id: root id: root

4
electrum/gui/qml/components/controls/BtcField.qml

@ -1,5 +1,5 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/controls/ButtonContainer.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
Container { Container {
id: root id: root

8
electrum/gui/qml/components/controls/ChannelBar.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

8
electrum/gui/qml/components/controls/ChannelDelegate.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

4
electrum/gui/qml/components/controls/ElComboBox.qml

@ -1,5 +1,5 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
ComboBox { ComboBox {
id: cb id: cb

17
electrum/gui/qml/components/controls/ElDialog.qml

@ -1,7 +1,7 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
Dialog { Dialog {
id: abstractdialog id: abstractdialog
@ -35,7 +35,7 @@ Dialog {
reject() reject()
} }
parent: resizeWithKeyboard ? Overlay.overlay.children[0] : Overlay.overlay parent: resizeWithKeyboard ? app.keyboardFreeZone : Overlay.overlay
modal: true modal: true
Overlay.modal: Rectangle { Overlay.modal: Rectangle {
color: "#aa000000" color: "#aa000000"
@ -100,11 +100,4 @@ Dialog {
} }
} }
background: Rectangle {
id: bg
color: Material.dialogColor
TapHandler {
onTapped: bg.forceActiveFocus()
}
}
} }

39
electrum/gui/qml/components/controls/ElListView.qml

@ -1,40 +1,27 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
ListView { ListView {
id: root id: root
property int width_left_exclusion_zone: 0 // avoid interference with android back-gesture by defining deadzones
property int width_right_exclusion_zone: 0 // you can override to 0 if listview is away from left or right edge.
property int exclusionZone: constants.fingerWidth / 2
property int leftExclusionZone: exclusionZone
property int rightExclusionZone: exclusionZone
MouseArea { MouseArea {
anchors {top: root.top; left: root.left; bottom: root.bottom } anchors {top: root.top; left: root.left; bottom: root.bottom }
visible: width_left_exclusion_zone > 0 visible: leftExclusionZone > 0
width: width_left_exclusion_zone width: leftExclusionZone
} }
MouseArea { MouseArea {
anchors { top: root.top; right: root.right; bottom: root.bottom } anchors { top: root.top; right: root.right; bottom: root.bottom }
visible: width_right_exclusion_zone > 0 visible: rightExclusionZone > 0
width: width_right_exclusion_zone width: rightExclusionZone
} }
// determine distance from sides of window and reserve some
// space using noop mouseareas in order to not emit clicks when
// android back gesture is used
function layoutExclusionZones() {
var reserve = constants.fingerWidth / 2
var p = root.mapToGlobal(0, 0) // note: coords on whole *screen*, not just window
width_left_exclusion_zone = Math.max(0, reserve - p.x)
p = root.mapToGlobal(width, 0)
width_right_exclusion_zone = Math.max(0, reserve - (app.width - p.x))
}
Component.onCompleted: {
if (AppController.isAndroid()) {
layoutExclusionZones()
}
}
} }

4
electrum/gui/qml/components/controls/FeeMethodComboBox.qml

@ -1,5 +1,5 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import org.electrum 1.0 import org.electrum 1.0

4
electrum/gui/qml/components/controls/FiatField.qml

@ -1,5 +1,5 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import org.electrum 1.0 import org.electrum 1.0

10
electrum/gui/qml/components/controls/FlatButton.qml

@ -1,8 +1,8 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Controls.Material 2.15 import QtQuick.Controls.Material
import QtQuick.Controls.impl 2.15 import QtQuick.Controls.impl
import QtQuick.Controls.Material.impl 2.15 import QtQuick.Controls.Material.impl
TabButton { TabButton {
id: control id: control

8
electrum/gui/qml/components/controls/FormattedAmount.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0

6
electrum/gui/qml/components/controls/Heading.qml

@ -1,6 +1,6 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.1 import QtQuick.Controls
RowLayout { RowLayout {
id: root id: root

10
electrum/gui/qml/components/controls/HistoryItemDelegate.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0
@ -121,7 +121,7 @@ Item {
visible: delegate.ListView.section == delegate.ListView.nextSection visible: delegate.ListView.section == delegate.ListView.nextSection
Layout.preferredWidth: parent.width * 2/3 Layout.preferredWidth: parent.width * 2/3
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: constants.paddingTiny Layout.preferredHeight: constants.paddingXXSmall
color: Material.background color: Material.background
} }

8
electrum/gui/qml/components/controls/InfoTextArea.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.1 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
TextHighlightPane { TextHighlightPane {
enum IconStyle { enum IconStyle {

12
electrum/gui/qml/components/controls/InvoiceDelegate.qml

@ -1,7 +1,7 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls 2.0 import QtQuick.Controls
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
ItemDelegate { ItemDelegate {
id: root id: root
@ -31,7 +31,7 @@ ItemDelegate {
Rectangle { Rectangle {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: constants.paddingTiny Layout.preferredHeight: constants.paddingXXSmall
color: 'transparent' color: 'transparent'
} }
@ -133,7 +133,7 @@ ItemDelegate {
Rectangle { Rectangle {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: constants.paddingTiny Layout.preferredHeight: constants.paddingXXSmall
color: 'transparent' color: 'transparent'
} }

2
electrum/gui/qml/components/controls/LightningNetworkStatusIndicator.qml

@ -1,4 +1,4 @@
import QtQuick 2.6 import QtQuick
import org.electrum 1.0 import org.electrum 1.0

6
electrum/gui/qml/components/controls/OnchainNetworkStatusIndicator.qml

@ -1,4 +1,4 @@
import QtQuick 2.6 import QtQuick
Image { Image {
id: root id: root
@ -13,7 +13,7 @@ Image {
property bool proxy: connected && 'mode' in Network.proxy && Network.proxy.mode property bool proxy: connected && 'mode' in Network.proxy && Network.proxy.mode
// ?: in order to keep this a binding.. // ?: in order to keep this a binding..
source: !connected source: Qt.resolvedUrl(!connected
? '../../../icons/status_disconnected.png' ? '../../../icons/status_disconnected.png'
: syncing : syncing
? '../../../icons/status_waiting.png' ? '../../../icons/status_waiting.png'
@ -27,7 +27,7 @@ Image {
: '../../../icons/status_connected_fork.png' : '../../../icons/status_connected_fork.png'
: proxy : proxy
? '../../../icons/status_connected_proxy.png' ? '../../../icons/status_connected_proxy.png'
: '../../../icons/status_connected.png' : '../../../icons/status_connected.png')
states: [ states: [

4
electrum/gui/qml/components/controls/PaneInsetBackground.qml

@ -1,5 +1,5 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
Rectangle { Rectangle {
property color baseColor: Material.background property color baseColor: Material.background

6
electrum/gui/qml/components/controls/PasswordField.qml

@ -1,6 +1,6 @@
import QtQuick 2.6 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.1 import QtQuick.Controls
RowLayout { RowLayout {
id: root id: root

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save