Migrate to Qt6

Co-authored-by: malinero <malinero@protonmail.com>
Co-authored-by: auth <auth@waifu.club>
Co-authored-by: jpk68 <jpk68@tutanota.com>
This commit is contained in:
committed 2026-10-06 00:39:02 +02:00
1 parent d7c2f13d88
commit 66fbec6669
150 files changed
+2928 -2472

No files matched your search

+179
View File
@@ -0,0 +1,179 @@
#!/usr/bin/env python3
import argparse
import fnmatch
import hashlib
import pathlib
import subprocess
import urllib.parse
import urllib.request
import xml.etree.ElementTree as ET
MAX_TRIES = 32
MAX_XML_SIZE = 1024 * 1024 * 1024
MIRROR = 'download.qt.io'
def fetch_links_to_archives(host_os, target, major, minor, patch, toolchain, packages):
qt_dir = f'qt{major}_{major}{minor}{patch}'
base_url = f'https://{MIRROR}/online/qtsdkrepository/{host_os}/{target}/{qt_dir}/{qt_dir}'
url = f'{base_url}/Updates.xml'
print('fetching', url, flush=True)
for _ in range(MAX_TRIES):
try:
with urllib.request.urlopen(url, timeout=30) as response:
resp = response.read(MAX_XML_SIZE + 1)
if len(resp) > MAX_XML_SIZE:
raise RuntimeError(f'{url} exceeds the {MAX_XML_SIZE}-byte size limit')
update_xml = ET.fromstring(resp)
break
except KeyboardInterrupt:
raise
except Exception as e:
print('error', e, flush=True)
else:
raise RuntimeError(f'Failed to fetch {url} after {MAX_TRIES} attempts')
package_prefix = f'qt.qt{major}.{major}{minor}{patch}'
package_names = {
f'{package_prefix}.{package}.{toolchain}' if package else f'{package_prefix}.{toolchain}'
for package in packages
}
found_packages = set()
for pkg in update_xml.findall('./PackageUpdate'):
name = pkg.find('.//Name')
if name is None:
continue
if name.text not in package_names:
continue
found_packages.add(name.text)
version = pkg.find('.//Version')
if version is None:
continue
archives = pkg.find('.//DownloadableArchives')
if archives is None or archives.text is None:
continue
for archive in archives.text.split(', '):
archive = archive.strip()
if not archive:
continue
url = f'{base_url}/{name.text}/{version.text}{archive}'
file_name = pathlib.Path(urllib.parse.urlparse(url).path).name
yield {'name': file_name, 'url': url, 'archive': archive}
missing_packages = package_names - found_packages
if missing_packages:
raise RuntimeError(f'Qt packages not found: {", ".join(sorted(missing_packages))}')
def download(links):
metalink = ET.Element('metalink', xmlns='urn:ietf:params:xml:ns:metalink')
for link in links:
file = ET.SubElement(metalink, 'file', name=link['name'])
ET.SubElement(file, 'url').text = link['url']
data = ET.tostring(metalink, encoding='UTF-8', xml_declaration=True)
for _ in range(MAX_TRIES):
result = subprocess.run([
'aria2c',
'--connect-timeout=8',
'--console-log-level=warn',
'--continue',
'--follow-metalink=mem',
'--max-concurrent-downloads=100',
'--max-connection-per-server=16',
'--max-file-not-found=100',
'--max-tries=100',
'--min-split-size=1MB',
'--retry-wait=1',
'--split=100',
'--summary-interval=0',
'--timeout=8',
'--user-agent=',
'--metalink-file=-',
], input=data, check=False)
if result.returncode == 0:
return True
return False
def file_hash(path):
digest = hashlib.sha256()
with open(path, 'rb') as file:
for chunk in iter(lambda: file.read(1024 * 1024), b''):
digest.update(chunk)
return digest.digest()
def calc_hash_sum(files):
digest = hashlib.sha256()
for path in files:
digest.update(file_hash(path))
return digest.hexdigest()
def extract_archives(files, out='.', targets=()):
for path in files:
print('extracting', path, flush=True)
result = subprocess.run(
['bsdtar', '-xf', path, '-C', out, *targets],
stdout=subprocess.DEVNULL,
check=False,
)
if result.returncode != 0:
return False
return True
def main():
parser = argparse.ArgumentParser()
parser.add_argument('os')
parser.add_argument('target')
parser.add_argument('version')
parser.add_argument('toolchain')
parser.add_argument('expect')
parser.add_argument('--add-package', action='append', default=[],
help='additional package below qt.qt<major>.<version>, such as addons.qtshadertools')
parser.add_argument('--archive', action='append', default=[],
help='fnmatch pattern selecting archives from the requested packages')
args = parser.parse_args()
host_os, target, version, toolchain, expect = (
args.os, args.target, args.version, args.toolchain, args.expect
)
major, minor, patch = version.split('.')
packages = [''] + args.add_package
links = list(fetch_links_to_archives(
host_os, target, major, minor, patch, toolchain, packages
))
if args.archive:
links = [
link for link in links
if any(fnmatch.fnmatch(link['archive'], pattern) for pattern in args.archive)
]
if not links:
raise RuntimeError('No Qt archives matched')
print(*(link['url'] for link in links), sep='\n', flush=True)
if not download(links):
raise RuntimeError('Failed to download Qt archives')
archive_names = [link['name'] for link in links]
result = calc_hash_sum(archive_names)
print('result', result, 'expect', expect, flush=True)
if expect != '-' and result != expect:
raise RuntimeError(f'Qt archive hash mismatch: expected {expect}, got {result}')
if not extract_archives(archive_names):
raise RuntimeError('Failed to extract Qt archives')
for archive_name in archive_names:
pathlib.Path(archive_name).unlink()
if __name__ == '__main__':
main()
+60 -65
View File
@@ -4,9 +4,7 @@ on: [push, pull_request]
env:
FREE_DISKSPACE: |
sudo rm -rf /usr/local/.ghcup /usr/share/dotnet /usr/share/swift /usr/share/miniconda
QT_TAG: v5.15.17-lts-lgpl
QT_PREFIX: ${{ github.workspace }}/qt-install
sudo rm -rf /usr/local/.ghcup /usr/share/dotnet /usr/share/swift /usr/share/miniconda /usr/local/lib/android /opt/hostedtoolcache
jobs:
build-macos:
@@ -16,14 +14,14 @@ jobs:
with:
submodules: recursive
- name: install dependencies
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi ninja openssl zmq libsodium unbound protobuf qt5 pkg-config
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi ninja openssl zmq libsodium unbound protobuf qt pkg-config
- name: build
run: DEV_MODE=ON QML_TESTS=ON make release
- name: test qml
run: build/release/bin/monero-wallet-gui.app/Contents/MacOS/monero-wallet-gui --test-qml
build-ubuntu:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
with:
@@ -38,13 +36,14 @@ jobs:
- name: update apt
run: sudo apt update
- name: install monero dependencies
run: sudo apt -y install build-essential cmake ninja-build libboost-all-dev libunbound-dev graphviz doxygen pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev libprotobuf-dev protobuf-compiler
- name: install monero gui dependencies
run: sudo apt -y install qtbase5-dev qtdeclarative5-dev qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-platform qml-module-qt-labs-folderlistmodel qml-module-qttest qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev libgcrypt20-dev xvfb
run: sudo apt -y install build-essential cmake ninja-build libboost-all-dev libunbound-dev graphviz doxygen pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev libprotobuf-dev protobuf-compiler libgcrypt20-dev qt6-base-dev qt6-declarative-dev qt6-svg-dev qt6-tools-dev qt6-tools-dev-tools qml6-module-qtcore qml6-module-qtqml qml6-module-qtqml-models qml6-module-qtquick qml6-module-qtquick-controls qml6-module-qtquick-dialogs qml6-module-qtquick-effects qml6-module-qtquick-layouts qml6-module-qtquick-shapes qml6-module-qtquick-window qml6-module-qt-labs-folderlistmodel qml6-module-qt-labs-platform qml6-module-qttest
- name: build
run: DEV_MODE=ON QML_TESTS=ON make release
- name: test qml
run: xvfb-run -a build/release/bin/monero-wallet-gui --test-qml
env:
QT_QPA_PLATFORM: offscreen
QT_QUICK_BACKEND: software
run: build/release/bin/monero-wallet-gui --test-qml
build-windows:
runs-on: windows-latest
@@ -60,11 +59,9 @@ jobs:
msystem: ucrt64
update: true
install: make
pacboy: toolchain:p pcre:p cmake:p ninja:p boost:p openssl:p zeromq:p libsodium:p hidapi:p protobuf-c:p libusb:p unbound:p git qt5:p libgcrypt:p angleproject:p rust:p
- name: add qmake.exe and windeployqt.exe
run: |
cp -f "$MSYSTEM_PREFIX/bin/qmake-qt5.exe" "$MSYSTEM_PREFIX/bin/qmake.exe"
cp -f "$MSYSTEM_PREFIX/bin/windeployqt-qt5.exe" "$MSYSTEM_PREFIX/bin/windeployqt.exe"
pacboy: toolchain:p pcre:p cmake:p ninja:p boost:p openssl:p zeromq:p libsodium:p hidapi:p protobuf:p libusb:p unbound:p git qt6-base:p qt6-declarative:p qt6-svg:p qt6-tools:p libgcrypt:p rust:p
- name: add qmlimportscanner.exe
run: cp -f "$MSYSTEM_PREFIX/share/qt6/bin/qmlimportscanner.exe" "$MSYSTEM_PREFIX/bin/qmlimportscanner.exe"
- name: build
run: DEV_MODE=ON QML_TESTS=ON make release-win64
- name: deploy
@@ -74,47 +71,45 @@ jobs:
run: build/release/bin/monero-wallet-gui --test-qml -o test.log,txt || { rc=$?; cat test.log; exit "$rc"; }
macos-bundle:
runs-on: macos-15
name: macOS ${{ matrix.arch }} bundle
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: macos-14
archive_name: monero-wallet-gui-macos-armv8.tar.gz
arch: ARM
- runner: macos-15-intel
archive_name: monero-wallet-gui-macos-x64.tar.gz
arch: Intel
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: install dependencies
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi ninja openssl zmq unbound protobuf pkg-config
- name: clone qt repo
run: git clone -b "${QT_TAG}" --recursive --depth 1 --shallow-submodules https://github.com/qt/qt5
- name: build qt from source
run: |
cd qt5
mkdir build && cd build
../configure -prefix "${QT_PREFIX}" -opensource -confirm-license -release -nomake examples -nomake tests -no-rpath -skip qtwebengine -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtlocation -skip qtnetworkauth -skip qtpurchasing -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine
make -j"$(sysctl -n hw.ncpu)"
make install
cd ../qttools/src/linguist/lrelease
../../../../build/qtbase/bin/qmake
make -j"$(sysctl -n hw.ncpu)"
make install
cd ../../../../qttools/src/macdeployqt/macdeployqt/
../../../../build/qtbase/bin/qmake
make -j"$(sysctl -n hw.ncpu)"
make install
- name: build monero-gui
run: |
mkdir build && cd build
cmake -G Ninja -D CMAKE_BUILD_TYPE=Release -D ARCH=default -D CMAKE_PREFIX_PATH="${QT_PREFIX}" ..
cmake --build .
- name: deploy
run: cmake --build . --target deploy
working-directory: build
- name: check qml startup
run: build/bin/monero-wallet-gui.app/Contents/MacOS/monero-wallet-gui --check-qml
- name: create .tar
run: tar -cf monero-wallet-gui.tar monero-wallet-gui.app
working-directory: build/bin
- uses: actions/upload-artifact@v7
with:
name: ${{ github.job }}
path: build/bin/monero-wallet-gui.tar
- uses: actions/checkout@v7
with:
submodules: recursive
- name: install dependencies
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi libsodium ninja openssl pkg-config protobuf unbound zeromq aria2
- name: download Qt
run: mkdir qt6 && cd qt6 && python3 ../monero-gui/.github/qt_helper.py mac_x64 desktop 6.11.1 clang_64 4a88665d61643410399e15d2cc7625cca62d7f5a005d88c02a1e17dde7d9f62c
working-directory: ../
- name: configure
run: >
cmake -S . -B build -G Ninja
-D CMAKE_PREFIX_PATH="/Users/runner/work/monero-gui/qt6/"
-D CMAKE_OSX_DEPLOYMENT_TARGET="13.0"
-D ARCH=default
- name: build
run: cmake --build build
- name: deploy
run: cmake --build build --target deploy
- name: check qml startup
run: build/bin/monero-wallet-gui.app/Contents/MacOS/monero-wallet-gui --check-qml
- name: create archive
run: tar -C build/bin -czf "${{ matrix.archive_name }}" monero-wallet-gui.app
- uses: actions/upload-artifact@v7
with:
path: ${{ matrix.archive_name }}
archive: false
docker-linux-static:
runs-on: ubuntu-22.04
@@ -122,24 +117,24 @@ jobs:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: install dependencies
run: sudo apt -y install xvfb libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xkb1 libxcb-shape0 libxkbcommon-x11-0
- name: free up diskspace
run: ${{env.FREE_DISKSPACE}}
- name: prepare build environment
run: docker build --tag monero:build-env-linux --build-arg THREADS=3 --file Dockerfile.linux .
run: docker build --tag monero:build-env-linux --build-arg THREADS=4 --file Dockerfile.linux .
- name: build
run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make release-static'
run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make depends root=/depends target=x86_64-linux-gnu tag=linux-x64'
- name: sha256sum
run: shasum -a256 /home/runner/work/monero-gui/monero-gui/build/release/bin/monero-wallet-gui
run: shasum -a256 /home/runner/work/monero-gui/monero-gui/build/x86_64-linux-gnu/release/bin/monero-wallet-gui
- name: install test dependencies
run: sudo apt -y install xvfb libopengl0 libegl1 libgl1 libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-shape0
- name: check qml startup
run: xvfb-run -a /home/runner/work/monero-gui/monero-gui/build/release/bin/monero-wallet-gui --check-qml
run: xvfb-run -a /home/runner/work/monero-gui/monero-gui/build/x86_64-linux-gnu/release/bin/monero-wallet-gui --check-qml
- uses: actions/upload-artifact@v7
with:
name: ${{ github.job }}
path: |
/home/runner/work/monero-gui/monero-gui/build/release/bin/monero-wallet-gui
/home/runner/work/monero-gui/monero-gui/build/release/bin/monerod
/home/runner/work/monero-gui/monero-gui/build/x86_64-linux-gnu/release/bin/monero-wallet-gui
/home/runner/work/monero-gui/monero-gui/build/x86_64-linux-gnu/release/bin/monerod
docker-windows-static:
runs-on: ubuntu-22.04
@@ -150,7 +145,7 @@ jobs:
- name: free up diskspace
run: ${{env.FREE_DISKSPACE}}
- name: prepare build environment
run: docker build --tag monero:build-env-windows --build-arg THREADS=3 --file Dockerfile.windows .
run: docker build --tag monero:build-env-windows --build-arg THREADS=4 --file Dockerfile.windows .
- name: build
run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui -w /monero-gui monero:build-env-windows sh -c 'make depends root=/depends target=x86_64-w64-mingw32 tag=win-x64'
- name: sha256sum
@@ -171,13 +166,13 @@ jobs:
- name: free up diskspace
run: ${{env.FREE_DISKSPACE}}
- name: prepare build environment
run: docker build --tag monero:build-env-android --build-arg THREADS=3 --file Dockerfile.android .
run: docker build --tag monero:build-env-android --build-arg THREADS=4 --file Dockerfile.android .
- name: build
run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui monero:build-env-android
- uses: actions/upload-artifact@v7
with:
name: ${{ github.job }}
path: /home/runner/work/monero-gui/monero-gui/build/Android/release/android-build/monero-gui.apk
path: /home/runner/work/monero-gui/monero-gui/build/Android/release/android-build/build/outputs/apk/release/android-build-release-unsigned.apk
source-archive:
runs-on: ubuntu-slim
+113 -200
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.22)
project(monero-gui)
include(CMakeDependentOption)
@@ -20,12 +20,7 @@ option(DEV_MODE "Checkout latest monero master on build" OFF)
cmake_dependent_option(QML_TESTS "Build QML tests" OFF "NOT STATIC;NOT ANDROID;NOT IOS" OFF)
option(SKIP_OPTIONAL_MONERO_BINARIES "Don't build optional monero binaries" ON)
if(DEV_MODE)
# DEV_MODE checks out the monero submodule to master, which requires C++17.
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
@@ -82,7 +77,9 @@ if(SKIP_OPTIONAL_MONERO_BINARIES)
blockchain_prune_known_spent_data
blockchain_prune)
if(TARGET ${_optional_monero_target})
set_target_properties(${_optional_monero_target} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# Directory exclusion also skips install rules for unbuilt binaries.
get_target_property(_optional_monero_source_dir ${_optional_monero_target} SOURCE_DIR)
set_property(DIRECTORY "${_optional_monero_source_dir}" PROPERTY EXCLUDE_FROM_ALL TRUE)
endif()
endforeach()
endif()
@@ -139,219 +136,53 @@ if(UNIX AND NOT APPLE AND NOT ANDROID)
endif()
endif()
set(QT5_LIBRARIES
Qt5Core
Qt5Quick
Qt5Gui
Qt5Qml
Qt5Svg
Qt5Xml
)
if(QML_TESTS)
list(APPEND QT5_LIBRARIES Qt5QuickTest Qt5Test)
endif()
if(WITH_SCANNER)
list(APPEND QT5_LIBRARIES Qt5Multimedia)
endif()
if(APPLE)
list(APPEND QT5_LIBRARIES Qt5MacExtras)
endif()
if(UNIX)
if(NOT CMAKE_PREFIX_PATH AND DEFINED ENV{CMAKE_PREFIX_PATH})
message(STATUS "Using CMAKE_PREFIX_PATH environment variable: '$ENV{CMAKE_PREFIX_PATH}'")
set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
endif()
if(APPLE AND NOT CMAKE_PREFIX_PATH)
execute_process(COMMAND brew --prefix qt5 OUTPUT_VARIABLE QT5_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
list(APPEND CMAKE_PREFIX_PATH ${QT5_DIR})
execute_process(COMMAND brew --prefix qt OUTPUT_VARIABLE QT6_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
list(APPEND CMAKE_PREFIX_PATH ${QT6_DIR})
endif()
endif()
set(QT_MIN_VERSION "5.12")
set(QT_MIN_VERSION "6.8")
find_package(PkgConfig REQUIRED)
# TODO: drop this once we switch to Qt 5.14+
pkg_check_modules(Qt5QmlModels_PKG_CONFIG QUIET Qt5QmlModels)
if(Qt5QmlModels_PKG_CONFIG_FOUND)
list(APPEND QT5_LIBRARIES Qt5QmlModels)
set(QT_COMPONENTS
Core
Concurrent
Gui
Qml
QmlModels
Quick
QuickControls2
Svg
Widgets
Xml
)
if(QML_TESTS)
list(APPEND QT_COMPONENTS QuickTest Test)
endif()
foreach(QT5_MODULE ${QT5_LIBRARIES})
find_package(${QT5_MODULE} ${QT_MIN_VERSION} REQUIRED)
include_directories(${${QT5_MODULE}_INCLUDE_DIRS})
endforeach()
if(NOT (CMAKE_CROSSCOMPILING AND ANDROID))
pkg_check_modules(QT5_PKG_CONFIG REQUIRED ${QT5_LIBRARIES})
else()
set(QT5_LIBRARIES_ABI)
foreach(QT5_MODULE ${QT5_LIBRARIES})
list(APPEND QT5_LIBRARIES_ABI "${QT5_MODULE}_${CMAKE_ANDROID_ARCH_ABI}")
endforeach()
pkg_check_modules(QT5_PKG_CONFIG REQUIRED ${QT5_LIBRARIES_ABI})
if(WITH_SCANNER)
list(APPEND QT_COMPONENTS Multimedia)
endif()
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS ${QT_COMPONENTS})
get_target_property(QMAKE_IMPORTED_LOCATION Qt5::qmake IMPORTED_LOCATION)
list(TRANSFORM QT_COMPONENTS PREPEND "Qt6::" OUTPUT_VARIABLE QT_LIBRARIES)
get_target_property(QMAKE_IMPORTED_LOCATION Qt6::qmake IMPORTED_LOCATION)
get_filename_component(QT_INSTALL_PREFIX "${QMAKE_IMPORTED_LOCATION}/../.." ABSOLUTE)
if(APPLE AND NOT STATIC)
set(CMAKE_BUILD_RPATH "${QT_INSTALL_PREFIX}/lib")
endif()
if(QT5_PKG_CONFIG_FOUND)
set(QT5_PKG_CONFIG "QT5_PKG_CONFIG")
if(STATIC)
set(QT5_PKG_CONFIG "${QT5_PKG_CONFIG}_STATIC")
endif()
if(UNIX AND CMAKE_PREFIX_PATH)
if(APPLE)
list(JOIN ${QT5_PKG_CONFIG}_LDFLAGS_OTHER " " ${QT5_PKG_CONFIG}_LDFLAGS_OTHER)
endif()
# temporal workaround for https://bugreports.qt.io/browse/QTBUG-80922
STRING(REPLACE "${QT5_PKG_CONFIG_Qt5Core_PREFIX}" "${QT_INSTALL_PREFIX}" ${QT5_PKG_CONFIG}_LDFLAGS_OTHER "${${QT5_PKG_CONFIG}_LDFLAGS_OTHER}")
STRING(REPLACE "${QT5_PKG_CONFIG_Qt5Core_PREFIX}" "${QT_INSTALL_PREFIX}" ${QT5_PKG_CONFIG}_LIBRARIES "${${QT5_PKG_CONFIG}_LIBRARIES}")
STRING(REPLACE "${QT5_PKG_CONFIG_Qt5Core_PREFIX}" "${QT_INSTALL_PREFIX}" ${QT5_PKG_CONFIG}_INCLUDE_DIRS "${${QT5_PKG_CONFIG}_INCLUDE_DIRS}")
STRING(REPLACE "${QT5_PKG_CONFIG_Qt5Core_PREFIX}" "${QT_INSTALL_PREFIX}" ${QT5_PKG_CONFIG}_LIBRARY_DIRS "${${QT5_PKG_CONFIG}_LIBRARY_DIRS}")
endif()
set(QT5_LIBRARIES ${${QT5_PKG_CONFIG}_LIBRARIES} ${${QT5_PKG_CONFIG}_LDFLAGS_OTHER})
include_directories(${${QT5_PKG_CONFIG}_INCLUDE_DIRS})
link_directories(${${QT5_PKG_CONFIG}_LIBRARY_DIRS})
endif()
list(APPEND QT5_LIBRARIES
${Qt5Gui_PLUGINS}
${Qt5Svg_PLUGINS}
${Qt5Qml_PLUGINS}
${Qt5Network_PLUGINS}
)
if(STATIC)
set(QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/Qt/labs/folderlistmodel)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/Qt/labs/settings)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/Qt/labs/platform)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtGraphicalEffects)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtGraphicalEffects/private)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtMultimedia)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQml)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQml/Models.2)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick.2)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Controls)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Controls.2)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Dialogs)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Dialogs/Private)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Layouts)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/PrivateWidgets)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Templates.2)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Window.2)
set(QT5_EXTRA_LIBRARIES_LIST
qtquicktemplates2plugin
Qt5QuickTemplates2
qtquickcontrols2plugin
Qt5QuickControls2
dialogplugin
dialogsprivateplugin
qmlfolderlistmodelplugin
qmlsettingsplugin
qtlabsplatformplugin
qquicklayoutsplugin
modelsplugin
)
if(WITH_SCANNER)
list(APPEND QT5_EXTRA_LIBRARIES_LIST
declarative_multimedia
Qt5MultimediaQuick
)
endif()
list(APPEND QT5_EXTRA_LIBRARIES_LIST
qtgraphicaleffectsplugin
qtgraphicaleffectsprivate
qtquick2plugin
qtquickcontrolsplugin
widgetsplugin
windowplugin
)
if(NOT ${Qt5Core_VERSION} VERSION_LESS 5.14)
list(APPEND QT5_EXTRA_LIBRARIES_LIST qmlplugin)
endif()
set(QT5_EXTRA_LIBRARIES)
foreach(LIBRARY ${QT5_EXTRA_LIBRARIES_LIST})
find_library(${LIBRARY}_LIBRARY ${LIBRARY} PATHS ${QT5_EXTRA_PATHS} REQUIRED)
list(APPEND QT5_EXTRA_LIBRARIES ${${LIBRARY}_LIBRARY})
endforeach()
if(MINGW)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND QT5_EXTRA_LIBRARIES D3D11 Dwrite D2d1)
endif()
endif()
set(QT5_LIBRARIES
${QT5_EXTRA_LIBRARIES}
${QT5_LIBRARIES}
)
set(QT5_INTEGRATION_LIBRARIES_LIST
Qt5EventDispatcherSupport
Qt5PacketProtocol
Qt5ThemeSupport
Qt5FontDatabaseSupport
)
if(UNIX AND NOT APPLE)
list(APPEND QT5_INTEGRATION_LIBRARIES_LIST
Qt5XcbQpa
Qt5ServiceSupport
Qt5GlxSupport
)
elseif(MINGW)
list(APPEND QT5_INTEGRATION_LIBRARIES_LIST qtfreetype)
endif()
foreach(LIBRARY ${QT5_INTEGRATION_LIBRARIES_LIST})
find_library(${LIBRARY}_LIBRARY ${LIBRARY} PATHS ${QT5_EXTRA_PATHS} REQUIRED)
list(APPEND QT5_LIBRARIES ${${LIBRARY}_LIBRARY})
endforeach()
if(UNIX AND NOT APPLE)
pkg_check_modules(X11XCB_XCBGLX REQUIRED x11-xcb xcb-glx)
list(APPEND QT5_LIBRARIES ${X11XCB_XCBGLX_LIBRARIES})
pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
list(APPEND QT5_LIBRARIES ${FONTCONFIG_STATIC_LIBRARIES})
endif()
endif()
if(ANDROID)
set(QT5_EXTRA_LIBRARIES_LIST
GLESv2
log
z
jnigraphics
android
EGL
Qt5VirtualKeyboard_${CMAKE_ANDROID_ARCH_ABI}
c++_shared
)
foreach(LIBRARY ${QT5_EXTRA_LIBRARIES_LIST})
find_library(${LIBRARY}_LIBRARY ${LIBRARY} PATHS "${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/${ANDROID_PLATFORM_LEVEL}" REQUIRED)
list(APPEND QT5_LIBRARIES ${${LIBRARY}_LIBRARY})
endforeach()
endif()
if(MINGW)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt)
# QtCore uses the Windows version-information APIs, but Qt 6.8 does not
# propagate version.lib to consumers.
set(EXTRA_LIBRARIES mswsock ws2_32 iphlpapi crypt32 bcrypt -lversion)
if(DEPENDS)
set(ICU_LIBRARIES icuio icui18n icuuc icudata icutu iconv)
else()
@@ -470,4 +301,86 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_SECURITY_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}")
add_subdirectory(translations)
set(EXECUTABLE_FLAG)
if(MINGW)
set(EXECUTABLE_FLAG WIN32)
set(ICON "${PROJECT_SOURCE_DIR}/images/appicon.ico")
set(ICON_RC "${CMAKE_CURRENT_BINARY_DIR}/icon.rc")
set(ICON_RES "${CMAKE_CURRENT_BINARY_DIR}/icon.o")
file(WRITE "${ICON_RC}" "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"")
find_program(WINDRES_EXECUTABLE
NAMES windres x86_64-w64-mingw32-windres
REQUIRED
CMAKE_FIND_ROOT_PATH_BOTH
)
add_custom_command(
OUTPUT "${ICON_RES}"
COMMAND "${WINDRES_EXECUTABLE}" "${ICON_RC}" "${ICON_RES}"
MAIN_DEPENDENCY "${ICON_RC}"
)
endif()
if(APPLE)
set(ICON "${PROJECT_SOURCE_DIR}/images/appicon.icns")
set_source_files_properties("${ICON}" PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources"
)
endif()
if(NOT ANDROID)
add_executable(monero-wallet-gui ${EXECUTABLE_FLAG} ${ICON} ${ICON_RES})
else()
set(QT_ANDROID_MIN_SDK_VERSION 28 CACHE STRING "Minimum Android API level")
set(QT_ANDROID_TARGET_SDK_VERSION 35 CACHE STRING "Target Android API level")
qt_add_executable(monero-wallet-gui)
set_target_properties(monero-wallet-gui PROPERTIES
QT_ANDROID_MIN_SDK_VERSION "${QT_ANDROID_MIN_SDK_VERSION}"
QT_ANDROID_TARGET_SDK_VERSION "${QT_ANDROID_TARGET_SDK_VERSION}"
)
target_compile_definitions(monero-wallet-gui PRIVATE ANDROID)
endif()
add_subdirectory(src)
include(src/qml-resources.cmake)
qt_policy(SET QTP0004 NEW)
set(QML_MODULE_OPTIONS)
if(MINGW AND NOT CMAKE_GENERATOR MATCHES "Ninja")
message(STATUS "Disabling QML cache generation: MinGW requires the Ninja generator")
list(APPEND QML_MODULE_OPTIONS NO_CACHEGEN)
endif()
qt_add_qml_module(monero-wallet-gui
${QML_MODULE_OPTIONS}
URI MoneroGUI
VERSION 1.0
RESOURCE_PREFIX /
NO_RESOURCE_TARGET_PATH
NO_GENERATE_EXTRA_QMLDIRS
IMPORT_PATH
"${CMAKE_SOURCE_DIR}/fonts"
QML_FILES
${GUI_QML_FILES}
RESOURCES
${GUI_ASSET_FILES}
)
if(STATIC)
qt_import_qml_plugins(monero-wallet-gui)
endif()
if(APPLE AND WITH_SCANNER)
qt_import_plugins(monero-wallet-gui INCLUDE Qt6::QDarwinCameraPermissionPlugin)
target_link_options(monero-wallet-gui PRIVATE "-Wl,-u,_QDarwinCameraPermissionRequest")
endif()
add_custom_command(TARGET monero-wallet-gui POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:daemon>
$<TARGET_FILE_DIR:monero-wallet-gui>
)
install(TARGETS monero-wallet-gui DESTINATION bin)
+4 -32
View File
@@ -1,6 +1,6 @@
# macOS:
Use macOS 10.12 - 10.13 for better backwards compability.
Use macOS 12 for better backwards compability.
1. `HOMEBREW_OPTFLAGS="-march=core2" HOMEBREW_OPTIMIZATION_LEVEL="O0" brew install boost zmq libpgm libsodium expat protobuf@21 libgcrypt hidapi libusb cmake pkg-config && brew link protobuf@21`
@@ -12,9 +12,9 @@ Use macOS 10.12 - 10.13 for better backwards compability.
```bash
mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=Release -D ARCH=default -D CMAKE_PREFIX_PATH=/path/to/Qt5.12.8/5.12.8/clang_64 ..
make
make deploy
cmake -S . -B build -G Ninja -D ARCH=default -D CMAKE_PREFIX_PATH=/path/to/Qt6.8.3/
cmake --build build
cmake --build build --target deploy
```
5. Replace the `monerod` binary inside `monero-wallet-gui.app/Contents/MacOS/` with one built using deterministic builds / gitian.
@@ -45,31 +45,3 @@ You can check if this step worked by using `codesign -dvvv monero-wallet-gui.app
5. `xcrun notarytool info aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee --apple-id email@address.org --team-id XXXXXXXXXX`
6. `xcrun stapler staple -v monero-gui-mac-x64-v0.X.Y.Z.dmg`
## Compile Qt for Apple Silicon
Qt does not offer pre-built binaries for Apple Silicon, they have to be manually compiled.
```bash
git clone https://github.com/qt/qt5.git
cd qt5
git checkout v5.15.9-lts-lgpl
./init-repository
mkdir build
cd build
../configure -prefix /path/to/qt-build-dir/ -opensource -confirm-license -release -nomake examples -nomake tests -no-rpath -skip qtwebengine -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtlocation -skip qtnetworkauth -skip qtpurchasing -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine
make
make install
cd ../qttools/src/linguist/lrelease
../../../../build/qtbase/bin/qmake
make
make install
cd ../../../../qttools/src/macdeployqt/macdeployqt/
../../../../build/qtbase/bin/qmake
make
make install
```
For compilation with Xcode 15 the following patch has to be applied: https://raw.githubusercontent.com/Homebrew/formula-patches/086e8cf/qt5/qt5-qmake-xcode15.patch
The `CMAKE_PREFIX_PATH` has to be set to `/path/to/qt-build-dir/` during monero-gui compilation.
+150 -63
View File
@@ -1,31 +1,39 @@
FROM ubuntu:20.04
FROM debian:bookworm
ARG THREADS=1
ARG ANDROID_NDK_REVISION=23c
ARG ANDROID_NDK_HASH=e5053c126a47e84726d9f7173a04686a71f9a67a
ARG ANDROID_SDK_REVISION=7302050_latest
ARG ANDROID_SDK_HASH=7a00faadc0864f78edd8f4908a629a46d622375cbe2e5814e82934aebecdb622
ARG QT_VERSION=v5.15.19-lts-lgpl
ARG QT_VERSION=v6.8.4-lts-lgpl
ARG QT_COMMIT=487fcaa501534f0906dd2c19714f9052164142fc
ARG ANDROID_NDK_REVISION=27d
ARG ANDROID_NDK_HASH=601246087a682d1944e1e16dd85bc6e49560fe8b6d61255be2829178c8ed15d9
ARG ANDROID_SDK_REVISION=11076708_latest
ARG ANDROID_SDK_HASH=2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258
WORKDIR /opt/android
ENV WORKDIR=/opt/android
ENV ANDROID_NATIVE_API_LEVEL=31
# Native libraries must use the minimum supported API.
ENV ANDROID_NATIVE_API_LEVEL=28
ENV ANDROID_API=android-${ANDROID_NATIVE_API_LEVEL}
ENV ANDROID_TARGET_API_LEVEL=35
ENV ANDROID_CLANG=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang
ENV ANDROID_CLANGPP=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang++
ENV ANDROID_NDK_ROOT=${WORKDIR}/android-ndk-r${ANDROID_NDK_REVISION}
ENV ANDROID_SDK_ROOT=${WORKDIR}/cmdline-tools
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
ENV PATH=${JAVA_HOME}/bin:${PATH}
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
ENV QT_HOST_BUILD=${WORKDIR}/qt-host
ENV QT_HOST_PREFIX=${QT_HOST_BUILD}/qtbase
ENV PATH=${QT_HOST_PREFIX}/bin:${QT_HOST_PREFIX}/libexec:${JAVA_HOME}/bin:${PATH}
ENV PREFIX=${WORKDIR}/prefix
ENV LD_LIBRARY_PATH=${QT_HOST_PREFIX}/lib:${QT_HOST_PREFIX}
ENV TOOLCHAIN_DIR=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y ant automake build-essential ca-certificates-java file gettext git libc6 libncurses5 \
libssl-dev libstdc++6 libtinfo5 libtool libz1 ninja-build openjdk-11-jdk-headless openjdk-11-jre-headless pkg-config python3 \
unzip wget
libdbus-1-3 libegl1 libfontconfig1 libfreetype6 libgl1-mesa-dev libglib2.0-0 libgssapi-krb5-2 libssl-dev \
libstdc++6 libtinfo5 libtool libx11-6 libxkbcommon0 libz1 libzstd1 ninja-build openjdk-17-jdk-headless \
openjdk-17-jre-headless pkg-config python3 unzip wget \
&& rm -rf /var/lib/apt/lists/*
RUN PACKAGE_NAME=commandlinetools-linux-${ANDROID_SDK_REVISION}.zip \
&& wget -q https://dl.google.com/android/repository/${PACKAGE_NAME} \
@@ -35,15 +43,59 @@ RUN PACKAGE_NAME=commandlinetools-linux-${ANDROID_SDK_REVISION}.zip \
RUN PACKAGE_NAME=android-ndk-r${ANDROID_NDK_REVISION}-linux.zip \
&& wget -q https://dl.google.com/android/repository/${PACKAGE_NAME} \
&& echo "${ANDROID_NDK_HASH} ${PACKAGE_NAME}" | sha1sum -c \
&& echo "${ANDROID_NDK_HASH} ${PACKAGE_NAME}" | sha256sum -c \
&& unzip -q ${PACKAGE_NAME} \
&& rm -f ${PACKAGE_NAME}
RUN echo y | ${ANDROID_SDK_ROOT}/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} "build-tools;28.0.3" "platforms;${ANDROID_API}" > /dev/null
RUN yes | ${ANDROID_SDK_ROOT}/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"build-tools;35.0.1" "platforms;android-${ANDROID_TARGET_API_LEVEL}" > /dev/null
# Keep the pinned CMake version in sync with the Linux Docker build.
RUN wget -q https://github.com/Kitware/CMake/releases/download/v4.3.3/cmake-4.3.3-linux-x86_64.tar.gz \
&& echo "927b2368a946c37269c3a66225ab00544e756459cdd0b5d0da438694fb9ff802 cmake-4.3.3-linux-x86_64.tar.gz" | sha256sum -c \
&& tar -xzf cmake-4.3.3-linux-x86_64.tar.gz -C /usr/local --strip-components=1 \
&& rm cmake-4.3.3-linux-x86_64.tar.gz \
&& cmake --version
ENV HOST_PATH=${PATH}
ENV PATH=${TOOLCHAIN_DIR}/aarch64-linux-android/bin:${TOOLCHAIN_DIR}/bin:${PATH}
ARG QT_UNITY_BUILD=ON
RUN git clone https://github.com/qt/qt5.git -b ${QT_VERSION} --depth 1 qt-sources \
&& git -C qt-sources reset --hard ${QT_COMMIT} \
&& mkdir -p "${QT_HOST_BUILD}" \
&& cd "${QT_HOST_BUILD}" \
&& PATH=${HOST_PATH} ../qt-sources/configure -init-submodules \
-submodules qtbase,qtdeclarative,qtshadertools,qttools \
-skip qtactiveqt \
-skip qtlanguageserver \
-skip qtquicktimeline \
-developer-build \
-no-warnings-are-errors \
-opensource \
-confirm-license \
-release \
-no-feature-testlib \
-no-feature-widgets \
-no-feature-qml-debug \
-no-feature-assistant \
-no-feature-clang \
-no-feature-clangcpp \
-no-feature-designer \
-no-feature-distancefieldgenerator \
-no-feature-pixeltool \
-no-feature-qdbus \
-no-feature-qdoc \
-no-feature-qev \
-no-feature-qtattributionsscanner \
-no-feature-qtdiag \
-no-feature-qtplugininfo \
-nomake examples \
-nomake tests \
-- -DQT_UNITY_BUILD="${QT_UNITY_BUILD}" \
&& PATH=${HOST_PATH} cmake --build . --parallel ${THREADS} --target host_tools
ARG ZLIB_VERSION=1.3.1
ARG ZLIB_HASH=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
RUN wget -q https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz \
@@ -56,41 +108,78 @@ RUN wget -q https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zl
&& make -j${THREADS} install \
&& rm -rf $(pwd)
RUN git clone https://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 \
&& cd qt5 \
&& git reset --hard dc2ac680fa9d0ef7b0d9520859593d13951bedea \
&& perl init-repository --module-subset=default,-qtwebengine \
&& PATH=${HOST_PATH} ./configure -v -developer-build -release \
-xplatform android-clang \
-android-ndk-platform ${ANDROID_API} \
-android-ndk ${ANDROID_NDK_ROOT} \
-android-sdk ${ANDROID_SDK_ROOT} \
-android-ndk-host linux-x86_64 \
-no-dbus \
-opengl es2 \
-no-use-gold-linker \
-no-sql-mysql \
-opensource -confirm-license \
-android-arch arm64-v8a \
-prefix ${PREFIX} \
-nomake tools -nomake tests -nomake examples \
-skip qtwebengine \
-skip qtserialport \
-skip qtconnectivity \
-skip qttranslations \
-skip qtpurchasing \
-skip qtgamepad -skip qtscript -skip qtdoc \
-no-warnings-are-errors \
&& PATH=${HOST_PATH} make -j${THREADS} \
&& PATH=${HOST_PATH} make -j${THREADS} install \
&& cd qttools/src/linguist/lrelease \
&& ../../../../qtbase/bin/qmake \
&& PATH=${HOST_PATH} make -j${THREADS} install \
&& cd ../../../.. \
&& rm -rf $(pwd)
# Backport the Android JNI unity exclusions from Qt 6.10.0; remove when updating
# to a Qt version containing https://github.com/qt/qtbase/commit/6f92aada9abd4ec8e83e38eb953e987558af796d.
# Initialize all target modules before patching: initialization rejects dirty submodules.
RUN cd qt-sources \
&& PATH=${HOST_PATH} ./init-repository --force --module-subset=qtbase,qtdeclarative,qtshadertools,qtsvg,qttools,qtmultimedia,-qtquick3d \
&& wget -q -O /tmp/qt-android-unity.patch https://github.com/qt/qtbase/commit/6f92aada9abd4ec8e83e38eb953e987558af796d.patch \
&& echo "5b657c5ddd625336cb3f132cdd92aeba4d2f87c24de7544bb52f5125ed9668ef /tmp/qt-android-unity.patch" | sha256sum -c \
&& git -C qtbase apply /tmp/qt-android-unity.patch \
&& rm /tmp/qt-android-unity.patch
ARG ICONV_VERSION=1.16
ARG ICONV_HASH=e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04
RUN mkdir qt-build-android \
&& cd qt-build-android \
&& PATH=${HOST_PATH} ../qt-sources/configure \
-prefix ${PREFIX} \
-qt-host-path "${QT_HOST_PREFIX}" \
-android-ndk ${ANDROID_NDK_ROOT} \
-android-sdk ${ANDROID_SDK_ROOT} \
-android-abis arm64-v8a \
-android-ndk-platform ${ANDROID_API} \
-no-feature-ffmpeg \
-opensource -confirm-license -release \
-opengl es2 -no-dbus -no-openssl -no-feature-sql \
-skip qtactiveqt \
-skip qtlanguageserver \
-skip qtquicktimeline \
-skip qtquick3d \
-no-feature-http \
-no-feature-ssl \
-no-feature-dtls \
-no-feature-ocsp \
-no-feature-networkproxy \
-no-feature-socks5 \
-no-feature-networkdiskcache \
-no-feature-brotli \
-no-feature-dnslookup \
-no-feature-topleveldomain \
-no-feature-udpsocket \
-no-feature-system-proxies \
-no-feature-sctp \
-no-feature-qml-worker-script \
-no-feature-testlib \
-no-feature-quick-particles \
-no-feature-qml-xmllistmodel \
-no-feature-qml-debug \
-no-feature-quickcontrols2-imagine \
-no-feature-quickcontrols2-universal \
-no-feature-quickcontrols2-fluentwinui3 \
-no-feature-printsupport \
-no-feature-pdf \
-no-feature-vulkan \
-no-feature-sessionmanager \
-no-feature-assistant \
-no-feature-designer \
-no-feature-qdoc \
-no-feature-clang \
-no-feature-clangcpp \
-no-feature-distancefieldgenerator \
-no-feature-pixeltool \
-no-feature-qdbus \
-no-feature-qev \
-no-feature-qtattributionsscanner \
-no-feature-qtdiag \
-no-feature-qtplugininfo \
-nomake examples -nomake tests \
-- -DQT_UNITY_BUILD="${QT_UNITY_BUILD}" \
&& PATH=${HOST_PATH} cmake --build . --parallel ${THREADS} \
&& PATH=${HOST_PATH} cmake --install . \
&& cd .. \
&& rm -rf qt-build-android qt-sources
ARG ICONV_VERSION=1.18
ARG ICONV_HASH=3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8
RUN wget -q https://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz \
&& echo "${ICONV_HASH} libiconv-${ICONV_VERSION}.tar.gz" | sha256sum -c \
&& tar -xzf libiconv-${ICONV_VERSION}.tar.gz \
@@ -198,42 +287,40 @@ RUN git clone -b libgcrypt-1.10.1 --depth 1 https://github.com/gpg/libgcrypt \
&& make -j${THREADS} install \
&& rm -rf $(pwd)
RUN git clone -b v3.31.4 --depth 1 https://github.com/Kitware/CMake \
&& cd CMake \
&& git reset --hard 569b821a138a4d3f7f4cc42c0cf5ae5e68d56f96 \
&& PATH=${HOST_PATH} ./bootstrap \
&& PATH=${HOST_PATH} make -j${THREADS} \
&& PATH=${HOST_PATH} make -j${THREADS} install \
&& rm -rf $(pwd)
# Workaround
# Keep only the SDK components required by androiddeployqt. Moving these out
# of cmdline-tools also avoids sdkmanager treating its own directory as the
# SDK root during deployment.
ENV NEW_SDK_ROOT=${WORKDIR}/sdk
RUN mkdir ${NEW_SDK_ROOT} \
&& cp -r ${ANDROID_SDK_ROOT}/licenses ${NEW_SDK_ROOT} \
&& cp -r ${ANDROID_SDK_ROOT}/platforms ${NEW_SDK_ROOT} \
&& cp -r ${ANDROID_SDK_ROOT}/build-tools ${NEW_SDK_ROOT}
&& cp -r ${ANDROID_SDK_ROOT}/build-tools ${NEW_SDK_ROOT} \
&& rm -rf ${ANDROID_SDK_ROOT} \
&& mv ${NEW_SDK_ROOT} ${ANDROID_SDK_ROOT}
CMD set -ex \
&& git config --global --add safe.directory '*' \
&& cd /monero-gui \
&& mkdir -p build/Android/release \
&& cd build/Android/release \
&& cmake -G Ninja \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" \
&& cmake \
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE="${PREFIX}/lib/cmake/Qt6/qt.toolchain.cmake" \
-DCMAKE_PREFIX_PATH="${PREFIX}" \
-DCMAKE_FIND_ROOT_PATH="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DARCH="armv8-a" \
-DANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL} \
-DANDROID_PLATFORM=${ANDROID_API} \
-DQT_ANDROID_MIN_SDK_VERSION=${ANDROID_NATIVE_API_LEVEL} \
-DQT_ANDROID_TARGET_SDK_VERSION=${ANDROID_TARGET_API_LEVEL} \
-DANDROID_ABI="arm64-v8a" \
-DANDROID_TOOLCHAIN=clang \
-DBoost_USE_STATIC_RUNTIME=ON \
-DLRELEASE_PATH="${PREFIX}/bin" \
-DQT_ANDROID_APPLICATION_BINARY="monero-wallet-gui" \
-DANDROID_SDK="${NEW_SDK_ROOT}" \
-DANDROID_SDK="${ANDROID_SDK_ROOT}" \
-DWITH_SCANNER=ON \
-DWITH_DESKTOP_ENTRY=OFF \
../../.. \
&& PATH=${HOST_PATH} cmake --build . --target generate_translations_header \
&& sed -i -e "/^build .*monero-wallet-gui.*:.*LINKER/,/^$/ { s#monero/external/randomx/librandomx.a##; s#-lm#-lm monero/external/randomx/librandomx.a#; }" build.ninja \
&& cmake --build . --target monero-wallet-gui \
&& cmake --build . --target apk
+78 -104
View File
@@ -1,17 +1,43 @@
FROM ubuntu:18.04
FROM ubuntu:20.04
ARG THREADS=1
ARG QT_VERSION=v5.15.19-lts-lgpl
ARG QT_VERSION=v6.8.4-lts-lgpl
ARG QT_COMMIT=487fcaa501534f0906dd2c19714f9052164142fc
ENV CFLAGS="-fPIC"
ENV CPPFLAGS="-fPIC"
ENV CXXFLAGS="-fPIC"
ENV SOURCE_DATE_EPOCH=1397818193
ENV QT_PREFIX=/depends/x86_64-linux-gnu
ENV PATH="${QT_PREFIX}/bin:${PATH}"
ENV CMAKE_PREFIX_PATH="${QT_PREFIX}"
RUN apt update && \
apt install -y automake autopoint bison gettext git gperf libgl1-mesa-dev libglib2.0-dev ninja-build \
libpng-dev libpthread-stubs0-dev libsodium-dev libtool-bin libudev-dev libusb-1.0-0-dev mesa-common-dev \
pkg-config python wget xutils-dev
DEBIAN_FRONTEND=noninteractive apt install -y \
aria2 automake autopoint bison bzip2 ca-certificates curl gettext git g++ make \
gperf libarchive-tools libgl1-mesa-dev libglib2.0-dev libpng-dev libpthread-stubs0-dev \
libtool-bin libudev-dev mesa-common-dev \
ninja-build pkg-config python3 python-is-python3 wget xutils-dev && \
rm -rf /var/lib/apt/lists/*
RUN git clone -b v0.18.5.1 --depth 1 https://github.com/monero-project/monero && \
cd monero && \
git reset --hard 4f92268d7c16741cfb41e5bbe2aa46cc260a9ea5 && \
cp -a contrib/depends / && \
cd .. && \
rm -rf monero
RUN make -j"$THREADS" -C /depends HOST=x86_64-linux-gnu
# Use the pinned upstream CMake binary without changing the compiler or glibc
# baseline. The Linux x86_64 binaries require glibc 2.17 or newer.
RUN wget -q https://github.com/Kitware/CMake/releases/download/v4.3.3/cmake-4.3.3-linux-x86_64.tar.gz && \
echo "927b2368a946c37269c3a66225ab00544e756459cdd0b5d0da438694fb9ff802 cmake-4.3.3-linux-x86_64.tar.gz" | sha256sum -c && \
tar -xzf cmake-4.3.3-linux-x86_64.tar.gz -C /usr/local --strip-components=1 && \
rm cmake-4.3.3-linux-x86_64.tar.gz && \
cmake --version
RUN git clone -b xorgproto-2020.1 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xorgproto && \
cd xorgproto && \
@@ -21,9 +47,9 @@ RUN git clone -b xorgproto-2020.1 --depth 1 https://gitlab.freedesktop.org/xorg/
make -j$THREADS install && \
rm -rf $(pwd)
RUN git clone -b 1.12 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xcbproto && \
RUN git clone -b xcb-proto-1.17.0 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xcbproto && \
cd xcbproto && \
git reset --hard 6398e42131eedddde0d98759067dde933191f049 && \
git reset --hard 77d7fc04da729ddc5ed4aacf30253726fac24dca && \
./autogen.sh && \
make -j$THREADS && \
make -j$THREADS install && \
@@ -37,9 +63,9 @@ RUN git clone -b libXau-1.0.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/
make -j$THREADS install && \
rm -rf $(pwd)
RUN git clone -b 1.12 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb && \
RUN git clone -b libxcb-1.17.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb && \
cd libxcb && \
git reset --hard d34785a34f28fa6a00f8ce00d87e3132ff0f6467 && \
git reset --hard 622152ee42a310876f10602601206954b8d0613e && \
./autogen.sh --enable-shared --disable-static && \
make -j$THREADS && \
make -j$THREADS install && \
@@ -156,96 +182,61 @@ RUN git clone -b release-64-2 --depth 1 https://github.com/unicode-org/icu && \
make -j$THREADS install && \
rm -rf $(pwd)
RUN wget https://archives.boost.io/release/1.80.0/source/boost_1_80_0.tar.gz && \
echo "4b2136f98bdd1f5857f1c3dea9ac2018effe65286cf251534b6ae20cc45e1847 boost_1_80_0.tar.gz" | sha256sum -c && \
tar -xzf boost_1_80_0.tar.gz && \
rm boost_1_80_0.tar.gz && \
cd boost_1_80_0 && \
./bootstrap.sh && \
./b2 --with-atomic --with-system --with-filesystem --with-thread --with-date_time --with-chrono --with-regex --with-serialization --with-program_options --with-locale variant=release link=static runtime-link=static cflags="${CFLAGS}" cxxflags="${CXXFLAGS}" install -a --prefix=/usr && \
rm -rf $(pwd)
RUN wget https://www.openssl.org/source/openssl-1.1.1u.tar.gz && \
echo "e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6 openssl-1.1.1u.tar.gz" | sha256sum -c && \
tar -xzf openssl-1.1.1u.tar.gz && \
rm openssl-1.1.1u.tar.gz && \
cd openssl-1.1.1u && \
./config no-shared no-zlib-dynamic --prefix=/usr --openssldir=/usr && \
RUN git clone -b xcb-util-cursor-0.1.4 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-cursor && \
cd libxcb-cursor && \
git reset --hard 3d7e713e85af18d7e52cafdc9d20a2715048dee7 && \
git submodule init && \
git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \
git -C m4 reset --hard c617eee22ae5c285e79e81ec39ce96862fd3262f && \
./autogen.sh --enable-shared --disable-static && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
RUN wget https://www.nlnetlabs.nl/downloads/unbound/unbound-1.16.2.tar.gz && \
echo "2e32f283820c24c51ca1dd8afecfdb747c7385a137abe865c99db4b257403581 unbound-1.16.2.tar.gz" | sha256sum -c && \
tar -xzf unbound-1.16.2.tar.gz && \
rm unbound-1.16.2.tar.gz && \
cd unbound-1.16.2 && \
./configure --disable-shared --enable-static --without-pyunbound --with-libexpat=/usr --with-ssl=/usr --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only --with-pic && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
# CMake's FindFontconfig target does not expose the private dependencies of a
# static Fontconfig build. Bundle them so Qt tools and downstream static links
# do not depend on library ordering or pkg-config-specific metadata.
RUN printf 'create /tmp/libfontconfig.a\naddlib /usr/local/lib/libfontconfig.a\naddlib /usr/local/lib/libfreetype.a\naddlib /usr/lib/libexpat.a\nsave\nend\n' | ar -M && \
mv /tmp/libfontconfig.a /usr/local/lib/libfontconfig.a && \
ldconfig
RUN rm /usr/lib/x86_64-linux-gnu/libX11.a && \
rm /usr/lib/x86_64-linux-gnu/libXext.a && \
rm /usr/lib/x86_64-linux-gnu/libX11-xcb.a && \
git clone https://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \
cd qt5 && \
git reset --hard dc2ac680fa9d0ef7b0d9520859593d13951bedea && \
git submodule update --init --depth 1 qtbase qtdeclarative qtgraphicaleffects qtimageformats qtmultimedia qtquickcontrols qtquickcontrols2 qtsvg qttools qttranslations qtx11extras && \
ARG QT_UNITY_BUILD=ON
RUN rm -f /usr/lib/x86_64-linux-gnu/libX11.a \
/usr/lib/x86_64-linux-gnu/libXext.a \
/usr/lib/x86_64-linux-gnu/libX11-xcb.a && \
git clone https://github.com/qt/qt5.git -b ${QT_VERSION} --depth 1 qt-sources && \
git -C qt-sources reset --hard ${QT_COMMIT} && \
sed -ri s/\(Libs:.*\)/\\1\ -lexpat/ /usr/local/lib/pkgconfig/fontconfig.pc && \
sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \
sed -ri s/\(Libs:.*\)/\\1\ -lXau/ /usr/local/lib/pkgconfig/xcb.pc && \
sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf && \
./configure --prefix=/usr -platform linux-g++-64 -opensource -confirm-license -release -static -no-avx \
-opengl desktop -qpa xcb -xcb -xcb-xlib -feature-xlib -system-freetype -fontconfig -glib \
-no-dbus -no-feature-qml-worker-script -no-linuxfb -no-openssl -no-sql-sqlite -no-kms -no-use-gold-linker \
-qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \
-skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \
-skip qtdoc -skip qtgamepad -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing \
-skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools \
-skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview \
-skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine \
-nomake examples -nomake tests -nomake tools && \
make -j$THREADS && \
make -j$THREADS install && \
cd qttools/src/linguist/lrelease && \
../../../../qtbase/bin/qmake && \
make -j$THREADS && \
make -j$THREADS install && \
cd ../../../.. && \
rm -rf $(pwd)
RUN git clone -b v1.0.26 --depth 1 https://github.com/libusb/libusb && \
cd libusb && \
git reset --hard 4239bc3a50014b8e6a5a2a59df1fff3b7469543b && \
./autogen.sh --disable-shared --enable-static && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
RUN git clone -b hidapi-0.15.0 --depth 1 https://github.com/libusb/hidapi && \
cd hidapi && \
git reset --hard d6b2a974608dec3b76fb1e36c189f22b9cf3650c && \
./bootstrap && \
./configure --disable-shared --enable-static && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
RUN git clone -b v4.3.4 --depth 1 https://github.com/zeromq/libzmq && \
cd libzmq && \
git reset --hard 4097855ddaaa65ed7b5e8cb86d143842a594eebd && \
./autogen.sh && \
./configure --disable-shared --enable-static --disable-libunwind --with-libsodium && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
mkdir qt-build && \
cd qt-build && \
../qt-sources/configure -init-submodules \
-submodules qtbase,qtdeclarative,qtshadertools,qtsvg,qttools \
-prefix ${QT_PREFIX} -opensource -confirm-license -release -static -no-avx \
-opengl desktop -xcb -no-feature-xlib -system-freetype -fontconfig -no-feature-eglfs -no-glib \
-no-dbus -no-feature-qml-worker-script -no-feature-linuxfb -no-openssl -no-feature-sql -no-feature-kms \
-no-feature-testlib -no-feature-quick-particles -no-feature-qml-xmllistmodel -no-feature-qml-debug \
-no-feature-quickcontrols2-imagine -no-feature-quickcontrols2-universal -no-feature-quickcontrols2-fluentwinui3 \
-no-feature-printsupport -no-feature-pdf -no-feature-vulkan -no-feature-sessionmanager -no-feature-gtk3 \
-no-feature-assistant -no-feature-clang -no-feature-clangcpp -no-feature-qdoc -no-feature-designer -no-feature-distancefieldgenerator \
-no-feature-pixeltool -no-feature-qdbus -no-feature-qtattributionsscanner -no-feature-qtdiag -no-feature-qtplugininfo \
-no-feature-http -no-feature-ssl -no-feature-dtls -no-feature-ocsp -no-feature-networkproxy -no-feature-socks5 -no-feature-networkdiskcache \
-no-feature-brotli -no-feature-dnslookup -no-feature-topleveldomain -no-feature-udpsocket -no-feature-system-proxies \
-no-feature-sctp -skip qtactiveqt -skip qtlanguageserver -skip qtquicktimeline -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \
-nomake examples -nomake tests \
-- -DQT_UNITY_BUILD="${QT_UNITY_BUILD}" && \
cmake --build . --parallel $THREADS && \
cmake --install . && \
cd .. && \
rm -rf qt-build qt-sources
RUN git clone -b libgpg-error-1.45 --depth 1 https://github.com/gpg/libgpg-error && \
cd libgpg-error && \
git reset --hard dbac537e5e865fb6f3aa8596d213aa8c47a9dea1 && \
./autogen.sh && \
./configure --disable-shared --enable-static --disable-doc --disable-tests && \
./configure --disable-shared --enable-static --disable-doc --disable-tests --prefix="${QT_PREFIX}" && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
@@ -254,24 +245,7 @@ RUN git clone -b libgcrypt-1.10.1 --depth 1 https://github.com/gpg/libgcrypt &&
cd libgcrypt && \
git reset --hard ae0e567820c37f9640440b3cff77d7c185aa6742 && \
./autogen.sh && \
./configure --disable-shared --enable-static --disable-doc && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
RUN git clone -b v21.5 --depth 1 https://github.com/protocolbuffers/protobuf && \
cd protobuf && \
git reset --hard ab840345966d0fa8e7100d771c92a73bfbadd25c && \
./autogen.sh && \
./configure --enable-static --disable-shared && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
RUN git clone -b v3.24.0 --depth 1 https://github.com/Kitware/CMake && \
cd CMake && \
git reset --hard 4be24f031a4829db75b85062cc67125035d8831e && \
./bootstrap && \
./configure --disable-shared --enable-static --disable-doc --with-gpg-error-prefix="${QT_PREFIX}" --prefix="${QT_PREFIX}" && \
make -j$THREADS && \
make -j$THREADS install && \
rm -rf $(pwd)
+163 -41
View File
@@ -1,16 +1,48 @@
FROM ubuntu:20.04
FROM ubuntu:24.04
ARG THREADS=1
ARG QT_VERSION=v5.15.19-lts-lgpl
ARG QT_VERSION=v6.8.4-lts-lgpl
ARG QT_COMMIT=487fcaa501534f0906dd2c19714f9052164142fc
ENV SOURCE_DATE_EPOCH=1397818193
ENV QT_HOST_BUILD=/opt/qt-host
ENV QT_HOST_PREFIX=${QT_HOST_BUILD}/qtbase
ENV LD_LIBRARY_PATH=${QT_HOST_PREFIX}/lib:${QT_HOST_PREFIX}
ENV QT_TARGET_PREFIX=/depends/x86_64-w64-mingw32
ENV PATH=${QT_HOST_PREFIX}/bin:${QT_HOST_PREFIX}/libexec:${PATH}
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y build-essential cmake g++-mingw-w64 gettext git libtool ninja-build pkg-config \
python && \
DEBIAN_FRONTEND=noninteractive apt install -y \
autoconf \
automake \
autopoint \
bison \
build-essential \
ca-certificates \
cmake \
curl \
flex \
g++-mingw-w64 \
gettext \
git \
gperf \
libdbus-1-3 \
libfontconfig1-dev \
libglib2.0-0 \
libgl1-mesa-dev \
libgssapi-krb5-2 \
libtool \
libxkbcommon0 \
ninja-build \
perl \
pkg-config \
python3 \
python-is-python3 \
xz-utils && \
rm -rf /var/lib/apt/lists/*
RUN update-alternatives --set x86_64-w64-mingw32-g++ $(which x86_64-w64-mingw32-g++-posix) && \
update-alternatives --set x86_64-w64-mingw32-gcc $(which x86_64-w64-mingw32-gcc-posix)
RUN update-alternatives --set x86_64-w64-mingw32-g++ "$(which x86_64-w64-mingw32-g++-posix)" && \
update-alternatives --set x86_64-w64-mingw32-gcc "$(which x86_64-w64-mingw32-gcc-posix)"
RUN git clone -b v0.18.5.3 --depth 1 https://github.com/monero-project/monero && \
cd monero && \
@@ -19,44 +51,130 @@ RUN git clone -b v0.18.5.3 --depth 1 https://github.com/monero-project/monero &&
cd .. && \
rm -rf monero
RUN make -j$THREADS -C /depends HOST=x86_64-w64-mingw32 NO_QT=1
RUN make -j"$THREADS" -C /depends HOST=x86_64-w64-mingw32
RUN git clone https://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \
cd qt5 && \
git reset --hard dc2ac680fa9d0ef7b0d9520859593d13951bedea && \
git submodule update --init --depth 1 qtbase qtdeclarative qtgraphicaleffects qtimageformats qtmultimedia qtquickcontrols qtquickcontrols2 qtsvg qttools qttranslations && \
./configure --prefix=/depends/x86_64-w64-mingw32 -xplatform win32-g++ \
ARG QT_UNITY_BUILD=ON
RUN git clone https://github.com/qt/qt5.git -b "${QT_VERSION}" --depth 1 qt-sources && \
git -C qt-sources reset --hard "${QT_COMMIT}" && \
mkdir -p "${QT_HOST_BUILD}" && \
cd "${QT_HOST_BUILD}" && \
/qt-sources/configure -init-submodules \
-submodules qtbase,qtdeclarative,qtshadertools,qttools \
-skip qtactiveqt \
-skip qtlanguageserver \
-skip qtquicktimeline \
-developer-build \
-no-warnings-are-errors \
-opensource \
-confirm-license \
-release \
-no-feature-testlib \
-no-feature-widgets \
-no-feature-qml-debug \
-no-feature-assistant \
-no-feature-clang \
-no-feature-clangcpp \
-no-feature-designer \
-no-feature-distancefieldgenerator \
-no-feature-pixeltool \
-no-feature-qdbus \
-no-feature-qdoc \
-no-feature-qev \
-no-feature-qtattributionsscanner \
-no-feature-qtdiag \
-no-feature-qtplugininfo \
-nomake examples \
-nomake tests \
-- -DQT_UNITY_BUILD="${QT_UNITY_BUILD}" && \
cmake --build . --parallel "$THREADS" --target host_tools && \
mkdir /qt-target-build && \
cd /qt-target-build && \
/qt-sources/configure -init-submodules \
-submodules qtbase,qtdeclarative,qtshadertools,qtsvg,qttools \
-skip qtactiveqt \
-skip qtlanguageserver \
-skip qtquicktimeline \
-prefix "${QT_TARGET_PREFIX}" \
-qt-host-path "${QT_HOST_PREFIX}" \
-xplatform win32-g++ \
-device-option CROSS_COMPILE=/usr/bin/x86_64-w64-mingw32- \
-I $(pwd)/qtbase/src/3rdparty/angle/include \
-opensource -confirm-license -release -static -static-runtime -opengl dynamic -no-angle \
-no-avx -no-openssl -no-sql-sqlite \
-no-feature-qml-worker-script -no-openssl -no-sql-sqlite \
-qt-freetype -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \
-skip gamepad -skip location -skip qt3d -skip qtactiveqt -skip qtandroidextras \
-skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdoc \
-skip qtgamepad -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing \
-skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \
-skip qtspeech -skip qttools -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel \
-skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras \
-skip serialbus -skip webengine \
-nomake examples -nomake tests -nomake tools && \
make -j$THREADS && \
make -j$THREADS install && \
cd qttools/src/linguist/lrelease && \
../../../../qtbase/bin/qmake && \
make -j$THREADS && \
make -j$THREADS install && \
cd ../../../.. && \
rm -rf $(pwd)
-opensource \
-confirm-license \
-release \
-static \
-static-runtime \
-opengl dynamic \
-no-avx \
-no-openssl \
-no-feature-sql \
-no-feature-http \
-no-feature-ssl \
-no-feature-dtls \
-no-feature-ocsp \
-no-feature-networkproxy \
-no-feature-socks5 \
-no-feature-networkdiskcache \
-no-feature-brotli \
-no-feature-dnslookup \
-no-feature-topleveldomain \
-no-feature-udpsocket \
-no-feature-system-proxies \
-no-feature-sctp \
-no-feature-schannel \
-no-feature-qml-worker-script \
-no-feature-testlib \
-no-feature-quick-particles \
-no-feature-qml-xmllistmodel \
-no-feature-qml-debug \
-no-feature-quickcontrols2-imagine \
-no-feature-quickcontrols2-universal \
-no-feature-quickcontrols2-fluentwinui3 \
-no-feature-printsupport \
-no-feature-pdf \
-no-feature-vulkan \
-no-feature-sessionmanager \
-no-feature-assistant \
-no-feature-designer \
-no-feature-qdoc \
-no-feature-clang \
-no-feature-clangcpp \
-no-feature-distancefieldgenerator \
-no-feature-pixeltool \
-no-feature-qdbus \
-no-feature-qev \
-no-feature-qtattributionsscanner \
-no-feature-qtdiag \
-no-feature-qtplugininfo \
-qt-freetype \
-qt-harfbuzz \
-qt-libjpeg \
-qt-libpng \
-qt-pcre \
-qt-zlib \
-nomake examples \
-nomake tests \
-- \
-DQT_UNITY_BUILD="${QT_UNITY_BUILD}" \
-DCMAKE_TOOLCHAIN_FILE=/depends/x86_64-w64-mingw32/share/toolchain.cmake && \
cmake --build . --parallel "$THREADS" && \
cmake --install . && \
cd / && \
rm -rf qt-target-build qt-sources
RUN git clone -b libgpg-error-1.38 --depth 1 https://github.com/gpg/libgpg-error && \
cd libgpg-error && \
git reset --hard 71d278824c5fe61865f7927a2ed1aa3115f9e439 && \
./autogen.sh && \
./configure --disable-shared --enable-static --disable-doc --disable-tests \
--host=x86_64-w64-mingw32 --prefix=/depends/x86_64-w64-mingw32 && \
make -j$THREADS && \
make -j$THREADS install && \
./configure \
--disable-shared \
--enable-static \
--disable-doc \
--disable-tests \
--host=x86_64-w64-mingw32 \
--prefix=/depends/x86_64-w64-mingw32 && \
make -j"$THREADS" && \
make -j"$THREADS" install && \
cd .. && \
rm -rf libgpg-error
@@ -64,10 +182,14 @@ RUN git clone -b libgcrypt-1.8.5 --depth 1 https://github.com/gpg/libgcrypt && \
cd libgcrypt && \
git reset --hard 56606331bc2a80536db9fc11ad53695126007298 && \
./autogen.sh && \
./configure --disable-shared --enable-static --disable-doc \
--host=x86_64-w64-mingw32 --prefix=/depends/x86_64-w64-mingw32 \
./configure \
--disable-shared \
--enable-static \
--disable-doc \
--host=x86_64-w64-mingw32 \
--prefix=/depends/x86_64-w64-mingw32 \
--with-gpg-error-prefix=/depends/x86_64-w64-mingw32 && \
make -j$THREADS && \
make -j$THREADS install && \
make -j"$THREADS" && \
make -j"$THREADS" install && \
cd .. && \
rm -rf libgcrypt
+15 -14
View File
@@ -26,13 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import QtQuick
import QtQuick.Effects
import moneroComponents.Wallet 1.0
import moneroComponents.NetworkType 1.0
import moneroComponents.Clipboard 1.0
import FontAwesome 1.0
import "components" as MoneroComponents
import "components/effects/" as MoneroEffects
@@ -106,6 +104,9 @@ Rectangle {
anchors.topMargin: (persistentSettings.customDecorations)? 50 : 0
Item {
width: parent.width
height: parent.height
Item {
anchors.left: parent.left
anchors.top: parent.top
@@ -116,23 +117,23 @@ Rectangle {
Image {
id: card
visible: !isOpenGL || MoneroComponents.Style.blackTheme
visible: GraphicsInfo.api === GraphicsInfo.Software || MoneroComponents.Style.blackTheme
width: 260
height: 135
fillMode: Image.PreserveAspectFit
source: MoneroComponents.Style.blackTheme ? "qrc:///images/card-background-black" + (currentAccountIndex % MoneroComponents.Style.accountColors.length) + ".png" : "qrc:///images/card-background-white.png"
}
DropShadow {
visible: isOpenGL && !MoneroComponents.Style.blackTheme
MultiEffect {
visible: GraphicsInfo.api !== GraphicsInfo.Software && !MoneroComponents.Style.blackTheme
anchors.fill: card
horizontalOffset: 3
verticalOffset: 3
radius: 10.0
samples: 15
color: "#3B000000"
source: card
cached: true
shadowEnabled: true
shadowHorizontalOffset: 3
shadowVerticalOffset: 3
shadowBlur: 0.625
blurMax: 16
shadowColor: "#3B000000"
}
MoneroComponents.TextPlain {
@@ -308,7 +309,7 @@ Rectangle {
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: balancePart1MouseArea.clicked(mouse)
onClicked: (mouse) => balancePart1MouseArea.clicked(mouse)
}
}
+13 -28
View File
@@ -27,12 +27,10 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQml 2.0
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import QtQml
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import moneroComponents.Wallet 1.0
import "./pages"
@@ -98,8 +96,13 @@ Rectangle {
}
previousView = currentView
if (currentView) {
stackView.replace(currentView)
// Component.onCompleted is called before wallet is initilized
if (stackView.currentItem !== currentView) {
if (stackView.depth > 0) {
stackView.replace(currentView)
} else {
stackView.push(currentView)
}
}
if (typeof currentView.onPageCompleted === "function") {
currentView.onPageCompleted();
}
@@ -191,6 +194,8 @@ Rectangle {
anchors.bottom: parent.bottom
anchors.bottomMargin: persistentSettings.customDecorations ? 15 : 10
onActiveChanged: if (!active && !isMac) active = true
palette.mid: "#8E8E93"
palette.dark: "#B8B8BD"
}
onFlickingChanged: {
@@ -204,26 +209,6 @@ Rectangle {
anchors.fill:parent
clip: true // otherwise animation will affect left panel
delegate: StackViewDelegate {
pushTransition: StackViewTransition {
PropertyAnimation {
target: enterItem
property: "x"
from: 0 - target.width
to: 0
duration: 300
easing.type: Easing.OutCubic
}
PropertyAnimation {
target: exitItem
property: "x"
from: 0
to: target.width
duration: 300
easing.type: Easing.OutCubic
}
}
}
}
}// flickable
+47 -17
View File
@@ -94,7 +94,7 @@ Packaging for your favorite distribution would be a welcome contribution!
## Compiling the Monero GUI from source
*Note*: Qt 5.12 is the minimum version required to build the GUI.
*Note*: Qt 6.8 is the minimum version required to build the GUI.
*Note*: Official GUI releases use monero-wallet-gui from this process alongside the supporting binaries (monerod, etc) from the [CLI deterministic builds](https://github.com/monero-project/monero/blob/release-v0.18/contrib/gitian/README.md).
@@ -138,17 +138,22 @@ Packaging for your favorite distribution would be a welcome contribution!
```
\* `4` - number of CPU threads to use
The image builds the non-Qt dependencies with Monero's `contrib/depends`
system and installs Qt into the resulting `/depends/x86_64-linux-gnu`
prefix.
4. Build
```
docker run --rm -it -v <MONERO_GUI_DIR_FULL_PATH>:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make release-static'
docker run --rm -it -v <MONERO_GUI_DIR_FULL_PATH>:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make depends root=/depends target=x86_64-linux-gnu tag=linux-x64'
```
\* `<MONERO_GUI_DIR_FULL_PATH>` - absolute path to `monero-gui` directory
\* Set `CMAKE_BUILD_PARALLEL_LEVEL` to control the number of parallel build jobs, e.g. add `-e CMAKE_BUILD_PARALLEL_LEVEL=4` to the `docker run` command
5. Monero GUI Linux static binary will be placed in `monero-gui/build/release/bin` directory
5. Monero GUI Linux static binary will be placed in `monero-gui/build/x86_64-linux-gnu/release/bin` directory
6. (*Note*) This process is only for building `monero-wallet-gui`, `monerod` has to be built separately according to the instructions in the `monero` repository.
7. (*Optional*) Compare `monero-wallet-gui` SHA-256 hash to the one obtained from a trusted source
```
docker run --rm -it -v <MONERO_GUI_DIR_FULL_PATH>:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'shasum -a 256 /monero-gui/build/release/bin/monero-wallet-gui'
docker run --rm -it -v <MONERO_GUI_DIR_FULL_PATH>:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'shasum -a 256 /monero-gui/build/x86_64-linux-gnu/release/bin/monero-wallet-gui'
```
\* `<MONERO_GUI_DIR_FULL_PATH>` - absolute path to `monero-gui` directory
@@ -201,9 +206,34 @@ Packaging for your favorite distribution would be a welcome contribution!
http://<your.local.ip>:8080/QtApp-debug.apk
```
### Building on Linux
### Comparing Docker Qt build times
(Tested on Ubuntu 17.10 x64, Ubuntu 18.04 x64 and Gentoo x64)
`Dockerfile.linux`, `Dockerfile.windows`, and `Dockerfile.android` enable Qt unity
builds by default. Add `--build-arg QT_UNITY_BUILD=OFF` to disable them, or
`--build-arg QT_UNITY_BUILD=ON` to enable them explicitly. Use the same setting
when comparing reproducible binary hashes.
To compare fresh Qt builds, run both variants sequentially on the same builder
with the same CPU and memory allocation, thread count, and platform. For example,
from the repository root on an amd64 builder:
```sh
docker build --no-cache --progress=plain --platform linux/amd64 \
--build-arg THREADS=4 --build-arg QT_UNITY_BUILD=OFF \
--tag monero:build-env-linux-unity-off --file Dockerfile.linux . \
> qt-unity-off.log 2>&1
docker build --no-cache --progress=plain --platform linux/amd64 \
--build-arg THREADS=4 --build-arg QT_UNITY_BUILD=ON \
--tag monero:build-env-linux-unity-on --file Dockerfile.linux . \
> qt-unity-on.log 2>&1
```
Compare the Qt build step durations in the two logs as well as total image build
time; downloads and other dependencies can affect the total. For Windows or
Android, substitute the corresponding Dockerfile and image tags, and include
both the host-tools and target Qt build steps in the comparison.
### Building on Linux
1. Install Monero dependencies
@@ -221,32 +251,32 @@ Packaging for your favorite distribution would be a welcome contribution!
2. Install Qt:
*Note*: The Qt 5.12 or newer requirement makes **some** distributions (mostly based on Debian, like Ubuntu 16.x or Linux Mint 18.x) obsolete due to their repositories containing an older Qt version.
*Note*: The Qt 6.8 or newer requirement makes **some** distributions obsolete due to their repositories containing an older Qt version.
The recommended way is to install 5.12 or newer from the [official Qt installer](https://www.qt.io/download-qt-installer) or [compiling it yourself](https://wiki.qt.io/Install_Qt_5_on_Ubuntu). This ensures you have the correct version. Higher versions *can* work but as it differs from our production build target, slight differences may occur.
The recommended way is to install 6.8 or newer from the [official Qt installer](https://www.qt.io/download-qt-installer) or [compiling it yourself](https://doc.qt.io/qt-6/build-sources.html). This ensures you have the correct version. Higher versions *can* work but as it differs from our production build target, slight differences may occur.
The following instructions will fetch Qt from your distribution's repositories instead. Take note of what version it installs. Your mileage may vary.
- For Debian distributions (Debian, Ubuntu, Mint, Tails...)
`sudo apt install qtbase5-dev qtdeclarative5-dev qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-platform qml-module-qt-labs-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev`
`sudo apt install qt6-base-dev qt6-declarative-dev qt6-svg-dev qt6-tools-dev qt6-tools-dev-tools qml6-module-qtcore qml6-module-qtqml qml6-module-qtqml-models qml6-module-qtquick qml6-module-qtquick-controls qml6-module-qtquick-dialogs qml6-module-qtquick-effects qml6-module-qtquick-layouts qml6-module-qtquick-shapes qml6-module-qtquick-window qml6-module-qt-labs-folderlistmodel qml6-module-qt-labs-platform`
- For Gentoo
The *qml* USE flag must be enabled.
`sudo emerge dev-qt/qtcore:5 dev-qt/qtdeclarative:5 dev-qt/qtquickcontrols:5 dev-qt/qtquickcontrols2:5 dev-qt/qtgraphicaleffects:5`
`sudo emerge dev-qt/qtbase:6 dev-qt/qtdeclarative:6 dev-qt/qtsvg:6 dev-qt/qttools:6`
- Optional : To build the flag `WITH_SCANNER`
- For Debian distributions (Debian, Ubuntu, Mint, Tails...)
`sudo apt install qtmultimedia5-dev qml-module-qtmultimedia`
`sudo apt install qt6-multimedia-dev qml6-module-qtmultimedia`
- For Gentoo
`emerge dev-qt/qtmultimedia:5`
`emerge dev-qt/qtmultimedia:6`
3. Clone repository
@@ -262,7 +292,7 @@ The following instructions will fetch Qt from your distribution's repositories i
make release
```
\* Add `CMAKE_PREFIX_PATH` environment variable to set a custom Qt install directory, e.g. `CMAKE_PREFIX_PATH=$HOME/Qt/5.9.7/gcc_64 make release`
\* Add `CMAKE_PREFIX_PATH` environment variable to set a custom Qt install directory, e.g. `CMAKE_PREFIX_PATH=$HOME/Qt/6.8.3/gcc_64 make release`
\* Set `CMAKE_BUILD_PARALLEL_LEVEL` to control the number of parallel build jobs, e.g. `CMAKE_BUILD_PARALLEL_LEVEL=4 make release`
The executable can be found in the build/release/bin folder.
@@ -279,7 +309,7 @@ The executable can be found in the build/release/bin folder.
4. Install Qt:
`brew install qt5` (or download QT 5.12+ from [qt.io](https://www.qt.io/download-open-source/))
`brew install qt` (or download Qt 6.8+ from [qt.io](https://www.qt.io/download-open-source/))
5. Grab an up-to-date copy of the monero-gui repository
@@ -293,7 +323,7 @@ The executable can be found in the build/release/bin folder.
```
make release
```
\* Add `CMAKE_PREFIX_PATH` environment variable to set a custom Qt install directory, e.g. `CMAKE_PREFIX_PATH=$HOME/Qt/5.9.7/clang_64 make release`
\* Add `CMAKE_PREFIX_PATH` environment variable to set a custom Qt install directory, e.g. `CMAKE_PREFIX_PATH=$HOME/Qt/6.8.3/macos make release`
\* Set `CMAKE_BUILD_PARALLEL_LEVEL` to control the number of parallel build jobs, e.g. `CMAKE_BUILD_PARALLEL_LEVEL=4 make release`
The executable can be found in the `build/release/bin` folder.
@@ -316,10 +346,10 @@ The Monero GUI on Windows is 64 bits only; 32-bit Windows GUI builds are not off
You find more details about those dependencies in the [Monero documentation](https://github.com/monero-project/monero). Note that that there is no more need to compile Boost from source; like everything else, you can install it now with a MSYS2 package.
4. Install Qt5
4. Install Qt6
```
pacman -S mingw-w64-x86_64-qt5
pacman -S mingw-w64-x86_64-qt6-base mingw-w64-x86_64-qt6-declarative mingw-w64-x86_64-qt6-svg mingw-w64-x86_64-qt6-tools
```
There is no more need to download some special installer from the Qt website, the standard MSYS2 package for Qt will do in almost all circumstances.
+32
View File
@@ -0,0 +1,32 @@
if(NOT DEFINED EXECUTABLE)
message(FATAL_ERROR "EXECUTABLE is not set")
endif()
if(NOT DEFINED INSTALL_NAME_TOOL)
set(INSTALL_NAME_TOOL install_name_tool)
endif()
execute_process(
COMMAND otool -l "${EXECUTABLE}"
OUTPUT_VARIABLE _otool_output
RESULT_VARIABLE _otool_result
)
if(NOT _otool_result EQUAL 0)
message(FATAL_ERROR "Failed to read rpaths from ${EXECUTABLE}")
endif()
string(REGEX MATCHALL "path (/opt/homebrew|/usr/local)[^ \n]*" _homebrew_rpath_lines "${_otool_output}")
foreach(_line IN LISTS _homebrew_rpath_lines)
string(REGEX REPLACE "^path " "" _rpath "${_line}")
message(STATUS "Deleting Homebrew rpath: ${_rpath}")
execute_process(
COMMAND "${INSTALL_NAME_TOOL}" -delete_rpath "${_rpath}" "${EXECUTABLE}"
RESULT_VARIABLE _delete_result
OUTPUT_QUIET
ERROR_QUIET
)
endforeach()
+65 -36
View File
@@ -1,45 +1,66 @@
if(APPLE OR (WIN32 AND NOT STATIC))
add_custom_target(deploy)
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
if(APPLE AND NOT IOS)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
add_custom_command(TARGET deploy
POST_BUILD
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "$<TARGET_FILE_DIR:monero-wallet-gui>/../.." -always-overwrite -qmldir="${CMAKE_SOURCE_DIR}"
COMMENT "Running macdeployqt..."
)
# workaround for a Qt bug that requires manually adding libqsvg.dylib to bundle
find_file(_qt_svg_dylib "libqsvg.dylib" PATHS "${CMAKE_PREFIX_PATH}/plugins/imageformats" NO_DEFAULT_PATH)
if(_qt_svg_dylib)
add_custom_command(TARGET deploy
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${_qt_svg_dylib} $<TARGET_FILE_DIR:monero-wallet-gui>/../PlugIns/imageformats/
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_PREFIX_PATH}/lib/QtGui.framework/Versions/5/QtGui" "@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui" $<TARGET_FILE_DIR:monero-wallet-gui>/../PlugIns/imageformats/libqsvg.dylib
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_PREFIX_PATH}/lib/QtWidgets.framework/Versions/5/QtWidgets" "@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets" $<TARGET_FILE_DIR:monero-wallet-gui>/../PlugIns/imageformats/libqsvg.dylib
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_PREFIX_PATH}/lib/QtSvg.framework/Versions/5/QtSvg" "@executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg" $<TARGET_FILE_DIR:monero-wallet-gui>/../PlugIns/imageformats/libqsvg.dylib
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_PREFIX_PATH}/lib/QtCore.framework/Versions/5/QtCore" "@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore" $<TARGET_FILE_DIR:monero-wallet-gui>/../PlugIns/imageformats/libqsvg.dylib
COMMENT "Copying libqsvg.dylib, running install_name_tool"
)
endif()
# Copy Boost dylibs that macdeployqt doesn't pick up
# Help macdeployqt resolve transitive @rpath dependencies.
find_package(Boost QUIET COMPONENTS atomic container date_time)
set(_boost_extras Boost::atomic Boost::container Boost::date_time)
foreach(_tgt IN LISTS _boost_extras)
find_package(Protobuf QUIET)
set(_macdeployqt_library_options)
foreach(_tgt Boost::atomic Boost::container Boost::date_time protobuf::libprotobuf)
if(TARGET ${_tgt})
add_custom_command(TARGET deploy POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
"$<TARGET_FILE:${_tgt}>"
"$<TARGET_FILE_DIR:monero-wallet-gui>/../Frameworks/"
COMMENT "Copying $<TARGET_FILE_NAME:${_tgt}>"
list(APPEND _macdeployqt_library_options
"-libpath=$<TARGET_FILE_DIR:${_tgt}>"
)
endif()
endforeach()
# macdeployqt skips Boost's @loader_path dependencies. Copy them first.
foreach(_tgt Boost::atomic Boost::container Boost::date_time)
if(TARGET ${_tgt})
add_custom_command(TARGET deploy POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
"$<TARGET_FILE_DIR:monero-wallet-gui>/../Frameworks"
COMMAND ${CMAKE_COMMAND} -E copy
"$<TARGET_FILE:${_tgt}>"
"$<TARGET_FILE_DIR:monero-wallet-gui>/../Frameworks/"
VERBATIM
COMMENT "Copying $<TARGET_FILE_NAME:${_tgt}>"
)
endif()
endforeach()
find_library(_abseil_strings_dylib
NAMES absl_strings
HINTS /opt/homebrew/opt/abseil/lib /usr/local/opt/abseil/lib
)
if(_abseil_strings_dylib)
get_filename_component(_abseil_lib_dir "${_abseil_strings_dylib}" DIRECTORY)
list(APPEND _macdeployqt_library_options "-libpath=${_abseil_lib_dir}")
endif()
add_custom_command(TARGET deploy
POST_BUILD
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "$<TARGET_FILE_DIR:monero-wallet-gui>/../.."
-always-overwrite "-qmldir=${CMAKE_SOURCE_DIR}" ${_macdeployqt_library_options}
COMMAND_EXPAND_LISTS
VERBATIM
COMMENT "Running macdeployqt..."
)
# Remove Homebrew rpaths from the executable.
# These can make the app load local Homebrew libraries instead of bundled libraries.
add_custom_command(TARGET deploy
POST_BUILD
COMMAND ${CMAKE_COMMAND}
-DEXECUTABLE=$<TARGET_FILE:monero-wallet-gui>
-DINSTALL_NAME_TOOL=${CMAKE_INSTALL_NAME_TOOL}
-P ${CMAKE_SOURCE_DIR}/cmake/DeleteHomebrewRpaths.cmake
COMMENT "Removing Homebrew rpaths from app executable"
)
# Apple Silicon requires all binaries to be codesigned
find_program(CODESIGN_EXECUTABLE NAMES codesign)
if(CODESIGN_EXECUTABLE)
@@ -53,11 +74,22 @@ if(APPLE OR (WIN32 AND NOT STATIC))
elseif(WIN32)
find_program(QMAKE_EXECUTABLE qmake HINTS "${_qt_bin_dir}")
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
if(NOT QMAKE_EXECUTABLE OR NOT WINDEPLOYQT_EXECUTABLE)
message(WARNING "Deploy requires qmake.exe and windeployqt.exe (no -qt5 suffix) in ${_qt_bin_dir}")
set(QMLIMPORTSCANNER_EXECUTABLE "${_qt_bin_dir}/qmlimportscanner${CMAKE_EXECUTABLE_SUFFIX}")
if(NOT QMAKE_EXECUTABLE OR NOT WINDEPLOYQT_EXECUTABLE OR
NOT EXISTS "${QMLIMPORTSCANNER_EXECUTABLE}")
message(WARNING "Deploy requires qmake, windeployqt, and qmlimportscanner in ${_qt_bin_dir}")
endif()
execute_process(
COMMAND "${QMAKE_EXECUTABLE}" -query QT_INSTALL_QML
OUTPUT_VARIABLE _qt_qml_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT IS_DIRECTORY "${_qt_qml_dir}")
message(WARNING "Qt QML import directory does not exist: ${_qt_qml_dir}")
endif()
add_custom_command(TARGET deploy POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}" "$<TARGET_FILE:monero-wallet-gui>" -no-translations -qmldir="${CMAKE_SOURCE_DIR}"
COMMAND "${CMAKE_COMMAND}" -E env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}" "$<TARGET_FILE:monero-wallet-gui>" -no-translations -qmldir="${CMAKE_SOURCE_DIR}" -qmlimport="${_qt_qml_dir}"
COMMENT "Running windeployqt..."
)
set(WIN_DEPLOY_DLLS
@@ -74,14 +106,11 @@ if(APPLE OR (WIN32 AND NOT STATIC))
zlib1.dll
libzstd.dll
libwinpthread-1.dll
libtiff-6.dll
libstdc++-6.dll
libpng16-16.dll
libpcre16-0.dll
libpcre-1.dll
libmng-2.dll
liblzma-5.dll
liblcms2-2.dll
libjpeg-8.dll
libintl-8.dll
libiconv-2.dll
+2 -2
View File
@@ -1,5 +1,5 @@
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import "../components" as MoneroComponents
+6 -5
View File
@@ -26,9 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import FontAwesome 1.0
import QtQuick
import QtQuick.Layouts
import FontAwesome
import "." as MoneroComponents
import "effects/" as MoneroEffects
@@ -57,8 +58,8 @@ Item {
opacity: enabled ? 1 : 0.7
Keys.onEnterPressed: toggle()
Keys.onReturnPressed: Keys.onEnterPressed(event)
Keys.onSpacePressed: Keys.onEnterPressed(event)
Keys.onReturnPressed: toggle()
Keys.onSpacePressed: toggle()
function toggle(){
if (checkBox.toggleOnClick) {
+4 -4
View File
@@ -26,10 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import FontAwesome 1.0
import QtQuick
import QtQuick.Layouts
import FontAwesome
import "." 1.0
import "." as MoneroComponents
+3 -4
View File
@@ -1,7 +1,6 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick
import QtQuick.Controls
import FontAwesome 1.0
import "../components" as MoneroComponents
MouseArea {
@@ -14,7 +13,7 @@ MouseArea {
id: root
acceptedButtons: Qt.RightButton
anchors.fill: parent
onClicked: {
onClicked: (mouse) => {
if (mouse.button === Qt.RightButton) {
root.parent.persistentSelection = true;
contextMenu.open()
+5 -4
View File
@@ -1,8 +1,9 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import FontAwesome
import FontAwesome 1.0
import "../components" as MoneroComponents
MenuItem {
+3 -6
View File
@@ -26,12 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.0
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import moneroComponents.Wallet 1.0
import "../components" as MoneroComponents
+14 -171
View File
@@ -26,13 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.2
import QtQuick.Controls 2.2 as QtQuickControls2
import QtQuick.Layouts 1.2
import QtGraphicalEffects 1.0
import QtQuick.Controls.Styles 1.2
import FontAwesome 1.0
import QtQuick
import QtQuick.Controls as Controls
import QtQuick.Layouts
import FontAwesome
import "." as MoneroComponents
import "effects/" as MoneroEffects
@@ -47,7 +45,7 @@ Item {
property bool error: false
property alias inputLabel: inputLabel
signal dateChanged();
signal dateChanged()
height: 50
@@ -246,11 +244,11 @@ Item {
}
}
QtQuickControls2.Popup {
Controls.Popup {
id: popup
padding: 0
focus: true
closePolicy: QtQuickControls2.Popup.CloseOnEscape | QtQuickControls2.Popup.CloseOnPressOutsideParent
closePolicy: Controls.Popup.CloseOnEscape | Controls.Popup.CloseOnPressOutsideParent
onOpened: {
calendar.visibleMonth = currentDate.getMonth();
calendar.visibleYear = currentDate.getFullYear();
@@ -291,7 +289,7 @@ Item {
height: 1
}
Calendar {
MoneroComponents.MoneroCalendar {
id: calendar
anchors.left: parent.left
anchors.right: parent.right
@@ -299,166 +297,11 @@ Item {
anchors.margins: 1
anchors.bottomMargin: 10
height: 220
frameVisible: false
style: CalendarStyle {
gridVisible: false
background: Rectangle { color: MoneroComponents.Style.middlePanelBackgroundColor }
dayDelegate: Item {
z: parent.z + 1
implicitHeight: implicitWidth
implicitWidth: calendar.width / 7
Rectangle {
id: dayRect
anchors.fill: parent
radius: parent.implicitHeight / 2
}
MoneroComponents.TextPlain {
id: dayText
anchors.centerIn: parent
font.family: MoneroComponents.Style.fontMonoRegular.name
font.pixelSize: {
if(!styleData.visibleMonth) return 12
return 14
}
font.bold: {
if(dayArea.pressed || styleData.visibleMonth) return true;
return false;
}
font.underline: styleData.date.toDateString() === (new Date()).toDateString()
text: styleData.date.getDate()
themeTransition: false
color: {
if (currentDate.toDateString() === styleData.date.toDateString()) {
if (dayArea.containsMouse) {
dayRect.color = MoneroComponents.Style.buttonBackgroundColorHover;
} else {
dayRect.color = MoneroComponents.Style.buttonBackgroundColor;
}
} else {
if (dayArea.containsMouse) {
dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
} else {
dayRect.color = "transparent";
}
}
if(!styleData.valid) return "transparent"
if(!styleData.visibleMonth) return MoneroComponents.Style.lightGreyFontColor
if(dayArea.pressed) return MoneroComponents.Style.defaultFontColor
return MoneroComponents.Style.defaultFontColor
}
}
MouseArea {
id: dayArea
anchors.fill: parent
visible: styleData.valid
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if(styleData.visibleMonth) {
currentDate = styleData.date
popup.close()
} else {
var date = styleData.date
if(date.getMonth() > calendar.visibleMonth)
calendar.showNextMonth()
else calendar.showPreviousMonth()
}
datePicker.dateChanged();
}
}
}
dayOfWeekDelegate: Item {
implicitHeight: 20
implicitWidth: calendar.width / 7
MoneroComponents.TextPlain {
anchors.centerIn: parent
elide: Text.ElideRight
font.family: MoneroComponents.Style.fontMonoRegular.name
font.pixelSize: 12
color: MoneroComponents.Style.lightGreyFontColor
themeTransition: false
text: {
var locale = Qt.locale()
return locale.dayName(styleData.dayOfWeek, Locale.ShortFormat)
}
}
}
navigationBar: Rectangle {
color: MoneroComponents.Style.middlePanelBackgroundColor
implicitWidth: calendar.width
implicitHeight: 30
MoneroComponents.TextPlain {
anchors.centerIn: parent
font.family: MoneroComponents.Style.fontMonoRegular.name
font.pixelSize: 14
color: MoneroComponents.Style.dimmedFontColor
themeTransition: false
text: styleData.title
}
Item {
anchors.left: parent.left
anchors.leftMargin: 4
anchors.top: parent.top
anchors.bottom: parent.bottom
width: height
MoneroEffects.ImageMask {
id: prevMonthIcon
anchors.centerIn: parent
image: "qrc:///images/prevMonth.png"
height: 8
width: 12
fontAwesomeFallbackIcon: FontAwesome.arrowLeft
fontAwesomeFallbackSize: 14
color: MoneroComponents.Style.defaultFontColor
}
MouseArea {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: calendar.showPreviousMonth()
}
}
Item {
anchors.right: parent.right
anchors.rightMargin: 4
anchors.top: parent.top
anchors.bottom: parent.bottom
width: height
MoneroEffects.ImageMask {
id: nextMonthIcon
anchors.centerIn: parent
image: "qrc:///images/prevMonth.png"
height: 8
width: 12
rotation: 180
fontAwesomeFallbackIcon: FontAwesome.arrowLeft
fontAwesomeFallbackSize: 14
color: MoneroComponents.Style.defaultFontColor
}
MouseArea {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: calendar.showNextMonth()
}
}
}
selectedDate: datePicker.currentDate
onDateSelected: function(selectedDate) {
datePicker.currentDate = selectedDate
popup.close()
datePicker.dateChanged()
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick
import "." as MoneroComponents
Item {
+3 -3
View File
@@ -26,9 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "." as MoneroComponents
+2 -2
View File
@@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick
import "../components" as MoneroComponents
import "../components/effects" as MoneroEffects
@@ -62,6 +62,6 @@ MoneroEffects.ImageMask {
button.height = button.height - 2
}
onClicked: button.clicked(mouse)
onClicked: (mouse) => button.clicked(mouse)
}
}
+21 -18
View File
@@ -26,15 +26,17 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import QtQuick
import QtQuick.Layouts
import FontAwesome 1.0
import FontAwesome
import "." as MoneroComponents
import "./effects/" as MoneroEffects
import QtQuick.Effects
Item {
id: inlineButton
@@ -42,9 +44,9 @@ Item {
property string textColor: MoneroComponents.Style.inlineButtonTextColor
property alias text: inlineText.text
property alias fontPixelSize: inlineText.font.pixelSize
property alias fontFamily: inlineText.font.family
property alias fontStyleName: inlineText.font.styleName
property bool isFontAwesomeIcon: fontFamily == FontAwesome.fontFamily || fontFamily == FontAwesome.fontFamilySolid
property string fontFamily: MoneroComponents.Style.fontBold.name
property string fontStyleName: ""
property bool isFontAwesomeIcon: fontStyleName === "Solid" || fontFamily === FontAwesome.fontFamily || fontFamily === FontAwesome.fontFamilySolid
property alias buttonColor: rect.color
property alias tooltip: tooltip.text
property alias tooltipLeft: tooltip.tooltipLeft
@@ -70,8 +72,9 @@ Item {
MoneroComponents.TextPlain {
id: inlineText
font.family: MoneroComponents.Style.fontBold.name
font.bold: true
font.family: inlineButton.fontStyleName === "Solid" ? FontAwesome.fontFamilySolid : inlineButton.fontFamily
font.styleName: inlineButton.fontStyleName
font.bold: !inlineButton.isFontAwesomeIcon
font.pixelSize: inlineButton.isFontAwesomeIcon ? 22 : inlineButton.small ? 14 : 16
color: inlineButton.textColor
anchors.verticalCenter: parent.verticalCenter
@@ -108,20 +111,20 @@ Item {
}
}
DropShadow {
visible: !MoneroComponents.Style.blackTheme
MultiEffect {
visible: !MoneroComponents.Style.blackTheme && GraphicsInfo.api !== GraphicsInfo.Software
anchors.fill: rect
horizontalOffset: 2
verticalOffset: 2
radius: 7.0
samples: 10
color: "#1B000000"
cached: true
source: rect
shadowEnabled: true
shadowHorizontalOffset: 2
shadowVerticalOffset: 2
shadowBlur: 0.875
blurMax: 16
shadowColor: "#1B000000"
}
Keys.enabled: inlineButton.visible
Keys.onSpacePressed: doClick()
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onEnterPressed: doClick()
Keys.onReturnPressed: doClick()
}
+2 -2
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick.Controls 2.0
import QtQuick 2.9
import QtQuick.Controls
import QtQuick
import "../components" as MoneroComponents
+9 -8
View File
@@ -26,12 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../components" as MoneroComponents
@@ -109,11 +106,15 @@ Item {
}
Keys.enabled: root.visible
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: {
function acceptInput() {
root.close()
root.accepted()
}
Keys.onEnterPressed: acceptInput()
Keys.onReturnPressed: {
acceptInput()
}
Keys.onEscapePressed: {
root.close()
root.rejected()
+7 -3
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick.Controls 2.0
import QtQuick 2.9
import QtQuick.Controls
import QtQuick
import "../js/TxUtils.js" as TxUtils
import "../components" as MoneroComponents
@@ -51,12 +51,16 @@ TextArea {
selectionColor: MoneroComponents.Style.textSelectionColor
selectedTextColor: MoneroComponents.Style.textSelectedColor
background: Rectangle {
color: "transparent"
}
property int minimumHeight: 100
height: contentHeight > minimumHeight ? contentHeight : minimumHeight
onTextChanged: {
if(addressValidation){
// js replacement for `RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }`
// js replacement for `RegularExpressionValidator { regularExpression: /[0-9A-Fa-f]{95}/g }`
if (textArea.text.startsWith("monero:")) {
error = false;
return;
+2 -2
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import "../components" as MoneroComponents
+2 -2
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import "../components" as MoneroComponents
+1 -1
View File
@@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick
import "../components" as MoneroComponents
import "../components/effects/" as MoneroEffects
+4 -3
View File
@@ -26,10 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick
import QtQuick.Layouts
import FontAwesome 1.0
import FontAwesome
import "../components" as MoneroComponents
+7 -7
View File
@@ -28,10 +28,10 @@
import "../components" as MoneroComponents
import QtQuick 2.9
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.0
import moneroComponents.LanguageModel 1.0
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import moneroComponents.LanguageModel 1.0 as LanguageModels
Drawer {
@@ -85,7 +85,6 @@ Drawer {
var locale_spl = locale.split("_");
// reload active translations
console.log(locale_spl[0]);
translationManager.setLanguage(locale_spl[0]);
// set wizard language settings
@@ -166,12 +165,13 @@ Drawer {
ScrollBar.vertical: ScrollBar {
onActiveChanged: if (!active && !isMac) active = true
palette.mid: "#8E8E93"
palette.dark: "#B8B8BD"
}
}
}
//Flags model
LanguageModel {
LanguageModels.LanguageModel {
id: langModel
}
+4 -4
View File
@@ -26,10 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import FontAwesome 1.0
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import FontAwesome
import "../components" as MoneroComponents
+2 -2
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import "../components" as MoneroComponents
+1 -1
View File
@@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import Qt.labs.platform 1.0 as PlatformLabs
import Qt.labs.platform as PlatformLabs
import "." as MoneroComponents
PlatformLabs.MenuBar {
+8 -10
View File
@@ -26,8 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick
import "../components" as MoneroComponents
import "effects/" as MoneroEffects
@@ -61,26 +60,25 @@ Rectangle {
property bool present: !under || under.checked || checked || under.numSelectedChildren > 0
height: present ? ((appWindow.height >= 800) ? 44 : 38 ) : 0
LinearGradient {
visible: isOpenGL && (button.checked || buttonArea.containsMouse)
Rectangle {
visible: GraphicsInfo.api !== GraphicsInfo.Software && (button.checked || buttonArea.containsMouse)
height: parent.height
width: 260
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: -20
anchors.leftMargin: parent.getOffset()
start: Qt.point(width, 0)
end: Qt.point(0, 0)
gradient: Gradient {
GradientStop { position: 0.0; color: MoneroComponents.Style.menuButtonGradientStart }
GradientStop { position: 1.0; color: MoneroComponents.Style.menuButtonGradientStop }
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: MoneroComponents.Style.menuButtonGradientStop }
GradientStop { position: 1.0; color: MoneroComponents.Style.menuButtonGradientStart }
}
opacity: button.checked ? 1 : 0.3
}
// fallback hover effect when opengl is not available
// fallback hover effect for the software renderer
Rectangle {
visible: !isOpenGL && (button.checked || buttonArea.containsMouse)
visible: GraphicsInfo.api === GraphicsInfo.Software && (button.checked || buttonArea.containsMouse)
anchors.fill: parent
color: MoneroComponents.Style.menuButtonFallbackBackgroundColor
opacity: button.checked ? 1 : 0.3
+1 -1
View File
@@ -1,4 +1,4 @@
import QtQuick 2.9
import QtQuick
import "." as MoneroComponents
import "effects/" as MoneroEffects
+193
View File
@@ -0,0 +1,193 @@
// Copyright (c) 2026, The Monero Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick
import QtQuick.Controls
import "." as MoneroComponents
Item {
id: root
property int visibleMonth: (new Date()).getMonth()
property int visibleYear: (new Date()).getFullYear()
property date selectedDate
signal dateSelected(date selectedDate)
function moveMonth(offset) {
const date = new Date(visibleYear, visibleMonth + offset, 1)
visibleMonth = date.getMonth()
visibleYear = date.getFullYear()
}
function showPreviousMonth() {
moveMonth(-1)
}
function showNextMonth() {
moveMonth(1)
}
Rectangle {
anchors.fill: parent
color: MoneroComponents.Style.middlePanelBackgroundColor
Column {
anchors.fill: parent
Rectangle {
width: parent.width
height: 30
color: MoneroComponents.Style.middlePanelBackgroundColor
MoneroComponents.TextPlain {
anchors.centerIn: parent
font.family: MoneroComponents.Style.fontMonoRegular.name
font.pixelSize: 14
color: MoneroComponents.Style.dimmedFontColor
themeTransition: false
text: Qt.locale().standaloneMonthName(root.visibleMonth, Locale.LongFormat)
+ " " + root.visibleYear
}
MoneroComponents.TextPlain {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: "\u2039"
font.pixelSize: 22
color: MoneroComponents.Style.defaultFontColor
MouseArea {
anchors.fill: parent
anchors.margins: -8
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.showPreviousMonth()
}
}
MoneroComponents.TextPlain {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: "\u203a"
font.pixelSize: 22
color: MoneroComponents.Style.defaultFontColor
MouseArea {
anchors.fill: parent
anchors.margins: -8
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.showNextMonth()
}
}
}
DayOfWeekRow {
width: parent.width
height: 20
locale: Qt.locale()
delegate: MoneroComponents.TextPlain {
required property var model
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: MoneroComponents.Style.fontMonoRegular.name
font.pixelSize: 12
color: MoneroComponents.Style.lightGreyFontColor
themeTransition: false
text: model.shortName
}
}
MonthGrid {
id: monthGrid
width: parent.width
height: parent.height - 50
month: root.visibleMonth
year: root.visibleYear
locale: Qt.locale()
delegate: Item {
required property var model
Rectangle {
id: dayBackground
anchors.centerIn: parent
width: Math.min(parent.width, parent.height)
height: width
radius: width / 2
color: {
if (root.selectedDate
&& root.selectedDate.toDateString() === model.date.toDateString())
return MoneroComponents.Style.buttonBackgroundColor
if (dayArea.containsMouse)
return MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
return "transparent"
}
}
MoneroComponents.TextPlain {
anchors.centerIn: parent
font.family: MoneroComponents.Style.fontMonoRegular.name
font.pixelSize: model.month === root.visibleMonth ? 14 : 12
font.bold: model.month === root.visibleMonth
font.underline: model.today
color: {
if (model.month !== root.visibleMonth)
return MoneroComponents.Style.lightGreyFontColor
return MoneroComponents.Style.defaultFontColor
}
text: model.day
themeTransition: false
}
MouseArea {
id: dayArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (model.month !== root.visibleMonth) {
if (model.date < new Date(root.visibleYear, root.visibleMonth, 1))
root.showPreviousMonth()
else
root.showNextMonth()
return
}
root.dateSelected(model.date)
}
}
}
}
}
}
}
+2 -2
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import "." as MoneroComponents
Rectangle {
+1 -1
View File
@@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick
QtObject {
property bool active: false
+4 -3
View File
@@ -26,10 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import FontAwesome
import FontAwesome 1.0
import moneroComponents.Wallet 1.0
import "../components" as MoneroComponents
+3 -9
View File
@@ -26,17 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.0
import FontAwesome 1.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "." as MoneroComponents
import "effects/" as MoneroEffects
import "../js/Utils.js" as Utils
FocusScope {
id: root
+15 -17
View File
@@ -26,11 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Window 2.1
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts
import "../components" as MoneroComponents
@@ -73,25 +72,24 @@ Rectangle {
id: imgLogo
width: 60
height: 60
sourceSize: Qt.size(width, height)
anchors.centerIn: parent
source: "qrc:///images/monero-vector.svg"
mipmap: true
}
BusyIndicator {
running: parent.visible
running: root.visible
anchors.centerIn: imgLogo
style: BusyIndicatorStyle {
indicator: Image {
visible: control.running
source: "qrc:///images/busy-indicator.png"
RotationAnimator on rotation {
running: control.running
loops: Animation.Infinite
duration: 1000
from: 0
to: 360
}
contentItem: Image {
visible: parent.running
source: "qrc:///images/busy-indicator.png"
RotationAnimator on rotation {
running: root.visible
loops: Animation.Infinite
duration: 1000
from: 0
to: 360
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick
import moneroComponents.Wallet 1.0
import "../components" as MoneroComponents
+91 -40
View File
@@ -26,9 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtMultimedia 5.4
import QtQuick.Dialogs 1.2
import QtQuick
import QtCore
import QtMultimedia
import QtQuick.Dialogs
import moneroComponents.QRCodeScanner 1.0
Rectangle {
@@ -46,6 +47,7 @@ Rectangle {
signal qrcode_decoded(string address, string payment_id, string amount, string tx_description, string recipient_name, var extra_parameters)
property bool walletRestoreMode: false
property bool sessionConfigured: false
function parseWalletRestoreUri(data) {
var prefix = ""
@@ -81,17 +83,62 @@ Rectangle {
return { "address": address, "extra_parameters": params }
}
function showDecodeError(error, warning) {
if (!warning)
root.state = "Stopped"
messageDialog.text = error
messageDialog.visible = true
}
function startCapture() {
if (root.state !== "Capture")
return
if (cameraPermission.status === Qt.PermissionStatus.Undetermined) {
cameraPermission.request()
} else if (cameraPermission.status === Qt.PermissionStatus.Denied) {
showDecodeError(qsTr("Camera permission was denied.") + translationManager.emptyString, false)
} else {
startCamera()
}
}
function startCamera() {
if (mediaDevices.videoInputs.length === 0) {
appWindow.qrScannerEnabled = false
root.state = "Stopped"
return
}
if (!sessionConfigured) {
if (!finder.setSource(camera) || !finder.setVideoOutput(viewfinder)) {
appWindow.qrScannerEnabled = false
root.state = "Stopped"
return
}
sessionConfigured = true
}
camera.start()
}
CameraPermission {
id: cameraPermission
}
MediaDevices {
id: mediaDevices
onVideoInputsChanged: {
appWindow.qrScannerEnabled = videoInputs.length > 0
if (videoInputs.length === 0 && root.state === "Capture")
root.state = "Stopped"
}
}
states: [
State {
name: "Capture"
StateChangeScript {
script: {
root.visible = true
camera.captureMode = Camera.CaptureStillImage
camera.cameraState = Camera.ActiveState
camera.start()
finder.enabled = true
}
// Finish entering Capture before an error can return to Stopped.
script: Qt.callLater(root.startCapture)
}
},
State {
@@ -101,7 +148,6 @@ Rectangle {
camera.stop()
root.visible = false
finder.enabled = false
camera.cameraState = Camera.UnloadedState
root.walletRestoreMode = false
}
}
@@ -111,23 +157,38 @@ Rectangle {
Camera {
id: camera
objectName: "qrCameraQML"
captureMode: Camera.CaptureStillImage
cameraState: Camera.UnloadedState
cameraDevice: mediaDevices.defaultVideoInput
focus {
focusMode: Camera.FocusContinuous
onActiveChanged: {
if (camera.active && root.state === "Capture") {
root.visible = true
finder.enabled = true
} else if (!camera.active) {
root.visible = false
finder.enabled = false
}
}
onErrorOccurred: function(error, errorString) {
console.error("QR scanner camera error:", error, errorString)
if (root.state === "Capture") {
root.state = "Stopped"
messageDialog.text = errorString
messageDialog.visible = true
}
}
focusMode: Camera.FocusModeAuto
}
QRCodeScanner {
id : finder
objectName: "QrFinder"
onDecoded : {
onDecoded : (data) => {
var walletRestore = null
try {
if (root.walletRestoreMode)
walletRestore = root.parseWalletRestoreUri(data)
} catch (error) {
finder.notifyError(qsTr("Invalid wallet restore QR code"), false)
root.showDecodeError(qsTr("Invalid wallet restore QR code"), false)
return
}
if (walletRestore !== null) {
@@ -143,24 +204,17 @@ Rectangle {
root.qrcode_decoded(data, "", "", "", "", null);
root.state = "Stopped";
} else {
onNotifyError(parsed.error);
root.showDecodeError(parsed.error, false)
}
}
onNotifyError : {
if( warning )
messageDialog.icon = StandardIcon.Critical
else {
messageDialog.icon = StandardIcon.Warning
root.state = "Stopped"
}
messageDialog.text = error
messageDialog.visible = true
onNotifyError : (error, warning) => {
root.showDecodeError(error, warning)
}
}
VideoOutput {
id: viewfinder
visible: root.state == "Capture"
visible: camera.active
x: 0
y: 0
@@ -168,16 +222,9 @@ Rectangle {
width: parent.width
height: parent.height
source: camera
autoOrientation: true
MouseArea {
anchors.fill: parent
propagateComposedEvents: true
onPressAndHold: {
if (camera.lockStatus == Camera.locked)camera.unlock()
camera.searchAndLock()
}
onDoubleClicked: {
root.state = "Stopped"
}
@@ -186,16 +233,20 @@ Rectangle {
MessageDialog {
id: messageDialog
title: qsTr("QrCode Scanned") + translationManager.emptyString
title: qsTr("QR Scanner") + translationManager.emptyString
onAccepted: {
root.state = "Stopped"
}
}
Component.onCompleted: {
if( QtMultimedia.availableCameras.length == 0) {
console.log("No camera available. Disable qrScannerEnabled");
appWindow.qrScannerEnabled = false;
Connections {
target: cameraPermission
function onStatusChanged() {
root.startCapture()
}
}
Component.onCompleted: {
appWindow.qrScannerEnabled = mediaDevices.videoInputs.length > 0
}
}
+2 -2
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import "../components" as MoneroComponents
+2 -3
View File
@@ -26,9 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import "." as MoneroComponents
+2 -5
View File
@@ -26,12 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import "../js/Utils.js" as Utils
import "../components" as MoneroComponents
GridLayout {
+8 -5
View File
@@ -26,10 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import FontAwesome 1.0
import FontAwesome
import "." as MoneroComponents
import "effects/" as MoneroEffects
@@ -138,7 +139,8 @@ ColumnLayout {
MoneroComponents.InlineButton {
buttonColor: "transparent"
fontFamily: FontAwesome.fontFamily
fontFamily: FontAwesome.fontFamilySolid
fontStyleName: "Solid"
fontPixelSize: 18
text: FontAwesome.edit
tooltip: qsTr("Edit remote node") + translationManager.emptyString
@@ -153,7 +155,8 @@ ColumnLayout {
MoneroComponents.InlineButton {
buttonColor: "transparent"
fontFamily: FontAwesome.fontFamily
fontFamily: FontAwesome.fontFamilySolid
fontStyleName: "Solid"
text: FontAwesome.times
visible: remoteNodesModel.count > 1
tooltip: qsTr("Remove remote node") + translationManager.emptyString
+4 -4
View File
@@ -1,6 +1,7 @@
import QtQuick 2.9
import QtQuick.Layouts 1.1
import FontAwesome 1.0
import QtQuick
import QtQuick.Layouts
import FontAwesome
import "../components" as MoneroComponents
@@ -11,7 +12,6 @@ ColumnLayout {
property alias description: area.text
property alias title: header.text
property bool isLast: false
property bool enabled: true
signal clicked()
Layout.fillWidth: true
+3 -3
View File
@@ -1,6 +1,6 @@
import QtQuick 2.9
import QtQuick.Controls 2.0 as QtQuickControls
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls as QtQuickControls
import QtQuick.Layouts
import "../components" as MoneroComponents
+5 -4
View File
@@ -26,10 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Layouts
import FontAwesome 1.0
import FontAwesome
import "../components" as MoneroComponents
@@ -187,6 +188,6 @@ Item {
Keys.enabled: button.visible
Keys.onSpacePressed: doClick()
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onEnterPressed: doClick()
Keys.onReturnPressed: doClick()
}
+6 -8
View File
@@ -26,12 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../components" as MoneroComponents
import "effects/" as MoneroEffects
@@ -50,8 +47,6 @@ Rectangle {
property alias cancelText: cancelButton.text
property alias closeVisible: closeButton.visible
property var icon
// same signals as Dialog has
signal accepted()
signal rejected()
@@ -130,6 +125,8 @@ Rectangle {
anchors.fill: parent
ScrollBar.vertical: ScrollBar {
onActiveChanged: if (!active && !isMac) active = true
palette.mid: "#8E8E93"
palette.dark: "#B8B8BD"
}
boundsBehavior: isMac ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
@@ -145,6 +142,7 @@ Rectangle {
selectByMouse: false
wrapMode: TextEdit.Wrap
color: MoneroComponents.Style.defaultFontColor
background: null
MouseArea {
anchors.fill: parent
+5 -6
View File
@@ -26,12 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Window 2.2
import QtGraphicalEffects 1.0
import FontAwesome 1.0
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import FontAwesome
import "../components" as MoneroComponents
import "../components/effects/" as MoneroEffects
+1 -1
View File
@@ -1,6 +1,6 @@
pragma Singleton
import QtQuick 2.5
import QtQuick
QtObject {
property bool blackTheme: true
+10 -8
View File
@@ -26,9 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import moneroComponents.Clipboard 1.0
import "../components" as MoneroComponents
@@ -54,14 +54,16 @@ Rectangle {
Clipboard { id: clipboard }
property var transactionID;
property string transactionID: ""
// same signals as Dialog has
signal accepted()
signal rejected()
function open(txid) {
root.transactionID = txid;
function open(txids) {
root.transactionID = !txids ? ""
: typeof txids === "string" ? txids
: txids.join("\n");
root.visible = true;
}
@@ -128,7 +130,7 @@ Rectangle {
readOnly: true
wrapMode: Text.Wrap
labelText: qsTr("Transaction file location:") + translationManager.emptyString
text: walletManager.urlToLocalPath(saveTxDialog.fileUrl)
text: walletManager.urlToLocalPath(saveTxDialog.selectedFile)
fontSize: 16
}
@@ -161,7 +163,7 @@ Rectangle {
width: 200
KeyNavigation.tab: doneButton
onClicked: {
oshelper.openContainingFolder(walletManager.urlToLocalPath(saveTxDialog.fileUrl))
oshelper.openContainingFolder(walletManager.urlToLocalPath(saveTxDialog.selectedFile))
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
import QtQuick 2.9
import QtQuick
import "../components" as MoneroComponents
+1 -1
View File
@@ -1,4 +1,4 @@
import QtQuick 2.9
import QtQuick
import "." as MoneroComponents
import "effects/" as MoneroEffects
+2 -2
View File
@@ -1,5 +1,5 @@
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick
import QtQuick.Controls
import "." as MoneroComponents
+2 -2
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Window 2.1
import QtQuick
import QtQuick.Window
import "../components" as MoneroComponents
+11 -22
View File
@@ -26,12 +26,13 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Window 2.0
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.2
import QtQuick
import QtQuick.Effects
import QtQuick.Window
import QtQuick.Layouts
import FontAwesome
import FontAwesome 1.0
import "." as MoneroComponents
import "effects/" as MoneroEffects
@@ -281,17 +282,17 @@ Rectangle {
source: MoneroComponents.Style.titleBarLogoSource
visible: {
if(!isOpenGL) return true;
if(GraphicsInfo.api === GraphicsInfo.Software) return true;
if(!MoneroComponents.Style.blackTheme) return true;
return false;
}
}
Colorize {
visible: isOpenGL && MoneroComponents.Style.blackTheme
MultiEffect {
visible: GraphicsInfo.api !== GraphicsInfo.Software && MoneroComponents.Style.blackTheme
anchors.fill: imgLogo
source: imgLogo
saturation: 0.0
saturation: -1.0
}
}
@@ -421,21 +422,9 @@ Rectangle {
MouseArea {
enabled: persistentSettings.customDecorations
property var previousPosition
anchors.fill: parent
propagateComposedEvents: true
onPressed: previousPosition = globalCursor.getPosition()
onPressed: appWindow.startSystemMove()
onDoubleClicked: root.maximizeClicked()
onPositionChanged: {
if (pressedButtons == Qt.LeftButton) {
var pos = globalCursor.getPosition()
var dx = pos.x - previousPosition.x
var dy = pos.y - previousPosition.y
appWindow.x += dx
appWindow.y += dy
previousPosition = pos
}
}
}
}
+5 -4
View File
@@ -26,11 +26,12 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import FontAwesome
import FontAwesome 1.0
import "." as MoneroComponents
Rectangle {
+9 -7
View File
@@ -26,14 +26,14 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.4 as QtQuickControls1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import FontAwesome
import "../components" as MoneroComponents
import "../js/Utils.js" as Utils
import FontAwesome 1.0
Rectangle {
id: root
@@ -189,7 +189,7 @@ Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 71
QtQuickControls1.BusyIndicator {
BusyIndicator {
id: txAmountBusyIndicator
Layout.fillHeight: true
Layout.fillWidth: true
@@ -326,6 +326,8 @@ Rectangle {
ScrollBar.vertical: ScrollBar {
policy: recipientsArea.contentHeight > flickable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
palette.mid: "#8E8E93"
palette.dark: "#B8B8BD"
}
}
@@ -381,7 +383,7 @@ Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 50
QtQuickControls1.BusyIndicator {
BusyIndicator {
visible: !bottomTextAnimation.running
running: !bottomTextAnimation.running
scale: .5
+3 -3
View File
@@ -26,9 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import moneroComponents.Downloader 1.0
+3 -3
View File
@@ -1,6 +1,6 @@
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import "." as MoneroComponents
+1 -2
View File
@@ -26,8 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick
import "../" as MoneroComponents
+35 -20
View File
@@ -26,8 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick
import QtQuick.Shapes
import "../" as MoneroComponents
@@ -49,34 +49,49 @@ Item {
// background software renderer
Rectangle {
visible: !isOpenGL
visible: GraphicsInfo.api === GraphicsInfo.Software
anchors.fill: parent
color: root.fallBackColor
}
// background opengl
LinearGradient {
visible: isOpenGL
// accelerated background
Shape {
id: gradientShape
visible: GraphicsInfo.api !== GraphicsInfo.Software
anchors.fill: parent
start: root.start
end: root.end
gradient: Gradient {
GradientStop {
id: gradientStart
position: root.posStart
color: root.initialStartColor
}
GradientStop {
id: gradientStop
position: root.posStop
color: root.initialStopColor
ShapePath {
strokeWidth: -1
fillGradient: LinearGradient {
x1: root.start.x
y1: root.start.y
x2: root.end.x
y2: root.end.y
GradientStop {
id: gradientStart
position: root.posStart
color: root.initialStartColor
}
GradientStop {
id: gradientStop
position: root.posStop
color: root.initialStopColor
}
}
startX: 0
startY: 0
PathLine { x: gradientShape.width; y: 0 }
PathLine { x: gradientShape.width; y: gradientShape.height }
PathLine { x: 0; y: gradientShape.height }
PathLine { x: 0; y: 0 }
}
states: [
State {
name: "black";
when: isOpenGL && MoneroComponents.Style.blackTheme
when: GraphicsInfo.api !== GraphicsInfo.Software && MoneroComponents.Style.blackTheme
PropertyChanges {
target: gradientStart
color: root.blackColorStart
@@ -87,7 +102,7 @@ Item {
}
}, State {
name: "white";
when: isOpenGL && !MoneroComponents.Style.blackTheme
when: GraphicsInfo.api !== GraphicsInfo.Software && !MoneroComponents.Style.blackTheme
PropertyChanges {
target: gradientStart
color: root.whiteColorStart
+9 -7
View File
@@ -26,15 +26,16 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick
import QtQuick.Effects
import FontAwesome
import "../" as MoneroComponents
import FontAwesome 1.0
Item {
// Use this component to color+opacity change images with transparency (svg/png)
// Does not work in low graphics mode, use fontAwesome fallback option.
// Does not work with the software renderer, use the FontAwesome fallback.
id: root
property string image: ""
@@ -63,12 +64,13 @@ Item {
visible: false
}
ColorOverlay {
MultiEffect {
id: imgMockColor
anchors.fill: root
source: svgMask
color: root.color
visible: image && isOpenGL
colorization: 1.0
colorizationColor: root.color
visible: image && GraphicsInfo.api !== GraphicsInfo.Software
}
Text {
+52 -58
View File
@@ -1,76 +1,70 @@
pragma Singleton
import QtQuick 2.9
Object {
import QtQuick
QtObject {
//Font Awesome version 5.15.3
FontLoader {
id: regular
readonly property FontLoader regular: FontLoader {
source: "./fa-regular-400.otf"
}
FontLoader {
id: brands
readonly property FontLoader brands: FontLoader {
source: "./fa-brands-400.otf"
}
FontLoader {
id: solid
readonly property FontLoader solid: FontLoader {
source: "./fa-solid-900.otf"
}
property string fontFamily: regular.name
property string fontFamilyBrands: brands.name
property string fontFamilySolid: solid.name
readonly property string fontFamily: regular.name
readonly property string fontFamilyBrands: brands.name
readonly property string fontFamilySolid: solid.name
// Icons used in Monero GUI (Font Awesome version 5.15.3)
// To add new icons, check unicodes in Font Awesome Free's Cheatsheet:
// https://fontawesome.com/v5/cheatsheet/free/solid
// https://fontawesome.com/v5/cheatsheet/free/regular
// https://fontawesome.com/v5/cheatsheet/free/brands
property string addressBook : "\uf2b9"
property string arrowCircleRight : "\uf0a9"
property string arrowDown : "\uf063"
property string arrowLeft : "\uf060"
property string arrowRight : "\uf061"
property string cashRegister: "\uf788"
property string checkCircle: "\uf058"
property string clipboard : "\uf0ea"
property string clockO : "\uf017"
property string cloud : "\uf0c2"
property string desktop : "\uf108"
property string edit : "\uf044"
property string ellipsisH : "\uf141"
property string exclamationCircle : "\uf06a"
property string eye : "\uf06e"
property string eyeSlash : "\uf070"
property string folderOpen : "\uf07c"
property string globe : "\uf0ac"
property string home : "\uf015"
property string houseUser : "\ue065"
property string infinity : "\uf534"
property string info : "\uf129"
property string key : "\uf084"
property string language : "\uf1ab"
property string lock : "\uf023"
property string magnifyingGlass : "\uf002"
property string minus : "\uf068"
property string minusCircle : "\uf056"
property string moonO : "\uf186"
property string monero : "\uf3d0"
property string paste : "\uf0ea"
property string pencilSquare : "\uf14b"
property string plus : "\uf067"
property string plusCircle : "\uf055"
property string productHunt : "\uf288"
property string qrcode : "\uf029"
property string questionCircle : "\uf059"
property string random : "\uf074"
property string repeat : "\uf01e"
property string searchPlus : "\uf00e"
property string server : "\uf233"
property string shieldAlt : "\uf3ed"
property string signOutAlt : "\uf2f5"
property string times : "\uf00d"
readonly property string addressBook: "\uf2b9"
readonly property string arrowCircleRight: "\uf0a9"
readonly property string arrowDown: "\uf063"
readonly property string arrowLeft: "\uf060"
readonly property string arrowRight: "\uf061"
readonly property string cashRegister: "\uf788"
readonly property string checkCircle: "\uf058"
readonly property string clipboard: "\uf0ea"
readonly property string clockO: "\uf017"
readonly property string cloud: "\uf0c2"
readonly property string desktop: "\uf108"
readonly property string edit: "\uf044"
readonly property string ellipsisH: "\uf141"
readonly property string exclamationCircle: "\uf06a"
readonly property string eye: "\uf06e"
readonly property string eyeSlash: "\uf070"
readonly property string folderOpen: "\uf07c"
readonly property string globe: "\uf0ac"
readonly property string home: "\uf015"
readonly property string houseUser: "\ue065"
readonly property string infinity: "\uf534"
readonly property string info: "\uf129"
readonly property string key: "\uf084"
readonly property string language: "\uf1ab"
readonly property string lock: "\uf023"
readonly property string magnifyingGlass: "\uf002"
readonly property string minus: "\uf068"
readonly property string minusCircle: "\uf056"
readonly property string moonO: "\uf186"
readonly property string monero: "\uf3d0"
readonly property string paste: "\uf0ea"
readonly property string pencilSquare: "\uf14b"
readonly property string plus: "\uf067"
readonly property string plusCircle: "\uf055"
readonly property string productHunt: "\uf288"
readonly property string qrcode: "\uf029"
readonly property string questionCircle: "\uf059"
readonly property string random: "\uf074"
readonly property string repeat: "\uf01e"
readonly property string searchPlus: "\uf00e"
readonly property string server: "\uf233"
readonly property string shieldAlt: "\uf3ed"
readonly property string signOutAlt: "\uf2f5"
readonly property string times: "\uf00d"
}
-8
View File
@@ -1,8 +0,0 @@
import QtQuick 2.9
QtObject {
id: object
default property alias children: object.__children
property list<QtObject> __children: [QtObject {}]
}
+1 -1
View File
@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="14" viewBox="0 0 8 14">
<path fill="none" fill-rule="evenodd" stroke="#404040" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2" d="M1 1l6 6-6 6" opacity="1"/>
<path fill="none" fill-rule="evenodd" stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2" d="M1 1l6 6-6 6" opacity="1"/>
</svg>

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

+6
View File
@@ -28,6 +28,12 @@ function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
function finishSettingsLoad(settings) {
// Qt may save defaults over existing settings when a new setting is added.
// Refresh the pending save after all settings have loaded.
settings.wallet_pathChanged();
}
function showSeedPage() {
// Shows `Settings->Seed & keys`. Prompts a password dialog.
passwordDialog.onAcceptedCallback = function() {
+40 -47
View File
@@ -26,15 +26,16 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQml.Models 2.2
import QtQuick 2.9
import QtQuick.Window 2.0
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Dialogs 1.2
import QtGraphicalEffects 1.0
import QtQml.Models
import QtCore
import QtQuick
import QtQuick.Effects
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Dialogs
import FontAwesome 1.0
import FontAwesome
import moneroComponents.Network 1.0
import moneroComponents.Wallet 1.0
@@ -68,7 +69,7 @@ ApplicationWindow {
property bool hideBalanceForced: false
property bool ctrlPressed: false
property alias persistentSettings : persistentSettings
property string accountsDir: !persistentSettings.portable ? moneroAccountsDir : persistentSettings.portableFolderName + "/wallets"
property string accountsDir: !portableSettings.portable ? moneroAccountsDir : portableSettings.portableFolderName + "/wallets"
property var currentWallet;
property bool disconnected: currentWallet ? currentWallet.disconnected : false
property var transaction;
@@ -838,7 +839,6 @@ ApplicationWindow {
middlePanel.advancedView.miningView.update()
informationPopup.text += qsTr("\n\nExiting p2pool. Please check that port 18083 is available.") + translationManager.emptyString;
}
informationPopup.icon = StandardIcon.Critical
informationPopup.onCloseCallback = null
informationPopup.open();
}
@@ -1000,8 +1000,8 @@ ApplicationWindow {
FileDialog {
id: saveTxDialog
title: "Please choose a location"
folder: "file://" + appWindow.accountsDir
selectExisting: false;
currentFolder: "file://" + appWindow.accountsDir
fileMode: FileDialog.SaveFile
onAccepted: {
handleTransactionConfirmed()
@@ -1046,12 +1046,12 @@ ApplicationWindow {
// View only wallet - we save the tx
if(viewOnly){
// No file specified - abort
if(!saveTxDialog.fileUrl) {
if(!saveTxDialog.selectedFile.toString()) {
rejectPendingTransaction()
return;
}
var path = walletManager.urlToLocalPath(saveTxDialog.fileUrl)
var path = walletManager.urlToLocalPath(saveTxDialog.selectedFile)
// Store to file
transaction.setFilename(path);
@@ -1068,7 +1068,6 @@ ApplicationWindow {
console.log("Error committing transaction: " + transaction.errorString);
informationPopup.title = qsTr("Error") + translationManager.emptyString
informationPopup.text = qsTr("Couldn't send the money: ") + transaction.errorString
informationPopup.icon = StandardIcon.Critical
informationPopup.onCloseCallback = null;
informationPopup.open();
} else {
@@ -1125,10 +1124,8 @@ ApplicationWindow {
if (result.indexOf("error|") === 0) {
var errorString = result.split("|")[1];
informationPopup.text = qsTr("Couldn't generate a proof because of the following reason: \n") + errorString + translationManager.emptyString;
informationPopup.icon = StandardIcon.Critical;
} else {
informationPopup.text = result;
informationPopup.icon = StandardIcon.Critical;
}
}
@@ -1159,10 +1156,8 @@ ApplicationWindow {
var confirmations = results[4];
informationPopup.title = qsTr("Payment proof check") + translationManager.emptyString;
informationPopup.icon = StandardIcon.Information
if (!good) {
informationPopup.text = qsTr("Bad signature");
informationPopup.icon = StandardIcon.Critical;
} else if (received > 0) {
if (in_pool) {
informationPopup.text = qsTr("This address received %1 monero, but the transaction is not yet mined").arg(walletManager.displayAmount(received));
@@ -1178,19 +1173,16 @@ ApplicationWindow {
else if (results.length == 2 && results[0] === "true") {
var good = results[1] === "true";
informationPopup.title = qsTr("Payment proof check") + translationManager.emptyString;
informationPopup.icon = good ? StandardIcon.Information : StandardIcon.Critical;
informationPopup.text = good ? qsTr("Good signature") : qsTr("Bad signature");
}
else if (isReserveProof && results[0] === "true") {
var good = results[1] === "true";
informationPopup.title = qsTr("Reserve proof check") + translationManager.emptyString;
informationPopup.icon = good ? StandardIcon.Information : StandardIcon.Critical;
informationPopup.text = good ? qsTr("Good signature on %1 total and %2 spent.").arg(walletManager.displayAmount(results[2])).arg(walletManager.displayAmount(results[3])) : qsTr("Bad signature");
}
else {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = currentWallet.errorString;
informationPopup.icon = StandardIcon.Critical
}
informationPopup.onCloseCallback = null
informationPopup.open()
@@ -1404,7 +1396,7 @@ ApplicationWindow {
function fiatApiUpdateBalance(balance){
// update balance card
var bFiat = "?.??"
if (!hideBalanceForced && !persistentSettings.hideBalance) {
if (!hideBalanceForced && !persistentSettings.hideBalance && appWindow.fiatPrice > 0) {
bFiat = fiatApiConvertToFiat(balance);
}
leftPanel.balanceFiatString = bFiat;
@@ -1415,7 +1407,7 @@ ApplicationWindow {
}
Component.onCompleted: {
logger.resetLogFilePath(persistentSettings.portable);
logger.resetLogFilePath(portableSettings.portable);
if (persistentSettings.logLevel == 5)
walletManager.setLogCategories(persistentSettings.logCategories)
else
@@ -1450,16 +1442,14 @@ ApplicationWindow {
mainApp.closing.connect(appWindow.close);
if( appWindow.qrScannerEnabled ){
console.log("qrScannerEnabled : load component QRCodeScanner");
var component = Qt.createComponent("components/QRCodeScanner.qml");
if (component.status == Component.Ready) {
console.log("Camera component ready");
cameraUi = component.createObject(appWindow);
} else {
console.log("component not READY !!!");
console.error("QR scanner component not ready:", component.errorString());
appWindow.qrScannerEnabled = false;
}
} else console.log("qrScannerEnabled disabled");
}
if(!walletsFound()) {
wizard.wizardState = "wizardLanguage";
@@ -1471,7 +1461,7 @@ ApplicationWindow {
}
const desktopEntryEnabled = (typeof builtWithDesktopEntry != "undefined") && builtWithDesktopEntry;
if (persistentSettings.askDesktopShortcut && !persistentSettings.portable && desktopEntryEnabled) {
if (persistentSettings.askDesktopShortcut && !portableSettings.portable && desktopEntryEnabled) {
persistentSettings.askDesktopShortcut = false;
if (isTails) {
@@ -1479,7 +1469,6 @@ ApplicationWindow {
} else if (isLinux) {
confirmationDialog.title = qsTr("Desktop entry") + translationManager.emptyString;
confirmationDialog.text = qsTr("Would you like to register Monero GUI Desktop entry?") + translationManager.emptyString;
confirmationDialog.icon = StandardIcon.Question;
confirmationDialog.cancelText = qsTr("No") + translationManager.emptyString;
confirmationDialog.okText = qsTr("Yes") + translationManager.emptyString;
confirmationDialog.onAcceptedCallback = function() {
@@ -1493,13 +1482,19 @@ ApplicationWindow {
remoteNodesModel.initialize();
}
MoneroSettings {
id: persistentSettings
fileName: {
PortableSettings {
id: portableSettings
settings: persistentSettings
unportableFileName: {
if(isTails && tailsUsePersistence)
return homePath + "/Persistent/Monero/monero-core.conf";
return "";
}
}
Settings {
id: persistentSettings
location: portableSettings.location
property bool askDesktopShortcut: isLinux
property bool askStopLocalNode: true
@@ -1603,6 +1598,7 @@ ApplicationWindow {
fiatPriceProvider = "kraken";
fiatPriceEnabled = false;
}
Utils.finishSettingsLoad(persistentSettings)
}
}
@@ -1771,18 +1767,17 @@ ApplicationWindow {
}
// Choose blockchain folder
FileDialog {
FolderDialog {
id: blockchainFileDialog
property string directory: ""
signal changed();
title: "Please choose a folder"
selectFolder: true
folder: "file://" + persistentSettings.blockchainDataDir
currentFolder: "file://" + persistentSettings.blockchainDataDir
onRejected: console.log("data dir selection canceled")
onAccepted: {
var dataDir = walletManager.urlToLocalPath(blockchainFileDialog.fileUrl)
var dataDir = walletManager.urlToLocalPath(blockchainFileDialog.selectedFolder)
var validator = daemonManager.validateDataDir(dataDir, estimatedBlockchainSize);
if(validator.valid) {
persistentSettings.blockchainDataDir = dataDir;
@@ -1798,8 +1793,6 @@ ApplicationWindow {
if(!validator.lmdbExists)
confirmationDialog.text += qsTr("Note: lmdb folder not found. A new folder will be created.") + "\n\n"
confirmationDialog.icon = StandardIcon.Question
// Continue
confirmationDialog.onAcceptedCallback = function() {
persistentSettings.blockchainDataDir = dataDir
@@ -1810,7 +1803,7 @@ ApplicationWindow {
confirmationDialog.open()
}
blockchainFileDialog.directory = blockchainFileDialog.fileUrl;
blockchainFileDialog.directory = blockchainFileDialog.selectedFolder;
delete validator;
}
}
@@ -1835,11 +1828,9 @@ ApplicationWindow {
appWindow.walletPassword = passwordDialog.password;
informationPopup.title = qsTr("Information") + translationManager.emptyString;
informationPopup.text = qsTr("Password changed successfully") + translationManager.emptyString;
informationPopup.icon = StandardIcon.Information;
} else {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Error: ") + currentWallet.errorString;
informationPopup.icon = StandardIcon.Critical;
}
informationPopup.onCloseCallback = null;
informationPopup.open();
@@ -1995,11 +1986,14 @@ ApplicationWindow {
}
}
FastBlur {
MultiEffect {
id: blur
anchors.fill: blurredArea
source: blurredArea
radius: 64
blurEnabled: true
blurMax: 64
blur: 1.0
autoPaddingEnabled: false
visible: passwordDialog.visible || inputDialog.visible || splash.visible || updateDialog.visible ||
devicePassphraseDialog.visible || txConfirmationPopup.visible || successfulTxPopup.visible ||
remoteNodeDialog.visible
@@ -2241,7 +2235,6 @@ ApplicationWindow {
// Show confirmation dialog
confirmationDialog.title = qsTr("Local node is running") + translationManager.emptyString;
confirmationDialog.text = qsTr("Do you want to stop local node or keep it running in the background?") + translationManager.emptyString;
confirmationDialog.icon = StandardIcon.Question;
confirmationDialog.cancelText = qsTr("Force stop") + translationManager.emptyString;
confirmationDialog.okText = qsTr("Keep it running") + translationManager.emptyString;
confirmationDialog.onAcceptedCallback = function() {
@@ -2253,7 +2246,7 @@ ApplicationWindow {
confirmationDialog.open();
}
onClosing: {
onClosing: function(close) {
close.accepted = false;
console.log("blocking close event");
if(isAndroid) {
@@ -2454,7 +2447,7 @@ ApplicationWindow {
anchors.fill: parent
anchors.topMargin: titleBar.height
color: MoneroComponents.Style.blackTheme ? "black" : "white"
opacity: isOpenGL ? 0.3 : inputDialog.visible || splash.visible ? 0.7 : 1.0
opacity: GraphicsInfo.api !== GraphicsInfo.Software ? 0.3 : inputDialog.visible || splash.visible ? 0.7 : 1.0
MoneroEffects.ColorTransition {
targetObj: parent
+8 -8
View File
@@ -26,12 +26,12 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import FontAwesome 1.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import FontAwesome
import "../components" as MoneroComponents
import "../components/effects/" as MoneroEffects
@@ -339,7 +339,7 @@ Rectangle {
fontAwesomeFallbackIcon: FontAwesome.edit
fontAwesomeFallbackSize: 22
color: MoneroComponents.Style.defaultFontColor
opacity: isOpenGL ? 0.5 : 1
opacity: GraphicsInfo.api !== GraphicsInfo.Software ? 0.5 : 1
fontAwesomeFallbackOpacity: 0.5
Layout.preferredWidth: 23
Layout.preferredHeight: 21
@@ -354,7 +354,7 @@ Rectangle {
fontAwesomeFallbackIcon: FontAwesome.clipboard
fontAwesomeFallbackSize: 22
color: MoneroComponents.Style.defaultFontColor
opacity: isOpenGL ? 0.5 : 1
opacity: GraphicsInfo.api !== GraphicsInfo.Software ? 0.5 : 1
fontAwesomeFallbackOpacity: 0.5
Layout.preferredWidth: 16
Layout.preferredHeight: 21
+9 -10
View File
@@ -26,10 +26,12 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import FontAwesome
import "../components" as MoneroComponents
import "../components/effects/" as MoneroEffects
@@ -39,7 +41,6 @@ import moneroComponents.AddressBook 1.0
import moneroComponents.AddressBookModel 1.0
import moneroComponents.Clipboard 1.0
import moneroComponents.NetworkType 1.0
import FontAwesome 1.0
Rectangle {
id: root
@@ -223,7 +224,7 @@ Rectangle {
id: sendToButton
image: "qrc:///images/arrow-right-in-circle-outline-medium-white.svg"
color: MoneroComponents.Style.defaultFontColor
opacity: isOpenGL ? 0.5 : 1
opacity: GraphicsInfo.api !== GraphicsInfo.Software ? 0.5 : 1
fontAwesomeFallbackIcon: FontAwesome.arrowRight
fontAwesomeFallbackSize: 22
fontAwesomeFallbackOpacity: 0.5
@@ -252,7 +253,7 @@ Rectangle {
id: editEntryButton
image: "qrc:///images/edit.svg"
color: MoneroComponents.Style.defaultFontColor
opacity: isOpenGL ? 0.5 : 1
opacity: GraphicsInfo.api !== GraphicsInfo.Software ? 0.5 : 1
fontAwesomeFallbackIcon: FontAwesome.edit
fontAwesomeFallbackSize: 22
fontAwesomeFallbackOpacity: 0.5
@@ -270,7 +271,7 @@ Rectangle {
id: copyButton
image: "qrc:///images/copy.svg"
color: MoneroComponents.Style.defaultFontColor
opacity: isOpenGL ? 0.5 : 1
opacity: GraphicsInfo.api !== GraphicsInfo.Software ? 0.5 : 1
fontAwesomeFallbackIcon: FontAwesome.clipboard
fontAwesomeFallbackSize: 22
fontAwesomeFallbackOpacity: 0.5
@@ -539,7 +540,6 @@ Rectangle {
function oa_message(text) {
oaPopup.title = qsTr("OpenAlias error") + translationManager.emptyString
oaPopup.text = text
oaPopup.icon = StandardIcon.Information
oaPopup.onCloseCallback = null
oaPopup.open()
}
@@ -550,7 +550,6 @@ Rectangle {
qsTr("OpenAlias: ") + openAlias + "\n\n" +
qsTr("Resolved address: ") + resolvedAddress + "\n\n" +
qsTr("Only use this address if you trust this OpenAlias result.") + translationManager.emptyString
confirmationDialog.icon = StandardIcon.Question
confirmationDialog.cancelText = qsTr("Cancel") + translationManager.emptyString
confirmationDialog.okText = qsTr("Use address") + translationManager.emptyString
confirmationDialog.onAcceptedCallback = onAccepted
+10 -25
View File
@@ -26,10 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../components" as MoneroComponents
import "."
@@ -94,7 +93,13 @@ ColumnLayout {
}
previousView = currentView
if (currentView) {
stackView.replace(currentView)
if (stackView.currentItem !== currentView) {
if (stackView.depth > 0) {
stackView.replace(currentView)
} else {
stackView.push(currentView)
}
}
if (typeof currentView.onPageCompleted === "function") {
currentView.onPageCompleted();
}
@@ -127,26 +132,6 @@ ColumnLayout {
anchors.fill: parent
clip: false // otherwise animation will affect left panel
delegate: StackViewDelegate {
pushTransition: StackViewTransition {
PropertyAnimation {
target: enterItem
property: "x"
from: (navbarId.currentIndex < navbarId.previousIndex ? 1 : -1) * - target.width
to: 0
duration: 300
easing.type: Easing.OutCubic
}
PropertyAnimation {
target: exitItem
property: "x"
from: 0
to: (navbarId.currentIndex < navbarId.previousIndex ? 1 : -1) * target.width
duration: 300
easing.type: Easing.OutCubic
}
}
}
}
}
+12 -14
View File
@@ -26,17 +26,17 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtGraphicalEffects 1.0
import QtQuick
import QtQuick.Layouts
import QtQuick.Dialogs
import FontAwesome
import moneroComponents.Wallet 1.0
import moneroComponents.WalletManager 1.0
import moneroComponents.TransactionHistory 1.0
import moneroComponents.TransactionInfo 1.0
import moneroComponents.TransactionHistoryModel 1.0
import moneroComponents.Clipboard 1.0
import FontAwesome 1.0
import "../components/effects/" as MoneroEffects
import "../components" as MoneroComponents
@@ -1514,8 +1514,8 @@ Rectangle {
root.txOffset = 0;
root.txData.sort(function(a, b) {
if (root.sortBy === "blockheight") {
var aPending = typeof a.blockheight === "undefined";
var bPending = typeof b.blockheight === "undefined";
var aPending = a.blockheight === "";
var bPending = b.blockheight === "";
if (aPending !== bPending)
return aPending ? 1 : -1;
if (aPending)
@@ -1588,7 +1588,8 @@ Rectangle {
var destinationAddresses = _model.data(idx, TransactionHistoryModel.TransactionDestinationAddressesRole);
var time = _model.data(idx, TransactionHistoryModel.TransactionTimeRole);
var date = _model.data(idx, TransactionHistoryModel.TransactionDateRole);
var blockheight = _model.data(idx, TransactionHistoryModel.TransactionBlockHeightRole);
var blockheightValue = _model.data(idx, TransactionHistoryModel.TransactionBlockHeightRole);
var blockheight = blockheightValue == null ? "" : blockheightValue.toString();
var confirmations = _model.data(idx, TransactionHistoryModel.TransactionConfirmationsRole);
var confirmationsRequired = _model.data(idx, TransactionHistoryModel.TransactionConfirmationsRequiredRole);
var fee = _model.data(idx, TransactionHistoryModel.TransactionFeeRole);
@@ -1809,15 +1810,14 @@ Rectangle {
+ translationManager.emptyString;
}
FileDialog {
FolderDialog {
id: writeCSVFileDialog
title: qsTr("Please choose a folder") + translationManager.emptyString
selectFolder: true
onRejected: {
console.log("csv write canceled")
}
onAccepted: {
var dataDir = walletManager.urlToLocalPath(writeCSVFileDialog.fileUrl);
var dataDir = walletManager.urlToLocalPath(writeCSVFileDialog.selectedFolder);
var written = currentWallet.history.writeCSV(currentWallet.currentSubaddressAccount, dataDir);
if(written !== ""){
@@ -1825,7 +1825,6 @@ Rectangle {
var text = qsTr("CSV file written to: %1").arg(written) + "\n\n"
text += qsTr("Tip: Use your favorite spreadsheet software to sort on blockheight.") + "\n\n" + translationManager.emptyString;
confirmationDialog.text = text;
confirmationDialog.icon = StandardIcon.Information;
confirmationDialog.cancelText = qsTr("Open folder") + translationManager.emptyString;
confirmationDialog.onAcceptedCallback = null;
confirmationDialog.onRejectedCallback = function() {
@@ -1835,7 +1834,6 @@ Rectangle {
} else {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Error exporting transaction data.") + "\n\n" + translationManager.emptyString;
informationPopup.icon = StandardIcon.Critical;
informationPopup.onCloseCallback = null;
informationPopup.open();
@@ -1848,7 +1846,7 @@ Rectangle {
}
catch(err) {}
finally {
writeCSVFileDialog.folder = _folder;
writeCSVFileDialog.currentFolder = _folder;
}
}
}
+2 -7
View File
@@ -26,15 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Layouts
import moneroComponents.Clipboard 1.0
import "../version.js" as Version
import "../components" as MoneroComponents
import "." 1.0
Rectangle {
+4 -8
View File
@@ -26,10 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQml.Models 2.2
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtQml.Models
import QtQuick
import QtQuick.Layouts
import QtQuick.Dialogs
import "../components" as MoneroComponents
import moneroComponents.Wallet 1.0
import moneroComponents.P2PoolManager 1.0
@@ -305,7 +305,6 @@ Rectangle {
else {
confirmationDialog.title = qsTr("P2Pool installation") + translationManager.emptyString;
confirmationDialog.text = qsTr("P2Pool will be installed at %1. Proceed?").arg(applicationDirectory) + translationManager.emptyString;
confirmationDialog.icon = StandardIcon.Question;
confirmationDialog.cancelText = qsTr("No") + translationManager.emptyString;
confirmationDialog.okText = qsTr("Yes") + translationManager.emptyString;
confirmationDialog.onAcceptedCallback = function() {
@@ -586,7 +585,6 @@ Rectangle {
errorPopup.text = message
if (persistentSettings.useRemoteNode && !persistentSettings.allowRemoteNodeMining)
errorPopup.text += qsTr("Mining is only available on local daemons. Run a local daemon to be able to mine.<br>") + translationManager.emptyString
errorPopup.icon = StandardIcon.Critical
errorPopup.open()
}
@@ -681,7 +679,6 @@ allArgs = allArgs.filter( ( el ) => !defaultArgs.includes( el.split(" ")[0] ) )
default:
errorPopup.text = qsTr("Unknown error.") + translationManager.emptyString;
}
errorPopup.icon = StandardIcon.Critical
errorPopup.open()
update()
}
@@ -690,7 +687,6 @@ allArgs = allArgs.filter( ( el ) => !defaultArgs.includes( el.split(" ")[0] ) )
statusMessage.visible = false
informationPopup.title = qsTr("P2Pool Installation Succeeded") + translationManager.emptyString;
informationPopup.text = qsTr("P2Pool has successfully installed.");
informationPopup.icon = StandardIcon.Critical
informationPopup.open()
update()
}
+19 -21
View File
@@ -26,12 +26,12 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import FontAwesome 1.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import FontAwesome
import "../components" as MoneroComponents
import "../components/effects/" as MoneroEffects
@@ -153,7 +153,7 @@ Rectangle {
acceptedButtons: Qt.LeftButton | Qt.RightButton
onEntered: qrCodeTooltip.tooltipPopup.open()
onExited: qrCodeTooltip.tooltipPopup.close()
onClicked: {
onClicked: (mouse) => {
if (mouse.button == Qt.LeftButton){
walletManager.saveQrCodeToClipboard(generateQRCodeString());
appWindow.showStatusMessage(qsTr("QR code copied to clipboard") + translationManager.emptyString, 3);
@@ -279,8 +279,8 @@ Rectangle {
amountToReceiveXMR.text = fiatApiConvertToXMR(amountToReceiveFiat.text);
}
}
validator: RegExpValidator {
regExp: /^\s*(\d{1,8})?([\.,]\d{1,2})?\s*$/
validator: RegularExpressionValidator {
regularExpression: /^\s*(\d{1,8})?([\.,]\d{1,2})?\s*$/
}
}
@@ -339,8 +339,8 @@ Rectangle {
amountToReceiveFiat.text = fiatApiConvertToFiat(amountToReceiveXMR.text);
}
}
validator: RegExpValidator {
regExp: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/
validator: RegularExpressionValidator {
regularExpression: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/
}
}
@@ -694,7 +694,7 @@ Rectangle {
fontAwesomeFallbackIcon: FontAwesome.edit
fontAwesomeFallbackSize: 22
color: MoneroComponents.Style.defaultFontColor
opacity: isOpenGL ? 0.5 : 1
opacity: GraphicsInfo.api !== GraphicsInfo.Software ? 0.5 : 1
fontAwesomeFallbackOpacity: 0.5
Layout.preferredWidth: 23
Layout.preferredHeight: 21
@@ -712,7 +712,7 @@ Rectangle {
fontAwesomeFallbackIcon: FontAwesome.clipboard
fontAwesomeFallbackSize: 22
color: MoneroComponents.Style.defaultFontColor
opacity: isOpenGL ? 0.5 : 1
opacity: GraphicsInfo.api !== GraphicsInfo.Software ? 0.5 : 1
fontAwesomeFallbackOpacity: 0.5
Layout.preferredWidth: 16
Layout.preferredHeight: 21
@@ -745,24 +745,22 @@ Rectangle {
MessageDialog {
id: receivePageDialog
standardButtons: StandardButton.Ok
buttons: MessageDialog.Ok
}
FileDialog {
id: qrFileDialog
title: qsTr("Please choose a name") + translationManager.emptyString
folder: shortcuts.pictures
selectExisting: false
fileMode: FileDialog.SaveFile
nameFilters: ["Image (*.png)"]
onAccepted: {
if(!walletManager.saveQrCode(generateQRCodeString(), walletManager.urlToLocalPath(fileUrl))) {
console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(fileUrl) )
if(!walletManager.saveQrCode(generateQRCodeString(), walletManager.urlToLocalPath(selectedFile))) {
console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(selectedFile) )
receivePageDialog.title = qsTr("Save QrCode") + translationManager.emptyString;
receivePageDialog.text = qsTr("Failed to save QrCode to ") + walletManager.urlToLocalPath(fileUrl) + translationManager.emptyString;
receivePageDialog.icon = StandardIcon.Error
receivePageDialog.text = qsTr("Failed to save QrCode to ") + walletManager.urlToLocalPath(selectedFile) + translationManager.emptyString;
receivePageDialog.open()
} else {
appWindow.showStatusMessage(qsTr("QR code saved to ") + walletManager.urlToLocalPath(fileUrl) + translationManager.emptyString, 3);
appWindow.showStatusMessage(qsTr("QR code saved to ") + walletManager.urlToLocalPath(selectedFile) + translationManager.emptyString, 3);
}
}
}
+5 -6
View File
@@ -26,11 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import "../components" as MoneroComponents
import moneroComponents.Clipboard 1.0
@@ -81,7 +80,7 @@ Rectangle {
MessageDialog {
id: sharedRingDBDialog
standardButtons: StandardButton.Ok
buttons: MessageDialog.Ok
}
MoneroComponents.Label {
+8 -12
View File
@@ -26,11 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Layouts
import QtQuick.Dialogs
import moneroComponents.Clipboard 1.0
import moneroComponents.WalletManager 1.0
@@ -49,7 +47,7 @@ Rectangle {
// dynamically change onclose handler
property var onCloseCallback
id: signatureVerificationMessage
standardButtons: StandardButton.Ok
buttons: MessageDialog.Ok
onAccepted: {
if (onCloseCallback) {
onCloseCallback()
@@ -72,12 +70,10 @@ Rectangle {
if (result.old) {
signatureVerificationMessage.text += "\n\n" + qsTr("This signature uses the old signing algorithm.") + translationManager.emptyString
}
signatureVerificationMessage.icon = StandardIcon.Information
}
else {
signatureVerificationMessage.title = qsTr("Bad signature") + translationManager.emptyString
signatureVerificationMessage.text = qsTr("This signature did not verify") + translationManager.emptyString
signatureVerificationMessage.icon = StandardIcon.Critical
}
signatureVerificationMessage.open()
}
@@ -412,22 +408,22 @@ Rectangle {
FileDialog {
id: signFileDialog
title: qsTr("Please choose a file to sign") + translationManager.emptyString;
folder: "file://"
currentFolder: "file://"
nameFilters: [ "*"]
onAccepted: {
signFileLine.text = walletManager.urlToLocalPath(signFileDialog.fileUrl)
signFileLine.text = walletManager.urlToLocalPath(signFileDialog.selectedFile)
}
}
FileDialog {
id: verifyFileDialog
title: qsTr("Please choose a file to verify") + translationManager.emptyString;
folder: "file://"
currentFolder: "file://"
nameFilters: [ "*"]
onAccepted: {
verifyFileLine.text = walletManager.urlToLocalPath(verifyFileDialog.fileUrl)
verifyFileLine.text = walletManager.urlToLocalPath(verifyFileDialog.selectedFile)
}
}
}
+23 -34
View File
@@ -26,16 +26,17 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQml.Models 2.2
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtQml.Models
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import FontAwesome
import moneroComponents.Clipboard 1.0
import moneroComponents.PendingTransaction 1.0
import moneroComponents.Wallet 1.0
import moneroComponents.NetworkType 1.0
import FontAwesome 1.0
import "../components"
import "../components" as MoneroComponents
import "." 1.0
@@ -100,7 +101,6 @@ Rectangle {
function oa_message(text) {
oaPopup.title = qsTr("OpenAlias error") + translationManager.emptyString
oaPopup.text = text
oaPopup.icon = StandardIcon.Information
oaPopup.onCloseCallback = null
oaPopup.open()
}
@@ -111,7 +111,6 @@ Rectangle {
qsTr("OpenAlias: ") + openAlias + "\n\n" +
qsTr("Resolved address: ") + resolvedAddress + "\n\n" +
qsTr("Only use this address if you trust this OpenAlias result.") + translationManager.emptyString
confirmationDialog.icon = StandardIcon.Question
confirmationDialog.cancelText = qsTr("Cancel") + translationManager.emptyString
confirmationDialog.okText = qsTr("Use address") + translationManager.emptyString
confirmationDialog.onAcceptedCallback = onAccepted
@@ -520,8 +519,8 @@ Rectangle {
amount = text;
}
validator: RegExpValidator {
regExp: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/
validator: RegularExpressionValidator {
regularExpression: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/
}
}
@@ -1022,11 +1021,11 @@ Rectangle {
FileDialog {
id: signTxDialog
title: qsTr("Please choose a file") + translationManager.emptyString
folder: "file://" + appWindow.accountsDir
currentFolder: "file://" + appWindow.accountsDir
nameFilters: [ "Unsigned transfers (*)"]
onAccepted: {
var path = walletManager.urlToLocalPath(fileUrl);
var path = walletManager.urlToLocalPath(selectedFile);
// Load the unsigned tx from file
var transaction = currentWallet.loadTxFile(path);
@@ -1034,7 +1033,6 @@ Rectangle {
console.error("Can't load unsigned transaction: ", transaction.errorString);
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Can't load unsigned transaction: ") + transaction.errorString
informationPopup.icon = StandardIcon.Critical
informationPopup.onCloseCallback = null
informationPopup.open();
// deleting transaction object, we don't want memleaks
@@ -1045,7 +1043,6 @@ Rectangle {
// Show confirmation dialog
confirmationDialog.title = qsTr("Confirmation") + translationManager.emptyString
confirmationDialog.icon = StandardIcon.Question
confirmationDialog.onAcceptedCallback = function() {
transaction.sign(path+"_signed");
transaction.destroy();
@@ -1066,20 +1063,18 @@ Rectangle {
FileDialog {
id: submitTxDialog
title: qsTr("Please choose a file") + translationManager.emptyString
folder: "file://" + appWindow.accountsDir
currentFolder: "file://" + appWindow.accountsDir
nameFilters: [ "signed transfers (*)"]
onAccepted: {
if(!currentWallet.submitTxFile(walletManager.urlToLocalPath(fileUrl))){
if(!currentWallet.submitTxFile(walletManager.urlToLocalPath(selectedFile))){
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Can't submit transaction: ") + currentWallet.errorString
informationPopup.icon = StandardIcon.Critical
informationPopup.onCloseCallback = null
informationPopup.open();
} else {
informationPopup.title = qsTr("Information") + translationManager.emptyString
informationPopup.text = qsTr("Monero sent successfully") + translationManager.emptyString
informationPopup.icon = StandardIcon.Information
informationPopup.onCloseCallback = null
informationPopup.open();
}
@@ -1092,11 +1087,10 @@ Rectangle {
FileDialog {
id: exportOutputsDialog
selectMultiple: false
selectExisting: false
fileMode: FileDialog.SaveFile
onAccepted: {
console.log(walletManager.urlToLocalPath(exportOutputsDialog.fileUrl))
if (currentWallet.exportOutputs(walletManager.urlToLocalPath(exportOutputsDialog.fileUrl), true)) {
console.log(walletManager.urlToLocalPath(exportOutputsDialog.selectedFile))
if (currentWallet.exportOutputs(walletManager.urlToLocalPath(exportOutputsDialog.selectedFile), true)) {
appWindow.showStatusMessage(qsTr("Outputs successfully exported to file") + translationManager.emptyString, 3);
} else {
appWindow.showStatusMessage(currentWallet.errorString, 5);
@@ -1109,12 +1103,10 @@ Rectangle {
FileDialog {
id: importOutputsDialog
selectMultiple: false
selectExisting: true
title: qsTr("Please choose a file") + translationManager.emptyString
onAccepted: {
console.log(walletManager.urlToLocalPath(importOutputsDialog.fileUrl))
if (currentWallet.importOutputs(walletManager.urlToLocalPath(importOutputsDialog.fileUrl))) {
console.log(walletManager.urlToLocalPath(importOutputsDialog.selectedFile))
if (currentWallet.importOutputs(walletManager.urlToLocalPath(importOutputsDialog.selectedFile))) {
appWindow.showStatusMessage(qsTr("Outputs successfully imported to wallet") + translationManager.emptyString, 3);
} else {
appWindow.showStatusMessage(currentWallet.errorString, 5);
@@ -1128,11 +1120,10 @@ Rectangle {
//ExportKeyImagesDialog
FileDialog {
id: exportKeyImagesDialog
selectMultiple: false
selectExisting: false
fileMode: FileDialog.SaveFile
onAccepted: {
console.log(walletManager.urlToLocalPath(exportKeyImagesDialog.fileUrl))
if (currentWallet.exportKeyImages(walletManager.urlToLocalPath(exportKeyImagesDialog.fileUrl), true)) {
console.log(walletManager.urlToLocalPath(exportKeyImagesDialog.selectedFile))
if (currentWallet.exportKeyImages(walletManager.urlToLocalPath(exportKeyImagesDialog.selectedFile), true)) {
appWindow.showStatusMessage(qsTr("Key images successfully exported to file") + translationManager.emptyString, 3);
} else {
appWindow.showStatusMessage(currentWallet.errorString, 5);
@@ -1146,12 +1137,10 @@ Rectangle {
//ImportKeyImagesDialog
FileDialog {
id: importKeyImagesDialog
selectMultiple: false
selectExisting: true
title: qsTr("Please choose a file") + translationManager.emptyString
onAccepted: {
console.log(walletManager.urlToLocalPath(importKeyImagesDialog.fileUrl))
if (currentWallet.importKeyImages(walletManager.urlToLocalPath(importKeyImagesDialog.fileUrl))) {
console.log(walletManager.urlToLocalPath(importKeyImagesDialog.selectedFile))
if (currentWallet.importKeyImages(walletManager.urlToLocalPath(importKeyImagesDialog.selectedFile))) {
appWindow.showStatusMessage(qsTr("Key images successfully imported to wallet") + translationManager.emptyString, 3);
} else {
appWindow.showStatusMessage(currentWallet.errorString, 5);
+5 -6
View File
@@ -26,10 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../components" as MoneroComponents
import moneroComponents.Clipboard 1.0
@@ -125,8 +124,8 @@ Rectangle {
}
error = walletManager.amountFromString(text) > appWindow.getUnlockedBalance();
}
validator: RegExpValidator {
regExp: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/
validator: RegularExpressionValidator {
regularExpression: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/
}
}
+37 -44
View File
@@ -26,12 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtGraphicalEffects 1.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Effects
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Dialogs
import moneroComponents.Clipboard 1.0
import moneroComponents.Wallet 1.0
@@ -206,16 +205,15 @@ Item {
}
}
DropShadow {
MultiEffect {
anchors.fill: source
cached: true
horizontalOffset: 3
verticalOffset: 3
radius: 8.0
samples: 16
color: "#20000000"
smooth: true
source: tracker
shadowEnabled: true
shadowHorizontalOffset: 3
shadowVerticalOffset: 3
shadowBlur: 1.0
blurMax: 8
shadowColor: "#20000000"
}
Rectangle {
@@ -244,7 +242,7 @@ Item {
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
onClicked: (mouse) => {
if (mouse.button == Qt.RightButton){
qrMenu.x = this.mouseX;
qrMenu.y = this.mouseY;
@@ -266,16 +264,15 @@ Item {
}
}
DropShadow {
MultiEffect {
anchors.fill: source
cached: true
horizontalOffset: 3
verticalOffset: 3
radius: 8.0
samples: 16
color: "#30000000"
smooth: true
source: qrImg
shadowEnabled: true
shadowHorizontalOffset: 3
shadowVerticalOffset: 3
shadowBlur: 1.0
blurMax: 8
shadowColor: "#30000000"
}
}
@@ -398,7 +395,6 @@ Item {
// onClicked: {
// merchantPageDialog.title = qsTr("Payment URL") + translationManager.emptyString;
// merchantPageDialog.text = qsTr("payment url explanation")
// merchantPageDialog.icon = StandardIcon.Information
// merchantPageDialog.open()
// }
// }
@@ -451,16 +447,15 @@ Item {
}
}
DropShadow {
MultiEffect {
anchors.fill: source
cached: true
horizontalOffset: 3
verticalOffset: 3
radius: 8.0
samples: 16
color: "#20000000"
smooth: true
source: payment_url_container
shadowEnabled: true
shadowHorizontalOffset: 3
shadowVerticalOffset: 3
shadowBlur: 1.0
blurMax: 8
shadowColor: "#20000000"
}
Item {
@@ -513,8 +508,8 @@ Item {
amountToReceive.text = '0' + amountToReceive.text;
}
}
validator: RegExpValidator {
regExp: /^(\d{1,8})?([\.]\d{1,12})?$/
validator: RegularExpressionValidator {
regularExpression: /^(\d{1,8})?([\.]\d{1,12})?$/
}
}
}
@@ -653,7 +648,7 @@ Item {
var confirmations = 0;
var displayAmount = model.data(idx, TransactionHistoryModel.TransactionDisplayAmountRole);
if (blockHeight === undefined) {
if (!blockHeight) {
in_txpool = true;
} else {
confirmations = model.data(idx, TransactionHistoryModel.TransactionConfirmationsRole);
@@ -703,22 +698,20 @@ Item {
MessageDialog {
id: merchantPageDialog
standardButtons: StandardButton.Ok
buttons: MessageDialog.Ok
}
FileDialog {
id: qrFileDialog
title: "Please choose a name"
folder: shortcuts.pictures
selectExisting: false
fileMode: FileDialog.SaveFile
nameFilters: ["Image (*.png)"]
onAccepted: {
if (!walletManager.saveQrCode(walletManager.make_uri(appWindow.current_address, amountToReceive.text), walletManager.urlToLocalPath(fileUrl))) {
console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(fileUrl) )
receivePageDialog.title = qsTr("Save QrCode") + translationManager.emptyString;
receivePageDialog.text = qsTr("Failed to save QrCode to ") + walletManager.urlToLocalPath(fileUrl) + translationManager.emptyString;
receivePageDialog.icon = StandardIcon.Error
receivePageDialog.open()
if (!walletManager.saveQrCode(walletManager.make_uri(appWindow.current_address, amountToReceive.text), walletManager.urlToLocalPath(selectedFile))) {
console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(selectedFile) )
merchantPageDialog.title = qsTr("Save QrCode") + translationManager.emptyString;
merchantPageDialog.text = qsTr("Failed to save QrCode to ") + walletManager.urlToLocalPath(selectedFile) + translationManager.emptyString;
merchantPageDialog.open()
}
}
}
+10 -11
View File
@@ -26,9 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import QtQuick
import QtQuick.Effects
import QtQuick.Layouts
import "../../components" as MoneroComponents
@@ -60,16 +60,15 @@ Item {
source: "qrc:///images/uncheckedIcon.png"
}
}
DropShadow {
MultiEffect {
anchors.fill: source
cached: true
horizontalOffset: 3
verticalOffset: 3
radius: 8.0
samples: 16
color: "#20000000"
smooth: true
source: checkbox
shadowEnabled: true
shadowHorizontalOffset: 3
shadowVerticalOffset: 3
shadowBlur: 1.0
blurMax: 8
shadowColor: "#20000000"
}
}
MoneroComponents.TextPlain {
+4 -18
View File
@@ -26,12 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Window 2.0
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.2
import QtQuick
import QtQuick.Window
import QtQuick.Layouts
import FontAwesome 1.0
import "../../components/" as MoneroComponents
import "../../components/effects/" as MoneroEffects
@@ -178,20 +176,8 @@ Rectangle {
MouseArea {
enabled: persistentSettings.customDecorations
property var previousPosition
anchors.fill: parent
propagateComposedEvents: true
onPressed: previousPosition = globalCursor.getPosition()
onPositionChanged: {
if (pressedButtons == Qt.LeftButton) {
var pos = globalCursor.getPosition()
var dx = pos.x - previousPosition.x
var dy = pos.y - previousPosition.y
appWindow.x += dx
appWindow.y += dy
previousPosition = pos
}
}
onPressed: appWindow.startSystemMove()
}
}
+4 -5
View File
@@ -26,11 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import "../../js/Utils.js" as Utils
import "../../components" as MoneroComponents
+11 -26
View File
@@ -26,11 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import "../../js/Windows.js" as Windows
import "../../js/Utils.js" as Utils
import "../../components" as MoneroComponents
@@ -105,7 +104,13 @@ ColumnLayout {
}
previousView = currentView
if (currentView) {
stackView.replace(currentView)
if (stackView.currentItem !== currentView) {
if (stackView.depth > 0) {
stackView.replace(currentView)
} else {
stackView.push(currentView)
}
}
if (typeof currentView.onPageCompleted === "function") {
currentView.onPageCompleted();
}
@@ -142,26 +147,6 @@ ColumnLayout {
anchors.fill: parent
clip: false // otherwise animation will affect left panel
delegate: StackViewDelegate {
pushTransition: StackViewTransition {
PropertyAnimation {
target: enterItem
property: "x"
from: (navbarId.currentIndex < navbarId.previousIndex ? 1 : -1) * - target.width
to: 0
duration: 300
easing.type: Easing.OutCubic
}
PropertyAnimation {
target: exitItem
property: "x"
from: 0
to: (navbarId.currentIndex < navbarId.previousIndex ? 1 : -1) * target.width
duration: 300
easing.type: Easing.OutCubic
}
}
}
}
}
+17 -8
View File
@@ -26,10 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Dialogs
import "../../js/Wizard.js" as Wizard
import "../../js/Utils.js" as Utils
@@ -41,6 +41,16 @@ Rectangle {
color: "transparent"
Layout.fillWidth: true
property alias infoHeight: infoLayout.height
readonly property string rendererName: ({
[GraphicsInfo.OpenGL]: "OpenGL",
[GraphicsInfo.Vulkan]: "Vulkan",
[GraphicsInfo.Metal]: "Metal",
[GraphicsInfo.Direct3D11]: "Direct3D 11",
[GraphicsInfo.Direct3D12]: "Direct3D 12",
[GraphicsInfo.OpenVG]: "OpenVG",
[GraphicsInfo.Software]: "Software",
[GraphicsInfo.Null]: "Null"
})[GraphicsInfo.api] ?? "Unknown"
property string walletModeString: {
var modeStr;
if(appWindow.walletMode === 0){
@@ -50,7 +60,7 @@ Rectangle {
} else if(appWindow.walletMode === 2){
modeStr = "%1 (%2)".arg(qsTr("Advanced mode")).arg(persistentSettings.useRemoteNode ? qsTr("Remote node") : qsTr("Local node")) + translationManager.emptyString;
}
return modeStr + (persistentSettings.portable ? ", %1".arg(qsTr("portable")) : "");
return modeStr + (portableSettings.portable ? ", %1".arg(qsTr("portable")) : "");
}
ColumnLayout {
@@ -208,7 +218,6 @@ Rectangle {
+ "- Tx descriptions\n\n"
+ "The old wallet cache file will be renamed and can be restored later.\n"
);
confirmationDialog.icon = StandardIcon.Question
confirmationDialog.onAcceptedCallback = function() {
appWindow.closeWallet(function() {
walletManager.clearWalletCache(persistentSettings.wallet_path);
@@ -338,7 +347,7 @@ Rectangle {
Layout.fillWidth: true
color: MoneroComponents.Style.dimmedFontColor
font.pixelSize: 14
text: isOpenGL ? "OpenGL" : "Low graphics mode"
text: rendererName
}
Rectangle {
@@ -395,7 +404,7 @@ Rectangle {
data += "\nWallet log path: " + logger.logFilePath;
data += "\nWallet mode: " + walletModeString;
data += "\nGraphics mode: " + (isOpenGL ? "OpenGL" : "Low graphics mode");
data += "\nGraphics mode: " + rendererName;
if (isTails)
data += "\nTails: " + (tailsUsePersistence ? "persistent" : "persistence disabled");
+4 -4
View File
@@ -26,10 +26,10 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Dialogs
import moneroComponents.Wallet 1.0
+6 -3
View File
@@ -26,9 +26,9 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.2
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import "../../js/Utils.js" as Utils
import "../../components" as MoneroComponents
@@ -175,6 +175,7 @@ Rectangle {
font.pixelSize: 14
wrapMode: TextEdit.Wrap
readOnly: true
background: null
function logCommand(msg){
msg = log_color(msg, MoneroComponents.Style.blackTheme ? "lime" : "green");
consoleArea.append(msg);
@@ -219,6 +220,8 @@ Rectangle {
ScrollBar.vertical: ScrollBar {
onActiveChanged: if (!active && !isMac) active = true
policy: isMac ? ScrollBar.AsNeeded : ScrollBar.AlwaysOn
palette.mid: "#8E8E93"
palette.dark: "#B8B8BD"
}
}
}
+6 -5
View File
@@ -26,10 +26,11 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import FontAwesome 1.0
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import FontAwesome
import "../../components" as MoneroComponents
import "../../components/effects" as MoneroEffects
@@ -299,7 +300,7 @@ Rectangle{
onInputLabelLinkActivated: {
//mouse.accepted = false
if(persistentSettings.blockchainDataDir !== ""){
blockchainFileDialog.folder = "file://" + persistentSettings.blockchainDataDir;
blockchainFileDialog.currentFolder = "file://" + persistentSettings.blockchainDataDir;
}
blockchainFileDialog.open();
blockchainFolder.focus = true;
+6 -8
View File
@@ -26,11 +26,12 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
import FontAwesome 1.0
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Dialogs
import FontAwesome
import "../../js/Utils.js" as Utils
import "../../components" as MoneroComponents
@@ -114,13 +115,11 @@ Rectangle {
} else {
informationPopup.text = qsTr("Error: ") + currentWallet.errorString;
}
informationPopup.icon = StandardIcon.Critical
informationPopup.onCloseCallback = null
informationPopup.open();
} else {
informationPopup.title = qsTr("Information") + translationManager.emptyString
informationPopup.text = qsTr("Successfully rescanned spent outputs.") + translationManager.emptyString
informationPopup.icon = StandardIcon.Information
informationPopup.onCloseCallback = null
informationPopup.open();
}
@@ -145,7 +144,6 @@ Rectangle {
if (currentWallet.errorString == "The wallet has already seen 1 or more recent transactions than the scanned tx") {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("The wallet has already seen 1 or more recent transactions than the scanned transaction.\n\nIn order to rescan the transaction, you can re-sync your wallet by resetting the wallet restore height in the Settings > Info page. Make sure to use a restore height from before your wallet's earliest transaction.") + translationManager.emptyString;
informationPopup.icon = StandardIcon.Critical
informationPopup.onCloseCallback = null
informationPopup.open();
} else {
-304
View File
@@ -1,304 +0,0 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>LeftPanel.qml</file>
<file>MiddlePanel.qml</file>
<file>components/Dialog.qml</file>
<file>components/Label.qml</file>
<file>components/LanguageButton.qml</file>
<file>components/Navbar.qml</file>
<file>components/NavbarItem.qml</file>
<file>components/RemoteNodeDialog.qml</file>
<file>components/RemoteNodeList.qml</file>
<file>components/SettingsListItem.qml</file>
<file>components/Slider.qml</file>
<file>components/Tooltip.qml</file>
<file>components/UpdateDialog.qml</file>
<file>images/whatIsIcon.png</file>
<file>images/whatIsIcon@2x.png</file>
<file>components/MenuButton.qml</file>
<file>monero/utils/gpg_keys/binaryfate.asc</file>
<file>monero/utils/gpg_keys/fluffypony.asc</file>
<file>monero/utils/gpg_keys/luigi1111.asc</file>
<file>pages/Account.qml</file>
<file>pages/Advanced.qml</file>
<file>pages/Transfer.qml</file>
<file>pages/History.qml</file>
<file>pages/AddressBook.qml</file>
<file>pages/Mining.qml</file>
<file>components/ContextMenu.qml</file>
<file>components/ContextMenuItem.qml</file>
<file>components/NetworkStatusItem.qml</file>
<file>components/Input.qml</file>
<file>components/StandardButton.qml</file>
<file>components/LineEdit.qml</file>
<file>components/TipItem.qml</file>
<file>images/tip.png</file>
<file>components/MenuButtonDivider.qml</file>
<file>images/monero-vector.svg</file>
<file>components/StandardDropdown.qml</file>
<file>images/whiteDropIndicator.png</file>
<file>images/whiteDropIndicator@2x.png</file>
<file>components/CheckBox.qml</file>
<file>images/uncheckedIcon.png</file>
<file>images/uncheckedIcon@2x.png</file>
<file>components/DatePicker.qml</file>
<file>images/prevMonth.png</file>
<file>images/prevMonth@2x.png</file>
<file>components/TitleBar.qml</file>
<file>components/MenuBar.qml</file>
<file>images/resize.png</file>
<file>images/resize@2x.png</file>
<file>images/resizeHovered.png</file>
<file>images/resizeHovered@2x.png</file>
<file>images/nextPage.png</file>
<file>images/nextPage@2x.png</file>
<file>lang/languages.xml</file>
<file>lang/flags/bd.png</file>
<file>lang/flags/bg.png</file>
<file>lang/flags/br.png</file>
<file>lang/flags/catalonia.png</file>
<file>lang/flags/cn.png</file>
<file>lang/flags/hr.png</file>
<file>lang/flags/hu.png</file>
<file>lang/flags/cz.png</file>
<file>lang/flags/dk.png</file>
<file>lang/flags/eg.png</file>
<file>lang/flags/eo.png</file>
<file>lang/flags/fi.png</file>
<file>lang/flags/fr.png</file>
<file>lang/flags/de.png</file>
<file>lang/flags/in.png</file>
<file>lang/flags/id.png</file>
<file>lang/flags/il.png</file>
<file>lang/flags/ir.png</file>
<file>lang/flags/irl.png</file>
<file>lang/flags/it.png</file>
<file>lang/flags/jp.png</file>
<file>lang/flags/ku.png</file>
<file>lang/flags/lt.png</file>
<file>lang/flags/nl.png</file>
<file>lang/flags/pk.png</file>
<file>lang/flags/ps.png</file>
<file>lang/flags/pl.png</file>
<file>lang/flags/pt.png</file>
<file>lang/flags/ro.png</file>
<file>lang/flags/ru.png</file>
<file>lang/flags/rs.png</file>
<file>lang/flags/sk.png</file>
<file>lang/flags/si.png</file>
<file>lang/flags/za.png</file>
<file>lang/flags/kr.png</file>
<file>lang/flags/es.png</file>
<file>lang/flags/se.png</file>
<file>lang/flags/tw.png</file>
<file>lang/flags/tr.png</file>
<file>lang/flags/ua.png</file>
<file>lang/flags/gb.png</file>
<file>lang/flags/us.png</file>
<file>lang/flags/nb_NO.png</file>
<file>lang/flags/el.png</file>
<file>lang/flags/vi.png</file>
<file>lang/flags/is.png</file>
<file>pages/Receive.qml</file>
<file>pages/TxKey.qml</file>
<file>pages/SharedRingDB.qml</file>
<file>components/effects/ImageMask.qml</file>
<file>components/IconButton.qml</file>
<file>components/PasswordDialog.qml</file>
<file>components/InputDialog.qml</file>
<file>components/ProcessingSplash.qml</file>
<file>components/ProgressBar.qml</file>
<file>components/StandardDialog.qml</file>
<file>components/DevicePassphraseDialog.qml</file>
<file>pages/Sign.qml</file>
<file>components/DaemonManagerDialog.qml</file>
<file>version.js</file>
<file>components/QRCodeScanner.qml</file>
<file>components/TextBlock.qml</file>
<file>components/RemoteNodeEdit.qml</file>
<file>pages/Keys.qml</file>
<file>images/appicon.ico</file>
<file>images/card-background-black0.png</file>
<file>images/card-background-black1.png</file>
<file>images/card-background-black2.png</file>
<file>images/card-background-black3.png</file>
<file>images/card-background-black4.png</file>
<file>images/card-background-black5.png</file>
<file>images/card-background-black6.png</file>
<file>images/card-background-black7.png</file>
<file>images/card-background-black0@2x.png</file>
<file>images/card-background-black1@2x.png</file>
<file>images/card-background-black2@2x.png</file>
<file>images/card-background-black3@2x.png</file>
<file>images/card-background-black4@2x.png</file>
<file>images/card-background-black5@2x.png</file>
<file>images/card-background-black6@2x.png</file>
<file>images/card-background-black7@2x.png</file>
<file>images/card-background-white.png</file>
<file>images/card-background-white@2x.png</file>
<file>images/moneroLogo_white.png</file>
<file>images/titlebarLogo.png</file>
<file>images/titlebarLogo@2x.png</file>
<file>pages/merchant/MerchantTitlebar.qml</file>
<file>images/menuButtonGradient.png</file>
<file>fonts/Roboto-Medium.ttf</file>
<file>fonts/Roboto-Regular.ttf</file>
<file>fonts/Roboto-Light.ttf</file>
<file>fonts/Roboto-Bold.ttf</file>
<file>fonts/RobotoMono-Medium.ttf</file>
<file>fonts/RobotoMono-Regular.ttf</file>
<file>fonts/RobotoMono-Light.ttf</file>
<file>fonts/RobotoMono-Bold.ttf</file>
<file>components/Style.qml</file>
<file>components/qmldir</file>
<file>components/InlineButton.qml</file>
<file>images/lightning.png</file>
<file>images/lightning@2x.png</file>
<file>images/logout.png</file>
<file>images/logout@2x.png</file>
<file>images/moneroIcon-28x28.png</file>
<file>images/moneroIcon-28x28@2x.png</file>
<file>images/lightning-white.png</file>
<file>images/lightning-white@2x.png</file>
<file>components/InputMulti.qml</file>
<file>components/LineEditMulti.qml</file>
<file>components/LabelButton.qml</file>
<file>components/LabelSubheader.qml</file>
<file>images/arrow-right-medium-white.png</file>
<file>images/arrow-right-medium-white@2x.png</file>
<file>images/rightArrow.png</file>
<file>images/rightArrow@2x.png</file>
<file>images/historyBorderRadius.png</file>
<file>components/CheckBox2.qml</file>
<file>components/TextPlain.qml</file>
<file>components/TextPlainArea.qml</file>
<file>js/TxUtils.js</file>
<file>images/warning.png</file>
<file>images/warning@2x.png</file>
<file>js/Windows.js</file>
<file>js/Utils.js</file>
<file>components/RadioButton.qml</file>
<file>pages/settings/Settings.qml</file>
<file>pages/settings/SettingsWallet.qml</file>
<file>pages/settings/SettingsNode.qml</file>
<file>pages/settings/SettingsLog.qml</file>
<file>pages/settings/SettingsLayout.qml</file>
<file>pages/settings/SettingsInfo.qml</file>
<file>components/WarningBox.qml</file>
<file>images/miningxmr.png</file>
<file>images/miningxmr@2x.png</file>
<file>pages/merchant/Merchant.qml</file>
<file>pages/merchant/MerchantCheckbox.qml</file>
<file>pages/merchant/MerchantTrackingList.qml</file>
<file>images/merchant/arrow_right.png</file>
<file>images/merchant/bg.png</file>
<file>images/merchant/input_box.png</file>
<file>fonts/FontAwesome/fa-brands-400.otf</file>
<file>fonts/FontAwesome/fa-regular-400.otf</file>
<file>fonts/FontAwesome/fa-solid-900.otf</file>
<file>fonts/FontAwesome/FontAwesome.qml</file>
<file>fonts/FontAwesome/Object.qml</file>
<file>fonts/FontAwesome/qmldir</file>
<file>wizard/WizardAskPassword.qml</file>
<file>wizard/WizardController.qml</file>
<file>wizard/WizardCreateWallet1.qml</file>
<file>wizard/WizardCreateWallet2.qml</file>
<file>wizard/WizardCreateWallet3.qml</file>
<file>wizard/WizardCreateWallet4.qml</file>
<file>wizard/WizardCreateWallet5.qml</file>
<file>wizard/WizardCreateDevice1.qml</file>
<file>wizard/WizardDaemonSettings.qml</file>
<file>wizard/WizardHeader.qml</file>
<file>wizard/WizardHome.qml</file>
<file>wizard/WizardLanguage.qml</file>
<file>wizard/WizardNav.qml</file>
<file>wizard/WizardWalletInput.qml</file>
<file>wizard/WizardRestoreWallet1.qml</file>
<file>wizard/WizardRestoreWallet2.qml</file>
<file>wizard/WizardRestoreWallet3.qml</file>
<file>wizard/WizardRestoreWallet4.qml</file>
<file>wizard/WizardSummary.qml</file>
<file>wizard/WizardSummaryItem.qml</file>
<file>wizard/WizardModeSelection.qml</file>
<file>wizard/WizardModeRemoteNodeWarning.qml</file>
<file>wizard/WizardModeBootstrap.qml</file>
<file>wizard/WizardMenuItem.qml</file>
<file>js/Wizard.js</file>
<file>components/LanguageSidebar.qml</file>
<file>images/world-flags-globe.png</file>
<file>images/restore-wallet-from-hardware@2x.png</file>
<file>images/restore-wallet-from-hardware.png</file>
<file>images/open-wallet-from-file@2x.png</file>
<file>images/open-wallet-from-file.png</file>
<file>images/open-wallet-from-file-mainnet@2x.png</file>
<file>images/open-wallet-from-file-mainnet.png</file>
<file>images/open-wallet-from-file-stagenet@2x.png</file>
<file>images/open-wallet-from-file-stagenet.png</file>
<file>images/open-wallet-from-file-testnet@2x.png</file>
<file>images/open-wallet-from-file-testnet.png</file>
<file>images/open-wallet-from-file-view-only@2x.png</file>
<file>images/open-wallet-from-file-view-only.png</file>
<file>images/open-wallet-from-file-trezor@2x.png</file>
<file>images/open-wallet-from-file-trezor.png</file>
<file>images/restore-wallet@2x.png</file>
<file>images/restore-wallet.png</file>
<file>images/create-wallet@2x.png</file>
<file>images/create-wallet.png</file>
<file>images/remote-node.png</file>
<file>images/remote-node@2x.png</file>
<file>images/local-node.png</file>
<file>images/local-node@2x.png</file>
<file>images/local-node-full.png</file>
<file>images/local-node-full@2x.png</file>
<file>wizard/WizardOpenWallet1.qml</file>
<file>images/arrow-right-in-circle.png</file>
<file>images/arrow-right-in-circle@2x.png</file>
<file>images/right.svg</file>
<file>images/middlePanelShadow.png</file>
<file>images/themes/white/titlebarLogo@2x.png</file>
<file>images/themes/white/titlebarLogo.png</file>
<file>images/fullscreen.svg</file>
<file>images/close.svg</file>
<file>images/minimize.svg</file>
<file>images/themes/white/close.svg</file>
<file>images/themes/white/fullscreen.svg</file>
<file>images/themes/white/minimize.svg</file>
<file>components/effects/ColorTransition.qml</file>
<file>components/effects/GradientBackground.qml</file>
<file>images/check-white.svg</file>
<file>images/copy.svg</file>
<file>images/edit.svg</file>
<file>images/arrow-right-in-circle-outline-medium-white.svg</file>
<file>images/tails-grey.png</file>
<file>components/AdvancedOptionsItem.qml</file>
<file>images/busy-indicator.png</file>
<file>images/busy-indicator@2x.png</file>
<file>images/success.png</file>
<file>images/success@2x.png</file>
<file>components/SuccessfulTxDialog.qml</file>
<file>components/TxConfirmationDialog.qml</file>
<file>images/ledgerNanoS.png</file>
<file>images/ledgerNanoSPlus.png</file>
<file>images/ledgerNanoX.png</file>
<file>images/ledgerNanoGen5.png</file>
<file>images/ledgerStax.png</file>
<file>images/ledgerFlex.png</file>
<file>images/trezor3.png</file>
<file>images/trezor5.png</file>
<file>images/trezorT.png</file>
<file>images/trezorT@2x.png</file>
<file>qtquickcontrols2.conf</file>
<file>images/write-down.png</file>
<file>images/write-down-white.png</file>
<file>images/write-down@2x.png</file>
<file>images/write-down-white@2x.png</file>
<file>images/verify.png</file>
<file>images/verify-white.png</file>
<file>images/verify@2x.png</file>
<file>images/verify-white@2x.png</file>
<file>wizard/SeedListItem.qml</file>
<file>wizard/SeedListGrid.qml</file>
<file>wizard/template.pdf</file>
</qresource>
</RCC>
+1 -1
View File
@@ -1,2 +1,2 @@
[Controls]
Style=Desktop
Style=Fusion
+3
View File
@@ -8,6 +8,9 @@
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSCameraUsageDescription</key>
<string>The camera is used to scan Monero QR codes.</string>
<key>CFBundleIconFile</key>
<string>appicon.icns</string>
+11 -47
View File
@@ -2,8 +2,6 @@ add_subdirectory(QR-Code-scanner)
add_subdirectory(openpgp)
add_subdirectory(zxcvbn-c)
qt5_add_resources(RESOURCES ../qml.qrc)
# Compile source files (.h/.cpp)
file(GLOB SOURCE_FILES
"*.h"
@@ -50,36 +48,11 @@ if(APPLE)
list(APPEND SOURCE_FILES "qt/macoshelper.mm")
endif()
set(EXECUTABLE_FLAG)
if(MINGW)
set(EXECUTABLE_FLAG WIN32)
set(ICON ${PROJECT_SOURCE_DIR}/images/appicon.ico)
set(ICON_RC ${CMAKE_CURRENT_BINARY_DIR}/icon.rc)
set(ICON_RES ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
file(WRITE ${ICON_RC} "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"")
find_program(Qt5_WINDRES_EXECUTABLE NAMES windres x86_64-w64-mingw32-windres REQUIRED CMAKE_FIND_ROOT_PATH_BOTH)
add_custom_command(OUTPUT ${ICON_RES} COMMAND ${Qt5_WINDRES_EXECUTABLE} ${ICON_RC} ${ICON_RES} MAIN_DEPENDENCY ${ICON_RC})
list(APPEND RESOURCES ${ICON_RES})
endif()
if(APPLE)
set(ICON ${PROJECT_SOURCE_DIR}/images/appicon.icns)
set_source_files_properties(${ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
list(APPEND RESOURCES ${ICON})
endif()
set(monero_wallet_gui_sources
${SOURCE_FILES}
${RESOURCES}
)
if(NOT ANDROID)
add_executable(monero-wallet-gui ${EXECUTABLE_FLAG} ${monero_wallet_gui_sources})
else()
add_library(monero-wallet-gui SHARED ${monero_wallet_gui_sources})
set_target_properties(monero-wallet-gui PROPERTIES COMPILE_DEFINITIONS "ANDROID")
endif()
target_sources(monero-wallet-gui PRIVATE ${monero_wallet_gui_sources})
set_target_properties(monero-wallet-gui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
@@ -92,8 +65,6 @@ target_include_directories(monero-wallet-gui PUBLIC ${OPENGL_INCLUDE_DIR})
message(STATUS "OpenGL: include dir at ${OPENGL_INCLUDE_DIR}")
message(STATUS "OpenGL: libraries at ${OPENGL_LIBRARIES}")
target_include_directories(monero-wallet-gui PUBLIC ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
target_include_directories(monero-wallet-gui PUBLIC
${CMAKE_SOURCE_DIR}/monero/include
${CMAKE_SOURCE_DIR}/monero/src
@@ -109,12 +80,6 @@ target_include_directories(monero-wallet-gui PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/zxcvbn-c
)
target_compile_definitions(monero-wallet-gui
PUBLIC
${Qt5Widgets_DEFINITIONS}
${Qt5Qml_DEFINITIONS}
)
if(QML_TESTS)
target_include_directories(monero-wallet-gui PRIVATE "${CMAKE_SOURCE_DIR}/tests/qml")
target_compile_definitions(monero-wallet-gui PRIVATE
@@ -122,7 +87,6 @@ if(QML_TESTS)
QML_TEST_SOURCE_DIR="${CMAKE_SOURCE_DIR}/tests/qml"
)
endif()
if(APPLE)
if(NOT ICU_ROOT)
execute_process(COMMAND brew --prefix icu4c OUTPUT_VARIABLE ICU_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -131,16 +95,15 @@ if(APPLE)
target_link_directories(monero-wallet-gui PRIVATE ${ICU_ROOT}/lib)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
target_link_libraries(monero-wallet-gui
PRIVATE
epee
common
net
wallet_api
qrcodegen
easylogging
${QT5_LIBRARIES}
${QT_LIBRARIES}
${EXTRA_LIBRARIES}
openpgp
qrdecoder
@@ -148,10 +111,17 @@ target_link_libraries(monero-wallet-gui
zxcvbn
)
if(MINGW)
# Static Boost.Locale records ICU and iconv as bare library names. Keep the
# depends library search path scoped to the executable that consumes them.
target_link_directories(monero-wallet-gui PRIVATE "${BOOST_LIBRARYDIR}")
endif()
if(WITH_SCANNER)
target_link_libraries(monero-wallet-gui qrscanner)
target_link_libraries(monero-wallet-gui PRIVATE qrscanner)
if(LINUX AND NOT ANDROID)
target_link_libraries(monero-wallet-gui
PRIVATE
jpeg
v4l2
v4lconvert
@@ -160,10 +130,4 @@ if(WITH_SCANNER)
endif()
endif()
add_custom_command(TARGET monero-wallet-gui POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:daemon> $<TARGET_FILE_DIR:monero-wallet-gui>)
include(Deploy)
install(TARGETS monero-wallet-gui
DESTINATION bin
)
+2 -2
View File
@@ -3,7 +3,7 @@ add_library(qrdecoder STATIC
)
target_link_libraries(qrdecoder
PUBLIC
Qt5::Gui
Qt6::Gui
PRIVATE
quirc
)
@@ -15,7 +15,7 @@ if(WITH_SCANNER)
)
target_link_libraries(qrscanner
PUBLIC
Qt5::Multimedia
Qt6::Multimedia
qrdecoder
)
endif()
+36 -7
View File
@@ -27,8 +27,10 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "QrCodeScanner.h"
#include <QVideoProbe>
#include <QCamera>
#include <QDebug>
#include <QMediaCaptureSession>
#include <QVideoSink>
QrCodeScanner::QrCodeScanner(QObject *parent)
: QObject(parent)
@@ -36,16 +38,43 @@ QrCodeScanner::QrCodeScanner(QObject *parent)
, m_processInterval(750)
, m_enabled(true)
{
m_probe = new QVideoProbe(this);
m_captureSession = new QMediaCaptureSession(this);
m_sink = nullptr;
m_thread = new QrScanThread(this);
m_thread->start();
QObject::connect(m_thread, SIGNAL(decoded(QString)), this, SIGNAL(decoded(QString)));
QObject::connect(m_thread, SIGNAL(notifyError(const QString &, bool)), this, SIGNAL(notifyError(const QString &, bool)));
connect(m_probe, SIGNAL(videoFrameProbed(QVideoFrame)), this, SLOT(processFrame(QVideoFrame)));
connect(m_thread, &QrScanThread::decoded, this, &QrCodeScanner::decoded);
connect(m_thread, &QrScanThread::notifyError, this, &QrCodeScanner::notifyError);
}
void QrCodeScanner::setSource(QCamera *camera)
bool QrCodeScanner::setSource(QObject *camera)
{
m_probe->setSource(camera);
QCamera *qmlCamera = qobject_cast<QCamera *>(camera);
if (!qmlCamera) {
qWarning() << "QrCodeScanner: source is not a QCamera";
m_captureSession->setCamera(nullptr);
return false;
}
m_captureSession->setCamera(qmlCamera);
return true;
}
bool QrCodeScanner::setVideoOutput(QObject *videoOutput)
{
m_captureSession->setVideoOutput(videoOutput);
QVideoSink *sink = m_captureSession->videoSink();
if (!sink) {
qWarning() << "QrCodeScanner: video output has no QVideoSink";
m_captureSession->setVideoOutput(nullptr);
m_sink = nullptr;
return false;
}
if (m_sink == sink)
return true;
if (m_sink)
disconnect(m_sink, &QVideoSink::videoFrameChanged, this, &QrCodeScanner::processFrame);
m_sink = sink;
if (m_sink)
connect(m_sink, &QVideoSink::videoFrameChanged, this, &QrCodeScanner::processFrame);
return true;
}
void QrCodeScanner::processFrame(QVideoFrame frame)
{
+7 -4
View File
@@ -30,11 +30,12 @@
#define QRCODESCANNER_H_
#include <QImage>
#include <QPointer>
#include <QVideoFrame>
#include "QrScanThread.h"
class QVideoProbe;
class QCamera;
class QMediaCaptureSession;
class QVideoSink;
class QrCodeScanner : public QObject
{
@@ -45,7 +46,8 @@ class QrCodeScanner : public QObject
public:
QrCodeScanner(QObject *parent = Q_NULLPTR);
~QrCodeScanner();
void setSource(QCamera*);
Q_INVOKABLE bool setSource(QObject *camera);
Q_INVOKABLE bool setVideoOutput(QObject *videoOutput);
bool enabled() const;
void setEnabled(bool enabled);
@@ -66,7 +68,8 @@ protected:
int m_processInterval;
int m_enabled;
QVideoFrame m_curFrame;
QVideoProbe *m_probe;
QMediaCaptureSession *m_captureSession;
QPointer<QVideoSink> m_sink;
};
#endif
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff. Show more