Compare commits

...

172 Commits

Author SHA1 Message Date
luigi1111
43f378b7d2 Merge pull request #2644
3c6a1e4 wizard: fix mode selection back button (selsta)
2019-12-23 09:30:21 -05:00
luigi1111
b73551d6ab Merge pull request #2643
3528bcd main: show wizard init screen when no wallet is found (selsta)
2019-12-23 09:29:15 -05:00
luigi1111
632d82ac95 Merge pull request #2640
c5785ed main: fix wallet lock is unlocked without password (selsta)
2019-12-23 09:28:21 -05:00
luigi1111
3fb775de28 Merge pull request #2680
6d0593a build: fix build on Ubuntu 16.04 GCC 5.4 (missing includes) (xiphon)
2019-12-23 09:06:27 -05:00
luigi1111
82affff63f Merge pull request #2679
13ea403 FutureScheduler: drop moveToThread, setParent might silently fail (xiphon)
2019-12-23 09:05:09 -05:00
xiphon
6d0593a26b build: fix build on Ubuntu 16.04 GCC 5.4 (missing includes) 2019-12-23 12:01:41 +00:00
xiphon
13ea4035b5 FutureScheduler: drop moveToThread, setParent might silently fail 2019-12-23 11:35:47 +00:00
luigi1111
1c97e9796d Merge pull request #2601
4a86a1c remove colored dots (tobtoht)
2019-12-21 18:43:06 -05:00
luigi1111
4eca4194b7 Merge pull request #2675
3f4f6f0 misc: remove unused components (tobtoht)
2019-12-21 18:16:01 -05:00
luigi1111
5c801ec2ad Merge pull request #2674
ded0a4d Scrollbar: don't autohide if enabled (except on Mac) (tobtoht)
2019-12-21 18:15:09 -05:00
luigi1111
7f324fb3e6 Merge pull request #2673
6a5de80 Add *.autosave (tobtoht)
2019-12-21 18:14:17 -05:00
luigi1111
710159a236 Merge pull request #2670
1fef418 main: enable high DPI scaling (selsta)
2019-12-21 18:12:46 -05:00
luigi1111
7afbcc9855 Merge pull request #2665
c6c094b SettingsWallet: cleanup on wallet close (xiphon)
2019-12-21 18:10:59 -05:00
luigi1111
8d0647d677 Merge pull request #2650
10dea60 Settings: fix page height (tobtoht)
2019-12-21 18:09:53 -05:00
luigi1111
9a5296f00e Merge pull request #2648
beeddea build: add application icon on Windows (xiphon)
2019-12-21 18:07:53 -05:00
luigi1111
6f53cc4dda Merge pull request #2645
66f6b95 Account: update balance card label (selsta)
2019-12-21 18:07:07 -05:00
luigi1111
86f573f02c Merge pull request #2642
f8262b0 misc: cleanup unused variables and comments (selsta)
2019-12-21 18:06:17 -05:00
thotbot
ded0a4da48 Scrollbar: don't autohide if enabled (except on Mac) 2019-12-21 18:33:36 +00:00
thotbot
3f4f6f01dc misc: remove unused components 2019-12-21 15:13:23 +00:00
thotbot
6a5de80bd9 Add *.autosave 2019-12-21 11:16:43 +00:00
selsta
1fef418adb main: enable high DPI scaling 2019-12-21 06:31:25 +01:00
xiphon
c6c094bbd5 SettingsWallet: cleanup on wallet close 2019-12-20 19:28:17 +00:00
thotbot
10dea6073b Settings: fix page height 2019-12-20 16:15:36 +00:00
xiphon
beeddea678 build: add application icon on Windows 2019-12-20 13:27:47 +00:00
selsta
66f6b95b5c Account: update balance card label 2019-12-20 07:29:19 +01:00
selsta
3c6a1e45d7 wizard: fix mode selection back button 2019-12-20 06:32:42 +01:00
selsta
3528bcd6b5 main: show wizard init screen when no wallet is found 2019-12-20 03:49:31 +01:00
selsta
f8262b0d27 misc: cleanup unused variables and comments 2019-12-20 03:37:52 +01:00
selsta
c5785ed195 main: fix wallet lock is unlocked without password 2019-12-20 02:20:12 +01:00
luigi1111
500c7ec82e Merge pull request #2591
3e07eca main: blur on PasswordDialog, InputDialog or ProcessingSplash (xiphon)
2019-12-19 20:06:42 -05:00
xiphon
3e07ecabf9 main: blur on PasswordDialog, InputDialog or ProcessingSplash 2019-12-20 01:04:36 +00:00
luigi1111
98279f54fb Merge pull request #2635
aa96e2f build: define QT_NO_DEBUG for non--debug targets (xiphon)
2019-12-19 19:51:05 -05:00
luigi1111
a6818cd274 Merge pull request #2632
d6ccae3 Transfer: cleanup payment id code (tobtoht)
2019-12-19 19:50:11 -05:00
luigi1111
4c7d402eaf Merge pull request #2631
ec83dea build: support DEV_MODE env var to override default value (xiphon)
2019-12-19 19:49:06 -05:00
luigi1111
3984f8d1e8 Merge pull request #2630
3ea329e FutureScheduler: fix possible race, connect before setFuture (xiphon)
2019-12-19 19:48:10 -05:00
luigi1111
f2424ddeaa Merge pull request #2627
8c51172 Subaddress: fix use-after-free on accessing stale Wallet API data (xiphon)
2019-12-19 19:46:45 -05:00
luigi1111
b963028f10 Merge pull request #2626
a83adb7 Transfer: improve warning flow (tobtoht)
2019-12-19 19:45:33 -05:00
luigi1111
4aac66a024 Merge pull request #2625
131769f fix dropdown closure behavior (tobtoht)
2019-12-19 19:43:32 -05:00
luigi1111
598de0f03f Merge pull request #2623
c9900c0 SubaddressAccount: drop useless getAll 'update' default argument (xiphon)
e0ab9aa SubaddressAccount: fix use-after-free bug (xiphon)
2019-12-19 19:37:27 -05:00
luigi1111
bd3b26c33d Merge pull request #2604
50cb726 do not ask to start daemon if in remote node mode (tobtoht)
2019-12-19 19:36:17 -05:00
luigi1111
66f5b7310f Merge pull request #2622
94561ed fix clunky scrolling behavior on flickables (tobtoht)
2019-12-19 19:35:22 -05:00
luigi1111
5ff030783a Merge pull request #2616
5dccde2 History: don't hide 'Export all history' if there ain't any txes (xiphon)
2019-12-19 19:34:08 -05:00
luigi1111
7c11ac4d98 Merge pull request #2614
4e1f734 TransactionHistory: fix use-after-free bugs (xiphon)
2019-12-19 19:32:37 -05:00
luigi1111
05a0d21f4c Merge pull request #2590
cc86795 WizardController: always close and re-open newly created wallet (xiphon)
2019-12-19 19:30:32 -05:00
luigi1111
d0c2740a51 Merge pull request #2588
a113670 History: don't show empty paymentId in tx details (xiphon)
2019-12-19 19:29:36 -05:00
luigi1111
118752e775 Merge pull request #2587
1661c82 TransactionInfo: parse Wallet API provided data on initialization (xiphon)
2019-12-19 19:23:06 -05:00
luigi1111
1ed02f7d7a Merge pull request #2581
872b49f CMakeLists: remove duplicated x11 (selsta)
2019-12-19 19:21:55 -05:00
luigi1111
4042186fac Merge pull request #2580
ba24fd7 SettingsInfo: open containing folder on wallet log path click (xiphon)
088d32e OSHelper: file preselection support (Windows and Mac) (xiphon)
2019-12-19 19:20:53 -05:00
luigi1111
abd98b95f6 Merge pull request #2578
38d412a components: handle enter and return (selsta)
2019-12-19 19:19:32 -05:00
thotbot
d6ccae342d Transfer: cleanup payment id code 2019-12-20 00:18:52 +00:00
luigi1111
78f8cb2595 Merge pull request #2576
b940ad7 InputDialog: pre-populate input text (selsta)
2019-12-19 19:18:03 -05:00
xiphon
aa96e2ff3e build: define QT_NO_DEBUG for non--debug targets 2019-12-19 15:13:10 +00:00
xiphon
ec83dea3c3 build: support DEV_MODE env var to override default value 2019-12-19 00:52:26 +00:00
xiphon
3ea329e45f FutureScheduler: fix possible race, connect before setFuture 2019-12-19 00:37:00 +00:00
thotbot
a83adb70ad Transfer: improve warning flow 2019-12-19 00:16:00 +00:00
thotbot
94561ed2a6 fix clunky scrolling behavior on flickables 2019-12-17 23:11:11 +00:00
xiphon
8c511722e0 Subaddress: fix use-after-free on accessing stale Wallet API data 2019-12-17 21:51:04 +00:00
thotbot
131769f175 fix dropdown closure behavior 2019-12-17 20:21:04 +00:00
thotbot
4a86a1cf76 remove colored dots 2019-12-17 15:04:23 +00:00
xiphon
e0ab9aa898 SubaddressAccount: fix use-after-free bug 2019-12-17 14:18:54 +00:00
xiphon
cc86795fa3 WizardController: always close and re-open newly created wallet 2019-12-17 01:08:08 +00:00
thotbot
50cb72656a do not ask to start daemon if in remote node mode 2019-12-16 22:48:35 +00:00
xiphon
c9900c05b2 SubaddressAccount: drop useless getAll 'update' default argument 2019-12-16 14:35:50 +00:00
xiphon
4e1f7349c4 TransactionHistory: fix use-after-free bugs 2019-12-16 13:31:31 +00:00
xiphon
5dccde25f4 History: don't hide 'Export all history' if there ain't any txes 2019-12-16 09:30:23 +00:00
xiphon
a113670905 History: don't show empty paymentId in tx details 2019-12-13 10:42:47 +00:00
xiphon
1661c82449 TransactionInfo: parse Wallet API provided data on initialization 2019-12-12 21:26:18 +00:00
xiphon
088d32e712 OSHelper: file preselection support (Windows and Mac)
Co-authored-by: selsta <selsta@sent.at>
2019-12-12 01:28:49 +00:00
xiphon
ba24fd79bb SettingsInfo: open containing folder on wallet log path click 2019-12-12 00:10:22 +00:00
luigi1111
46227bdad0 Merge pull request #2531
2833fdb cmake: use appropriate compiler flags (xiphon)
17ea26e build: fix monero-wallet-gui.pro source paths, rm qml.qrc duplicate (xiphon)
2019-12-09 22:05:22 -06:00
selsta
872b49f29a CMakeLists: remove duplicated x11 2019-12-10 03:01:02 +01:00
selsta
38d412a3fa components: handle enter and return 2019-12-10 02:52:15 +01:00
xiphon
2833fdb907 cmake: use appropriate compiler flags 2019-12-09 22:49:42 +00:00
selsta
b940ad72be InputDialog: pre-populate input text 2019-12-09 17:38:09 +01:00
xiphon
17ea26e02a build: fix monero-wallet-gui.pro source paths, rm qml.qrc duplicate 2019-12-09 14:03:24 +00:00
luigi1111
1cee81b996 Merge pull request #2404
8dd2a20 e04db92 d06ae80 c83c74d 1723d04 52182ef 97a9ac9 2d23917 91aff7c (TheCharlatan)
2019-12-09 07:52:41 -06:00
luigi1111
f03ea0461c Merge pull request #2560
6ce9a3c History: fix translations (xiphon)
2019-12-05 09:35:52 -06:00
xiphon
6ce9a3cba0 History: fix translations 2019-12-05 15:18:15 +00:00
luigi1111
8cd32987d4 Revert "Merge pull request #2526"
This reverts commit 457b1dee49, reversing
changes made to 7cca39ad48.
2019-12-05 09:03:56 -06:00
luigi1111
648b775a25 Merge pull request #2559
e81a589 Transfer: improve amount sanitization (xiphon)
2019-12-05 08:53:47 -06:00
luigi1111
b24ccc2fe3 Merge pull request #2558
074d8fb WizardLang: fix display text (selsta)
2019-12-05 08:52:57 -06:00
luigi1111
00783e7b68 Merge pull request #2557
b632d07 WizardRestoreWallet1: fix placeholder text visibility (selsta)
2019-12-05 08:52:11 -06:00
luigi1111
dafc47050a Merge pull request #2556
1c2920a WizardAskPassword: fix lock icon (selsta)
2019-12-05 08:51:05 -06:00
luigi1111
0e65d89172 Merge pull request #2555
676b8d6 History: add date, amount, integrated addr (incoming) to tx details (xiphon)
2019-12-05 08:50:15 -06:00
luigi1111
fd9e7d00ed Merge pull request #2553
9d5eb00 TransactionHistory: guard tx info list against concurrent access (xiphon)
2019-12-05 08:49:14 -06:00
luigi1111
3d7ded209a Merge pull request #2540
983a3ba Translation: fix untranslated strings (selsta)
2019-12-05 08:47:54 -06:00
xiphon
e81a589a8d Transfer: improve amount sanitization 2019-12-05 10:13:29 +00:00
selsta
074d8fb42e WizardLang: fix display text 2019-12-04 23:18:44 +01:00
selsta
b632d078e5 WizardRestoreWallet1: fix placeholder text visibility 2019-12-04 23:05:42 +01:00
selsta
1c2920a339 WizardAskPassword: fix lock icon 2019-12-04 22:24:08 +01:00
xiphon
676b8d6921 History: add date, amount, integrated addr (incoming) to tx details 2019-12-04 21:07:10 +00:00
xiphon
9d5eb002ae TransactionHistory: guard tx info list against concurrent access 2019-12-04 10:33:54 +00:00
luigi1111
63d4ba6df8 Merge pull request #2551
646d339 Wallet: persistent subaddress account selection (xiphon)
2019-12-03 22:32:58 -06:00
luigi1111
c2dbda63c6 Merge pull request #2543
bc40942 StandardDropdown: implement automatic closing (xiphon)
2019-12-03 22:32:10 -06:00
luigi1111
6e7b4ff9f9 Merge pull request #2542
32f7666 DatePicker: don't propagate mouse events to underlying controls (xiphon)
2019-12-03 22:31:20 -06:00
luigi1111
1269f0a13a Merge pull request #2532
265afe1 DaemonManager: increase daemon start timeout to 120 seconds (xiphon)
2019-12-03 22:30:22 -06:00
luigi1111
04b91e76f2 Merge pull request #2529
4cc3d3f Label: change cursor on link hover (selsta)
2019-12-03 22:29:14 -06:00
luigi1111
c9c7bb9171 Merge pull request #2528
2ab3d8e MiddlePanel: remove margin bottom (selsta)
2019-12-03 22:27:37 -06:00
luigi1111
619661a61d Merge pull request #2527
c06cb5c MiddlePanel: remove color stripe for consistency (selsta)
2019-12-03 22:26:51 -06:00
luigi1111
457b1dee49 Merge pull request #2526
20a5814 Transfer: add parenthesis to links (selsta)
2019-12-03 22:26:00 -06:00
luigi1111
7cca39ad48 Merge pull request #2520
7b0cd19 wizard: Language button on home and add back button (selsta)
2019-12-03 22:24:06 -06:00
luigi1111
90406dfd1e Merge pull request #2517
9e4bfb1 WarningBox: hover cursor and disable selecting text (selsta)
2019-12-03 22:22:45 -06:00
luigi1111
6d7abaf5c0 Merge pull request #2515
c0fa4f5 SettingsLayout: pointing mouse cursor and selecting text (selsta)
2019-12-03 22:21:51 -06:00
xiphon
bc40942889 StandardDropdown: implement automatic closing 2019-12-03 22:45:15 +00:00
xiphon
646d3394d3 Wallet: persistent subaddress account selection 2019-12-03 12:39:34 +00:00
selsta
c06cb5cc58 MiddlePanel: remove color stripe for consistency 2019-12-02 23:19:31 +01:00
selsta
983a3ba7ad Translation: fix untranslated strings 2019-12-02 00:09:43 +01:00
xiphon
265afe1610 DaemonManager: increase daemon start timeout to 120 seconds 2019-11-29 17:24:40 +00:00
xiphon
32f7666912 DatePicker: don't propagate mouse events to underlying controls 2019-11-29 17:22:00 +00:00
selsta
20a58143b6 Transfer: add parenthesis to links 2019-11-28 12:25:33 +01:00
selsta
4cc3d3f3e2 Label: change cursor on link hover 2019-11-28 00:59:44 +01:00
selsta
2ab3d8ebf2 MiddlePanel: remove margin bottom 2019-11-28 00:55:00 +01:00
selsta
9e4bfb1ef2 WarningBox: hover cursor and disable selecting text 2019-11-28 00:08:59 +01:00
xiphon
97a9ac9bf8 cmake: don't force LINUX=ON, DEBUG=ON, CMAKE_BUILD_TYPE=Release 2019-11-27 22:59:27 +01:00
xiphon
2d23917afb cmake: MinGW - set WIN32 executable property 2019-11-27 22:59:27 +01:00
xiphon
52182ef9b1 cmake: fix MinGW static builds, add 'release-static-win64' target 2019-11-27 22:59:27 +01:00
xiphon
91aff7c0e4 cmake: put monero-gui executable into 'bin' directory 2019-11-27 22:59:27 +01:00
xiphon
1723d04902 cmake: inherit ARCH_WIDTH from 'monero' subdirectory 2019-11-27 22:59:27 +01:00
TheCharlatan
c83c74d3c2 Add Apple support 2019-11-27 22:59:27 +01:00
TheCharlatan
d06ae80e0a Add support for msys/mingw32 2019-11-27 22:59:27 +01:00
TheCharlatan
8dd2a20ff8 Migrate build system to cmake
The content in this commit is not split in order to preserve working
compilation. Once this is added to master, the old build script will no
longer work and all existing build toolings will require changes.

Monero's cmake directory's files need to be copied to this project's cmake
directory in order for the linking and function definitions to work correctly.

Monero-gui has its own version check and generate file in order to not
conflict with monero's destination version files.

Most of the source files that are currently in monero-gui's root
directory are now moved to subdirectories. This is done to preserve
compilation order properly and to give some content structure.

The original CMakeList file included all headers it found in
subdirectories. Make sure that they are set manually to evade linking
errors.

The current build script always checks out latest master of the monero
submodule. The submodule rules in the current CMakeLists.txt file do not
enforce. An override to compile master nevertheless can still be given
with `-D DEV_MODE`.

To enable the linux X11 xcb linking the libraries had to be hardcoded. There
does not seem to be good support for this in pkgconfig, or in
existing cmake checks.
2019-11-27 22:59:27 +01:00
TheCharlatan
e04db9299d Add dsc's CMakeLists.txt file 2019-11-27 22:59:27 +01:00
selsta
7b0cd19487 wizard: Language button on home and add back button 2019-11-27 19:20:58 +01:00
selsta
c0fa4f5d27 SettingsLayout: pointing mouse cursor and selecting text 2019-11-27 18:49:18 +01:00
luigi1111
d5f4d5d93f Merge pull request #2506
f47335f Wizard, AddressBook, SettingsNode: prevent undesired text selection (xiphon)
2019-11-27 10:26:03 -06:00
luigi1111
9ba1960207 Merge pull request #2504
f75aa22 main: omit onWalletRefresh call with uninitialized currentWallet (xiphon)
2019-11-27 10:24:54 -06:00
luigi1111
04a665db0c Merge pull request #2449
4a52681 workflows: check if QML loads successfully (selsta)
2019-11-27 10:23:45 -06:00
xiphon
f47335f89f Wizard, AddressBook, SettingsNode: prevent undesired text selection 2019-11-27 12:33:30 +00:00
xiphon
f75aa22b26 main: omit onWalletRefresh call with uninitialized currentWallet 2019-11-27 09:14:35 +00:00
luigi1111
50e1ce1460 Merge pull request #2502
bd20626 Installer: fix 'GUI Wallet Guide' shortcut target filename (xiphon)
2019-11-26 15:18:25 -06:00
luigi1111
df02532fd5 Merge pull request #2500
8738210 PasswordDialog: fix text field height changing on input (Windows) (xiphon)
2019-11-26 15:17:38 -06:00
xiphon
bd20626460 Installer: fix 'GUI Wallet Guide' shortcut target filename 2019-11-26 16:25:24 +00:00
xiphon
8738210991 PasswordDialog: fix text field height changing on input (Windows) 2019-11-26 16:09:09 +00:00
luigi1111
6c2c17ada1 Merge pull request #2489
0daf2aa CheckBox: use Font Awesome plus/minus icons, remove unused images (xiphon)
2019-11-25 12:57:28 -06:00
luigi1111
380f218b3a Merge pull request #2494
56023fa build: MacOS openssl path provided by brew, fallback to default (xiphon)
2019-11-25 12:49:05 -06:00
luigi1111
12647fac73 Merge pull request #2491
1dc45ba Input: fix cursor shape, should be 'Qt.IBeamCursor' (xiphon)
2019-11-25 12:47:26 -06:00
luigi1111
9f0f40af80 Merge pull request #2486
06ccded Transfer: fix NaN fiat conversion (selsta)
2019-11-25 12:46:09 -06:00
luigi1111
c316fab29f Merge pull request #2485
ff38e96 build: set BUILD_TAG to fix update notification (selsta)
2019-11-25 12:45:22 -06:00
luigi1111
37de27d7f6 Merge pull request #2477
a9a59fd main: ask whether to stop local node upon switching to remote node (xiphon)
2019-11-25 12:44:28 -06:00
luigi1111
c61d857a67 Merge pull request #2464
e2a187f AppWindow: append wallet name to window title (xiphon)
2019-11-25 12:43:31 -06:00
xiphon
56023facaa build: MacOS openssl path provided by brew, fallback to default 2019-11-25 14:46:18 +00:00
xiphon
1dc45bad87 Input: fix cursor shape, should be 'Qt.IBeamCursor' 2019-11-25 07:56:30 +00:00
xiphon
0daf2aacf5 CheckBox: use Font Awesome plus/minus icons, remove unused images 2019-11-25 06:37:21 +00:00
selsta
06ccded94e Transfer: fix NaN fiat conversion 2019-11-25 00:57:59 +01:00
selsta
ff38e965bd build: set BUILD_TAG to fix update notification 2019-11-25 00:27:29 +01:00
xiphon
a9a59fd314 main: ask whether to stop local node upon switching to remote node 2019-11-24 10:19:40 +00:00
xiphon
e2a187f892 AppWindow: append wallet name to window title 2019-11-24 08:49:59 +00:00
selsta
4a526810ce workflows: check if QML loads successfully 2019-11-20 15:32:42 +01:00
luigi1111
2f5c47e95f Merge pull request #2448
d2b9d56 ContextMenu: styling, implement ContextMenuItem component (xiphon)
2019-11-19 10:36:34 -06:00
luigi1111
34b216e6dc Merge pull request #2444
5a65d28 build: set submodule to v0.15.0.1 (selsta)
2019-11-19 10:35:25 -06:00
xiphon
d2b9d5690b ContextMenu: styling, implement ContextMenuItem component 2019-11-19 12:32:53 +00:00
luigi1111
d10f1b5d30 Merge pull request #2447
d92cc94 readme: add 'zeromq-devel' to Fedora deps (xiphon)
2019-11-18 13:00:54 -06:00
luigi1111
fea3bb503f Merge pull request #2446
f57b2d5 workflows: add basic ubuntu/macOS build script (selsta)
2019-11-18 12:58:46 -06:00
xiphon
d92cc944cb readme: add 'zeromq-devel' to Fedora deps 2019-11-17 19:32:13 +00:00
selsta
f57b2d57cd workflows: add basic ubuntu/macOS build script 2019-11-14 22:12:38 +01:00
luigi1111
cf0e5a811e Merge pull request #2440
e9cdaf4 Transfer: convert and display entered amount in fiat currency (xiphon)
2019-11-13 09:08:16 -06:00
luigi1111
ea8f51d168 Merge pull request #2439
17f032e fiat: fix invalid type, don't round conversion rate to whole number (xiphon)
2019-11-13 09:06:51 -06:00
luigi1111
e8befc4c67 Merge pull request #2438
92f9bec installer: automatically set app version information (xiphon)
2019-11-13 09:05:55 -06:00
luigi1111
5518771a8b Merge pull request #2437
ef565e5 build: embed version metadata into binary (xiphon)
2019-11-13 09:04:49 -06:00
luigi1111
47bc0f2a3c Merge pull request #2435
0e3f3c1 SettingsWallet: refactor list items into separate component (xiphon)
2019-11-13 09:03:51 -06:00
luigi1111
8bd820b909 Merge pull request #2429
74e12ce ContextMenu: implement 'paste' context menu for all text fields (xiphon)
2019-11-13 09:03:02 -06:00
luigi1111
f948d0e214 Merge pull request #2428
5fe6b48 Settings: fix 'Light theme' checkbox (xiphon)
2019-11-13 09:02:03 -06:00
luigi1111
3a7c9e6c8e Merge pull request #2417
212c8dd Warning added that balance reflects only incoming transactions for view-only wallets (peli-pro)
2019-11-13 09:00:44 -06:00
selsta
5a65d28d29 build: set submodule to v0.15.0.1 2019-11-13 15:45:42 +01:00
xiphon
e9cdaf4dbe Transfer: convert and display entered amount in fiat currency 2019-11-13 08:10:49 +00:00
xiphon
17f032ea11 fiat: fix invalid type, don't round conversion rate to whole number 2019-11-13 06:34:33 +00:00
xiphon
ef565e5fa3 build: embed version metadata into binary 2019-11-12 16:23:02 +00:00
xiphon
92f9bec1e7 installer: automatically set app version information 2019-11-12 02:25:29 +00:00
xiphon
0e3f3c13a1 SettingsWallet: refactor list items into separate component 2019-11-11 21:14:39 +00:00
xiphon
74e12ce71d ContextMenu: implement 'paste' context menu for all text fields 2019-11-08 12:41:32 +00:00
xiphon
5fe6b48517 Settings: fix 'Light theme' checkbox 2019-11-04 21:47:38 +00:00
peli-pro
212c8dd054 Warning added that balance reflects only incoming transactions for view-only wallets 2019-10-17 14:25:36 +02:00
142 changed files with 5430 additions and 1795 deletions

34
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: GUI build
on: [push, pull_request]
jobs:
build-macos:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- name: update brew and install dependencies
run: brew update && brew install boost hidapi zmq libpgm unbound libsodium miniupnpc ldns expat doxygen graphviz libunwind-headers protobuf qt5
- name: build
run: export PATH=$PATH:/usr/local/opt/qt/bin && ./build.sh
- name: test qml
run: build/release/bin/monero-wallet-gui.app/Contents/MacOS/monero-wallet-gui --test-qml
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: update apt
run: sudo apt update
- name: install monero dependencies
run: sudo apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev
- name: install monero gui dependencies
run: sudo apt -y install qtbase5-dev qt5-default qtdeclarative5-dev 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-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev xvfb
- name: build
run: ./build.sh
- name: test qml
run: xvfb-run -a build/release/bin/monero-wallet-gui --test-qml

1
.gitignore vendored
View File

@@ -28,6 +28,7 @@ Session.vim
# Temporary
.netrwhist
*~
*.autosave
# Auto-generated tag files
tags
# Persistent undo

412
CMakeLists.txt Normal file
View File

@@ -0,0 +1,412 @@
cmake_minimum_required(VERSION 3.10)
project(monero-gui)
message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
set(VERSION_MAJOR "14")
set(VERSION_MINOR "0")
set(VERSION_REVISION "3")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")
# libwallet requires a static build, so we only allow static compilation
set(STATIC ON)
option(USE_DEVICE_TREZOR ON)
option(ENABLE_PASS_STRENGTH_METER "Disable zxcvbn" OFF)
option(WITH_SCANNER "Enable webcam QR scanner" OFF)
option(DEV_MODE "Checkout latest monero master on build" OFF)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(DEBUG)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
set(BUILD_GUI_DEPS ON)
set(ARCH "x86-64")
set(BUILD_64 ON)
set(INSTALL_VENDORED_LIBUNBOUND=ON)
function (add_c_flag_if_supported flag var)
string(REPLACE "-" "_" supported ${flag}_c)
check_c_compiler_flag(${flag} ${supported})
if(${${supported}})
set(${var} "${${var}} ${flag}" PARENT_SCOPE)
endif()
endfunction()
function (add_cxx_flag_if_supported flag var)
string(REPLACE "-" "_" supported ${flag}_cxx)
check_cxx_compiler_flag(${flag} ${supported})
if(${${supported}})
set(${var} "${${var}} ${flag}" PARENT_SCOPE)
endif()
endfunction()
function (add_linker_flag_if_supported flag var)
string(REPLACE "-" "_" supported ${flag}_ld)
string(REPLACE "," "_" supported ${flag}_ld)
check_linker_flag(${flag} ${supported})
if(${${supported}})
set(${var} "${${var}} ${flag}" PARENT_SCOPE)
endif()
endfunction()
find_package(Git)
if(GIT_FOUND)
if(NOT DEV_MODE)
find_package(Git)
function (check_submodule relative_path)
execute_process(COMMAND git rev-parse "HEAD" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${relative_path} OUTPUT_VARIABLE localHead)
execute_process(COMMAND git rev-parse "HEAD:${relative_path}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE checkedHead)
string(COMPARE EQUAL "${localHead}" "${checkedHead}" upToDate)
if (upToDate)
message(STATUS "Submodule '${relative_path}' is up-to-date")
else()
message(FATAL_ERROR "Submodule '${relative_path}' is not using the checked head. Please update all submodules with\ngit submodule update --init --force\nor run cmake with -DMANUAL_SUBMODULES=1,\n or if you want to build from latest master run cmake with -DEV_MODE,\n or run make devmode")
endif()
endfunction ()
message(STATUS "Checking submodules")
check_submodule(monero)
else()
execute_process(COMMAND cd monero && git checkout origin/master)
endif()
endif()
add_subdirectory(monero)
set_property(TARGET wallet_merged PROPERTY FOLDER "monero")
get_directory_property(ARCH_WIDTH DIRECTORY "monero" DEFINITION ARCH_WIDTH)
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DQT_NO_DEBUG)
endif()
if(STATIC)
message(STATUS "Initiating static build")
set(Boost_USE_STATIC_LIBS ON)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
add_definitions(-DMONERO_GUI_STATIC)
endif()
# Include password strength library
if(ENABLE_PASS_STRENGTH_METER)
message(STATUS "Buildin with pass strength meter support.")
else()
add_definitions(-DDISABLE_PASS_STRENGTH_METER)
endif()
include(CheckTrezor) # Trezor support check
include(CMakePackageConfigHelpers)
# force version update
function (monero_gui_add_library_with_deps)
cmake_parse_arguments(MONERO_ADD_LIBRARY "" "NAME" "DEPENDS;SOURCES" ${ARGN})
source_group("${MONERO_ADD_LIBRARY_NAME}" FILES ${MONERO_ADD_LIBRARY_SOURCES})
# Define a ("virtual") object library and an actual library that links those
# objects together. The virtual libraries can be arbitrarily combined to link
# any subset of objects into one library archive. This is used for releasing
# libwallet, which combines multiple components.
set(objlib obj_${MONERO_ADD_LIBRARY_NAME})
add_library(${objlib} OBJECT ${MONERO_ADD_LIBRARY_SOURCES})
add_library("${MONERO_ADD_LIBRARY_NAME}" $<TARGET_OBJECTS:${objlib}>)
if (MONERO_ADD_LIBRARY_DEPENDS)
add_dependencies(${objlib} ${MONERO_ADD_LIBRARY_DEPENDS})
endif()
set_property(TARGET "${MONERO_ADD_LIBRARY_NAME}" PROPERTY FOLDER "libs")
target_compile_definitions(${objlib}
PRIVATE $<TARGET_PROPERTY:${MONERO_ADD_LIBRARY_NAME},INTERFACE_COMPILE_DEFINITIONS>)
endfunction ()
function (monero_gui_add_library name)
monero_gui_add_library_with_deps(NAME "${name}" SOURCES ${ARGN})
endfunction()
include_directories(${EASYLOGGING_INCLUDE})
link_directories(${EASYLOGGING_LIBRARY_DIRS})
include(VersionGui)
monero_gui_add_library(gui_version SOURCES version.js DEPENDS genversiongui)
message(STATUS "${CMAKE_MODULE_PATH}")
# OpenSSL
find_package(OpenSSL REQUIRED)
message(STATUS "OpenSSL: Version ${OPENSSL_VERSION}")
message(STATUS "OpenSSL: include dir at ${OPENSSL_INCLUDE_DIR}")
message(STATUS "OpenSSL: libraries at ${OPENSSL_LIBRARIES} ${OPENSSL_SSL_LIBRARIES}")
# Zbar (for QR scanner)
if(WITH_SCANNER)
add_definitions(-DWITH_SCANNER)
find_package(ZBar0)
message(STATUS "libzbar: include dir at ${ZBAR_INCLUDE_DIR}")
message(STATUS "libzbar: libraries at ${ZBAR_LIBRARIES}")
endif()
# Sodium
find_library(SODIUM_LIBRARY sodium)
message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}")
# LibUSB
find_package(LibUSB)
message(STATUS "libusb: include dir at ${LibUSB_INCLUDE_DIRS}")
message(STATUS "libusb: libraries at ${LibUSB_LIBRARIES}")
# HIDApi
find_package(HIDAPI REQUIRED)
message(STATUS "libhidapi: include dir at ${HIDAPI_INCLUDE_DIRS}")
message(STATUS "libhidapi: libraries at ${HIDAPI_LIBRARIES}")
# Boost
if(DEBUG)
set(Boost_DEBUG ON)
endif()
find_package(Boost 1.62 REQUIRED COMPONENTS
system
filesystem
thread
date_time
chrono
regex
serialization
program_options
locale)
if(LINUX)
find_package(X11 REQUIRED)
message(STATUS "X11_FOUND = ${X11_FOUND}")
message(STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}")
message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
include_directories(${X11_INCLUDE_DIR})
link_directories(${X11_LIBRARIES})
if(STATIC)
find_library(XCB_LIBRARY xcb)
message(STATUS "Found xcb library: ${XCB_LIBRARY}")
endif()
endif()
if(MINGW)
string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}")
message(STATUS "MSYS location: ${msys2_install_path}")
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/Qt/labs/folderlistmodel")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/Qt/labs/settings")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtGraphicalEffects")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtGraphicalEffects/private")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtMultimedia")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick.2")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Controls")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Controls.2")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Dialogs")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Dialogs/Private")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Layouts")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/PrivateWidgets")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Templates.2")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Window.2")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/XmlListModel")
# This is necessary because otherwise CMake will make Boost libraries -lfoo
# rather than a full path. Unfortunately, this makes the shared libraries get
# linked due to a bug in CMake which misses putting -static flags around the
# -lfoo arguments.
set(DEFLIB ${msys2_install_path}/mingw${ARCH_WIDTH}/lib)
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
endif()
set(QT5_LIBRARIES
Qt5Core
Qt5Quick
Qt5QuickControls2
Qt5Widgets
Qt5Gui
Qt5Network
Qt5Qml
Qt5Multimedia
Qt5Xml
Qt5XmlPatterns
Qt5Svg
)
foreach(QT5_MODULE ${QT5_LIBRARIES})
find_package(${QT5_MODULE} REQUIRED)
endforeach()
find_package(PkgConfig)
if(PKGCONFIG_FOUND)
pkg_check_modules(QT5_PKG_CONFIG ${QT5_LIBRARIES})
if(QT5_PKG_CONFIG_FOUND)
set(QT5_PKG_CONFIG "QT5_PKG_CONFIG")
if(STATIC)
set(QT5_PKG_CONFIG "${QT5_PKG_CONFIG}_STATIC")
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()
endif()
list(APPEND QT5_LIBRARIES
${Qt5Gui_PLUGINS}
${Qt5Svg_PLUGINS}
${Qt5Qml_PLUGINS}
${Qt5Network_PLUGINS}
)
if(STATIC)
set(QT5_LIBRARIES
qtquickcontrols2plugin # has to be the first one, depends on Qt5QuickControls2
${QT5_LIBRARIES}
declarative_multimedia
dialogplugin
dialogsprivateplugin
qmlfolderlistmodelplugin
qmlsettingsplugin
qmlxmllistmodelplugin
qquicklayoutsplugin
Qt5EventDispatcherSupport
Qt5FontDatabaseSupport
Qt5MultimediaQuick_p
Qt5PacketProtocol
Qt5ThemeSupport
qtgraphicaleffectsplugin
qtgraphicaleffectsprivate
qtquick2plugin
qtquickcontrolsplugin
qtquicktemplates2plugin
widgetsplugin
windowplugin
)
if(MINGW)
list(APPEND QT5_LIBRARIES qtfreetype)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND QT5_LIBRARIES D3D11 Dwrite D2d1)
endif()
endif()
endif()
message(STATUS "Using Boost include dir at ${Boost_INCLUDE_DIRS}")
message(STATUS "Using Boost libraries at ${Boost_LIBRARIES}")
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if(MINGW)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt)
if(DEPENDS)
set(ICU_LIBRARIES icuio icui18n icuuc icudata icutu iconv)
else()
set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
endif()
elseif(APPLE OR OPENBSD OR ANDROID)
set(EXTRA_LIBRARIES "")
elseif(FREEBSD)
set(EXTRA_LIBRARIES execinfo)
elseif(DRAGONFLY)
find_library(COMPAT compat)
set(EXTRA_LIBRARIES execinfo ${COMPAT})
elseif(CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
set(EXTRA_LIBRARIES socket nsl resolv)
elseif(NOT MSVC AND NOT DEPENDS)
find_library(RT rt)
set(EXTRA_LIBRARIES ${RT})
endif()
list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
if(APPLE)
include_directories(SYSTEM /usr/include/malloc)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
endif()
if (APPLE AND NOT IOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -fvisibility=default -std=c++11")
endif()
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -DGTEST_HAS_TR1_TUPLE=0")
endif()
# warnings
add_c_flag_if_supported(-Wformat C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-Wformat CXX_SECURITY_FLAGS)
add_c_flag_if_supported(-Wformat-security C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-Wformat-security CXX_SECURITY_FLAGS)
# -fstack-protector
if (NOT OPENBSD AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)))
add_c_flag_if_supported(-fstack-protector C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fstack-protector CXX_SECURITY_FLAGS)
add_c_flag_if_supported(-fstack-protector-strong C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fstack-protector-strong CXX_SECURITY_FLAGS)
endif()
# New in GCC 8.2
if (NOT OPENBSD AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)))
add_c_flag_if_supported(-fcf-protection=full C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fcf-protection=full CXX_SECURITY_FLAGS)
endif()
if (NOT WIN32 AND NOT OPENBSD)
add_c_flag_if_supported(-fstack-clash-protection C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS)
endif()
# Removed in GCC 9.1 (or before ?), but still accepted, so spams the output
if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))
add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS)
endif()
# linker
if (NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
# Windows binaries die on startup with PIE when compiled with GCC
add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
endif()
add_linker_flag_if_supported(-Wl,-z,relro LD_SECURITY_FLAGS)
add_linker_flag_if_supported(-Wl,-z,now LD_SECURITY_FLAGS)
add_linker_flag_if_supported(-Wl,-z,noexecstack noexecstack_SUPPORTED)
if (noexecstack_SUPPORTED)
set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecstack")
endif()
add_linker_flag_if_supported(-Wl,-z,noexecheap noexecheap_SUPPORTED)
if (noexecheap_SUPPORTED)
set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecheap")
endif()
message(STATUS "Using C security hardening flags: ${C_SECURITY_FLAGS}")
message(STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}")
message(STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_SECURITY_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_SECURITY_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS}")
if (HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED)
if (APPLE)
if(DEPENDS)
list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework IOKit")
else()
find_library(COREFOUNDATION CoreFoundation)
find_library(IOKIT IOKit)
list(APPEND EXTRA_LIBRARIES ${IOKIT})
list(APPEND EXTRA_LIBRARIES ${COREFOUNDATION})
endif()
endif()
if (WIN32)
list(APPEND EXTRA_LIBRARIES setupapi Version)
endif()
endif()
add_subdirectory(src)
# Required to make wallet_merged build before the gui
add_dependencies(monero-gui wallet_merged)

View File

@@ -40,8 +40,8 @@ import "components/effects/" as MoneroEffects
Rectangle {
id: panel
property int currentAccountIndex: 0
property string currentAccountLabel: "Primary account"
property int currentAccountIndex
property alias currentAccountLabel: accountLabel.text
property string balanceString: "?.??"
property string balanceUnlockedString: "?.??"
property string balanceFiatString: "?.??"
@@ -184,7 +184,7 @@ Rectangle {
MoneroComponents.Label {
fontSize: 12
id: accountIndex
text: qsTr("Account") + " #" + currentAccountIndex
text: qsTr("Account") + translationManager.emptyString + " #" + currentAccountIndex
color: MoneroComponents.Style.blackTheme ? "white" : "black"
anchors.left: parent.left
anchors.leftMargin: 60
@@ -204,7 +204,6 @@ Rectangle {
fontSize: 16
id: accountLabel
textWidth: 170
text: currentAccountLabel
color: MoneroComponents.Style.blackTheme ? "white" : "black"
anchors.left: parent.left
anchors.leftMargin: 60
@@ -238,7 +237,7 @@ Rectangle {
font.pixelSize: 16
text: {
if (persistentSettings.fiatPriceEnabled && persistentSettings.fiatPriceToggle) {
return persistentSettings.fiatPriceCurrency == "xmrusd" ? "USD" : "EUR"
return appWindow.fiatApiCurrencySymbol();
} else {
return "XMR"
}
@@ -351,6 +350,7 @@ Rectangle {
anchors.top: parent.top
anchors.bottom: networkStatus.top
width: parent.width
boundsBehavior: isMac ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
clip: true
Column {
@@ -365,7 +365,7 @@ Rectangle {
MoneroComponents.MenuButtonDivider {
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Account tab ---------------
@@ -375,7 +375,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Account") + translationManager.emptyString
symbol: qsTr("T") + translationManager.emptyString
dotColor: "#44AAFF"
onClicked: {
parent.previousButton.checked = false
parent.previousButton = accountButton
@@ -387,7 +386,7 @@ Rectangle {
visible: accountButton.present
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Transfer tab ---------------
@@ -397,7 +396,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Send") + translationManager.emptyString
symbol: qsTr("S") + translationManager.emptyString
dotColor: "#FF6C3C"
onClicked: {
parent.previousButton.checked = false
parent.previousButton = transferButton
@@ -409,7 +407,7 @@ Rectangle {
visible: transferButton.present
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- AddressBook tab ---------------
@@ -420,7 +418,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Address book") + translationManager.emptyString
symbol: qsTr("B") + translationManager.emptyString
dotColor: "#FF4F41"
under: transferButton
onClicked: {
parent.previousButton.checked = false
@@ -433,7 +430,7 @@ Rectangle {
visible: addressBookButton.present
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Receive tab ---------------
@@ -443,7 +440,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Receive") + translationManager.emptyString
symbol: qsTr("R") + translationManager.emptyString
dotColor: "#AAFFBB"
onClicked: {
parent.previousButton.checked = false
parent.previousButton = receiveButton
@@ -455,7 +451,7 @@ Rectangle {
visible: receiveButton.present
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Merchant tab ---------------
@@ -467,7 +463,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Merchant") + translationManager.emptyString
symbol: qsTr("U") + translationManager.emptyString
dotColor: "#FF4F41"
under: receiveButton
onClicked: {
parent.previousButton.checked = false
@@ -480,7 +475,7 @@ Rectangle {
visible: merchantButton.present && appWindow.walletMode >= 2
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- History tab ---------------
@@ -491,7 +486,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Transactions") + translationManager.emptyString
symbol: qsTr("H") + translationManager.emptyString
dotColor: "#6B0072"
onClicked: {
parent.previousButton.checked = false
parent.previousButton = historyButton
@@ -503,7 +497,7 @@ Rectangle {
visible: historyButton.present
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Advanced tab ---------------
@@ -514,7 +508,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Advanced") + translationManager.emptyString
symbol: qsTr("D") + translationManager.emptyString
dotColor: "#FFD781"
onClicked: {
parent.previousButton.checked = false
parent.previousButton = advancedButton
@@ -525,7 +518,7 @@ Rectangle {
visible: advancedButton.present && appWindow.walletMode >= 2
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Mining tab ---------------
@@ -536,7 +529,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Mining") + translationManager.emptyString
symbol: qsTr("M") + translationManager.emptyString
dotColor: "#FFD781"
under: advancedButton
onClicked: {
parent.previousButton.checked = false
@@ -549,7 +541,7 @@ Rectangle {
visible: miningButton.present && appWindow.walletMode >= 2
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- TxKey tab ---------------
@@ -560,7 +552,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Prove/check") + translationManager.emptyString
symbol: qsTr("K") + translationManager.emptyString
dotColor: "#FFD781"
under: advancedButton
onClicked: {
parent.previousButton.checked = false
@@ -573,7 +564,7 @@ Rectangle {
visible: txkeyButton.present && appWindow.walletMode >= 2
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Shared RingDB tab ---------------
@@ -584,7 +575,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Shared RingDB") + translationManager.emptyString
symbol: qsTr("G") + translationManager.emptyString
dotColor: "#FFD781"
under: advancedButton
onClicked: {
parent.previousButton.checked = false
@@ -597,7 +587,7 @@ Rectangle {
visible: sharedringdbButton.present && appWindow.walletMode >= 2
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Sign/verify tab ---------------
@@ -608,7 +598,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Sign/verify") + translationManager.emptyString
symbol: qsTr("I") + translationManager.emptyString
dotColor: "#FFD781"
under: advancedButton
onClicked: {
parent.previousButton.checked = false
@@ -621,7 +610,7 @@ Rectangle {
visible: signButton.present && appWindow.walletMode >= 2
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
// ------------- Settings tab ---------------
@@ -631,7 +620,6 @@ Rectangle {
anchors.right: parent.right
text: qsTr("Settings") + translationManager.emptyString
symbol: qsTr("E") + translationManager.emptyString
dotColor: "#36B25C"
onClicked: {
parent.previousButton.checked = false
parent.previousButton = settingsButton
@@ -643,7 +631,7 @@ Rectangle {
visible: settingsButton.present
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.leftMargin: 20
}
} // Column

40
Makefile Normal file
View File

@@ -0,0 +1,40 @@
ANDROID_STANDALONE_TOOLCHAIN_PATH ?= /usr/local/toolchain
dotgit=$(shell ls -d .git/config)
ifneq ($(dotgit), .git/config)
USE_SINGLE_BUILDDIR=1
endif
subbuilddir:=$(shell echo `uname | sed -e 's|[:/\\ \(\)]|_|g'`/`git branch | grep '\* ' | cut -f2- -d' '| sed -e 's|[:/\\ \(\)]|_|g'`)
ifeq ($(USE_SINGLE_BUILDDIR),)
builddir := build/"$(subbuilddir)"
topdir := ../../../..
deldirs := $(builddir)
else
builddir := build
topdir := ../..
deldirs := $(builddir)/debug $(builddir)/release $(builddir)/fuzz
endif
default:
mkdir -p build && cd build && cmake -D ARCH="x86-64" -D DEV_MODE=$(or ${DEV_MODE},OFF) -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release .. && $(MAKE)
debug:
mkdir -p build && cd build && cmake -D DEV_MODE=$(or ${DEV_MODE},ON) .. && $(MAKE) VERBOSE=1
devmode:
mkdir -p build && cd build && cmake -D ARCH="x86-64" -D DEV_MODE=$(or ${DEV_MODE},ON) -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release .. && $(MAKE)
clean:
mkdir -p build && cd build && rm -rf *
scanner:
mkdir -p build && cd build && cmake -D ARCH="x86-64" -D DEV_MODE=$(or ${DEV_MODE},ON) -D WITH_SCANNER=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release .. && $(MAKE)
debug-static-win64:
mkdir -p $(builddir)/debug && cd $(builddir)/debug && cmake -D STATIC=ON -G "MSYS Makefiles" -D DEV_MODE=$(or ${DEV_MODE},ON) -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Debug -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=$(topdir)/cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=c:/msys64 -D MINGW=ON $(topdir) && $(MAKE)
debug-static-mac64:
mkdir -p $(builddir)/debug
cd $(builddir)/debug && cmake -D STATIC=ON -D DEV_MODE=$(or ${DEV_MODE},ON) -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="mac-x64" $(topdir) && $(MAKE)
release-static-win64:
mkdir -p $(builddir)/release && cd $(builddir)/release && cmake -D STATIC=ON -G "MSYS Makefiles" -D DEV_MODE=$(or ${DEV_MODE},OFF) -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=$(topdir)/cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=c:/msys64 -D MINGW=ON $(topdir) && $(MAKE)

View File

@@ -168,23 +168,6 @@ Rectangle {
}
]
// color stripe at the top
Row {
id: styledRow
visible: currentView !== merchantView
height: 4
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
z: parent.z + 1
Rectangle { height: 4; width: parent.width / 5; color: "#FFE00A" }
Rectangle { height: 4; width: parent.width / 5; color: "#6B0072" }
Rectangle { height: 4; width: parent.width / 5; color: "#FF6C3C" }
Rectangle { height: 4; width: parent.width / 5; color: "#FFD781" }
Rectangle { height: 4; width: parent.width / 5; color: "#FF4F41" }
}
ColumnLayout {
anchors.fill: parent
anchors.margins: {
@@ -195,6 +178,7 @@ Rectangle {
}
anchors.topMargin: appWindow.persistentSettings.customDecorations ? 50 : 0
anchors.bottomMargin: 0
spacing: 0
Flickable {
@@ -202,6 +186,7 @@ Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
boundsBehavior: isMac ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar {
parent: root
@@ -211,6 +196,7 @@ Rectangle {
anchors.topMargin: persistentSettings.customDecorations ? 60 : 10
anchors.bottom: parent.bottom
anchors.bottomMargin: persistentSettings.customDecorations ? 15 : 10
onActiveChanged: if (!active && !isMac) active = true
}
onFlickingChanged: {
@@ -253,7 +239,7 @@ Rectangle {
Rectangle {
id: borderLeft
visible: middlePanel.state !== "Merchant"
anchors.top: styledRow.bottom
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
width: 1

View File

@@ -93,7 +93,7 @@ Packaging for your favorite distribution would be a welcome contribution!
- For Fedora
`sudo dnf install make automake cmake gcc-c++ boost-devel miniupnpc-devel graphviz doxygen unbound-devel libunwind-devel pkgconfig openssl-devel libcurl-devel hidapi-devel libusb-devel`
`sudo dnf install make automake cmake gcc-c++ boost-devel miniupnpc-devel graphviz doxygen unbound-devel libunwind-devel pkgconfig openssl-devel libcurl-devel hidapi-devel libusb-devel zeromq-devel`
2. Install Qt:

View File

@@ -0,0 +1,50 @@
# Copyright (c) 2014-2019, 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.
if (NOT CMAKE_HOST_WIN32)
set (CMAKE_SYSTEM_NAME Windows)
endif()
set (GCC_PREFIX i686-w64-mingw32)
set (CMAKE_C_COMPILER ${GCC_PREFIX}-gcc)
set (CMAKE_CXX_COMPILER ${GCC_PREFIX}-g++)
set (CMAKE_AR ar CACHE FILEPATH "" FORCE)
set (CMAKE_NM nm CACHE FILEPATH "" FORCE)
set (CMAKE_LINKER ld CACHE FILEPATH "" FORCE)
#set (CMAKE_RANLIB ${GCC_PREFIX}-gcc-ranlib CACHE FILEPATH "" FORCE)
set (CMAKE_RC_COMPILER windres)
set (CMAKE_FIND_ROOT_PATH "${MSYS2_FOLDER}/mingw32")
# Ensure cmake doesn't find things in the wrong places
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
set (MINGW_FLAG "-m32")
set (USE_LTO_DEFAULT false)

View File

@@ -0,0 +1,50 @@
# Copyright (c) 2014-2019, 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.
if (NOT CMAKE_HOST_WIN32)
set (CMAKE_SYSTEM_NAME Windows)
endif()
set (GCC_PREFIX x86_64-w64-mingw32)
set (CMAKE_C_COMPILER ${GCC_PREFIX}-gcc)
set (CMAKE_CXX_COMPILER ${GCC_PREFIX}-g++)
set (CMAKE_AR ar CACHE FILEPATH "" FORCE)
set (CMAKE_NM nm CACHE FILEPATH "" FORCE)
set (CMAKE_LINKER ld CACHE FILEPATH "" FORCE)
#set (CMAKE_RANLIB ${GCC_PREFIX}-gcc-ranlib CACHE FILEPATH "" FORCE)
set (CMAKE_RC_COMPILER windres)
set (CMAKE_FIND_ROOT_PATH "${MSYS2_FOLDER}/mingw64")
# Ensure cmake doesn't find things in the wrong places
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
set (MINGW_FLAG "-m64")
set (USE_LTO_DEFAULT false)

14
cmake/CheckLinkerFlag.c Normal file
View File

@@ -0,0 +1,14 @@
#ifdef __CLASSIC_C__
int main()
{
int ac;
char* av[];
#else
int main(int ac, char* av[])
{
#endif
if (ac > 1000) {
return *av[0];
}
return 0;
}

View File

@@ -0,0 +1,47 @@
include(CheckCCompilerFlag)
macro(CHECK_LINKER_FLAG flag VARIABLE)
if(NOT DEFINED "${VARIABLE}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${flag} linker flag")
endif()
set(_cle_source ${CMAKE_SOURCE_DIR}/cmake/CheckLinkerFlag.c)
set(saved_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
set(CMAKE_C_FLAGS "${flag}")
try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${_cle_source}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${flag}
CMAKE_FLAGS
OUTPUT_VARIABLE OUTPUT)
unset(_cle_source)
set(CMAKE_C_FLAGS ${saved_CMAKE_C_FLAGS})
unset(saved_CMAKE_C_FLAGS)
if ("${OUTPUT}" MATCHES "warning.*ignored")
set(${VARIABLE} 0)
endif()
if(${VARIABLE})
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${flag} linker flag - found")
endif()
set(${VARIABLE} 1 CACHE INTERNAL "Have linker flag ${flag}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the ${flag} linker flag is supported "
"passed with the following output:\n"
"${OUTPUT}\n\n")
else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${flag} linker flag - not found")
endif()
set(${VARIABLE} "" CACHE INTERNAL "Have linker flag ${flag}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the ${flag} linker flag is supported "
"failed with the following output:\n"
"${OUTPUT}\n\n")
endif()
endif()
endmacro()

181
cmake/CheckTrezor.cmake Normal file
View File

@@ -0,0 +1,181 @@
OPTION(USE_DEVICE_TREZOR "Trezor support compilation" ON)
OPTION(USE_DEVICE_TREZOR_LIBUSB "Trezor LibUSB compilation" ON)
OPTION(USE_DEVICE_TREZOR_UDP_RELEASE "Trezor UdpTransport in release mode" OFF)
OPTION(USE_DEVICE_TREZOR_DEBUG "Trezor Debugging enabled" OFF)
OPTION(TREZOR_DEBUG "Main trezor debugging switch" OFF)
# Helper function to fix cmake < 3.6.0 FindProtobuf variables
function(_trezor_protobuf_fix_vars)
if(${CMAKE_VERSION} VERSION_LESS "3.6.0")
foreach(UPPER
PROTOBUF_SRC_ROOT_FOLDER
PROTOBUF_IMPORT_DIRS
PROTOBUF_DEBUG
PROTOBUF_LIBRARY
PROTOBUF_PROTOC_LIBRARY
PROTOBUF_INCLUDE_DIR
PROTOBUF_PROTOC_EXECUTABLE
PROTOBUF_LIBRARY_DEBUG
PROTOBUF_PROTOC_LIBRARY_DEBUG
PROTOBUF_LITE_LIBRARY
PROTOBUF_LITE_LIBRARY_DEBUG
)
if (DEFINED ${UPPER})
string(REPLACE "PROTOBUF_" "Protobuf_" Camel ${UPPER})
if (NOT DEFINED ${Camel})
set(${Camel} ${${UPPER}} PARENT_SCOPE)
endif()
endif()
endforeach()
endif()
endfunction()
# Use Trezor master switch
if (USE_DEVICE_TREZOR)
# Protobuf is required to build protobuf messages for Trezor
include(FindProtobuf OPTIONAL)
find_package(Protobuf)
_trezor_protobuf_fix_vars()
# Protobuf handling the cache variables set in docker.
if(NOT Protobuf_FOUND AND NOT Protobuf_LIBRARY AND NOT Protobuf_PROTOC_EXECUTABLE AND NOT Protobuf_INCLUDE_DIR)
message(STATUS "Could not find Protobuf")
elseif(NOT Protobuf_LIBRARY OR NOT EXISTS "${Protobuf_LIBRARY}")
message(STATUS "Protobuf library not found: ${Protobuf_LIBRARY}")
unset(Protobuf_FOUND)
elseif(NOT Protobuf_PROTOC_EXECUTABLE OR NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
message(STATUS "Protobuf executable not found: ${Protobuf_PROTOC_EXECUTABLE}")
unset(Protobuf_FOUND)
elseif(NOT Protobuf_INCLUDE_DIR OR NOT EXISTS "${Protobuf_INCLUDE_DIR}")
message(STATUS "Protobuf include dir not found: ${Protobuf_INCLUDE_DIR}")
unset(Protobuf_FOUND)
else()
message(STATUS "Protobuf lib: ${Protobuf_LIBRARY}, inc: ${Protobuf_INCLUDE_DIR}, protoc: ${Protobuf_PROTOC_EXECUTABLE}")
set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIR})
set(Protobuf_FOUND 1) # override found if all rquired info was provided by variables
endif()
if(TREZOR_DEBUG)
set(USE_DEVICE_TREZOR_DEBUG 1)
endif()
# Compile debugging support (for tests)
if (USE_DEVICE_TREZOR_DEBUG)
add_definitions(-DWITH_TREZOR_DEBUGGING=1)
endif()
else()
message(STATUS "Trezor support disabled by USE_DEVICE_TREZOR")
endif()
if(Protobuf_FOUND AND USE_DEVICE_TREZOR)
if (NOT "$ENV{TREZOR_PYTHON}" STREQUAL "")
set(TREZOR_PYTHON "$ENV{TREZOR_PYTHON}" CACHE INTERNAL "Copied from environment variable TREZOR_PYTHON")
else()
find_package(Python QUIET COMPONENTS Interpreter) # cmake 3.12+
if(Python_Interpreter_FOUND)
set(TREZOR_PYTHON "${Python_EXECUTABLE}")
endif()
endif()
if(NOT TREZOR_PYTHON)
find_package(PythonInterp)
if(PYTHONINTERP_FOUND AND PYTHON_EXECUTABLE)
set(TREZOR_PYTHON "${PYTHON_EXECUTABLE}")
endif()
endif()
if(NOT TREZOR_PYTHON)
message(STATUS "Trezor: Python not found")
endif()
endif()
# Protobuf compilation test
if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON)
execute_process(COMMAND ${Protobuf_PROTOC_EXECUTABLE} -I "${CMAKE_SOURCE_DIR}/cmake" -I "${Protobuf_INCLUDE_DIR}" "${CMAKE_SOURCE_DIR}/cmake/test-protobuf.proto" --cpp_out ${CMAKE_BINARY_DIR} RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE ERR)
if(RET)
message(STATUS "Protobuf test generation failed: ${OUT} ${ERR}")
endif()
try_compile(Protobuf_COMPILE_TEST_PASSED
"${CMAKE_BINARY_DIR}"
SOURCES
"${CMAKE_BINARY_DIR}/test-protobuf.pb.cc"
"${CMAKE_SOURCE_DIR}/cmake/test-protobuf.cpp"
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES=${Protobuf_INCLUDE_DIR};${CMAKE_BINARY_DIR}"
"-DCMAKE_CXX_STANDARD=11"
LINK_LIBRARIES ${Protobuf_LIBRARY}
OUTPUT_VARIABLE OUTPUT
)
if(NOT Protobuf_COMPILE_TEST_PASSED)
message(STATUS "Protobuf Compilation test failed: ${OUTPUT}.")
endif()
endif()
# Try to build protobuf messages
if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON AND Protobuf_COMPILE_TEST_PASSED)
set(ENV{PROTOBUF_INCLUDE_DIRS} "${Protobuf_INCLUDE_DIR}")
set(ENV{PROTOBUF_PROTOC_EXECUTABLE} "${Protobuf_PROTOC_EXECUTABLE}")
set(TREZOR_PROTOBUF_PARAMS "")
if (USE_DEVICE_TREZOR_DEBUG)
set(TREZOR_PROTOBUF_PARAMS "--debug")
endif()
execute_process(COMMAND ${TREZOR_PYTHON} tools/build_protob.py ${TREZOR_PROTOBUF_PARAMS} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/monero/src/device_trezor/trezor RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE ERR)
if(RET)
message(WARNING "Trezor protobuf messages could not be regenerated (err=${RET}, python ${PYTHON})."
"OUT: ${OUT}, ERR: ${ERR}."
"Please read src/device_trezor/trezor/tools/README.md")
else()
message(STATUS "Trezor protobuf messages regenerated out: \"${OUT}.\"")
set(DEVICE_TREZOR_READY 1)
add_definitions(-DDEVICE_TREZOR_READY=1)
add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS=0)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DTREZOR_DEBUG=1)
endif()
if(USE_DEVICE_TREZOR_UDP_RELEASE)
add_definitions(-DUSE_DEVICE_TREZOR_UDP_RELEASE=1)
endif()
if (Protobuf_INCLUDE_DIR)
include_directories(${Protobuf_INCLUDE_DIR})
endif()
# LibUSB support, check for particular version
# Include support only if compilation test passes
if (USE_DEVICE_TREZOR_LIBUSB)
find_package(LibUSB)
endif()
if (LibUSB_COMPILE_TEST_PASSED)
add_definitions(-DHAVE_TREZOR_LIBUSB=1)
if(LibUSB_INCLUDE_DIRS)
include_directories(${LibUSB_INCLUDE_DIRS})
endif()
endif()
set(TREZOR_LIBUSB_LIBRARIES "")
if(LibUSB_COMPILE_TEST_PASSED)
list(APPEND TREZOR_LIBUSB_LIBRARIES ${LibUSB_LIBRARIES})
message(STATUS "Trezor compatible LibUSB found at: ${LibUSB_INCLUDE_DIRS}")
endif()
if (BUILD_GUI_DEPS)
set(TREZOR_DEP_LIBS "")
set(TREZOR_DEP_LINKER "")
if (Protobuf_LIBRARY)
list(APPEND TREZOR_DEP_LIBS ${Protobuf_LIBRARY})
string(APPEND TREZOR_DEP_LINKER " -lprotobuf")
endif()
if (TREZOR_LIBUSB_LIBRARIES)
list(APPEND TREZOR_DEP_LIBS ${TREZOR_LIBUSB_LIBRARIES})
string(APPEND TREZOR_DEP_LINKER " -lusb-1.0")
endif()
endif()
endif()
endif()

1803
cmake/Doxyfile.in Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
/* increase vertical space */
#titlearea, #nav-path {
display: none;
height: 0px;
}
/* uncomment these lines for some extra vertical space */
/*
.tablist li {
line-height: 26px;
}
*/

98
cmake/FindBacktrace.cmake Normal file
View File

@@ -0,0 +1,98 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindBacktrace
# -------------
#
# Find provider for backtrace(3).
#
# Checks if OS supports backtrace(3) via either libc or custom library.
# This module defines the following variables:
#
# ``Backtrace_HEADER``
# The header file needed for backtrace(3). Cached.
# Could be forcibly set by user.
# ``Backtrace_INCLUDE_DIRS``
# The include directories needed to use backtrace(3) header.
# ``Backtrace_LIBRARIES``
# The libraries (linker flags) needed to use backtrace(3), if any.
# ``Backtrace_FOUND``
# Is set if and only if backtrace(3) support detected.
#
# The following cache variables are also available to set or use:
#
# ``Backtrace_LIBRARY``
# The external library providing backtrace, if any.
# ``Backtrace_INCLUDE_DIR``
# The directory holding the backtrace(3) header.
#
# Typical usage is to generate of header file using configure_file() with the
# contents like the following::
#
# #cmakedefine01 Backtrace_FOUND
# #if Backtrace_FOUND
# # include <${Backtrace_HEADER}>
# #endif
#
# And then reference that generated header file in actual source.
include(CMakePushCheckState)
include(CheckSymbolExists)
include(FindPackageHandleStandardArgs)
# List of variables to be provided to find_package_handle_standard_args()
set(_Backtrace_STD_ARGS Backtrace_INCLUDE_DIR)
if(Backtrace_HEADER)
set(_Backtrace_HEADER_TRY "${Backtrace_HEADER}")
else(Backtrace_HEADER)
set(_Backtrace_HEADER_TRY "execinfo.h")
endif(Backtrace_HEADER)
find_path(Backtrace_INCLUDE_DIR "${_Backtrace_HEADER_TRY}")
set(Backtrace_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
if (NOT DEFINED Backtrace_LIBRARY)
# First, check if we already have backtrace(), e.g., in libc
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
set(CMAKE_REQUIRED_QUIET ${Backtrace_FIND_QUIETLY})
check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
cmake_pop_check_state()
endif()
if(_Backtrace_SYM_FOUND)
# Avoid repeating the message() call below each time CMake is run.
if(NOT Backtrace_FIND_QUIETLY AND NOT DEFINED Backtrace_LIBRARY)
message(STATUS "backtrace facility detected in default set of libraries")
endif()
set(Backtrace_LIBRARY "" CACHE FILEPATH "Library providing backtrace(3), empty for default set of libraries")
else()
# Check for external library, for non-glibc systems
if(Backtrace_INCLUDE_DIR)
# OpenBSD has libbacktrace renamed to libexecinfo
find_library(Backtrace_LIBRARY "execinfo")
elseif() # respect user wishes
set(_Backtrace_HEADER_TRY "backtrace.h")
find_path(Backtrace_INCLUDE_DIR ${_Backtrace_HEADER_TRY})
find_library(Backtrace_LIBRARY "backtrace")
endif()
# Prepend list with library path as it's more common practice
set(_Backtrace_STD_ARGS Backtrace_LIBRARY ${_Backtrace_STD_ARGS})
endif()
message(STATUS "Backtrace_LIBRARY: ${Backtrace_LIBRARY}")
if(Backtrace_LIBRARY STREQUAL "NOTFOUND")
set(Backtrace_LIBRARY "")
endif()
if(Backtrace_LIBRARY STREQUAL "Backtrace_LIBRARY-NOTFOUND")
set(Backtrace_LIBRARY "")
endif()
set(Backtrace_LIBRARIES ${Backtrace_LIBRARY})
set(Backtrace_HEADER "${_Backtrace_HEADER_TRY}" CACHE STRING "Header providing backtrace(3) facility")
find_package_handle_standard_args(Backtrace FOUND_VAR Backtrace_FOUND REQUIRED_VARS ${_Backtrace_STD_ARGS})
mark_as_advanced(Backtrace_HEADER Backtrace_INCLUDE_DIR Backtrace_LIBRARY)

View File

@@ -0,0 +1,25 @@
# - Try to find Berkeley DB
# Once done this will define
#
# BERKELEY_DB_FOUND - system has Berkeley DB
# BERKELEY_DB_INCLUDE_DIR - the Berkeley DB include directory
# BERKELEY_DB_LIBRARIES - Link these to use Berkeley DB
# BERKELEY_DB_DEFINITIONS - Compiler switches required for using Berkeley DB
# Copyright (c) 2006, Alexander Dymo, <adymo@kdevelop.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
find_path(BERKELEY_DB_INCLUDE_DIR db_cxx.h
/usr/include/db4
/usr/local/include/db4
)
find_library(BERKELEY_DB_LIBRARIES NAMES db_cxx )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Berkeley "Could not find Berkeley DB >= 4.1" BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES)
# show the BERKELEY_DB_INCLUDE_DIR and BERKELEY_DB_LIBRARIES variables only in the advanced view
mark_as_advanced(BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES )

60
cmake/FindHIDAPI.cmake Normal file
View File

@@ -0,0 +1,60 @@
# - try to find HIDAPI library
# from http://www.signal11.us/oss/hidapi/
#
# Cache Variables: (probably not for direct use in your scripts)
# HIDAPI_INCLUDE_DIR
# HIDAPI_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# HIDAPI_FOUND
# HIDAPI_INCLUDE_DIRS
# HIDAPI_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
find_library(HIDAPI_LIBRARY
NAMES hidapi hidapi-libusb)
find_path(HIDAPI_INCLUDE_DIR
NAMES hidapi.h
PATH_SUFFIXES
hidapi)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HIDAPI
DEFAULT_MSG
HIDAPI_LIBRARY
HIDAPI_INCLUDE_DIR)
if(HIDAPI_FOUND)
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")
if((STATIC AND UNIX AND NOT APPLE) OR (DEPENDS AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
find_library(LIBUSB-1.0_LIBRARY usb-1.0)
find_library(LIBUDEV_LIBRARY udev)
if(LIBUSB-1.0_LIBRARY)
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${LIBUSB-1.0_LIBRARY}")
if(LIBUDEV_LIBRARY)
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${LIBUDEV_LIBRARY}")
else()
message(WARNING "libudev library not found, binaries may fail to link.")
endif()
else()
message(WARNING "libusb-1.0 library not found, binaries may fail to link.")
endif()
endif()
set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")
endif()
mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)

149
cmake/FindLibUSB.cmake Normal file
View File

@@ -0,0 +1,149 @@
# - Find libusb for portable USB support
# This module will find libusb as published by
# http://libusb.sf.net and
# http://libusb-win32.sf.net
#
# It will use PkgConfig if present and supported, else search
# it on its own. If the LibUSB_ROOT_DIR environment variable
# is defined, it will be used as base path.
# The following standard variables get defined:
# LibUSB_FOUND: true if LibUSB was found
# LibUSB_HEADER_FILE: the location of the C header file
# LibUSB_INCLUDE_DIRS: the directory that contains the include file
# LibUSB_LIBRARIES: the library
# source: https://github.com/IntelRealSense/librealsense
include ( CheckLibraryExists )
include ( CheckIncludeFile )
find_package ( PkgConfig )
if ( PKG_CONFIG_FOUND )
pkg_check_modules ( PKGCONFIG_LIBUSB libusb-1.0 )
if ( NOT PKGCONFIG_LIBUSB_FOUND )
pkg_check_modules ( PKGCONFIG_LIBUSB libusb )
endif ( NOT PKGCONFIG_LIBUSB_FOUND )
endif ( PKG_CONFIG_FOUND )
if ( PKGCONFIG_LIBUSB_FOUND )
set ( LibUSB_INCLUDE_DIRS ${PKGCONFIG_LIBUSB_INCLUDE_DIRS} )
foreach ( i ${PKGCONFIG_LIBUSB_LIBRARIES} )
string ( REGEX MATCH "[^-]*" ibase "${i}" )
find_library ( ${ibase}_LIBRARY
NAMES ${i}
PATHS ${PKGCONFIG_LIBUSB_LIBRARY_DIRS}
)
if ( ${ibase}_LIBRARY )
list ( APPEND LibUSB_LIBRARIES ${${ibase}_LIBRARY} )
endif ( ${ibase}_LIBRARY )
mark_as_advanced ( ${ibase}_LIBRARY )
endforeach ( i )
else ( PKGCONFIG_LIBUSB_FOUND )
find_file ( LibUSB_HEADER_FILE
NAMES
libusb.h usb.h
PATHS
$ENV{ProgramFiles}/LibUSB-Win32
$ENV{LibUSB_ROOT_DIR}
PATH_SUFFIXES
include
libusb-1.0
include/libusb-1.0
)
mark_as_advanced ( LibUSB_HEADER_FILE )
get_filename_component ( LibUSB_INCLUDE_DIRS "${LibUSB_HEADER_FILE}" PATH )
if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
# LibUSB-Win32 binary distribution contains several libs.
# Use the lib that got compiled with the same compiler.
if ( MSVC )
if ( WIN32 )
set ( LibUSB_LIBRARY_PATH_SUFFIX lib/msvc )
else ( WIN32 )
set ( LibUSB_LIBRARY_PATH_SUFFIX lib/msvc_x64 )
endif ( WIN32 )
elseif ( BORLAND )
set ( LibUSB_LIBRARY_PATH_SUFFIX lib/bcc )
elseif ( CMAKE_COMPILER_IS_GNUCC )
set ( LibUSB_LIBRARY_PATH_SUFFIX lib/gcc )
endif ( MSVC )
endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
find_library ( usb_LIBRARY
NAMES
usb-1.0 libusb usb
PATHS
$ENV{ProgramFiles}/LibUSB-Win32
$ENV{LibUSB_ROOT_DIR}
PATH_SUFFIXES
${LibUSB_LIBRARY_PATH_SUFFIX}
)
mark_as_advanced ( usb_LIBRARY )
if ( usb_LIBRARY )
set ( LibUSB_LIBRARIES ${usb_LIBRARY} )
endif ( usb_LIBRARY )
endif ( PKGCONFIG_LIBUSB_FOUND )
if ( LibUSB_INCLUDE_DIRS AND LibUSB_LIBRARIES )
set ( LibUSB_FOUND true )
endif ( LibUSB_INCLUDE_DIRS AND LibUSB_LIBRARIES )
if ( LibUSB_FOUND )
set ( CMAKE_REQUIRED_INCLUDES "${LibUSB_INCLUDE_DIRS}" )
check_include_file ( "${LibUSB_HEADER_FILE}" LibUSB_FOUND )
endif ( LibUSB_FOUND )
if ( LibUSB_FOUND )
check_library_exists ( "${LibUSB_LIBRARIES}" usb_open "" LibUSB_FOUND )
check_library_exists ( "${LibUSB_LIBRARIES}" libusb_get_device_list "" LibUSB_VERSION_1.0 )
check_library_exists ( "${LibUSB_LIBRARIES}" libusb_get_port_numbers "" LibUSB_VERSION_1.0.16 )
if((STATIC AND UNIX AND NOT APPLE) OR (DEPENDS AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
find_library(LIBUDEV_LIBRARY udev)
if(LIBUDEV_LIBRARY)
set(LibUSB_LIBRARIES "${LibUSB_LIBRARIES};${LIBUDEV_LIBRARY}")
else()
message(WARNING "libudev library not found, binaries may fail to link.")
endif()
endif()
# Library 1.0.16+ compilation test.
# The check_library_exists does not work well on Apple with shared libs.
if (APPLE OR LibUSB_VERSION_1.0.16 OR STATIC)
if (APPLE)
if(DEPENDS)
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES "-framework Foundation -framework IOKit")
else()
find_library(COREFOUNDATION CoreFoundation)
find_library(IOKIT IOKit)
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${IOKIT})
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${COREFOUNDATION})
endif()
endif()
if (WIN32)
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES setupapi)
endif()
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${LibUSB_LIBRARIES})
try_compile(LibUSB_COMPILE_TEST_PASSED
${CMAKE_BINARY_DIR}
"${CMAKE_SOURCE_DIR}/cmake/test-libusb-version.c"
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES=${LibUSB_INCLUDE_DIRS}"
"-DLINK_DIRECTORIES=${LibUSB_LIBRARIES}"
LINK_LIBRARIES ${TEST_COMPILE_EXTRA_LIBRARIES}
OUTPUT_VARIABLE OUTPUT)
unset(TEST_COMPILE_EXTRA_LIBRARIES)
message(STATUS "LibUSB Compilation test: ${LibUSB_COMPILE_TEST_PASSED}")
endif()
endif ( LibUSB_FOUND )
if ( NOT LibUSB_FOUND )
if ( NOT LibUSB_FIND_QUIETLY )
message ( STATUS "LibUSB not found, try setting LibUSB_ROOT_DIR environment variable." )
endif ( NOT LibUSB_FIND_QUIETLY )
if ( LibUSB_FIND_REQUIRED )
message ( FATAL_ERROR "" )
endif ( LibUSB_FIND_REQUIRED )
endif ( NOT LibUSB_FOUND )

41
cmake/FindLibunwind.cmake Normal file
View File

@@ -0,0 +1,41 @@
# - Try to find libunwind
# Once done this will define
#
# LIBUNWIND_FOUND - system has libunwind
# LIBUNWIND_INCLUDE_DIR - the libunwind include directory
# LIBUNWIND_LIBRARIES - Link these to use libunwind
# LIBUNWIND_DEFINITIONS - Compiler switches required for using libunwind
# Copyright (c) 2006, Alexander Dymo, <adymo@kdevelop.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
find_path(LIBUNWIND_INCLUDE_DIR libunwind.h
/usr/include
/usr/local/include
)
find_library(LIBUNWIND_LIBRARIES NAMES unwind )
if(NOT LIBUNWIND_LIBRARIES STREQUAL "LIBUNWIND_LIBRARIES-NOTFOUND")
if (CMAKE_COMPILER_IS_GNUCC)
set(LIBUNWIND_LIBRARIES "gcc_eh;${LIBUNWIND_LIBRARIES}")
endif()
endif()
# some versions of libunwind need liblzma, and we don't use pkg-config
# so we just look whether liblzma is installed, and add it if it is.
# It might not be actually needed, but doesn't hurt if it is not.
# We don't need any headers, just the lib, as it's privately needed.
message(STATUS "looking for liblzma")
find_library(LIBLZMA_LIBRARIES lzma )
if(NOT LIBLZMA_LIBRARIES STREQUAL "LIBLZMA_LIBRARIES-NOTFOUND")
message(STATUS "liblzma found")
set(LIBUNWIND_LIBRARIES "${LIBUNWIND_LIBRARIES};${LIBLZMA_LIBRARIES}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libunwind "Could not find libunwind" LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES)
# show the LIBUNWIND_INCLUDE_DIR and LIBUNWIND_LIBRARIES variables only in the advanced view
mark_as_advanced(LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES )

59
cmake/FindMiniupnpc.cmake Normal file
View File

@@ -0,0 +1,59 @@
# --------------------------------- FindMiniupnpc Start ---------------------------------
# Locate miniupnp library
# This module defines
# MINIUPNP_FOUND, if false, do not try to link to miniupnp
# MINIUPNP_LIBRARY, the miniupnp variant
# MINIUPNP_INCLUDE_DIR, where to find miniupnpc.h and family)
# MINIUPNPC_VERSION_1_7_OR_HIGHER, set if we detect the version of miniupnpc is 1.7 or higher
#
# Note that the expected include convention is
# #include "miniupnpc.h"
# and not
# #include <miniupnpc/miniupnpc.h>
# This is because, the miniupnpc location is not standardized and may exist
# in locations other than miniupnpc/
if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY)
# Already in cache, be silent
set(MINIUPNP_FIND_QUIETLY TRUE)
endif ()
find_path(MINIUPNP_INCLUDE_DIR miniupnpc.h
HINTS $ENV{MINIUPNP_INCLUDE_DIR}
PATH_SUFFIXES miniupnpc
)
find_library(MINIUPNP_LIBRARY miniupnpc
HINTS $ENV{MINIUPNP_LIBRARY}
)
find_library(MINIUPNP_STATIC_LIBRARY libminiupnpc.a
HINTS $ENV{MINIUPNP_STATIC_LIBRARY}
)
set(MINIUPNP_INCLUDE_DIRS ${MINIUPNP_INCLUDE_DIR})
set(MINIUPNP_LIBRARIES ${MINIUPNP_LIBRARY})
set(MINIUPNP_STATIC_LIBRARIES ${MINIUPNP_STATIC_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
MiniUPnPc DEFAULT_MSG
MINIUPNP_INCLUDE_DIR
MINIUPNP_LIBRARY
)
IF(MINIUPNPC_FOUND)
file(STRINGS "${MINIUPNP_INCLUDE_DIR}/miniupnpc.h" MINIUPNPC_API_VERSION_STR REGEX "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+[0-9]+")
if(MINIUPNPC_API_VERSION_STR MATCHES "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+([0-9]+)")
set(MINIUPNPC_API_VERSION "${CMAKE_MATCH_1}")
if (${MINIUPNPC_API_VERSION} GREATER "10" OR ${MINIUPNPC_API_VERSION} EQUAL "10")
message(STATUS "Found miniupnpc API version " ${MINIUPNPC_API_VERSION})
set(MINIUPNP_FOUND true)
set(MINIUPNPC_VERSION_1_7_OR_HIGHER true)
endif()
endif()
ENDIF()
mark_as_advanced(MINIUPNP_INCLUDE_DIR MINIUPNP_LIBRARY MINIUPNP_STATIC_LIBRARY)
# --------------------------------- FindMiniupnpc End ---------------------------------

91
cmake/FindReadline.cmake Normal file
View File

@@ -0,0 +1,91 @@
# - Try to find readline include dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Readline)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Readline_ROOT_DIR Set this variable to the root installation of
# readline if the module has problems finding the
# proper installation path.
#
# Variables defined by this module:
#
# READLINE_FOUND System has readline, include and lib dirs found
# GNU_READLINE_FOUND Version of readline found is GNU readline, not libedit!
# LIBEDIT_FOUND Version of readline found is libedit, not GNU readline!
# Readline_INCLUDE_DIR The readline include directories.
# Readline_LIBRARY The readline library.
# GNU_READLINE_LIBRARY The GNU readline library or empty string.
# LIBEDIT_LIBRARY The libedit library or empty string.
find_path(Readline_ROOT_DIR
NAMES include/readline/readline.h
PATHS /usr/local/opt/readline/ /opt/local/ /usr/local/ /usr/
NO_DEFAULT_PATH
)
find_path(Readline_INCLUDE_DIR
NAMES readline/readline.h
PATHS ${Readline_ROOT_DIR}/include
NO_DEFAULT_PATH
)
find_library(Readline_LIBRARY
NAMES readline
PATHS ${Readline_ROOT_DIR}/lib
NO_DEFAULT_PATH
)
find_library(Termcap_LIBRARY
NAMES tinfo termcap ncursesw ncurses cursesw curses
)
if(Readline_INCLUDE_DIR AND Readline_LIBRARY)
set(READLINE_FOUND TRUE)
else(Readline_INCLUDE_DIR AND Readline_LIBRARY)
FIND_LIBRARY(Readline_LIBRARY NAMES readline PATHS Readline_ROOT_DIR)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY )
MARK_AS_ADVANCED(Readline_INCLUDE_DIR Readline_LIBRARY)
endif(Readline_INCLUDE_DIR AND Readline_LIBRARY)
mark_as_advanced(
Readline_ROOT_DIR
Readline_INCLUDE_DIR
Readline_LIBRARY
)
set(CMAKE_REQUIRED_INCLUDES ${Readline_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARY})
include(CheckFunctionExists)
check_function_exists(rl_copy_text HAVE_COPY_TEXT)
check_function_exists(rl_filename_completion_function HAVE_COMPLETION_FUNCTION)
if(NOT HAVE_COMPLETION_FUNCTION)
if (Readline_LIBRARY)
set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARY} ${Termcap_LIBRARY})
endif(Readline_LIBRARY)
check_function_exists(rl_copy_text HAVE_COPY_TEXT_TC)
check_function_exists(rl_filename_completion_function HAVE_COMPLETION_FUNCTION_TC)
set(HAVE_COMPLETION_FUNCTION ${HAVE_COMPLETION_FUNCTION_TC})
set(HAVE_COPY_TEXT ${HAVE_COPY_TEXT_TC})
if(HAVE_COMPLETION_FUNCTION)
set(Readline_LIBRARY ${Readline_LIBRARY} ${Termcap_LIBRARY})
endif(HAVE_COMPLETION_FUNCTION)
endif(NOT HAVE_COMPLETION_FUNCTION)
set(LIBEDIT_LIBRARY "")
set(GNU_READLINE_LIBRARY "")
if(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT)
set(GNU_READLINE_FOUND TRUE)
set(GNU_READLINE_LIBRARY ${Readline_LIBRARY})
elseif(READLINE_FOUND AND NOT HAVE_COPY_TEXT)
set(LIBEDIT_FOUND TRUE)
set(LIBEDIT_LIBRARY ${Readline_LIBRARY})
endif(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT)

40
cmake/FindUnbound.cmake Normal file
View File

@@ -0,0 +1,40 @@
# Copyright (c) 2014-2019, 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.
MESSAGE(STATUS "Looking for libunbound")
FIND_PATH(UNBOUND_INCLUDE_DIR
NAMES unbound.h
PATH_SUFFIXES include/ include/unbound/
PATHS "${PROJECT_SOURCE_DIR}"
${UNBOUND_ROOT}
$ENV{UNBOUND_ROOT}
/usr/local/
/usr/
)
find_library(UNBOUND_LIBRARIES unbound)

22
cmake/FindZBar0.cmake Normal file
View File

@@ -0,0 +1,22 @@
# from http://code.google.com/p/low-cost-vision-2012/source/browse/CMakeModules/FindZBar0.cmake?name=2-helium-1&r=d61f248bd5565b3c086bf4769a04bfd98f7079df
# - Try to find ZBar
# This will define
#
# ZBAR_FOUND -
# ZBAR_LIBRARY_DIR -
# ZBAR_INCLUDE_DIR -
# ZBAR_LIBRARIES -
#
find_package(PkgConfig)
pkg_check_modules(PC_ZBAR QUIET zbar)
set(ZBAR_DEFINITIONS ${PC_ZBAR_CFLAGS_OTHER})
find_library(ZBAR_LIBRARIES NAMES zbar
HINTS ${PC_ZBAR_LIBDIR} ${PC_ZBAR_LIBRARY_DIRS} )
find_path(ZBAR_INCLUDE_DIR Decoder.h
HINTS ${PC_ZBAR_INCLUDEDIR} ${PC_ZBAR_INCLUDE_DIRS}
PATH_SUFFIXES zbar )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZBAR DEFAULT_MSG ZBAR_LIBRARIES ZBAR_INCLUDE_DIR)
message(STATUS "Found zbar libraries ${ZBAR_LIBRARIES}")

68
cmake/GenVersion.cmake Normal file
View File

@@ -0,0 +1,68 @@
# Copyright (c) 2014-2019, 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.
#
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
# Check what commit we're on
execute_process(COMMAND "${GIT}" rev-parse --short=9 HEAD RESULT_VARIABLE RET OUTPUT_VARIABLE COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
if(RET)
# Something went wrong, set the version tag to -unknown
message(WARNING "Cannot determine current commit. Make sure that you are building either from a Git working tree or from a source archive.")
set(VERSIONTAG "unknown")
set(VERSION_IS_RELEASE "false")
configure_file("monero/src/version.cpp.in" "${TO}")
else()
string(SUBSTRING ${COMMIT} 0 9 COMMIT)
message(STATUS "You are currently on commit ${COMMIT}")
# Get all the tags
execute_process(COMMAND "${GIT}" rev-list --tags --max-count=1 --abbrev-commit RESULT_VARIABLE RET OUTPUT_VARIABLE TAGGEDCOMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT TAGGEDCOMMIT)
message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.")
set(VERSIONTAG "${COMMIT}")
set(VERSION_IS_RELEASE "false")
else()
message(STATUS "The most recent tag was at ${TAGGEDCOMMIT}")
# Check if we're building that tagged commit or a different one
if(COMMIT STREQUAL TAGGEDCOMMIT)
message(STATUS "You are building a tagged release")
set(VERSIONTAG "release")
set(VERSION_IS_RELEASE "true")
else()
message(STATUS "You are ahead of or behind a tagged release")
set(VERSIONTAG "${COMMIT}")
set(VERSION_IS_RELEASE "false")
endif()
endif()
configure_file("monero/src/version.cpp.in" "${TO}")
endif()

64
cmake/GenVersionGui.cmake Normal file
View File

@@ -0,0 +1,64 @@
# Copyright (c) 2014-2019, 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.
#
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
# Check what commit we're on
execute_process(COMMAND "${GIT}" rev-parse --short=9 HEAD RESULT_VARIABLE RET OUTPUT_VARIABLE COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
if(RET)
# Something went wrong, set the version tag to -unknown
message(WARNING "Cannot determine current commit. Make sure that you are building either from a Git working tree or from a source archive.")
set(VERSIONTAG "unknown")
configure_file("src/version.js.in" "${TO}")
else()
string(SUBSTRING ${COMMIT} 0 9 COMMIT)
message(STATUS "You are currently on commit ${COMMIT}")
# Get all the tags
execute_process(COMMAND "${GIT}" rev-list --tags --max-count=1 --abbrev-commit RESULT_VARIABLE RET OUTPUT_VARIABLE TAGGEDCOMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT TAGGEDCOMMIT)
message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.")
set(VERSIONTAG "${COMMIT}")
else()
message(STATUS "The most recent tag was at ${TAGGEDCOMMIT}")
# Check if we're building that tagged commit or a different one
if(COMMIT STREQUAL TAGGEDCOMMIT)
message(STATUS "You are building a tagged release")
set(VERSIONTAG "release")
else()
message(STATUS "You are ahead of or behind a tagged release")
set(VERSIONTAG "${COMMIT}")
endif()
endif()
configure_file("src/version.js.in" "${TO}")
endif()

81
cmake/Version.cmake Normal file
View File

@@ -0,0 +1,81 @@
# Copyright (c) 2014-2017, 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.
function (write_static_version_header hash)
set(VERSIONTAG "${hash}")
configure_file("${CMAKE_SOURCE_DIR}/monero/src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp")
endfunction ()
find_package(Git QUIET)
if ("$Format:$" STREQUAL "")
# We're in a tarball; use hard-coded variables.
write_static_version_header("release")
elseif (GIT_FOUND OR Git_FOUND)
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/version.cpp"
COMMAND "${CMAKE_COMMAND}"
"-D" "GIT=${GIT_EXECUTABLE}"
"-D" "TO=${CMAKE_BINARY_DIR}/version.cpp"
"-P" "cmake/GenVersion.cmake"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
#message(STATUS "Found Git: ${GIT_EXECUTABLE}")
# COMMAND "${CMAKE_COMMAND}"
# "-D" "GIT=${GIT_EXECUTABLE}"
# "-D" "TO=${CMAKE_BINARY_DIR}/monero/version.cpp"
# "-P" "cmake/GenVersion.cmake"
# BYPRODUCTS "${CMAKE_BINARY_DIR}/monero/version.cpp"
# WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
else()
message(STATUS "WARNING: Git was not found!")
write_static_version_header("unknown")
endif ()
add_custom_target(genversion ALL
DEPENDS "${CMAKE_BINARY_DIR}/version.cpp")
#find_package(Git QUIET)
#if ("$Format:$" STREQUAL "")
# # We're in a tarball; use hard-coded variables.
# write_static_version_header("release")
#elseif (GIT_FOUND OR Git_FOUND)
# message(STATUS "Found Git: ${GIT_EXECUTABLE}")
# add_custom_command(
# OUTPUT "${CMAKE_BINARY_DIR}/version.cpp"
# COMMAND "${CMAKE_COMMAND}"
# "-D" "GIT=${GIT_EXECUTABLE}"
# "-D" "TO=${CMAKE_BINARY_DIR}/version.cpp"
# "-P" "cmake/GenVersion.cmake"
# WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
#else()
# message(STATUS "WARNING: Git was not found!")
# write_static_version_header("unknown")
#endif ()
#add_custom_target(genversion ALL
# DEPENDS "${CMAKE_BINARY_DIR}/version.cpp")

52
cmake/VersionGui.cmake Normal file
View File

@@ -0,0 +1,52 @@
# Copyright (c) 2014-2019, 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.
function (write_static_version_header hash)
set(VERSIONTAG "${hash}")
configure_file("${CMAKE_SOURCE_DIR}/version.js.in" "${CMAKE_SOURCE_DIR}/version.js")
endfunction ()
find_package(Git QUIET)
if ("$Format:$" STREQUAL "")
# We're in a tarball; use hard-coded variables.
write_static_version_header("release")
elseif (GIT_FOUND OR Git_FOUND)
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
add_custom_command(
OUTPUT "${CMAKE_SOURCE_DIR}/version.js"
COMMAND "${CMAKE_COMMAND}"
"-D" "GIT=${GIT_EXECUTABLE}"
"-D" "TO=${CMAKE_SOURCE_DIR}/version.js"
"-P" "cmake/GenVersionGui.cmake"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
else()
message(STATUS "WARNING: Git was not found!")
write_static_version_header("unknown")
endif ()
add_custom_target(genversiongui ALL
DEPENDS "${CMAKE_SOURCE_DIR}/version.js")

View File

@@ -0,0 +1,52 @@
// Copyright (c) 2014-2019, 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.
#include <libusb.h>
#define UNUSED(expr) (void)(expr)
int main(int argc, char *argv[]) {
libusb_device **devs;
libusb_context *ctx = NULL;
int r = libusb_init(&ctx); UNUSED(r);
ssize_t cnt = libusb_get_device_list(ctx, &devs); UNUSED(cnt);
struct libusb_device_descriptor desc;
r = libusb_get_device_descriptor(devs[0], &desc); UNUSED(r);
uint8_t bus_id = libusb_get_bus_number(devs[0]); UNUSED(bus_id);
uint8_t addr = libusb_get_device_address(devs[0]); UNUSED(addr);
uint8_t tmp_path[16];
r = libusb_get_port_numbers(devs[0], tmp_path, sizeof(tmp_path));
UNUSED(r);
UNUSED(tmp_path);
libusb_free_device_list(devs, 1);
libusb_exit(ctx);
}

43
cmake/test-protobuf.cpp Normal file
View File

@@ -0,0 +1,43 @@
// Copyright (c) 2014-2019, 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.
#include <string>
#include <iostream>
#include <google/protobuf/message.h>
#include <google/protobuf/unknown_field_set.h>
#include "test-protobuf.pb.h"
int main(int argc, char *argv[]) {
google::protobuf::UnknownFieldSet ufs;
ufs.ClearAndFreeMemory();
Success sc;
sc.set_message("test");
sc.SerializeToOstream(&std::cerr);
return 0;
}

View File

@@ -0,0 +1,7 @@
syntax = "proto2";
import "google/protobuf/descriptor.proto";
message Success {
optional string message = 1;
}

View File

@@ -0,0 +1,34 @@
// Copyright (c) 2014-2019, 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.
#include <assert.h>
static_assert(1, "FAIL");
int main(int argc, char *argv[]) {
return 0;
}

View File

@@ -0,0 +1,34 @@
// Copyright (c) 2014-2019, 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.
#include <assert.h>
static_assert(1, "FAIL");
int main(int argc, char *argv[]) {
return 0;
}

47
components/CMakeLists.txt Normal file
View File

@@ -0,0 +1,47 @@
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
###
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/defines.h.cmake
# ${CMAKE_CURRENT_BINARY_DIR}/defines.h)
file(GLOB_RECURSE UI_FILES *.ui)
file(GLOB_RECURSE CODE_FILES *.cpp)
qt5_wrap_ui(UI_HEADERS ${UI_FILES})
#qt5_add_resources(RESOURCE_FILES ../resources/resources.qrc)
# Windows application icon
if (WIN32)
set(WINDOWS_RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/resources.obj)
if (MSVC)
add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
COMMAND rc.exe /fo ${WINDOWS_RES_FILE} resources.rc
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/win
)
else()
add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
COMMAND windres.exe resources.rc ${WINDOWS_RES_FILE}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/win
)
endif()
endif()
add_executable(${CMAKE_PROJECT_NAME} WIN32
${UI_HEADERS}
${CODE_FILES}
${RESOURCE_FILES}
${WINDOWS_RES_FILE}
)
target_link_libraries(${CMAKE_PROJECT_NAME}
Qt5::Widgets
)
if (UNIX)
install(TARGETS ${CMAKE_PROJECT_NAME}
RUNTIME DESTINATION bin)
elseif (WIN32)
install(TARGETS ${CMAKE_PROJECT_NAME}
DESTINATION .)
endif()

View File

@@ -38,8 +38,10 @@ Item {
property alias text: label.text
property string checkedIcon: "qrc:///images/check-white.svg"
property string uncheckedIcon
property bool fontAwesomeIcons: false
property int imgWidth: 13
property int imgHeight: 13
property bool toggleOnClick: true
property bool checked: false
property alias background: backgroundRect.color
property bool border: true
@@ -51,7 +53,9 @@ Item {
width: checkBoxLayout.width
function toggle(){
checkBox.checked = !checkBox.checked
if (checkBox.toggleOnClick) {
checkBox.checked = !checkBox.checked
}
checkBox.clicked()
}
@@ -86,9 +90,11 @@ Item {
width: checkBox.imgWidth
height: checkBox.imgHeight
color: MoneroComponents.Style.defaultFontColor
fontAwesomeFallbackIcon: FontAwesome.plus
fontAwesomeFallbackIcon: checkBox.fontAwesomeIcons ? getIcon() : FontAwesome.plus
fontAwesomeFallbackSize: 14
image: {
image: checkBox.fontAwesomeIcons ? "" : getIcon()
function getIcon() {
if (checkBox.checked || checkBox.uncheckedIcon == "")
return checkBox.checkedIcon;
return checkBox.uncheckedIcon;

View File

@@ -0,0 +1,40 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import FontAwesome 1.0
import "../components" as MoneroComponents
MouseArea {
signal paste()
id: root
acceptedButtons: Qt.RightButton
anchors.fill: parent
onClicked: {
if (mouse.button === Qt.RightButton)
contextMenu.open()
}
Menu {
id: contextMenu
background: Rectangle {
border.color: MoneroComponents.Style.buttonBackgroundColorDisabledHover
border.width: 1
radius: 2
color: MoneroComponents.Style.buttonBackgroundColorDisabled
}
padding: 1
width: 100
x: root.mouseX
y: root.mouseY
MoneroComponents.ContextMenuItem {
enabled: root.parent.canPaste === true
glyphIcon: FontAwesome.paste
onTriggered: root.paste()
text: qsTr("Paste") + translationManager.emptyString
}
}
}

View File

@@ -0,0 +1,52 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
import FontAwesome 1.0
import "../components" as MoneroComponents
MenuItem {
id: menuItem
property bool glyphIconSolid: true
property alias glyphIcon: glyphIcon.text
background: Rectangle {
color: MoneroComponents.Style.buttonBackgroundColorDisabledHover
opacity: mouse.containsMouse ? 1 : 0
MouseArea {
id: mouse
anchors.fill: parent
hoverEnabled: true
onClicked: menuItem.triggered()
visible: menuItem.enabled
}
}
contentItem: RowLayout {
anchors.fill: parent
anchors.leftMargin: 10
anchors.rightMargin: 10
opacity: menuItem.enabled ? 1 : 0.4
spacing: 8
Text {
id: glyphIcon
color: MoneroComponents.Style.buttonTextColor
font.family: glyphIconSolid ? FontAwesome.fontFamilySolid : FontAwesome.fontFamily
font.pixelSize: 14
font.styleName: glyphIconSolid ? "Solid" : "Regular"
}
Text {
color: MoneroComponents.Style.buttonTextColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 14
Layout.fillWidth: true
text: menuItem.text
}
}
}

View File

@@ -1,220 +0,0 @@
// Copyright (c) 2014-2018, 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 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.2
import "." as MoneroComponents
import "effects/" as MoneroEffects
import "../js/Windows.js" as Windows
import "../js/Utils.js" as Utils
Window {
id: root
modality: Qt.ApplicationModal
color: "black"
flags: Windows.flags
property alias text: dialogContent.text
property alias content: root.text
property alias textArea: dialogContent
property var icon
// same signals as Dialog has
signal accepted()
signal rejected()
onClosing: {
inactiveOverlay.visible = false;
}
function open() {
inactiveOverlay.visible = true;
show();
}
// TODO: implement without hardcoding sizes
width: 480
height: 280
// background
MoneroEffects.GradientBackground {
anchors.fill: parent
fallBackColor: MoneroComponents.Style.middlePanelBackgroundColor
initialStartColor: MoneroComponents.Style.middlePanelBackgroundGradientStart
initialStopColor: MoneroComponents.Style.middlePanelBackgroundGradientStop
blackColorStart: MoneroComponents.Style._b_middlePanelBackgroundGradientStart
blackColorStop: MoneroComponents.Style._b_middlePanelBackgroundGradientStop
whiteColorStart: MoneroComponents.Style._w_middlePanelBackgroundGradientStart
whiteColorStop: MoneroComponents.Style._w_middlePanelBackgroundGradientStop
start: Qt.point(0, 0)
end: Qt.point(height, width)
}
// Make window draggable
MouseArea {
anchors.fill: parent
property point lastMousePos: Qt.point(0, 0)
onPressed: { lastMousePos = Qt.point(mouseX, mouseY); }
onMouseXChanged: root.x += (mouseX - lastMousePos.x)
onMouseYChanged: root.y += (mouseY - lastMousePos.y)
}
ColumnLayout {
id: mainLayout
anchors.fill: parent
anchors.topMargin: 20
anchors.margins: 35
spacing: 20
Item {
Layout.fillHeight: true
Layout.fillWidth: true
Rectangle {
anchors.fill: parent
color: "transparent"
border.color: MoneroComponents.Style.inputBorderColorActive
border.width: 1
radius: 4
}
Flickable {
id: flickable
anchors.fill: parent
TextArea.flickable: TextArea {
id : dialogContent
textFormat: TextEdit.RichText
selectByMouse: true
selectByKeyboard: true
font.family: MoneroComponents.Style.defaultFontColor
font.pixelSize: 14
color: MoneroComponents.Style.defaultFontColor
selectionColor: MoneroComponents.Style.textSelectionColor
wrapMode: TextEdit.Wrap
readOnly: true
function logCommand(msg){
msg = log_color(msg, MoneroComponents.Style.blackTheme ? "lime" : "#009100");
textArea.append(msg);
}
function logMessage(msg){
msg = msg.trim();
var color = MoneroComponents.Style.defaultFontColor;
if(msg.toLowerCase().indexOf('error') >= 0){
color = MoneroComponents.Style.errorColor;
} else if (msg.toLowerCase().indexOf('warning') >= 0){
color = MoneroComponents.Style.warningColor;
}
// format multi-lines
if(msg.split("\n").length >= 2){
msg = msg.split("\n").join('<br>');
}
log(msg, color);
}
function log_color(msg, color){
return "<span style='color: " + color + ";' >" + msg + "</span>";
}
function log(msg, color){
var timestamp = Utils.formatDate(new Date(), {
weekday: undefined,
month: "numeric",
timeZoneName: undefined
});
var _timestamp = log_color("[" + timestamp + "]", "#FFFFFF");
var _msg = log_color(msg, color);
textArea.append(_timestamp + " " + _msg);
// scroll to bottom
//if(flickable.contentHeight > content.height){
// flickable.contentY = flickable.contentHeight + 20;
//}
}
}
ScrollBar.vertical: ScrollBar {}
}
}
RowLayout {
Layout.fillWidth: true
MoneroComponents.LineEdit {
id: sendCommandText
Layout.fillWidth: true
placeholderText: qsTr("command + enter (e.g help)") + translationManager.emptyString
onAccepted: {
if(text.length > 0) {
textArea.logCommand(">>> " + text)
daemonManager.sendCommandAsync(text.split(" "), currentWallet.nettype, function(result) {
if (!result) {
appWindow.showStatusMessage(qsTr("Failed to send command"), 3);
}
});
}
text = ""
}
}
}
}
// window borders
Rectangle {
anchors.bottom: parent.bottom
anchors.top: parent.top
anchors.left: parent.left
width:1
color: "#2F2F2F"
z: 2
}
Rectangle {
anchors.bottom: parent.bottom
anchors.top: parent.top
anchors.right: parent.right
width:1
color: "#2F2F2F"
z: 2
}
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
height:1
color: "#2F2F2F"
z: 2
}
}

View File

@@ -28,6 +28,7 @@
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
@@ -37,8 +38,7 @@ import "effects/" as MoneroEffects
Item {
id: datePicker
z: parent.z + 1
property bool expanded: false
readonly property alias expanded: popup.visible
property date currentDate
property bool showCurrentDate: true
property color backgroundColor : MoneroComponents.Style.appWindowBorderColor
@@ -52,19 +52,6 @@ Item {
onExpandedChanged: if(expanded) appWindow.currentItem = datePicker
function hide() { datePicker.expanded = false }
function containsPoint(px, py) {
if(px < 0)
return false
if(px > width)
return false
if(py < 0)
return false
if(py > height + calendarRect.height)
return false
return true
}
Rectangle {
id: inputLabelRect
color: "transparent"
@@ -253,7 +240,7 @@ Item {
MouseArea {
anchors.fill: parent
onClicked: datePicker.expanded = !datePicker.expanded
onClicked: datePicker.expanded ? popup.close() : popup.open()
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
}
@@ -261,195 +248,205 @@ Item {
}
}
Rectangle {
id: calendarRect
anchors.left: parent.left
anchors.right: parent.right
anchors.top: head.bottom
anchors.topMargin: 10
color: MoneroComponents.Style.middlePanelBackgroundColor
border.width: 1
border.color: MoneroComponents.Style.appWindowBorderColor
height: datePicker.expanded ? calendar.height + 2 : 0
clip: true
Behavior on height {
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
}
QtQuickControls2.Popup {
id: popup
padding: 0
closePolicy: QtQuickControls2.Popup.CloseOnEscape | QtQuickControls2.Popup.CloseOnPressOutsideParent
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 1
anchors.rightMargin: 1
anchors.top: parent.top
color: MoneroComponents.Style.appWindowBorderColor
height: 1
}
id: calendarRect
width: head.width
x: head.x
y: head.y + head.height + 10
Calendar {
id: calendar
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 1
anchors.bottomMargin: 10
height: 220
frameVisible: false
color: MoneroComponents.Style.middlePanelBackgroundColor
border.width: 1
border.color: MoneroComponents.Style.appWindowBorderColor
height: datePicker.expanded ? calendar.height + 2 : 0
clip: true
style: CalendarStyle {
gridVisible: false
background: Rectangle { color: MoneroComponents.Style.middlePanelBackgroundColor }
dayDelegate: Item {
z: parent.z + 1
implicitHeight: implicitWidth
implicitWidth: calendar.width / 7
Behavior on height {
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
}
Rectangle {
id: dayRect
anchors.fill: parent
radius: parent.implicitHeight / 2
color: {
if(dayArea.pressed && styleData.visibleMonth)
return MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
return "transparent";
MouseArea {
anchors.fill: parent
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 1
anchors.rightMargin: 1
anchors.top: parent.top
color: MoneroComponents.Style.appWindowBorderColor
height: 1
}
Calendar {
id: calendar
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
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
color: {
if(dayArea.pressed && styleData.visibleMonth)
return MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
return "transparent";
}
}
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;
}
text: styleData.date.getDate()
themeTransition: false
color: {
if(!styleData.visibleMonth) return MoneroComponents.Style.lightGreyFontColor
if(dayArea.pressed) return MoneroComponents.Style.defaultFontColor
if(styleData.today) return MoneroComponents.Style.orange
return MoneroComponents.Style.defaultFontColor
}
}
MouseArea {
id: dayArea
anchors.fill: parent
hoverEnabled: true
onEntered: dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
onExited: dayRect.color = "transparent"
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();
}
}
}
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;
}
text: styleData.date.getDate()
themeTransition: false
color: {
if(!styleData.visibleMonth) return MoneroComponents.Style.lightGreyFontColor
if(dayArea.pressed) return MoneroComponents.Style.defaultFontColor
if(styleData.today) return MoneroComponents.Style.orange
return MoneroComponents.Style.defaultFontColor
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)
}
}
}
MouseArea {
id: dayArea
anchors.fill: parent
hoverEnabled: true
onEntered: dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
onExited: dayRect.color = "transparent"
cursorShape: Qt.PointingHandCursor
onClicked: {
if(styleData.visibleMonth) {
currentDate = styleData.date
datePicker.expanded = false
} else {
var date = styleData.date
if(date.getMonth() > calendar.visibleMonth)
calendar.showNextMonth()
else calendar.showPreviousMonth()
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
Image {
id: prevMonthIcon
anchors.centerIn: parent
source: "qrc:///images/prevMonth.png"
visible: false
}
datePicker.dateChanged();
}
}
}
ColorOverlay {
source: prevMonthIcon
anchors.fill: prevMonthIcon
color: MoneroComponents.Style.defaultFontColor
opacity: 0.5
}
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
Image {
id: prevMonthIcon
anchors.centerIn: parent
source: "qrc:///images/prevMonth.png"
visible: false
MouseArea {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: calendar.showPreviousMonth()
}
}
ColorOverlay {
source: prevMonthIcon
anchors.fill: prevMonthIcon
color: MoneroComponents.Style.defaultFontColor
opacity: 0.5
}
Item {
anchors.right: parent.right
anchors.rightMargin: 4
anchors.top: parent.top
anchors.bottom: parent.bottom
width: height
MouseArea {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: calendar.showPreviousMonth()
}
}
Image {
id: nextMonthIcon
anchors.centerIn: parent
source: "qrc:///images/prevMonth.png"
visible: false
}
Item {
anchors.right: parent.right
anchors.rightMargin: 4
anchors.top: parent.top
anchors.bottom: parent.bottom
width: height
ColorOverlay {
source: nextMonthIcon
anchors.fill: nextMonthIcon
color: MoneroComponents.Style.defaultFontColor
opacity: 0.5
rotation: 180
}
Image {
id: nextMonthIcon
anchors.centerIn: parent
source: "qrc:///images/prevMonth.png"
visible: false
}
ColorOverlay {
source: nextMonthIcon
anchors.fill: nextMonthIcon
color: MoneroComponents.Style.defaultFontColor
opacity: 0.5
rotation: 180
}
MouseArea {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: calendar.showNextMonth()
MouseArea {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: calendar.showNextMonth()
}
}
}
}

View File

@@ -125,6 +125,8 @@ Item {
source: rect
}
Keys.enabled: inlineButton.visible
Keys.onSpacePressed: doClick()
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: doClick()
}

View File

@@ -32,6 +32,7 @@ import QtQuick 2.9
import "../components" as MoneroComponents
TextField {
id: textField
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 18
font.bold: true
@@ -44,4 +45,12 @@ TextField {
background: Rectangle {
color: "transparent"
}
MoneroComponents.ContextMenu {
cursorShape: Qt.IBeamCursor
onPaste: {
textField.clear();
textField.paste();
}
}
}

View File

@@ -45,18 +45,16 @@ Item {
signal accepted()
signal rejected()
function open() {
inactiveOverlay.visible = true
function open(prepopulate) {
leftPanel.enabled = false
middlePanel.enabled = false
titleBar.state = "essentials"
root.visible = true;
input.focus = true;
input.text = "";
input.text = prepopulate ? prepopulate : "";
}
function close() {
inactiveOverlay.visible = false
leftPanel.enabled = true
middlePanel.enabled = true
titleBar.state = "default"
@@ -86,7 +84,7 @@ Item {
color: MoneroComponents.Style.defaultFontColor
}
TextField {
MoneroComponents.Input {
id : input
focus: true
Layout.topMargin: 6
@@ -110,6 +108,8 @@ Item {
color: MoneroComponents.Style.blackTheme ? "black" : "#A9FFFFFF"
}
Keys.enabled: root.visible
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: {
root.close()
root.accepted()

View File

@@ -57,6 +57,10 @@ TextArea {
onTextChanged: {
if(addressValidation){
// js replacement for `RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }`
if (textArea.text.startsWith("monero:")) {
error = false;
return;
}
textArea.text = textArea.text.replace(/[^a-z0-9.@\-]/gi,'');
var address_ok = TxUtils.checkAddress(textArea.text, appWindow.persistentSettings.nettype) || TxUtils.isValidOpenAliasAddress(textArea.text);
if(!address_ok) error = true;
@@ -64,4 +68,12 @@ TextArea {
TextArea.cursorPosition = textArea.text.length;
}
}
MoneroComponents.ContextMenu {
cursorShape: Qt.IBeamCursor
onPaste: {
textArea.clear();
textArea.paste();
}
}
}

View File

@@ -69,5 +69,10 @@ Item {
color: fontColor
onLinkActivated: item.linkActivated()
textFormat: parent.textFormat
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
}

View File

@@ -53,6 +53,8 @@ Item {
property alias inlineButtonText: inlineButtonId.text
property alias inlineIcon: inlineIcon.visible
property bool copyButton: false
property alias copyButtonText: copyButtonId.text
property alias copyButtonEnabled: copyButtonId.enabled
property bool borderDisabled: false
property string borderColor: {

View File

@@ -80,9 +80,6 @@ ColumnLayout {
property alias readOnly: input.readOnly
property bool copyButton: false
property bool pasteButton: false
property var onPaste: function(clipboardText) {
item.text = clipboardText;
}
property bool showingHeader: labelText != "" || copyButton || pasteButton
property var wrapMode: Text.NoWrap
property alias addressValidation: input.addressValidation
@@ -146,7 +143,10 @@ ColumnLayout {
MoneroComponents.LabelButton {
id: pasteButtonId
onClicked: item.onPaste(clipboard.text())
onClicked: {
input.clear();
input.paste();
}
text: qsTr("Paste") + translationManager.emptyString
visible: pasteButton
}

View File

@@ -36,7 +36,6 @@ Rectangle {
id: button
property alias text: label.text
property bool checked: false
property alias dotColor: dot.color
property alias symbol: symbolText.text
property int numSelectedChildren: 0
property var under: null
@@ -63,7 +62,7 @@ Rectangle {
height: present ? ((appWindow.height >= 800) ? 44 : 38 ) : 0
LinearGradient {
visible: isOpenGL && button.checked
visible: isOpenGL && button.checked || numSelectedChildren > 0
height: parent.height
width: 260
anchors.verticalCenter: parent.verticalCenter
@@ -88,27 +87,10 @@ Rectangle {
// button decorations that are subject to leftMargin offsets
Rectangle {
anchors.left: parent.left
anchors.leftMargin: parent.getOffset() + 20
anchors.leftMargin: 20
height: parent.height
width: button.checked ? 20: 10
color: "transparent"
// dot if unchecked
Rectangle {
id: dot
anchors.centerIn: parent
width: button.checked ? 20 : 8
height: button.checked ? 20 : 8
radius: button.checked ? 20 : 4
color: button.dotColor
// arrow if checked
Image {
anchors.centerIn: parent
anchors.left: parent.left
source: MoneroComponents.Style.menuButtonImageDotArrowSource
visible: button.checked
}
}
width: 2
color: button.checked ? MoneroComponents.Style.buttonBackgroundColor : "transparent"
// button text
MoneroComponents.TextPlain {
@@ -118,7 +100,7 @@ Rectangle {
themeTransitionWhiteColor: MoneroComponents.Style._w_menuButtonTextColor
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.right
anchors.leftMargin: 8
anchors.leftMargin: button.getOffset() + 8
font.bold: true
font.pixelSize: 14
}
@@ -144,7 +126,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 12
font.bold: true
color: button.checked || buttonArea.containsMouse ? MoneroComponents.Style.menuButtonTextColor : dot.color
color: MoneroComponents.Style.menuButtonTextColor
visible: appWindow.ctrlPressed
themeTransition: false
}

View File

@@ -68,7 +68,6 @@ Item {
passwordInput1.text = ""
passwordInput2.text = ""
passwordInput1.forceActiveFocus();
inactiveOverlay.visible = true // draw appwindow inactive
root.walletName = walletName ? walletName : ""
errorTextLabel.text = errorText ? errorText : "";
leftPanel.enabled = false
@@ -106,7 +105,6 @@ Item {
}
function close() {
inactiveOverlay.visible = false
leftPanel.enabled = true
middlePanel.enabled = true
wizard.enabled = true
@@ -125,7 +123,6 @@ Item {
}
ColumnLayout {
z: inactiveOverlay.z + 1
id: mainLayout
spacing: 10
anchors { fill: parent; margins: 35 }
@@ -187,7 +184,7 @@ Item {
text: qsTr("CAPSLOCKS IS ON.") + translationManager.emptyString;
}
TextField {
MoneroComponents.Input {
id: passwordInput1
Layout.topMargin: 6
Layout.fillWidth: true
@@ -203,6 +200,7 @@ Item {
return passwordInput2
}
}
implicitHeight: 50
bottomPadding: 10
leftPadding: 10
topPadding: 10
@@ -253,6 +251,7 @@ Item {
}
Keys.enabled: root.visible
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: {
root.close()
if (passwordDialogMode) {
@@ -296,7 +295,7 @@ Item {
color: MoneroComponents.Style.defaultFontColor
}
TextField {
MoneroComponents.Input {
id: passwordInput2
visible: !passwordDialogMode
Layout.topMargin: 6
@@ -307,6 +306,7 @@ Item {
font.pixelSize: 24
echoMode: TextInput.Password
KeyNavigation.tab: okButton
implicitHeight: 50
bottomPadding: 10
leftPadding: 10
topPadding: 10
@@ -350,6 +350,8 @@ Item {
}
}
Keys.enabled: root.visible
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: {
if (passwordInput1.text === passwordInput2.text) {
root.close()

View File

@@ -1,89 +0,0 @@
// Copyright (c) 2014-2018, 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 2.9
import "." as MoneroComponents
Item {
id: scrollItem
property var flickable
property alias scrollColor: scroll.color
property alias scrollWidth: scroll.width
property alias scrollRadius: scroll.radius
width: 15
z: 1
function flickableContentYChanged() {
if(flickable === undefined)
return
var t = flickable.height - scroll.height
scroll.y = (flickable.contentY / (flickable.contentHeight - flickable.height)) * t
}
MouseArea {
id: scrollArea
anchors.fill: parent
hoverEnabled: true
}
Rectangle {
id: scroll
width: 4
radius: width / 2
height: {
var t = (flickable.height * flickable.height) / flickable.contentHeight
return t < 50 ? 50 : t
}
y: 0; x: 0
color: MoneroComponents.Style.orange
opacity: flickable.moving || handleArea.pressed || scrollArea.containsMouse ? 0.8 : 0
visible: flickable.contentHeight > flickable.height
Behavior on opacity {
NumberAnimation { duration: 200; easing.type: Easing.InQuad }
}
MouseArea {
id: handleArea
anchors.fill: parent
drag.target: scroll
drag.axis: Drag.YAxis
drag.minimumY: 0
drag.maximumY: flickable.height - height
propagateComposedEvents: true
onPositionChanged: {
if(!pressed) return
var dy = scroll.y / (flickable.height - scroll.height)
flickable.contentY = (flickable.contentHeight - flickable.height) * dy
}
}
}
}

View File

@@ -0,0 +1,65 @@
import QtQuick 2.9
import QtQuick.Layouts 1.1
import "../components" as MoneroComponents
ColumnLayout {
property alias buttonText: button.text
property alias description: description.text
property alias title: title.text
signal clicked()
id: settingsListItem
Layout.fillWidth: true
spacing: 0
Rectangle {
// divider
Layout.preferredHeight: 1
Layout.fillWidth: true
Layout.bottomMargin: 8
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
RowLayout {
Layout.fillWidth: true
spacing: 0
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
spacing: 0
MoneroComponents.TextPlain {
id: title
Layout.fillWidth: true
Layout.preferredHeight: 20
Layout.topMargin: 8
color: MoneroComponents.Style.defaultFontColor
opacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.8
font.bold: true
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 16
}
MoneroComponents.TextPlainArea {
id: description
color: MoneroComponents.Style.dimmedFontColor
colorBlackTheme: MoneroComponents.Style._b_dimmedFontColor
colorWhiteTheme: MoneroComponents.Style._w_dimmedFontColor
Layout.fillWidth: true
horizontalAlignment: TextInput.AlignLeft
}
}
MoneroComponents.StandardButton {
id: button
small: true
onClicked: {
settingsListItem.clicked()
}
width: 135
}
}
}

View File

@@ -146,6 +146,8 @@ Item {
cursorShape: Qt.PointingHandCursor
}
Keys.enabled: button.visible
Keys.onSpacePressed: doClick()
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: doClick()
}

View File

@@ -124,7 +124,10 @@ Rectangle {
Flickable {
id: flickable
anchors.fill: parent
ScrollBar.vertical: ScrollBar { }
ScrollBar.vertical: ScrollBar {
onActiveChanged: if (!active && !isMac) active = true
}
boundsBehavior: isMac ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
TextArea.flickable: TextArea {
id: dialogContent

View File

@@ -27,6 +27,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import "../components" as MoneroComponents
@@ -42,7 +43,7 @@ Item {
property string releasedColor: MoneroComponents.Style.titleBarButtonHoverColor
property string textColor: MoneroComponents.Style.defaultFontColor
property alias currentIndex: columnid.currentIndex
property bool expanded: false
readonly property alias expanded: popup.visible
property int dropdownHeight: 42
property int fontHeaderSize: 16
property int fontItemSize: 14
@@ -56,18 +57,6 @@ Item {
signal changed();
onExpandedChanged: if(expanded) appWindow.currentItem = dropdown
function hide() { dropdown.expanded = false }
function containsPoint(px, py) {
if(px < 0)
return false
if(px > width)
return false
if(py < 0)
return false
if(py > height + droplist.height)
return false
return true
}
// Workaroud for suspected memory leak in 5.8 causing malloc crash on app exit
function update() {
@@ -128,118 +117,119 @@ Item {
MouseArea {
id: dropArea
anchors.fill: parent
onClicked: dropdown.expanded = !dropdown.expanded
onClicked: dropdown.expanded ? popup.close() : popup.open()
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
}
}
Rectangle {
id: droplist
anchors.left: parent.left
anchors.right: parent.right
anchors.top: head.bottom
clip: true
height: dropdown.expanded ? columnid.height : 0
color: dropdown.pressedColor
Popup {
id: popup
padding: 0
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
width: 3; height: 3
id: droplist
x: dropdown.x
width: dropdown.width
y: head.y + head.height
clip: true
height: dropdown.expanded ? columnid.height : 0
color: dropdown.pressedColor
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
width: 3; height: 3
color: dropdown.pressedColor
}
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
width: 3; height: 3
color: dropdown.pressedColor
}
Behavior on height {
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
width: 3; height: 3
color: dropdown.pressedColor
}
Column {
id: columnid
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
property int currentIndex: 0
Behavior on height {
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
}
Repeater {
id: repeater
Column {
id: columnid
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
property int currentIndex: 0
// Workaround for translations in listElements. All translated strings needs to be listed in this file.
property string stringLow: qsTr("Low (x1 fee)") + translationManager.emptyString
property string stringMedium: qsTr("Medium (x20 fee)") + translationManager.emptyString
property string stringHigh: qsTr("High (x166 fee)") + translationManager.emptyString
property string stringSlow: qsTr("Slow (x0.25 fee)") + translationManager.emptyString
property string stringDefault: qsTr("Default (x1 fee)") + translationManager.emptyString
property string stringFast: qsTr("Fast (x5 fee)") + translationManager.emptyString
property string stringFastest: qsTr("Fastest (x41.5 fee)") + translationManager.emptyString
property string stringAll: qsTr("All") + translationManager.emptyString
property string stringSent: qsTr("Sent") + translationManager.emptyString
property string stringReceived: qsTr("Received") + translationManager.emptyString
Repeater {
id: repeater
delegate: Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: (dropdown.dropdownHeight * 0.75)
//radius: index === repeater.count - 1 ? 4 : 0
color: itemArea.containsMouse || index === columnid.currentIndex || itemArea.containsMouse ? dropdown.releasedColor : dropdown.pressedColor
// Workaround for translations in listElements. All translated strings needs to be listed in this file.
property string stringAutomatic: qsTr("Automatic") + translationManager.emptyString
property string stringSlow: qsTr("Slow (x0.2 fee)") + translationManager.emptyString
property string stringNormal: qsTr("Normal (x1 fee)") + translationManager.emptyString
property string stringFast: qsTr("Fast (x5 fee)") + translationManager.emptyString
property string stringFastest: qsTr("Fastest (x200 fee)") + translationManager.emptyString
MoneroComponents.TextPlain {
id: col1Text
anchors.verticalCenter: parent.verticalCenter
delegate: Rectangle {
anchors.left: parent.left
anchors.right: col2Text.left
anchors.leftMargin: 12
anchors.rightMargin: 0
font.family: MoneroComponents.Style.fontRegular.name
font.bold: true
font.pixelSize: fontItemSize
color: itemArea.containsMouse || index === columnid.currentIndex || itemArea.containsMouse ? "#FA6800" : "#FFFFFF"
text: qsTr(column1) + translationManager.emptyString
}
MoneroComponents.TextPlain {
id: col2Text
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 45
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 14
color: "#FFFFFF"
text: ""
}
height: (dropdown.dropdownHeight * 0.75)
//radius: index === repeater.count - 1 ? 4 : 0
color: itemArea.containsMouse || index === columnid.currentIndex || itemArea.containsMouse ? dropdown.releasedColor : dropdown.pressedColor
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
width: 3; height: 3
color: parent.color
}
MoneroComponents.TextPlain {
id: col1Text
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: col2Text.left
anchors.leftMargin: 12
anchors.rightMargin: 0
font.family: MoneroComponents.Style.fontRegular.name
font.bold: true
font.pixelSize: fontItemSize
color: itemArea.containsMouse || index === columnid.currentIndex || itemArea.containsMouse ? "#FA6800" : "#FFFFFF"
text: qsTr(column1) + translationManager.emptyString
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
width: 3; height: 3
color: parent.color
}
MoneroComponents.TextPlain {
id: col2Text
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 45
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 14
color: "#FFFFFF"
text: ""
}
MouseArea {
id: itemArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
width: 3; height: 3
color: parent.color
}
onClicked: {
dropdown.expanded = false
columnid.currentIndex = index
changed();
dropdown.update()
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
width: 3; height: 3
color: parent.color
}
MouseArea {
id: itemArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
popup.close()
columnid.currentIndex = index
changed();
dropdown.update()
}
}
}
}

View File

@@ -37,26 +37,26 @@ Rectangle {
source: "qrc:///images/warning.png"
}
TextArea {
Text {
id: content
Layout.fillWidth: true
color: MoneroComponents.Style.defaultFontColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: root.fontSize
horizontalAlignment: TextInput.AlignLeft
selectByMouse: true
textFormat: Text.RichText
wrapMode: Text.WordWrap
textMargin: 0
leftPadding: 4
rightPadding: 18
topPadding: 10
bottomPadding: 10
readOnly: true
onLinkActivated: root.linkActivated();
selectionColor: MoneroComponents.Style.textSelectionColor
selectedTextColor: MoneroComponents.Style.textSelectedColor
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
}
}

View File

@@ -39,7 +39,6 @@ Item {
id: root
property string image: ""
property string color: ""
property bool fontAwesomeFallbackEnabled: true
property var fontAwesomeFallbackIcon: ""
property string fontAwesomeFallbackFont: FontAwesome.fontFamilySolid
property string fontAwesomeFallbackStyle: "Solid"
@@ -69,13 +68,13 @@ Item {
anchors.fill: root
source: svgMask
color: root.color
visible: isOpenGL
visible: image && isOpenGL
}
Text {
id: fontAwesomeFallback
visible: !isOpenGL && root.fontAwesomeFallback
text: !isOpenGL ? root.fontAwesomeFallbackIcon : ""
visible: !imgMockColor.visible
text: root.fontAwesomeFallbackIcon
font.family: root.fontAwesomeFallbackFont
font.pixelSize: root.fontAwesomeFallbackSize
font.styleName: root.fontAwesomeFallbackStyle

1
fonts/CMakeLists.txt Normal file
View File

@@ -0,0 +1 @@
qt5_add_resources(RESOURCE_FILES *.otf)

View File

@@ -17,7 +17,7 @@ if [ ! -d $MONERO_DIR/src ]; then
fi
git submodule update --remote
git -C $MONERO_DIR fetch
git -C $MONERO_DIR checkout v0.15.0.0
git -C $MONERO_DIR checkout v0.15.0.1
# get monero core tag
pushd $MONERO_DIR
@@ -144,9 +144,9 @@ make_exec="make"
if [ "$platform" == "darwin" ]; then
echo "Configuring build for MacOS.."
if [ "$STATIC" == true ]; then
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D BUILD_TAG="mac-x64" -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
else
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D BUILD_TAG="mac-x64" -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
fi
## LINUX 64
@@ -156,9 +156,9 @@ elif [ "$platform" == "linux64" ]; then
echo "Configuring build for Android on Linux host"
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D STATIC=ON -D ARCH="armv7-a" -D ANDROID=true -D BUILD_GUI_DEPS=ON -D USE_LTO=OFF -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
elif [ "$STATIC" == true ]; then
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D BUILD_TAG="linux-x64" -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
else
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D BUILD_GUI_DEPS=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D BUILD_TAG="linux-x64" -D BUILD_GUI_DEPS=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
fi
## LINUX 32
@@ -194,7 +194,7 @@ elif [ "$platform" == "mingw64" ]; then
# Do something under Windows NT platform
echo "Configuring build for MINGW64.."
BOOST_ROOT=/mingw64/boost
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D STATIC=ON -D BOOST_ROOT="$BOOST_ROOT" -D ARCH="x86-64" -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" -G "MSYS Makefiles" -D CMAKE_TOOLCHAIN_FILE=../../cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=c:/msys64 ../..
cmake -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -D STATIC=ON -D BOOST_ROOT="$BOOST_ROOT" -D ARCH="x86-64" -D BUILD_TAG="win-x64" -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON $BUILD_TREZOR_FLAGS -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" -G "MSYS Makefiles" -D CMAKE_TOOLCHAIN_FILE=../../cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=c:/msys64 ../..
## Windows 32
elif [ "$platform" == "mingw32" ]; then

1
images/CMakeLists.txt Normal file
View File

@@ -0,0 +1 @@
qt5_add_resources(RESOURCE_FILES *.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

View File

@@ -1,6 +1,7 @@
; Monero Carbon Chamaeleon GUI Wallet Installer for Windows
; Copyright (c) 2017-2019, The Monero Project
; See LICENSE
#define GuiVersion GetFileVersion("bin\monero-wallet-gui.exe")
[Setup]
AppName=Monero GUI Wallet
@@ -8,7 +9,8 @@ AppName=Monero GUI Wallet
; Thus it's important to keep this stable over releases
; With a different "AppName" InnoSetup would treat a mere update as a completely new application and thus mess up
AppVersion=0.15.0.0
AppVersion={#GuiVersion}
VersionInfoVersion={#GuiVersion}
DefaultDirName={pf}\Monero GUI Wallet
DefaultGroupName=Monero GUI Wallet
UninstallDisplayIcon={app}\monero-wallet-gui.exe
@@ -39,6 +41,8 @@ UsedUserAreasWarning=no
; play a role in only in few cases as the first standard user in a Windows installation does have admin rights.
; So, for the time being, this installer simply disregards this problem.
[Messages]
SetupWindowTitle=%1 {#GuiVersion} Installer
[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"
@@ -65,7 +69,7 @@ Name: "en"; MessagesFile: "compiler:Default.isl"
; Note that it would be very dangerous to use "ignoreversion" on files that may be shared with other
; applications somehow. Luckily this is no issue here because ALL files are "private" to Monero.
Source: "ReadMe.htm"; DestDir: "{app}"; Flags: ignoreversion
Source: {#file AddBackslash(SourcePath) + "ReadMe.htm"}; DestDir: "{app}"; DestName: "ReadMe.htm"; Flags: ignoreversion
Source: "FinishImage.bmp"; Flags: dontcopy
; Monero GUI wallet exe and guide
@@ -313,7 +317,7 @@ end;
; Icons in the "Monero GUI Wallet" program group
; Windows will almost always display icons in alphabetical order, per level, so specify the text accordingly
Name: "{group}\GUI Wallet"; Filename: "{app}\monero-wallet-gui.exe";
Name: "{group}\GUI Wallet Guide"; Filename: "{app}\monero-GUI-guide.pdf"; IconFilename: "{app}\monero-wallet-gui.exe"
Name: "{group}\GUI Wallet Guide"; Filename: "{app}\monero-gui-wallet-guide.pdf"; IconFilename: "{app}\monero-wallet-gui.exe"
Name: "{group}\Uninstall GUI Wallet"; Filename: "{uninstallexe}"
; Sub-folder "Utilities";

View File

@@ -6,8 +6,7 @@
<body style="font-family: Arial, Helvetica, sans-serif">
<h1>Monero Carbon Chamaeleon GUI Wallet</h1>
<p>Copyright (c) 2014-2019, The Monero Project<br>
Date: November 1, 2019</p>
<p>Copyright (c) 2014-2019, The Monero Project</p>
<h2>Preface</h2>
@@ -23,7 +22,7 @@
<h2>Content of the Package</h2>
<p>You just installed the <i>Monero GUI wallet</i> for Windows, release Carbon Chamaeleon, version 0.15.0.0.
<p>You just installed the <i>Monero GUI wallet</i> for Windows, release Carbon Chamaeleon, version {#GuiVersion}.
The wallet enables you to send and receive Moneroj in a secure and very private way.
</p>

1
js/CMakeLists.txt Normal file
View File

@@ -0,0 +1 @@
qt5_add_resources(RESOURCE_FILES *.js)

View File

@@ -19,10 +19,8 @@ function setCustomWindowDecorations(custom) {
if (custom) {
appWindow.flags = flagsCustomDecorations;
daemonConsolePopup.flags = flagsCustomDecorations;
} else {
appWindow.flags = flags;
daemonConsolePopup.flags = flags;
}
// Reset window

416
main.qml
View File

@@ -31,6 +31,7 @@ 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 moneroComponents.Wallet 1.0
import moneroComponents.PendingTransaction 1.0
@@ -47,7 +48,7 @@ import "js/Windows.js" as Windows
ApplicationWindow {
id: appWindow
title: "Monero"
title: "Monero" + (walletName ? " - " + walletName : "")
property var currentItem
property bool hideBalanceForced: false
@@ -57,7 +58,6 @@ ApplicationWindow {
property var transaction;
property var transactionDescription;
property var walletPassword
property bool isNewWallet: false
property int restoreHeight:0
property bool daemonSynced: false
property bool walletSynced: false
@@ -86,8 +86,8 @@ ApplicationWindow {
property bool themeTransition: false
// fiat price conversion
property int fiatPriceXMRUSD: 0
property int fiatPriceXMREUR: 0
property real fiatPriceXMRUSD: 0
property real fiatPriceXMREUR: 0
property var fiatPriceAPIs: {
return {
"kraken": {
@@ -112,7 +112,6 @@ ApplicationWindow {
property var current_address
property var current_address_label: "Primary"
property int current_subaddress_table_index: 0
property int current_subaddress_account_table_index: 0
function altKeyReleased() { ctrlPressed = false; }
@@ -202,8 +201,20 @@ ApplicationWindow {
leftPanel.selectItem(page);
}
function openWallet(prevState) {
passwordDialog.onAcceptedCallback = function() {
walletPassword = passwordDialog.password;
initialize();
}
passwordDialog.onRejectedCallback = function() {
if (prevState) {
appWindow.viewState = prevState;
}
};
passwordDialog.open(usefulName(walletPath()));
}
function initialize() {
appWindow.viewState = "normal";
console.log("initializing..")
// Use stored log level
@@ -239,30 +250,18 @@ ApplicationWindow {
simpleModeConnectionTimer.running = true;
// wallet already opened with wizard, we just need to initialize it
if (typeof wizard.m_wallet !== 'undefined') {
console.log("using wizard wallet")
//Set restoreHeight
if(persistentSettings.restore_height > 0){
// We store restore height in own variable for performance reasons.
restoreHeight = persistentSettings.restore_height
}
var wallet_path = walletPath();
if(isIOS)
wallet_path = moneroAccountsDir + wallet_path;
// console.log("opening wallet at: ", wallet_path, "with password: ", appWindow.walletPassword);
console.log("opening wallet at: ", wallet_path, ", network type: ", persistentSettings.nettype == NetworkType.MAINNET ? "mainnet" : persistentSettings.nettype == NetworkType.TESTNET ? "testnet" : "stagenet");
connectWallet(wizard.m_wallet)
isNewWallet = true
// We don't need the wizard wallet any more - delete to avoid conflict with daemon adress change
delete wizard.m_wallet
} else {
var wallet_path = walletPath();
if(isIOS)
wallet_path = moneroAccountsDir + wallet_path;
// console.log("opening wallet at: ", wallet_path, "with password: ", appWindow.walletPassword);
console.log("opening wallet at: ", wallet_path, ", network type: ", persistentSettings.nettype == NetworkType.MAINNET ? "mainnet" : persistentSettings.nettype == NetworkType.TESTNET ? "testnet" : "stagenet");
this.onWalletOpening();
walletManager.openWalletAsync(wallet_path, walletPassword,
persistentSettings.nettype, persistentSettings.kdfRounds);
}
this.onWalletOpening();
walletManager.openWalletAsync(
wallet_path,
walletPassword,
persistentSettings.nettype,
persistentSettings.kdfRounds);
// Hide titlebar based on persistentSettings.customDecorations
titleBar.visible = persistentSettings.customDecorations;
@@ -402,6 +401,13 @@ ApplicationWindow {
return path.replace(/.*[\/\\]/, '').replace(/\.keys$/, '')
}
function getUnlockedBalance() {
if(!currentWallet){
return 0
}
return currentWallet.unlockedBalance()
}
function updateBalance() {
if (!currentWallet)
return;
@@ -409,8 +415,8 @@ ApplicationWindow {
var balance = "?.??";
var balanceU = "?.??";
if(!hideBalanceForced && !persistentSettings.hideBalance){
balance = walletManager.displayAmount(currentWallet.balance(currentWallet.currentSubaddressAccount));
balanceU = walletManager.displayAmount(currentWallet.unlockedBalance(currentWallet.currentSubaddressAccount));
balance = walletManager.displayAmount(currentWallet.balance());
balanceU = walletManager.displayAmount(currentWallet.unlockedBalance());
}
if (persistentSettings.fiatPriceEnabled) {
@@ -418,8 +424,6 @@ ApplicationWindow {
}
leftPanel.minutesToUnlock = (balance !== balanceU) ? currentWallet.history.minutesToUnlock : "";
leftPanel.currentAccountIndex = currentWallet.currentSubaddressAccount;
leftPanel.currentAccountLabel = currentWallet.getSubaddressLabel(currentWallet.currentSubaddressAccount, 0);
leftPanel.balanceString = balance
leftPanel.balanceUnlockedString = balanceU
}
@@ -469,14 +473,18 @@ ApplicationWindow {
leftPanel.networkStatus.connected = status
// update local daemon status.
if(walletManager.isDaemonLocal(currentDaemonAddress))
daemonRunning = status;
const isDisconnected = status === Wallet.ConnectionStatus_Disconnected;
if (!persistentSettings.useRemoteNode) {
daemonRunning = !isDisconnected;
} else {
daemonRunning = false;
}
// Update fee multiplier dropdown on transfer page
middlePanel.transferView.updatePriorityDropdown();
// If wallet isnt connected, advanced wallet mode and no daemon is running - Ask
if (appWindow.walletMode >= 2 && walletManager.isDaemonLocal(currentDaemonAddress) && !walletInitialized && status === Wallet.ConnectionStatus_Disconnected) {
if (appWindow.walletMode >= 2 && !persistentSettings.useRemoteNode && !walletInitialized && isDisconnected) {
daemonManager.runningAsync(persistentSettings.nettype, function(running) {
if (!running) {
daemonManagerDialog.open();
@@ -516,16 +524,6 @@ ApplicationWindow {
walletName = usefulName(wallet.path)
console.log(">>> wallet opened: " + wallet)
if (wallet.status !== Wallet.Status_Ok) {
passwordDialog.onAcceptedCallback = function() {
walletPassword = passwordDialog.password;
appWindow.initialize();
}
passwordDialog.onRejectedCallback = function() {
walletPassword = "";
//appWindow.enableUI(false)
wizard.wizardState = "wizardHome";
rootItem.state = "wizard";
}
// try to resolve common wallet cache errors automatically
switch (wallet.errorString) {
case "basic_string::_M_replace_aux":
@@ -598,10 +596,19 @@ ApplicationWindow {
function connectRemoteNode() {
console.log("connecting remote node");
persistentSettings.useRemoteNode = true;
currentDaemonAddress = persistentSettings.remoteNodeAddress;
currentWallet.initAsync(currentDaemonAddress, isTrustedDaemon());
walletManager.setDaemonAddressAsync(currentDaemonAddress);
const callback = function() {
persistentSettings.useRemoteNode = true;
currentDaemonAddress = persistentSettings.remoteNodeAddress;
currentWallet.initAsync(currentDaemonAddress, isTrustedDaemon());
walletManager.setDaemonAddressAsync(currentDaemonAddress);
};
if (typeof daemonManager != "undefined" && daemonRunning) {
showDaemonIsRunningDialog(callback);
} else {
callback();
}
}
function disconnectRemoteNode() {
@@ -639,17 +646,6 @@ ApplicationWindow {
// Refresh is succesfull if blockchain height > 1
if (bcHeight > 1){
// Save new wallet after first refresh
// Wallet is nomrmally saved to disk on app exit. This prevents rescan from block 0 after app crash
if(isNewWallet){
console.log("Saving wallet after first refresh");
currentWallet.store()
isNewWallet = false
// Update History
currentWallet.history.refresh(currentWallet.currentSubaddressAccount);
}
// recovering from seed is finished after first refresh
if(persistentSettings.is_recovering) {
persistentSettings.is_recovering = false
@@ -848,24 +844,24 @@ ApplicationWindow {
if (amount !== "(all)") {
var amountxmr = walletManager.amountFromString(amount);
console.log("integer amount: ", amountxmr);
console.log("integer unlocked",currentWallet.unlockedBalance)
console.log("integer unlocked", currentWallet.unlockedBalance())
if (amountxmr <= 0) {
hideProcessingSplash()
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Amount is wrong: expected number from %1 to %2")
.arg(walletManager.displayAmount(0))
.arg(walletManager.maximumAllowedAmountAsSting())
.arg(walletManager.displayAmount(currentWallet.unlockedBalance()))
+ translationManager.emptyString
informationPopup.icon = StandardIcon.Critical
informationPopup.onCloseCallback = null
informationPopup.open()
return;
} else if (amountxmr > currentWallet.unlockedBalance) {
} else if (amountxmr > currentWallet.unlockedBalance()) {
hideProcessingSplash()
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Insufficient funds. Unlocked balance: %1")
.arg(walletManager.displayAmount(currentWallet.unlockedBalance))
.arg(walletManager.displayAmount(currentWallet.unlockedBalance()))
+ translationManager.emptyString
informationPopup.icon = StandardIcon.Critical
@@ -1094,7 +1090,6 @@ ApplicationWindow {
leftPanel.enabled = false;
middlePanel.enabled = false;
titleBar.enabled = false;
inactiveOverlay.visible = true;
splash.show();
}
@@ -1106,7 +1101,6 @@ ApplicationWindow {
leftPanel.enabled = true
middlePanel.enabled = true
titleBar.enabled = true
inactiveOverlay.visible = false;
}
}
@@ -1119,6 +1113,9 @@ ApplicationWindow {
rootItem.state = "wizard"
// reset balance
clearMoneroCardLabelText();
middlePanel.addressBookView.clearFields();
middlePanel.transferView.clearFields();
middlePanel.receiveView.clearFields();
// disable timers
userInActivityTimer.running = false;
simpleModeConnectionTimer.running = false;
@@ -1241,17 +1238,32 @@ ApplicationWindow {
Prices.getJSON(url);
}
function fiatApiUpdateBalance(balance){
// update balance card
function fiatApiCurrencySymbol() {
switch (persistentSettings.fiatPriceCurrency) {
case "xmrusd":
return "USD";
case "xmreur":
return "EUR";
default:
console.error("unsupported currency", persistentSettings.fiatPriceCurrency);
return "UNSUPPORTED";
}
}
function fiatApiConvertToFiat(amount) {
var ticker = persistentSettings.fiatPriceCurrency === "xmrusd" ? appWindow.fiatPriceXMRUSD : appWindow.fiatPriceXMREUR;
if(ticker <= 0){
console.log(fiatApiError("Could not update balance card; invalid ticker value"));
leftPanel.balanceFiatString = "?.??";
return;
console.log(fiatApiError("Invalid ticker value: " + ticker));
return "?.??";
}
return (amount * ticker).toFixed(2);
}
function fiatApiUpdateBalance(balance){
// update balance card
var bFiat = "?.??"
if (!hideBalanceForced && !persistentSettings.hideBalance) {
bFiat = (balance * ticker).toFixed(2);
bFiat = fiatApiConvertToFiat(balance);
}
leftPanel.balanceFiatString = bFiat;
}
@@ -1305,18 +1317,12 @@ ApplicationWindow {
} else console.log("qrScannerEnabled disabled");
if(!walletsFound()) {
wizard.wizardState = "wizardLanguage";
rootItem.state = "wizard"
} else {
wizard.wizardState = "wizardHome";
rootItem.state = "normal"
passwordDialog.onAcceptedCallback = function() {
walletPassword = passwordDialog.password;
initialize(persistentSettings);
}
passwordDialog.onRejectedCallback = function() {
wizard.wizardState = "wizardHome";
rootItem.state = "wizard"
}
passwordDialog.open(usefulName(walletPath()))
openWallet("wizard");
}
checkUpdates();
@@ -1339,12 +1345,9 @@ ApplicationWindow {
property string locale
property string account_name
property string wallet_path
property bool auto_donations_enabled : false
property int auto_donations_amount : 50
property bool allow_background_mining : false
property bool miningIgnoreBattery : true
property var nettype: NetworkType.MAINNET
property string payment_id
property int restore_height : 0
property bool is_trusted_daemon : false
property bool is_recovering : false
@@ -1582,88 +1585,108 @@ ApplicationWindow {
}
]
LeftPanel {
id: leftPanel
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
visible: rootItem.state == "normal" && middlePanel.state != "Merchant"
Item {
id: blurredArea
anchors.fill: parent
onTransferClicked: {
middlePanel.state = "Transfer";
middlePanel.flickable.contentY = 0;
updateBalance();
LeftPanel {
id: leftPanel
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
visible: rootItem.state == "normal" && middlePanel.state != "Merchant"
currentAccountIndex: currentWallet ? currentWallet.currentSubaddressAccount : 0
currentAccountLabel: {
if (currentWallet) {
return currentWallet.getSubaddressLabel(currentWallet.currentSubaddressAccount, 0);
}
return qsTr("Primary account") + translationManager.emptyString;
}
onTransferClicked: {
middlePanel.state = "Transfer";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onReceiveClicked: {
middlePanel.state = "Receive";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onMerchantClicked: {
middlePanel.state = "Merchant";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onTxkeyClicked: {
middlePanel.state = "TxKey";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onSharedringdbClicked: {
middlePanel.state = "SharedRingDB";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onHistoryClicked: {
middlePanel.state = "History";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onAddressBookClicked: {
middlePanel.state = "AddressBook";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onMiningClicked: {
middlePanel.state = "Mining";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onSignClicked: {
middlePanel.state = "Sign";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onSettingsClicked: {
middlePanel.state = "Settings";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onAccountClicked: {
middlePanel.state = "Account";
middlePanel.flickable.contentY = 0;
updateBalance();
}
}
onReceiveClicked: {
middlePanel.state = "Receive";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onMerchantClicked: {
middlePanel.state = "Merchant";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onTxkeyClicked: {
middlePanel.state = "TxKey";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onSharedringdbClicked: {
middlePanel.state = "SharedRingDB";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onHistoryClicked: {
middlePanel.state = "History";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onAddressBookClicked: {
middlePanel.state = "AddressBook";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onMiningClicked: {
middlePanel.state = "Mining";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onSignClicked: {
middlePanel.state = "Sign";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onSettingsClicked: {
middlePanel.state = "Settings";
middlePanel.flickable.contentY = 0;
updateBalance();
}
onAccountClicked: {
middlePanel.state = "Account";
middlePanel.flickable.contentY = 0;
updateBalance();
MiddlePanel {
id: middlePanel
accountView.currentAccountIndex: currentWallet ? currentWallet.currentSubaddressAccount : 0
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: leftPanel.visible ? leftPanel.right : parent.left
anchors.right: parent.right
state: "Transfer"
}
}
MiddlePanel {
id: middlePanel
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: leftPanel.visible ? leftPanel.right : parent.left
anchors.right: parent.right
state: "Transfer"
FastBlur {
id: blur
anchors.fill: blurredArea
source: blurredArea
radius: 64
visible: passwordDialog.visible || inputDialog.visible || splash.visible
}
WizardController {
@@ -1671,7 +1694,7 @@ ApplicationWindow {
anchors.fill: parent
onUseMoneroClicked: {
rootItem.state = "normal";
appWindow.initialize();
appWindow.openWallet("wizard");
}
}
@@ -1901,6 +1924,23 @@ ApplicationWindow {
statusMessage.visible = true
}
function showDaemonIsRunningDialog(onClose) {
// 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() {
onClose();
}
confirmationDialog.onRejectedCallback = function() {
daemonManager.stop(persistentSettings.nettype);
onClose();
};
confirmationDialog.open();
}
onClosing: {
close.accepted = false;
console.log("blocking close event");
@@ -1922,27 +1962,12 @@ ApplicationWindow {
// If daemon is running - prompt user before exiting
if(typeof daemonManager != "undefined" && daemonRunning) {
// Show confirmation dialog
confirmationDialog.title = qsTr("Daemon is running") + translationManager.emptyString;
confirmationDialog.text = qsTr("Daemon will still be running in background when GUI is closed.");
confirmationDialog.icon = StandardIcon.Question
confirmationDialog.cancelText = qsTr("Stop daemon")
confirmationDialog.onAcceptedCallback = function() {
closeAccepted();
}
confirmationDialog.onRejectedCallback = function() {
daemonManager.stop(persistentSettings.nettype);
closeAccepted();
};
if (appWindow.walletMode == 0) {
stopDaemon();
closeAccepted();
} else {
confirmationDialog.open();
showDaemonIsRunningDialog(closeAccepted);
}
} else {
closeAccepted();
}
@@ -1964,17 +1989,12 @@ ApplicationWindow {
if (parts.length == 4) {
var version = parts[0]
var hash = parts[1]
//var user_url = parts[2]
//var auto_url = parts[3]
var osBuildTag = isMac ? "mac-x64" : isWindows ? "win-x64" : isLinux ? "linux-x64" : "unknownBuildTag"
var extension = isMac || isLinux ? ".tar.bz2" : isWindows ? ".zip" : ".unknownExtension"
var base_url = "https://downloads.getmonero.org/gui/monero-gui-"
var download_url = base_url + osBuildTag + "-v" + version + extension
var user_url = parts[2]
var msg = ""
if (osBuildTag !== "unknownBuildTag") {
msg = qsTr("New version of Monero v.%1 is available.<br><br>Download:<br>%2<br><br>SHA256 Hash:<br>%3").arg(version).arg(download_url).arg(hash) + translationManager.emptyString
if (isMac || isWindows || isLinux) {
msg = qsTr("New version of Monero v%1 is available.<br><br>Download:<br>%2<br><br>SHA256 Hash:<br>%3").arg(version).arg(user_url).arg(hash) + translationManager.emptyString
} else {
msg = qsTr("New version of Monero is available. Check out getmonero.org") + translationManager.emptyString
msg = qsTr("New version of Monero v%1 is available. Check out getmonero.org").arg(version) + translationManager.emptyString
}
notifier.show(msg)
} else {
@@ -2010,7 +2030,9 @@ ApplicationWindow {
// some fields need an extra nudge when changing languages
function resetLanguageFields(){
clearMoneroCardLabelText()
onWalletRefresh()
if (currentWallet) {
onWalletRefresh();
}
}
function userActivity() {
@@ -2023,6 +2045,7 @@ ApplicationWindow {
if(rootItem.state !== "normal") return;
if(!persistentSettings.lockOnUserInActivity) return;
if(passwordDialog.visible) return;
var inputDialogVisible = inputDialog && inputDialog.visible
// prompt password after X seconds of inactivity
var epoch = Math.floor((new Date).getTime() / 1000);
@@ -2035,9 +2058,11 @@ ApplicationWindow {
} else {
passwordDialog.showError(qsTr("Wrong password"));
}
if (inputDialogVisible) inputDialog.open(inputDialog.inputText)
}
passwordDialog.onRejectedCallback = function() { appWindow.showWizard(); }
if (inputDialogVisible) inputDialog.close()
passwordDialog.open();
}
@@ -2071,24 +2096,13 @@ ApplicationWindow {
console.log("walletMode: " + (mode === 0 ? "simple": mode === 1 ? "simple (bootstrap)" : "Advanced"));
}
// Daemon console
DaemonConsole {
id: daemonConsolePopup
height:500
width:800
title: qsTr("Daemon log") + translationManager.emptyString
onAccepted: {
close();
}
}
Rectangle {
id: inactiveOverlay
visible: false
visible: blur.visible
anchors.fill: parent
anchors.topMargin: titleBar.height
color: MoneroComponents.Style.blackTheme ? "black" : "white"
opacity: MoneroComponents.Style.blackTheme ? 0.8 : 0.9
opacity: isOpenGL ? 0.3 : inputDialog.visible || splash.visible ? 0.7 : 1.0
MoneroEffects.ColorTransition {
targetObj: parent

View File

@@ -46,9 +46,9 @@ INCLUDEPATH += $$WALLET_ROOT/include \
$$WALLET_ROOT/src
HEADERS += \
filter.h \
clipboardAdapter.h \
oscursor.h \
src/main/filter.h \
src/main/clipboardAdapter.h \
src/main/oscursor.h \
src/libwalletqt/WalletManager.h \
src/libwalletqt/Wallet.h \
src/libwalletqt/PendingTransaction.h \
@@ -57,8 +57,8 @@ HEADERS += \
src/libwalletqt/QRCodeImageProvider.h \
src/libwalletqt/Transfer.h \
src/NetworkType.h \
oshelper.h \
TranslationManager.h \
src/main/oshelper.h \
src/TranslationManager.h \
src/model/TransactionHistoryModel.h \
src/model/TransactionHistorySortFilterModel.h \
src/QR-Code-generator/BitBuffer.hpp \
@@ -72,8 +72,8 @@ HEADERS += \
src/libwalletqt/SubaddressAccount.h \
src/zxcvbn-c/zxcvbn.h \
src/libwalletqt/UnsignedTransaction.h \
Logger.h \
MainApp.h \
src/main/Logger.h \
src/main/MainApp.h \
src/qt/FutureScheduler.h \
src/qt/ipc.h \
src/qt/KeysFiles.h \
@@ -83,18 +83,18 @@ HEADERS += \
src/qt/MoneroSettings.h \
src/qt/TailsOS.h
SOURCES += main.cpp \
filter.cpp \
clipboardAdapter.cpp \
oscursor.cpp \
SOURCES += src/main/main.cpp \
src/main/filter.cpp \
src/main/clipboardAdapter.cpp \
src/main/oscursor.cpp \
src/libwalletqt/WalletManager.cpp \
src/libwalletqt/Wallet.cpp \
src/libwalletqt/PendingTransaction.cpp \
src/libwalletqt/TransactionHistory.cpp \
src/libwalletqt/TransactionInfo.cpp \
src/libwalletqt/QRCodeImageProvider.cpp \
oshelper.cpp \
TranslationManager.cpp \
src/main/oshelper.cpp \
src/TranslationManager.cpp \
src/model/TransactionHistoryModel.cpp \
src/model/TransactionHistorySortFilterModel.cpp \
src/QR-Code-generator/BitBuffer.cpp \
@@ -108,8 +108,8 @@ SOURCES += main.cpp \
src/libwalletqt/SubaddressAccount.cpp \
src/zxcvbn-c/zxcvbn.c \
src/libwalletqt/UnsignedTransaction.cpp \
Logger.cpp \
MainApp.cpp \
src/main/Logger.cpp \
src/main/MainApp.cpp \
src/qt/FutureScheduler.cpp \
src/qt/ipc.cpp \
src/qt/KeysFiles.cpp \
@@ -370,11 +370,19 @@ macx {
# message("using static libraries")
# LIBS+= -Wl,-Bstatic
# }
OPENSSL_LIBRARY_DIRS = $$system(brew --prefix openssl, lines, EXIT_CODE)
equals(EXIT_CODE, 0) {
OPENSSL_LIBRARY_DIRS = $$OPENSSL_LIBRARY_DIRS/lib
} else {
OPENSSL_LIBRARY_DIRS = /usr/local/ssl/lib
}
QT += macextras
OBJECTIVE_SOURCES += src/qt/macoshelper.mm
LIBS+= \
-L/usr/local/lib \
-L/usr/local/opt/openssl/lib \
-L$$OPENSSL_LIBRARY_DIRS \
-L/usr/local/opt/boost/lib \
-lboost_serialization \
-lboost_thread-mt \
@@ -504,6 +512,9 @@ DISTFILES += \
notes.txt \
monero/src/wallet/CMakeLists.txt
VERSION = $$cat('version.js', lines)
VERSION = $$find(VERSION, 'GUI_VERSION')
VERSION = $$replace(VERSION, '.*(\d+\.\d+\.\d+\.\d+).*', '\1')
# windows application icon
RC_ICONS = images/appicon.ico

View File

@@ -31,6 +31,7 @@ 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 "../components" as MoneroComponents
import "../components/effects/" as MoneroEffects
@@ -48,15 +49,15 @@ Rectangle {
property var model
property alias accountHeight: mainLayout.height
property bool selectAndSend: false
property int currentAccountIndex
function renameSubaddressAccountLabel(_index){
inputDialog.labelText = qsTr("Set the label of the selected account:") + translationManager.emptyString;
inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(_index, 0);
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddressAccount.setLabel(_index, inputDialog.inputText)
appWindow.currentWallet.setSubaddressLabel(_index, 0, inputDialog.inputText)
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
inputDialog.open(appWindow.currentWallet.getSubaddressLabel(_index, 0))
}
Clipboard { id: clipboard }
@@ -179,6 +180,7 @@ Rectangle {
clip: true
boundsBehavior: ListView.StopAtBounds
interactive: false
currentIndex: currentAccountIndex
delegate: Rectangle {
id: tableItem2
@@ -210,7 +212,7 @@ Rectangle {
MoneroComponents.Label {
id: idLabel
color: index === appWindow.current_subaddress_account_table_index ? MoneroComponents.Style.defaultFontColor : "#757575"
color: index === currentAccountIndex ? MoneroComponents.Style.defaultFontColor : "#757575"
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 6
@@ -277,9 +279,9 @@ Rectangle {
onEntered: tableItem2.color = MoneroComponents.Style.titleBarButtonHoverColor
onExited: tableItem2.color = "transparent"
onClicked: {
if (index == subaddressAccountListView.currentIndex && selectAndSend)
appWindow.currentWallet.switchSubaddressAccount(index);
if (selectAndSend)
appWindow.showPageRequest("Transfer");
subaddressAccountListView.currentIndex = index;
}
}
}
@@ -318,17 +320,9 @@ Rectangle {
}
}
}
onCurrentItemChanged: {
// reset global vars
appWindow.current_subaddress_account_table_index = subaddressAccountListView.currentIndex;
appWindow.currentWallet.switchSubaddressAccount(appWindow.current_subaddress_account_table_index);
appWindow.onWalletUpdate();
}
onCurrentIndexChanged: {
if (selectAndSend) {
appWindow.showPageRequest("Transfer");
}
appWindow.onWalletUpdate();
}
}
}
@@ -349,8 +343,9 @@ Rectangle {
id: addNewAccountCheckbox
visible: !selectAndSend
border: false
checkedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: FontAwesome.plusCircle
toggleOnClick: false
fontAwesomeIcons: true
fontSize: 16
iconOnTheLeft: true
Layout.fillWidth: true
@@ -358,12 +353,9 @@ Rectangle {
text: qsTr("Create new account") + translationManager.emptyString;
onClicked: {
inputDialog.labelText = qsTr("Set the label of the new account:") + translationManager.emptyString
inputDialog.inputText = qsTr("(Untitled)") + translationManager.emptyString
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddressAccount.addRow(inputDialog.inputText)
appWindow.currentWallet.switchSubaddressAccount(appWindow.currentWallet.numSubaddressAccounts() - 1)
current_subaddress_account_table_index = appWindow.currentWallet.numSubaddressAccounts() - 1
subaddressAccountListView.currentIndex = current_subaddress_account_table_index
appWindow.onWalletUpdate();
}
inputDialog.onRejectedCallback = null;

View File

@@ -67,21 +67,18 @@ Rectangle {
spacing: 0
Layout.fillWidth: true
TextArea {
Text {
id: titleLabel
Layout.fillWidth: true
color: MoneroComponents.Style.defaultFontColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 32
horizontalAlignment: TextInput.AlignLeft
selectByMouse: false
wrapMode: Text.WordWrap;
textMargin: 0
leftPadding: 0
topPadding: 0
text: qsTr("Save your most used addresses here") + translationManager.emptyString
width: parent.width
readOnly: true
// @TODO: Legacy. Remove after Qt 5.8.
// https://stackoverflow.com/questions/41990013
@@ -91,20 +88,17 @@ Rectangle {
}
}
TextArea {
Text {
Layout.fillWidth: true
color: MoneroComponents.Style.dimmedFontColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 16
horizontalAlignment: TextInput.AlignLeft
selectByMouse: false
wrapMode: Text.WordWrap;
textMargin: 0
leftPadding: 0
topPadding: 0
text: qsTr("This makes it easier to send or receive Monero and reduces errors when typing in addresses manually.") + translationManager.emptyString
width: parent.width
readOnly: true
// @TODO: Legacy. Remove after Qt 5.8.
// https://stackoverflow.com/questions/41990013
@@ -284,8 +278,9 @@ Rectangle {
MoneroComponents.CheckBox {
id: addNewEntryCheckbox
border: false
checkedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: FontAwesome.plusCircle
toggleOnClick: false
fontAwesomeIcons: true
fontSize: 16
iconOnTheLeft: true
Layout.fillWidth: true
@@ -325,8 +320,8 @@ Rectangle {
wrapMode: Text.WrapAnywhere
addressValidation: true
pasteButton: true
onPaste: function(clipboardText) {
const parsed = walletManager.parse_uri_to_object(clipboardText);
onTextChanged: {
const parsed = walletManager.parse_uri_to_object(addressLine.text);
if (!parsed.error) {
addressLine.text = parsed.address;
descriptionLine.text = parsed.tx_description;

1
pages/CMakeLists.txt Normal file
View File

@@ -0,0 +1 @@
qt5_add_resources(RESOURCE_FILES *.qrc)

View File

@@ -181,7 +181,6 @@ Rectangle {
Layout.rightMargin: sideMargin
columns: 2
columnSpacing: 20
z: 6
MoneroComponents.DatePicker {
id: fromDatePicker
@@ -228,7 +227,7 @@ Rectangle {
MoneroComponents.TextPlain {
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 15
text: qsTr("Sort by") + ":"
text: qsTr("Sort by") + ":" + translationManager.emptyString
color: MoneroComponents.Style.defaultFontColor
anchors.verticalCenter: parent.verticalCenter
}
@@ -447,7 +446,7 @@ Rectangle {
MoneroComponents.TextPlain {
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 15
text: qsTr("Page") + ":"
text: qsTr("Page") + ":" + translationManager.emptyString
color: MoneroComponents.Style.defaultFontColor
anchors.verticalCenter: parent.verticalCenter
}
@@ -478,7 +477,6 @@ Rectangle {
return;
inputDialog.labelText = qsTr("Jump to page (1-%1)").arg(pages) + translationManager.emptyString;
inputDialog.inputText = "1";
inputDialog.onAcceptedCallback = function() {
var pageNumber = parseInt(inputDialog.inputText);
if (!isNaN(pageNumber) && pageNumber >= 1 && pageNumber <= pages) {
@@ -651,7 +649,7 @@ Rectangle {
MoneroComponents.TextPlain {
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 15
text: _amount + " XMR"
text: displayAmount
color: MoneroComponents.Style.defaultFontColor
anchors.verticalCenter: parent.verticalCenter
@@ -870,7 +868,7 @@ Rectangle {
MoneroComponents.TextPlain {
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 15
text: persistentSettings.historyHumanDates ? dateHuman : date + " " + time
text: persistentSettings.historyHumanDates ? dateHuman : dateTime
color: MoneroComponents.Style.defaultFontColor
anchors.verticalCenter: parent.verticalCenter
@@ -882,7 +880,7 @@ Rectangle {
onEntered: {
parent.color = MoneroComponents.Style.orange
if (persistentSettings.historyHumanDates) {
parent.text = date + " " + time;
parent.text = dateTime;
}
}
onExited: {
@@ -1196,8 +1194,8 @@ Rectangle {
if(res[i].state === 'copyable' && res[i].parent.hasOwnProperty('text')) toClipboard(res[i].parent.text);
if(res[i].state === 'copyable_address') root.toClipboard(address);
if(res[i].state === 'copyable_txkey') root.getTxKey(hash, res[i]);
if(res[i].state === 'set_tx_note') root.editDescription(hash);
if(res[i].state === 'details') root.showTxDetails(hash, paymentId, destinations, subaddrAccount, subaddrIndex);
if(res[i].state === 'set_tx_note') root.editDescription(hash, tx_note);
if(res[i].state === 'details') root.showTxDetails(hash, paymentId, destinations, subaddrAccount, subaddrIndex, dateTime, displayAmount, isout);
if(res[i].state === 'proof') root.showTxProof(hash, paymentId, destinations, subaddrAccount, subaddrIndex);
doCollapse = false;
break;
@@ -1316,7 +1314,7 @@ Rectangle {
}
MoneroComponents.StandardButton {
visible: !isIOS && root.txCount > 0
visible: !isIOS
small: true
text: qsTr("Export all history") + translationManager.emptyString
onClicked: {
@@ -1480,12 +1478,12 @@ Rectangle {
var timestamp = new Date(date + " " + time).getTime() / 1000;
var dateHuman = Utils.ago(timestamp);
var _amount = amount;
if(_amount === 0){
var displayAmount = amount;
if(displayAmount === 0){
// *sometimes* amount is 0, while the 'destinations string'
// has the correct amount, so we try to fetch it from that instead.
_amount = TxUtils.destinationsToAmount(destinations);
_amount = Number(_amount *1);
displayAmount = TxUtils.destinationsToAmount(destinations);
displayAmount = Number(displayAmount *1);
}
var tx_note = currentWallet.getUserNote(hash);
@@ -1503,15 +1501,14 @@ Rectangle {
"i": i,
"isout": isout,
"amount": Number(amount),
"_amount": _amount,
"displayAmount": displayAmount + " XMR",
"hash": hash,
"paymentId": paymentId,
"address": address,
"destinations": destinations,
"tx_note": tx_note,
"time": time,
"date": date,
"dateHuman": dateHuman,
"dateTime": date + " " + time,
"blockheight": blockheight,
"address": address,
"timestamp": timestamp,
@@ -1535,7 +1532,7 @@ Rectangle {
root.updateFilter();
}
function editDescription(_hash){
function editDescription(_hash, _tx_note){
inputDialog.labelText = qsTr("Set description:") + translationManager.emptyString;
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.setUserNote(_hash, inputDialog.inputText);
@@ -1543,7 +1540,7 @@ Rectangle {
root.update();
}
inputDialog.onRejectedCallback = null;
inputDialog.open();
inputDialog.open(_tx_note);
}
function paginationPrevClicked(){
@@ -1588,17 +1585,20 @@ Rectangle {
}
}
function showTxDetails(hash, paymentId, destinations, subaddrAccount, subaddrIndex){
function showTxDetails(hash, paymentId, destinations, subaddrAccount, subaddrIndex, dateTime, amount, isout) {
var tx_note = currentWallet.getUserNote(hash)
var rings = currentWallet.getRings(hash)
var address_label = subaddrIndex == 0 ? (qsTr("Primary address") + translationManager.emptyString) : currentWallet.getSubaddressLabel(subaddrAccount, subaddrIndex)
var address = currentWallet.address(subaddrAccount, subaddrIndex)
const hasPaymentId = parseInt(paymentId, 16);
const integratedAddress = !isout && hasPaymentId ? currentWallet.integratedAddress(paymentId) : null;
if (rings)
rings = rings.replace(/\|/g, '\n')
currentWallet.getTxKeyAsync(hash, function(hash, tx_key) {
informationPopup.title = qsTr("Transaction details") + translationManager.emptyString;
informationPopup.content = buildTxDetailsString(hash, paymentId, tx_key, tx_note, destinations, rings, address, address_label);
informationPopup.content = buildTxDetailsString(hash, hasPaymentId ? paymentId : null, tx_key, tx_note, destinations, rings, address, address_label, integratedAddress, dateTime, amount);
informationPopup.onCloseCallback = null
informationPopup.open();
});
@@ -1626,16 +1626,18 @@ Rectangle {
appWindow.showStatusMessage(qsTr("Copied to clipboard"),3);
}
function buildTxDetailsString(tx_id, paymentId, tx_key,tx_note, destinations, rings, address, address_label) {
var trStart = '<tr><td width="85" style="padding-top:5px"><b>',
function buildTxDetailsString(tx_id, paymentId, tx_key,tx_note, destinations, rings, address, address_label, integratedAddress, dateTime, amount) {
var trStart = '<tr><td style="white-space: nowrap; padding-top:5px"><b>',
trMiddle = '</b></td><td style="padding-left:10px;padding-top:5px;">',
trEnd = "</td></tr>";
return '<table border="0">'
+ (tx_id ? trStart + qsTr("Tx ID:") + trMiddle + tx_id + trEnd : "")
+ (address_label ? trStart + qsTr("Address label:") + trMiddle + address_label + trEnd : "")
+ (dateTime ? trStart + qsTr("Date") + ":" + trMiddle + dateTime + trEnd : "")
+ (amount ? trStart + qsTr("Amount") + ":" + trMiddle + amount + trEnd : "")
+ (address ? trStart + qsTr("Address:") + trMiddle + address + trEnd : "")
+ (paymentId ? trStart + qsTr("Payment ID:") + trMiddle + paymentId + trEnd : "")
+ (integratedAddress ? trStart + qsTr("Integrated address") + ":" + trMiddle + integratedAddress + trEnd : "")
+ (tx_key ? trStart + qsTr("Tx key:") + trMiddle + tx_key + trEnd : "")
+ (tx_note ? trStart + qsTr("Tx note:") + trMiddle + tx_note + trEnd : "")
+ (destinations ? trStart + qsTr("Destinations:") + trMiddle + destinations + trEnd : "")

View File

@@ -57,13 +57,13 @@ Rectangle {
MoneroComponents.WarningBox {
Layout.bottomMargin: 8
text: qsTr("Mining is only available on local daemons.") + translationManager.emptyString
visible: !walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
visible: persistentSettings.useRemoteNode
}
MoneroComponents.WarningBox {
Layout.bottomMargin: 8
text: qsTr("Your daemon must be synchronized before you can start mining") + translationManager.emptyString
visible: walletManager.isDaemonLocal(appWindow.currentDaemonAddress) && !appWindow.daemonSynced
visible: !persistentSettings.useRemoteNode && !appWindow.daemonSynced
}
MoneroComponents.TextPlain {
@@ -199,7 +199,7 @@ Rectangle {
} else {
errorPopup.title = qsTr("Error starting mining") + translationManager.emptyString;
errorPopup.text = qsTr("Couldn't start mining.<br>") + translationManager.emptyString
if (!walletManager.isDaemonLocal(appWindow.currentDaemonAddress))
if (persistentSettings.useRemoteNode)
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()
@@ -259,7 +259,7 @@ Rectangle {
}
function onMiningStatus(isMining) {
var daemonReady = walletManager.isDaemonLocal(appWindow.currentDaemonAddress) && appWindow.daemonSynced
var daemonReady = !persistentSettings.useRemoteNode && appWindow.daemonSynced
appWindow.isMining = isMining;
updateStatusText()
startSoloMinerButton.enabled = !appWindow.isMining && daemonReady
@@ -284,7 +284,7 @@ Rectangle {
function onPageCompleted() {
console.log("Mining page loaded");
update()
timer.running = walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
timer.running = !persistentSettings.useRemoteNode
}
function onPageClosed() {

View File

@@ -53,12 +53,11 @@ Rectangle {
function renameSubaddressLabel(_index){
inputDialog.labelText = qsTr("Set the label of the selected address:") + translationManager.emptyString;
inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, _index);
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddress.setLabel(appWindow.currentWallet.currentSubaddressAccount, _index, inputDialog.inputText);
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
inputDialog.open(appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, _index))
}
Clipboard { id: clipboard }
@@ -74,10 +73,6 @@ Rectangle {
anchors.right: parent.right
spacing: 20
property int labelWidth: 120
property int editWidth: 400
property int lineEditFontSize: 12
property int qrCodeSize: 220
ColumnLayout {
id: addressRow
@@ -244,8 +239,9 @@ Rectangle {
MoneroComponents.CheckBox {
id: addNewAddressCheckbox
border: false
checkedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: FontAwesome.plusCircle
toggleOnClick: false
fontAwesomeIcons: true
fontSize: 16
iconOnTheLeft: true
Layout.fillWidth: true
@@ -253,7 +249,6 @@ Rectangle {
text: qsTr("Create new address") + translationManager.emptyString;
onClicked: {
inputDialog.labelText = qsTr("Set the label of the new address:") + translationManager.emptyString
inputDialog.inputText = qsTr("(Untitled)") + translationManager.emptyString
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddress.addRow(appWindow.currentWallet.currentSubaddressAccount, inputDialog.inputText)
current_subaddress_table_index = appWindow.currentWallet.numSubaddresses(appWindow.currentWallet.currentSubaddressAccount) - 1

View File

@@ -53,9 +53,6 @@ Rectangle {
property string warningContent: ""
property string sendButtonWarning: ""
property string startLinkText: qsTr("<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style><font size='2'> (</font><a href='#'>Start daemon</a><font size='2'>)</font>") + translationManager.emptyString
property bool showAdvanced: false
// @TODO: remove after pid removal hardfork
property bool warningLongPidTransfer: false
property bool warningLongPidDescription: descriptionLine.text.match(/^[0-9a-f]{64}$/i)
Clipboard { id: clipboard }
@@ -87,17 +84,6 @@ Rectangle {
paymentIdCheckbox.checked = paymentIdLine.text != "";
}
function isLongPidService(text) {
// @TODO: remove after pid removal hardfork
return text.length == 95 &&
[ "44tLjmXrQNrWJ5NBsEj2R77ZBEgDa3fEe9GLpSf2FRmhexPvfYDUAB7EXX1Hdb3aMQ9FLqdJ56yaAhiXoRsceGJCRS3Jxkn", // Binance
"4AQ3ZREb53FMYKBmpPn7BD7hphPk6G1ceinQX6gefAvhFJsNbeFsGwebZWCNxoJAbZhD9cjetBAqmLhfXmcNLBpPMsBL6yM", // KuCoin
"47YzEcMrU2S42UitURo7ukUDaSaL485Z1QbmFgq1vSs5g3JesL4rChwWf2uWk1va99JAaRxt65jhX9uAqQnjeFM44ckgZtp", // AnycoinDirect
"4BCeEPhodgPMbPWFN1dPwhWXdRX8q4mhhdZdA1dtSMLTLCEYvAj9QXjXAfF7CugEbmfBhgkqHbdgK9b2wKA6nqRZQCgvCDm", // Bitfinex
"463tWEBn5XZJSxLU6uLQnQ2iY9xuNcDbjLSjkn3XAXHCbLrTTErJrBWYgHJQyrCwkNgYvyV3z8zctJLPCZy24jvb3NiTcTJ" // Bittrex
].indexOf(text) > -1
}
function clearFields() {
addressLine.text = ""
setPaymentId("");
@@ -168,6 +154,10 @@ Rectangle {
labelText: qsTr("<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\
Amount <font size='2'> ( </font> <a href='#'>Change account</a><font size='2'> )</font>")
+ translationManager.emptyString
copyButton: !isNaN(amountLine.text) && persistentSettings.fiatPriceEnabled
copyButtonText: fiatApiCurrencySymbol() + " ~" + fiatApiConvertToFiat(amountLine.text)
copyButtonEnabled: false
onLabelLinkActivated: {
middlePanel.accountView.selectAndSend = true;
appWindow.showPageRequest("Account")
@@ -178,9 +168,18 @@ Rectangle {
inlineButtonText: qsTr("All") + translationManager.emptyString
inlineButton.onClicked: amountLine.text = "(all)"
onTextChanged: {
if(amountLine.text.indexOf('.') === 0){
amountLine.text = '0' + amountLine.text;
}
const match = amountLine.text.match(/^0+(\d.*)/);
if (match) {
const cursorPosition = amountLine.cursorPosition;
amountLine.text = match[1];
amountLine.cursorPosition = Math.max(cursorPosition, 1) - 1;
} else if(amountLine.text.indexOf('.') === 0){
amountLine.text = '0' + amountLine.text;
if (amountLine.text.length > 2) {
amountLine.cursorPosition = 1;
}
}
amountLine.error = walletManager.amountFromString(amountLine.text) > appWindow.getUnlockedBalance()
}
validator: RegExpValidator {
@@ -257,20 +256,15 @@ Rectangle {
appWindow.showPageRequest("AddressBook");
}
pasteButton: true
onPaste: function(clipboardText) {
const parsed = walletManager.parse_uri_to_object(clipboardText);
onTextChanged: {
const parsed = walletManager.parse_uri_to_object(text);
if (!parsed.error) {
addressLine.text = parsed.address;
setPaymentId(parsed.payment_id);
amountLine.text = parsed.amount;
setDescription(parsed.tx_description);
} else {
addressLine.text = clipboardText;
}
}
onTextChanged: {
warningLongPidTransfer = isLongPidService(text);
}
inlineButton.text: FontAwesome.qrcode
inlineButton.fontPixelSize: 22
inlineButton.fontFamily: FontAwesome.fontFamily
@@ -343,8 +337,9 @@ Rectangle {
CheckBox {
id: descriptionCheckbox
border: false
checkedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png"
checkedIcon: FontAwesome.minusCircle
uncheckedIcon: FontAwesome.plusCircle
fontAwesomeIcons: true
fontSize: descriptionLine.labelFontSize
iconOnTheLeft: true
Layout.fillWidth: true
@@ -366,12 +361,12 @@ Rectangle {
ColumnLayout {
visible: paymentIdCheckbox.checked
// @TODO: remove after pid removal hardfork
CheckBox {
id: paymentIdCheckbox
border: false
checkedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png"
checkedIcon: FontAwesome.minusCircle
uncheckedIcon: FontAwesome.plusCircle
fontAwesomeIcons: true
fontSize: paymentIdLine.labelFontSize
iconOnTheLeft: true
Layout.fillWidth: true
@@ -393,17 +388,17 @@ Rectangle {
wrapMode: Text.WrapAnywhere
addressValidation: false
visible: paymentIdCheckbox.checked
error: paymentIdCheckbox.checked
}
}
}
MoneroComponents.WarningBox {
// @TODO: remove after pid removal hardfork
id: paymentIdWarningBox
text: qsTr("Long payment IDs are obsolete. \
Long payment IDs were not encrypted on the blockchain and would harm your privacy. \
If the party you're sending to still requires a long payment ID, please notify them.") + translationManager.emptyString;
visible: warningLongPidTransfer || paymentIdCheckbox.checked
visible: paymentIdCheckbox.checked || warningLongPidDescription
}
MoneroComponents.WarningBox {
@@ -434,22 +429,8 @@ Rectangle {
}
}
function checkInformation(amount, address, payment_id, nettype) {
address = address.trim()
payment_id = payment_id.trim()
var amount_ok = amount.length > 0
var address_ok = walletManager.addressValid(address, nettype)
var payment_id_ok = payment_id.length == 0 || (payment_id.length == 64 && walletManager.paymentIdValid(payment_id))
var ipid = walletManager.paymentIdFromAddress(address, nettype)
if (ipid.length > 0 && payment_id.length > 0)
payment_id_ok = false
addressLine.error = !address_ok
amountLine.error = !amount_ok
paymentIdLine.error = !payment_id_ok
return amount_ok && address_ok && payment_id_ok
function checkInformation(amount, address, nettype) {
return amount.length > 0 && walletManager.amountFromString(amountLine.text) <= appWindow.getUnlockedBalance() && TxUtils.checkAddress(address, nettype)
}
} // pageRoot
@@ -495,7 +476,7 @@ Rectangle {
id: saveTxButton
text: qsTr("Create tx file") + translationManager.emptyString
visible: appWindow.viewOnly
enabled: pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype)
enabled: pageRoot.checkInformation(amountLine.text, addressLine.text, appWindow.persistentSettings.nettype)
small: true
onClicked: {
console.log("Transfer: saveTx Clicked")
@@ -548,7 +529,7 @@ Rectangle {
id: importKeyImagesButton
text: qsTr("Import key images") + translationManager.emptyString
small: true
visible: appWindow.viewOnly && walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
visible: appWindow.viewOnly && !persistentSettings.useRemoteNode
enabled: pageRoot.enabled
onClicked: {
console.log("Transfer: import key images clicked")
@@ -700,7 +681,7 @@ Rectangle {
function updateStatus() {
var messageNotConnected = qsTr("Wallet is not connected to daemon.");
if(appWindow.walletMode >= 2) messageNotConnected += root.startLinkText;
if(appWindow.walletMode >= 2 && !persistentSettings.useRemoteNode) messageNotConnected += root.startLinkText;
pageRoot.enabled = true;
if(typeof currentWallet === "undefined") {
root.warningContent = messageNotConnected;
@@ -756,12 +737,13 @@ Rectangle {
// Currently opened wallet is not view-only
if(appWindow.viewOnly){
root.sendButtonWarning = qsTr("Wallet is view-only and sends are not possible.") + translationManager.emptyString;
root.sendButtonWarning = qsTr("Wallet is view-only and sends are not possible. Unless key images are imported, " +
"the balance reflects only incoming but not outgoing transactions.") + translationManager.emptyString;
return false;
}
// There are sufficient unlocked funds available
if(parseFloat(amountLine.text) > parseFloat(middlePanel.unlockedBalanceText)){
if(walletManager.amountFromString(amountLine.text) > appWindow.getUnlockedBalance()){
root.sendButtonWarning = qsTr("Amount is more than unlocked balance.") + translationManager.emptyString;
return false;
}
@@ -771,10 +753,19 @@ Rectangle {
return false;
}
// The transactional information is correct
if(!pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype)){
if(amountLine.text && addressLine.text)
root.sendButtonWarning = qsTr("Transaction information is incorrect.") + translationManager.emptyString;
if (addressLine.text == "") {
return false;
}
// Address is valid
if(!TxUtils.checkAddress(addressLine.text, appWindow.persistentSettings.nettype)){
root.sendButtonWarning = qsTr("Address is invalid.") + translationManager.emptyString;
return false;
}
// Amount is nonzero
if (!amountLine.text || parseFloat(amountLine.text) <= 0) {
root.sendButtonWarning = qsTr("Enter an amount.") + translationManager.emptyString;
return false;
}

View File

@@ -158,7 +158,7 @@ Item {
"<p>It's up to you whether to accept unconfirmed transactions or not. It is likely they'll be " +
"confirmed in short order, but there is still a possibility they might not, so for larger " +
"values you may want to wait for one or more confirmation(s).</p>"
);
) + translationManager.emptyString;
} else if(root.trackingError !== ""){
return root.trackingError;
} else if(trackingModel.count < 1){
@@ -265,7 +265,7 @@ Item {
font.pixelSize: 12
font.bold: false
color: "white"
text: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 12px;}</style>Currently selected address: " + addressLabel + " <a href='#'>(Change)</a>"
text: qsTr("<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 12px;}</style>Currently selected address: ") + addressLabel + qsTr(" <a href='#'>(Change)</a>") + translationManager.emptyString
textFormat: Text.RichText
themeTransition: false
@@ -446,7 +446,7 @@ Item {
font.pixelSize: 14
font.bold: false
color: "white"
text: qsTr("Amount to receive") + " (XMR)"
text: qsTr("Amount to receive") + " (XMR)" + translationManager.emptyString
themeTransition: false
}
@@ -455,7 +455,7 @@ Item {
width: 220
source: "qrc:///images/merchant/input_box.png"
TextField {
MoneroComponents.Input {
id: amountToReceive
topPadding: 0
leftPadding: 10

View File

@@ -83,18 +83,23 @@ ColumnLayout {
State {
name: "Wallet"
PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsWalletView }
PropertyChanges { target: settingsPage; settingsHeight: settingsStateView.settingsWalletView.settingsHeight + 140 }
}, State {
name: "UI"
PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsLayoutView }
PropertyChanges { target: settingsPage; settingsHeight: settingsStateView.settingsLayoutView.layoutHeight + 140 }
}, State {
name: "Node"
PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsNodeView }
PropertyChanges { target: settingsPage; settingsHeight: settingsStateView.settingsNodeView.nodeHeight + 140 }
}, State {
name: "Log"
PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsLogView }
PropertyChanges { target: settingsPage; settingsHeight: settingsStateView.settingsLogView.logHeight + 140 }
}, State {
name: "Info"
PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsInfoView }
PropertyChanges { target: settingsPage; settingsHeight: settingsStateView.settingsInfoView.infoHeight + 140 }
}
]

View File

@@ -39,8 +39,8 @@ import "../../components" as MoneroComponents
Rectangle {
color: "transparent"
height: 1400
Layout.fillWidth: true
property alias infoHeight: infoLayout.height
property string walletModeString: {
if(appWindow.walletMode === 0){
return qsTr("Simple mode") + translationManager.emptyString;
@@ -132,14 +132,21 @@ Rectangle {
MoneroComponents.TextBlock {
Layout.fillWidth: true
Layout.maximumWidth: 360
color: MoneroComponents.Style.dimmedFontColor
font.pixelSize: 14
text: {
var wallet_path = walletPath();
if(isIOS)
wallet_path = moneroAccountsDir + wallet_path;
return wallet_path;
property string walletPath: (isIOS ? moneroAccountsDir : "") + appWindow.walletPath()
text: "\
<style type='text/css'>\
a {cursor:pointer;text-decoration: none; color: #FF6C3C}\
</style>\
<a href='#'>%1</a>".arg(walletPath)
textFormat: Text.RichText
onLinkActivated: oshelper.openContainingFolder(walletPath)
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
@@ -178,7 +185,6 @@ Rectangle {
text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" <a href='#'> (Click to change)</a>") + translationManager.emptyString
onLinkActivated: {
inputDialog.labelText = qsTr("Set a new restore height.\nYou can enter a block height or a date (YYYY-MM-DD):") + translationManager.emptyString;
inputDialog.inputText = currentWallet ? currentWallet.walletCreationHeight : "0";
inputDialog.onAcceptedCallback = function() {
var _restoreHeight;
if (inputDialog.inputText) {
@@ -224,7 +230,7 @@ Rectangle {
appWindow.showStatusMessage(qsTr("Invalid restore height specified. Must be a number or a date formatted YYYY-MM-DD"),3);
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
inputDialog.open(currentWallet ? currentWallet.walletCreationHeight : "0")
}
MouseArea {
@@ -262,7 +268,19 @@ Rectangle {
Layout.fillWidth: true
color: MoneroComponents.Style.dimmedFontColor
font.pixelSize: 14
text: walletLogPath
text: "\
<style type='text/css'>\
a {cursor:pointer;text-decoration: none; color: #FF6C3C}\
</style>\
<a href='#'>%1</a>".arg(walletLogPath)
textFormat: Text.RichText
onLinkActivated: oshelper.openContainingFolder(walletLogPath)
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
Rectangle {

View File

@@ -37,8 +37,8 @@ import "../../components" as MoneroComponents
Rectangle {
color: "transparent"
height: 1400
Layout.fillWidth: true
property alias layoutHeight: settingsUI.height
ColumnLayout {
id: settingsUI
@@ -72,6 +72,7 @@ Rectangle {
id: themeCheckbox
checked: !MoneroComponents.Style.blackTheme
text: qsTr("Light theme") + translationManager.emptyString
toggleOnClick: false
onClicked: {
MoneroComponents.Style.blackTheme = !MoneroComponents.Style.blackTheme;
persistentSettings.blackTheme = MoneroComponents.Style.blackTheme;
@@ -92,7 +93,8 @@ Rectangle {
Layout.leftMargin: 42
spacing: 0
MoneroComponents.TextBlock {
Text {
color: MoneroComponents.Style.defaultFontColor
font.pixelSize: 14
Layout.fillWidth: true
text: {
@@ -141,6 +143,12 @@ Rectangle {
}
onMoved: persistentSettings.lockOnUserInActivityInterval = userInactivitySlider.value;
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
}
}
}

View File

@@ -37,8 +37,8 @@ import "../../components" as MoneroComponents
Rectangle {
property alias consoleArea: consoleArea
color: "transparent"
height: 1400
Layout.fillWidth: true
property alias logHeight: settingsLog.height
ColumnLayout {
id: settingsLog
@@ -150,6 +150,7 @@ Rectangle {
Flickable {
id: flickable
anchors.fill: parent
boundsBehavior: isMac ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
TextArea.flickable: TextArea {
id : consoleArea
@@ -203,7 +204,9 @@ Rectangle {
}
}
ScrollBar.vertical: ScrollBar {}
ScrollBar.vertical: ScrollBar {
onActiveChanged: if (!active && !isMac) active = true
}
}
}

View File

@@ -36,8 +36,8 @@ import "../../components/effects" as MoneroEffects
Rectangle{
color: "transparent"
height: 1400
Layout.fillWidth: true
property alias nodeHeight: root.height
/* main layout */
ColumnLayout {
@@ -50,10 +50,6 @@ Rectangle{
anchors.right: parent.right
spacing: 0
property int labelWidth: 120
property int editWidth: 400
property int lineEditFontSize: 14
property int buttonWidth: 110
Rectangle {
Layout.fillWidth: true
@@ -119,7 +115,7 @@ Rectangle{
text: qsTr("Local node") + translationManager.emptyString
}
TextArea {
Text {
id: localNodeArea
anchors.top: localNodeHeader.bottom
anchors.topMargin: 4
@@ -129,14 +125,11 @@ Rectangle{
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 15
horizontalAlignment: TextInput.AlignLeft
selectByMouse: false
wrapMode: Text.WordWrap;
textMargin: 0
leftPadding: 0
topPadding: 0
text: qsTr("The blockchain is downloaded to your computer. Provides higher security and requires more local storage.") + translationManager.emptyString
width: parent.width - (localNodeIcon.width + localNodeIcon.anchors.leftMargin + anchors.leftMargin)
readOnly: true
// @TODO: Legacy. Remove after Qt 5.8.
// https://stackoverflow.com/questions/41990013
@@ -221,7 +214,7 @@ Rectangle{
text: qsTr("Remote node") + translationManager.emptyString
}
TextArea {
Text {
id: remoteNodeArea
anchors.top: remoteNodeHeader.bottom
anchors.topMargin: 4
@@ -230,16 +223,12 @@ Rectangle{
color: MoneroComponents.Style.dimmedFontColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 15
activeFocusOnPress: false
horizontalAlignment: TextInput.AlignLeft
selectByMouse: false
wrapMode: Text.WordWrap;
textMargin: 0
leftPadding: 0
topPadding: 0
text: qsTr("Uses a third-party server to connect to the Monero network. Less secure, but easier on your computer.") + translationManager.emptyString
width: parent.width - (remoteNodeIcon.width + remoteNodeIcon.anchors.leftMargin + anchors.leftMargin)
readOnly: true
// @TODO: Legacy. Remove after Qt 5.8.
// https://stackoverflow.com/questions/41990013
@@ -253,7 +242,6 @@ Rectangle{
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
persistentSettings.useRemoteNode = true;
appWindow.connectRemoteNode();
}
}

View File

@@ -36,8 +36,8 @@ import "../../components" as MoneroComponents
Rectangle {
color: "transparent"
height: 1400
Layout.fillWidth: true
property alias settingsHeight: settingsWallet.height
ColumnLayout {
id: settingsWallet
@@ -47,312 +47,92 @@ Rectangle {
anchors.right: parent.right
anchors.margins: 20
anchors.topMargin: 0
spacing: 0
spacing: 8
Rectangle {
// divider
Layout.preferredHeight: 1
Layout.fillWidth: true
Layout.bottomMargin: 8
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
MoneroComponents.SettingsListItem {
buttonText: qsTr("Close wallet") + translationManager.emptyString
description: qsTr("Logs out of this wallet.") + translationManager.emptyString
title: qsTr("Close this wallet") + translationManager.emptyString
onClicked: appWindow.showWizard()
}
GridLayout {
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
columnSpacing: 0
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
spacing: 0
MoneroComponents.TextPlain {
Layout.fillWidth: true
Layout.preferredHeight: 20
Layout.topMargin: 8
color: MoneroComponents.Style.defaultFontColor
opacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.8
font.bold: true
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 16
text: qsTr("Close this wallet") + translationManager.emptyString
}
MoneroComponents.TextPlainArea {
color: MoneroComponents.Style.dimmedFontColor
colorBlackTheme: MoneroComponents.Style._b_dimmedFontColor
colorWhiteTheme: MoneroComponents.Style._w_dimmedFontColor
width: parent.width
Layout.fillWidth: true
horizontalAlignment: TextInput.AlignLeft
text: qsTr("Logs out of this wallet.") + translationManager.emptyString
}
}
MoneroComponents.StandardButton {
small: true
text: qsTr("Close wallet") + translationManager.emptyString
onClicked: {
middlePanel.addressBookView.clearFields();
middlePanel.transferView.clearFields();
middlePanel.receiveView.clearFields();
appWindow.showWizard();
}
width: 135
}
}
Rectangle {
// divider
Layout.preferredHeight: 1
Layout.fillWidth: true
Layout.topMargin: 8
Layout.bottomMargin: 8
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
GridLayout {
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
columnSpacing: 0
MoneroComponents.SettingsListItem {
buttonText: qsTr("Create wallet") + translationManager.emptyString
description: qsTr("Creates a new wallet that can only view and initiate transactions, but requires a spendable wallet to sign transactions before sending.") + translationManager.emptyString
title: qsTr("Create a view-only wallet") + translationManager.emptyString
visible: !appWindow.viewOnly
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
spacing: 0
MoneroComponents.TextPlain {
Layout.fillWidth: true
Layout.preferredHeight: 20
Layout.topMargin: 8
color: MoneroComponents.Style.defaultFontColor
opacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.8
font.bold: true
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 16
text: qsTr("Create a view-only wallet") + translationManager.emptyString
}
MoneroComponents.TextPlainArea {
color: MoneroComponents.Style.dimmedFontColor
colorBlackTheme: MoneroComponents.Style._b_dimmedFontColor
colorWhiteTheme: MoneroComponents.Style._w_dimmedFontColor
width: parent.width
Layout.fillWidth: true
horizontalAlignment: TextInput.AlignLeft
text: qsTr("Creates a new wallet that can only view and initiate transactions, but requires a spendable wallet to sign transactions before sending.") + translationManager.emptyString
onClicked: {
var newPath = currentWallet.path + "_viewonly";
if (currentWallet.createViewOnly(newPath, appWindow.walletPassword)) {
console.log("view only wallet created in " + newPath);
informationPopup.title = qsTr("Success") + translationManager.emptyString;
informationPopup.text = qsTr('The view only wallet has been created with the same password as the current wallet. You can open it by closing this current wallet, clicking the "Open wallet from file" option, and selecting the view wallet in: \n%1\nYou can change the password in the wallet settings.').arg(newPath);
informationPopup.open()
informationPopup.onCloseCallback = null
} else {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = currentWallet.errorString;
informationPopup.open()
}
}
}
MoneroComponents.StandardButton {
small: true
text: qsTr("Create wallet") + translationManager.emptyString
onClicked: {
var newPath = currentWallet.path + "_viewonly";
if (currentWallet.createViewOnly(newPath, appWindow.walletPassword)) {
console.log("view only wallet created in " + newPath);
informationPopup.title = qsTr("Success") + translationManager.emptyString;
informationPopup.text = qsTr('The view only wallet has been created with the same password as the current wallet. You can open it by closing this current wallet, clicking the "Open wallet from file" option, and selecting the view wallet in: \n%1\nYou can change the password in the wallet settings.').arg(newPath);
informationPopup.open()
informationPopup.onCloseCallback = null
MoneroComponents.SettingsListItem {
buttonText: qsTr("Show seed") + translationManager.emptyString
description: qsTr("Store this information safely to recover your wallet in the future.") + translationManager.emptyString
title: qsTr("Show seed & keys") + translationManager.emptyString
onClicked: {
Utils.showSeedPage();
}
}
MoneroComponents.SettingsListItem {
buttonText: qsTr("Rescan") + translationManager.emptyString
description: qsTr("Use this feature if you think the shown balance is not accurate.") + translationManager.emptyString
title: qsTr("Rescan wallet balance") + translationManager.emptyString
visible: appWindow.walletMode >= 2
onClicked: {
if (!currentWallet.rescanSpent()) {
console.error("Error: ", currentWallet.errorString);
informationPopup.title = qsTr("Error") + translationManager.emptyString;
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();
}
}
}
MoneroComponents.SettingsListItem {
buttonText: qsTr("Change password") + translationManager.emptyString
description: qsTr("Change the password of your wallet.") + translationManager.emptyString
title: qsTr("Change wallet password") + translationManager.emptyString
onClicked: {
passwordDialog.onAcceptedCallback = function() {
if(appWindow.walletPassword === passwordDialog.password){
passwordDialog.openNewPasswordDialog()
} else {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = currentWallet.errorString;
informationPopup.text = qsTr("Wrong password") + translationManager.emptyString;
informationPopup.open()
informationPopup.onCloseCallback = function() {
passwordDialog.open()
}
}
}
width: 135
}
}
Rectangle {
// divider
visible: !appWindow.viewOnly
Layout.preferredHeight: 1
Layout.fillWidth: true
Layout.topMargin: 8
Layout.bottomMargin: 8
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
GridLayout {
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
columnSpacing: 0
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
spacing: 0
MoneroComponents.TextPlain {
Layout.fillWidth: true
Layout.preferredHeight: 20
Layout.topMargin: 8
color: MoneroComponents.Style.defaultFontColor
opacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.8
font.bold: true
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 16
text: qsTr("Show seed & keys") + translationManager.emptyString
}
MoneroComponents.TextPlainArea {
color: MoneroComponents.Style.dimmedFontColor
colorBlackTheme: MoneroComponents.Style._b_dimmedFontColor
colorWhiteTheme: MoneroComponents.Style._w_dimmedFontColor
width: parent.width
Layout.fillWidth: true
horizontalAlignment: TextInput.AlignLeft
text: qsTr("Store this information safely to recover your wallet in the future.") + translationManager.emptyString
}
}
MoneroComponents.StandardButton {
small: true
text: qsTr("Show seed") + translationManager.emptyString
onClicked: {
Utils.showSeedPage();
}
width: 135
}
}
Rectangle {
// divider
Layout.preferredHeight: 1
Layout.fillWidth: true
Layout.topMargin: 8
Layout.bottomMargin: 8
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
GridLayout {
visible: appWindow.walletMode >= 2
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
columnSpacing: 0
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
spacing: 0
MoneroComponents.TextPlain {
Layout.fillWidth: true
Layout.preferredHeight: 20
Layout.topMargin: 8
color: MoneroComponents.Style.defaultFontColor
opacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.8
font.bold: true
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 16
text: qsTr("Rescan wallet balance") + translationManager.emptyString
}
MoneroComponents.TextPlainArea {
color: MoneroComponents.Style.dimmedFontColor
colorBlackTheme: MoneroComponents.Style._b_dimmedFontColor
colorWhiteTheme: MoneroComponents.Style._w_dimmedFontColor
width: parent.width
Layout.fillWidth: true
horizontalAlignment: TextInput.AlignLeft
text: qsTr("Use this feature if you think the shown balance is not accurate.") + translationManager.emptyString
}
}
MoneroComponents.StandardButton {
small: true
text: qsTr("Rescan") + translationManager.emptyString
onClicked: {
if (!currentWallet.rescanSpent()) {
console.error("Error: ", currentWallet.errorString);
informationPopup.title = qsTr("Error") + translationManager.emptyString;
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();
}
}
width: 135
}
}
Rectangle {
// divider
visible: appWindow.walletMode >= 2
Layout.preferredHeight: 1
Layout.fillWidth: true
Layout.topMargin: 8
Layout.bottomMargin: 8
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
GridLayout {
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
columnSpacing: 0
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
spacing: 0
MoneroComponents.TextPlain {
Layout.fillWidth: true
Layout.preferredHeight: 20
Layout.topMargin: 8
color: MoneroComponents.Style.defaultFontColor
opacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.8
font.bold: true
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 16
text: qsTr("Change wallet password") + translationManager.emptyString
}
MoneroComponents.TextPlainArea {
color: MoneroComponents.Style.dimmedFontColor
colorBlackTheme: MoneroComponents.Style._b_dimmedFontColor
colorWhiteTheme: MoneroComponents.Style._w_dimmedFontColor
width: parent.width
Layout.fillWidth: true
horizontalAlignment: TextInput.AlignLeft
text: qsTr("Change the password of your wallet.") + translationManager.emptyString
}
}
MoneroComponents.StandardButton {
small: true
text: qsTr("Change password") + translationManager.emptyString
onClicked: {
passwordDialog.onAcceptedCallback = function() {
if(appWindow.walletPassword === passwordDialog.password){
passwordDialog.openNewPasswordDialog()
} else {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Wrong password") + translationManager.emptyString;
informationPopup.open()
informationPopup.onCloseCallback = function() {
passwordDialog.open()
}
}
}
passwordDialog.onRejectedCallback = null;
passwordDialog.open()
}
width: 135
passwordDialog.onRejectedCallback = null;
passwordDialog.open()
}
}
}

11
qml.qrc
View File

@@ -7,11 +7,8 @@
<file>images/download-white@2x.png</file>
<file>images/external-link-white.png</file>
<file>images/external-link-white@2x.png</file>
<file>images/minus-white.png</file>
<file>images/minus-white@2x.png</file>
<file>images/plus-white.png</file>
<file>images/plus-white@2x.png</file>
<file>components/Label.qml</file>
<file>components/SettingsListItem.qml</file>
<file>images/whatIsIcon.png</file>
<file>images/whatIsIcon@2x.png</file>
<file>images/lockIcon.png</file>
@@ -21,13 +18,14 @@
<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/Scroll.qml</file>
<file>components/MenuButtonDivider.qml</file>
<file>images/moneroIcon.png</file>
<file>components/StandardDropdown.qml</file>
@@ -104,7 +102,6 @@
<file>pages/Sign.qml</file>
<file>components/DaemonManagerDialog.qml</file>
<file>version.js</file>
<file>components/DaemonConsole.qml</file>
<file>components/QRCodeScanner.qml</file>
<file>components/Notifier.qml</file>
<file>components/TextBlock.qml</file>
@@ -171,8 +168,6 @@
<file>components/WarningBox.qml</file>
<file>images/miningxmr.png</file>
<file>images/miningxmr@2x.png</file>
<file>images/plus-in-circle-medium-white.png</file>
<file>images/plus-in-circle-medium-white@2x.png</file>
<file>pages/merchant/Merchant.qml</file>
<file>pages/merchant/MerchantCheckbox.qml</file>
<file>pages/merchant/MerchantTrackingList.qml</file>

164
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,164 @@
add_subdirectory(QR-Code-generator)
add_subdirectory(QR-Code-scanner)
add_subdirectory(daemon)
add_subdirectory(libwalletqt)
add_subdirectory(model)
add_subdirectory(zxcvbn-c)
qt5_add_resources(RESOURCES ../qml.qrc)
# Compile source files (.h/.cpp)
file(GLOB SOURCE_FILES
"*.h"
"*.cpp"
"main/*.h"
"main/*.cpp"
"libwalletqt/WalletManager.cpp"
"libwalletqt/Wallet.cpp"
"libwalletqt/PendingTransaction.cpp"
"libwalletqt/TransactionHistory.cpp"
"libwalletqt/TransactionInfo.cpp"
"libwalletqt/QRCodeImageProvider.cpp" QR
"QR-Code-generator/BitBuffer.cpp"
"QR-Code-generator/QrCode.cpp"
"QR-Code-generator/QrSegment.cpp"
"libwalletqt/AddressBook.cpp"
"libwalletqt/Subaddress.cpp"
"libwalletqt/SubaddressAccount.cpp"
"libwalletqt/UnsignedTransaction.cpp"
"libwalletqt/WalletManager.h"
"libwalletqt/Wallet.h"
"libwalletqt/PendingTransaction.h"
"libwalletqt/TransactionHistory.h"
"libwalletqt/TransactionInfo.h"
"libwalletqt/QRCodeImageProvider.h"
"QR-Code-generator/BitBuffer.h"
"QR-Code-generator/QrCode.h"
"QR-Code-generator/QrSegment.h"
"libwalletqt/Transfer.h"
"libwalletqt/AddressBook.h"
"libwalletqt/Subaddress.h"
"libwalletqt/SubaddressAccount.h"
"libwalletqt/UnsignedTransaction.h"
"daemon/*.h"
"daemon/*.cpp"
"model/*.h"
"model/*.cpp"
"qt/*.h"
"qt/*.cpp"
)
if(ENABLE_PASS_STRENGTH_METER)
file(GLOB PASS_STRENGTH_FILES
"zxcvbn-c/zxcvbn.h"
"zxcvbn-c/zxcvbn.c"
)
endif()
if(WITH_SCANNER)
file(GLOB QR_CODE_FILES
"QR-Code-generator/*.h"
"QR-Code-generator/*.cpp"
"QR-Code-scanner/*.h"
"QR-Code-scanner/*.cpp"
)
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}\"")
add_custom_command(OUTPUT ${ICON_RES} COMMAND windres ${ICON_RC} ${ICON_RES} MAIN_DEPENDENCY ${ICON_RC})
list(APPEND RESOURCES ${ICON_RES})
endif()
add_executable(monero-gui ${EXECUTABLE_FLAG} main/main.cpp
${SOURCE_FILES}
${PASS_STRENGTH_FILES}
${QR_CODE_FILES}
${RESOURCES}
)
set_property(TARGET monero-gui PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# OpenGL
target_include_directories(monero-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-gui PUBLIC ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
file(GLOB_RECURSE SRC_SOURCES *.cpp)
file(GLOB_RECURSE SRC_HEADERS *.h)
target_include_directories(monero-gui PUBLIC
${CMAKE_SOURCE_DIR}/monero/include
${CMAKE_SOURCE_DIR}/monero/src
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/daemon
${CMAKE_CURRENT_SOURCE_DIR}/libwalletqt
${CMAKE_CURRENT_SOURCE_DIR}/model
${CMAKE_CURRENT_SOURCE_DIR}/QR-Code-generator
${CMAKE_CURRENT_SOURCE_DIR}/QR-Code-scanner
${CMAKE_CURRENT_SOURCE_DIR}/zxcvbn-c
${LibUSB_INCLUDE_DIRS}
${HIDAPI_INCLUDE_DIRS}
${X11_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${ZBAR_INCLUDE_DIR}
)
target_compile_definitions(monero-gui
PUBLIC
${Qt5Widgets_DEFINITIONS}
${Qt5Qml_DEFINITIONS}
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
if(X11_FOUND)
target_link_libraries(monero-gui ${X11_LIBRARIES} pthread dl Xt xcb X11)
endif()
if(DEVICE_TREZOR_READY)
target_link_libraries(monero-gui ${TREZOR_DEP_LIBS})
endif()
target_link_libraries(monero-gui
${CMAKE_BINARY_DIR}/lib/libwallet_merged.a
${LMDB_LIBRARY}
${CMAKE_BINARY_DIR}/monero/contrib/epee/src/libepee.a
${CMAKE_BINARY_DIR}/monero/external/unbound/libunbound.a
${SODIUM_LIBRARY}
${CMAKE_BINARY_DIR}/monero/external/easylogging++/libeasylogging.a
${CMAKE_BINARY_DIR}/monero/src/blockchain_db/libblockchain_db.a
${CMAKE_BINARY_DIR}/monero/external/randomx/librandomx.a
${CMAKE_BINARY_DIR}/monero/src/hardforks/libhardforks.a
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${CMAKE_DL_LIBS}
${LibUSB_LIBRARIES}
${HIDAPI_LIBRARIES}
${QT5_LIBRARIES}
${EXTRA_LIBRARIES}
${ICU_LIBRARIES}
)
if(WITH_SCANNER)
target_link_libraries(monero-gui
${ZBAR_LIBRARIES}
jpeg
v4l2
v4lconvert
rt
)
endif()
install(TARGETS monero-gui
DESTINATION ${CMAKE_INSTALL_PREFIX}
)

View File

@@ -0,0 +1,4 @@
file(GLOB_RECURSE SRC_SOURCES *.cpp)
file(GLOB_RECURSE SRC_HEADERS *.h)

View File

@@ -0,0 +1,4 @@
file(GLOB_RECURSE SRC_SOURCES *.cpp)
file(GLOB_RECURSE SRC_HEADERS *.h)

View File

@@ -0,0 +1,4 @@
file(GLOB_RECURSE SRC_SOURCES *.cpp)
file(GLOB_RECURSE SRC_HEADERS *.h)

View File

@@ -43,7 +43,7 @@
#include <QMap>
namespace {
static const int DAEMON_START_TIMEOUT_SECONDS = 60;
static const int DAEMON_START_TIMEOUT_SECONDS = 120;
}
DaemonManager * DaemonManager::m_instance = nullptr;

View File

@@ -0,0 +1,4 @@
file(GLOB_RECURSE SRC_SOURCES *.cpp)
file(GLOB_RECURSE SRC_HEADERS *.h)

View File

@@ -36,49 +36,58 @@ Subaddress::Subaddress(Monero::Subaddress *subaddressImpl, QObject *parent)
getAll();
}
QList<Monero::SubaddressRow*> Subaddress::getAll(bool update) const
void Subaddress::getAll() const
{
qDebug(__FUNCTION__);
emit refreshStarted();
if(update)
m_rows.clear();
{
QWriteLocker locker(&m_lock);
if (m_rows.empty()){
m_rows.clear();
for (auto &row: m_subaddressImpl->getAll()) {
m_rows.append(row);
}
}
emit refreshFinished();
return m_rows;
}
Monero::SubaddressRow * Subaddress::getRow(int index) const
bool Subaddress::getRow(int index, std::function<void (Monero::SubaddressRow &row)> callback) const
{
return m_rows.at(index);
QReadLocker locker(&m_lock);
if (index < 0 || index >= m_rows.size())
{
return false;
}
callback(*m_rows.value(index));
return true;
}
void Subaddress::addRow(quint32 accountIndex, const QString &label) const
{
m_subaddressImpl->addRow(accountIndex, label.toStdString());
getAll(true);
getAll();
}
void Subaddress::setLabel(quint32 accountIndex, quint32 addressIndex, const QString &label) const
{
m_subaddressImpl->setLabel(accountIndex, addressIndex, label.toStdString());
getAll(true);
getAll();
}
void Subaddress::refresh(quint32 accountIndex) const
{
m_subaddressImpl->refresh(accountIndex);
getAll(true);
getAll();
}
quint64 Subaddress::count() const
{
QReadLocker locker(&m_lock);
return m_rows.size();
}

View File

@@ -29,7 +29,10 @@
#ifndef SUBADDRESS_H
#define SUBADDRESS_H
#include <functional>
#include <wallet/api/wallet2_api.h>
#include <QReadWriteLock>
#include <QObject>
#include <QList>
#include <QDateTime>
@@ -38,8 +41,8 @@ class Subaddress : public QObject
{
Q_OBJECT
public:
Q_INVOKABLE QList<Monero::SubaddressRow*> getAll(bool update = false) const;
Q_INVOKABLE Monero::SubaddressRow * getRow(int index) const;
Q_INVOKABLE void getAll() const;
Q_INVOKABLE bool getRow(int index, std::function<void (Monero::SubaddressRow &row)> callback) const;
Q_INVOKABLE void addRow(quint32 accountIndex, const QString &label) const;
Q_INVOKABLE void setLabel(quint32 accountIndex, quint32 addressIndex, const QString &label) const;
Q_INVOKABLE void refresh(quint32 accountIndex) const;
@@ -54,6 +57,7 @@ public slots:
private:
explicit Subaddress(Monero::Subaddress * subaddressImpl, QObject *parent);
friend class Wallet;
mutable QReadWriteLock m_lock;
Monero::Subaddress * m_subaddressImpl;
mutable QList<Monero::SubaddressRow*> m_rows;
};

View File

@@ -36,49 +36,57 @@ SubaddressAccount::SubaddressAccount(Monero::SubaddressAccount *subaddressAccoun
getAll();
}
QList<Monero::SubaddressAccountRow*> SubaddressAccount::getAll(bool update) const
void SubaddressAccount::getAll() const
{
qDebug(__FUNCTION__);
emit refreshStarted();
if(update)
{
QWriteLocker locker(&m_lock);
m_rows.clear();
if (m_rows.empty()){
for (auto &row: m_subaddressAccountImpl->getAll()) {
m_rows.append(row);
}
}
emit refreshFinished();
return m_rows;
}
Monero::SubaddressAccountRow * SubaddressAccount::getRow(int index) const
bool SubaddressAccount::getRow(int index, std::function<void (Monero::SubaddressAccountRow &)> callback) const
{
return m_rows.at(index);
QReadLocker locker(&m_lock);
if (index < 0 || index >= m_rows.size())
{
return false;
}
callback(*m_rows.value(index));
return true;
}
void SubaddressAccount::addRow(const QString &label) const
{
m_subaddressAccountImpl->addRow(label.toStdString());
getAll(true);
getAll();
}
void SubaddressAccount::setLabel(quint32 accountIndex, const QString &label) const
{
m_subaddressAccountImpl->setLabel(accountIndex, label.toStdString());
getAll(true);
getAll();
}
void SubaddressAccount::refresh() const
{
m_subaddressAccountImpl->refresh();
getAll(true);
getAll();
}
quint64 SubaddressAccount::count() const
{
QReadLocker locker(&m_lock);
return m_rows.size();
}

View File

@@ -29,8 +29,11 @@
#ifndef SUBADDRESSACCOUNT_H
#define SUBADDRESSACCOUNT_H
#include <functional>
#include <wallet/api/wallet2_api.h>
#include <QObject>
#include <QReadWriteLock>
#include <QList>
#include <QDateTime>
@@ -38,8 +41,8 @@ class SubaddressAccount : public QObject
{
Q_OBJECT
public:
Q_INVOKABLE QList<Monero::SubaddressAccountRow*> getAll(bool update = false) const;
Q_INVOKABLE Monero::SubaddressAccountRow * getRow(int index) const;
Q_INVOKABLE void getAll() const;
Q_INVOKABLE bool getRow(int index, std::function<void (Monero::SubaddressAccountRow &)> callback) const;
Q_INVOKABLE void addRow(const QString &label) const;
Q_INVOKABLE void setLabel(quint32 accountIndex, const QString &label) const;
Q_INVOKABLE void refresh() const;
@@ -54,6 +57,7 @@ public slots:
private:
explicit SubaddressAccount(Monero::SubaddressAccount * subaddressAccountImpl, QObject *parent);
friend class Wallet;
mutable QReadWriteLock m_lock;
Monero::SubaddressAccount * m_subaddressAccountImpl;
mutable QList<Monero::SubaddressAccountRow*> m_rows;
};

View File

@@ -32,17 +32,22 @@
#include <QFile>
#include <QDebug>
#include <QReadLocker>
#include <QWriteLocker>
TransactionInfo *TransactionHistory::transaction(int index)
bool TransactionHistory::transaction(int index, std::function<void (TransactionInfo &)> callback)
{
QReadLocker locker(&m_lock);
if (index < 0 || index >= m_tinfo.size()) {
qCritical("%s: no transaction info for index %d", __FUNCTION__, index);
qCritical("%s: there's %d transactions in backend", __FUNCTION__, m_pimpl->count());
return nullptr;
return false;
}
return m_tinfo.at(index);
callback(*m_tinfo.value(index));
return true;
}
//// XXX: not sure if this method really needed;
@@ -51,43 +56,50 @@ TransactionInfo *TransactionHistory::transaction(int index)
// return nullptr;
//}
QList<TransactionInfo *> TransactionHistory::getAll(quint32 accountIndex) const
void TransactionHistory::refresh(quint32 accountIndex)
{
// XXX this invalidates previously saved history that might be used by model
emit refreshStarted();
qDeleteAll(m_tinfo);
m_tinfo.clear();
QDateTime firstDateTime = QDateTime(QDate(2014, 4, 18)); // the genesis block
QDateTime lastDateTime = QDateTime::currentDateTime().addDays(1); // tomorrow (guard against jitter and timezones)
quint64 lastTxHeight = 0;
m_locked = false;
m_minutesToUnlock = 0;
TransactionHistory * parent = const_cast<TransactionHistory*>(this);
for (const auto i : m_pimpl->getAll()) {
TransactionInfo * ti = new TransactionInfo(i, parent);
if (ti->subaddrAccount() != accountIndex) {
delete ti;
continue;
}
m_tinfo.append(ti);
// looking for transactions timestamp scope
if (ti->timestamp() >= lastDateTime) {
lastDateTime = ti->timestamp();
}
if (ti->timestamp() <= firstDateTime) {
firstDateTime = ti->timestamp();
}
quint64 requiredConfirmations = (ti->blockHeight() < ti->unlockTime()) ? ti->unlockTime() - ti->blockHeight() : 10;
// store last tx height
if (ti->confirmations() < requiredConfirmations && ti->blockHeight() >= lastTxHeight) {
lastTxHeight = ti->blockHeight();
// TODO: Fetch block time and confirmations needed from wallet2?
m_minutesToUnlock = (requiredConfirmations - ti->confirmations()) * 2;
m_locked = true;
}
emit refreshStarted();
{
QWriteLocker locker(&m_lock);
qDeleteAll(m_tinfo);
m_tinfo.clear();
quint64 lastTxHeight = 0;
m_locked = false;
m_minutesToUnlock = 0;
m_pimpl->refresh();
for (const auto i : m_pimpl->getAll()) {
if (i->subaddrAccount() != accountIndex) {
continue;
}
m_tinfo.append(new TransactionInfo(i, this));
const TransactionInfo *ti = m_tinfo.back();
// looking for transactions timestamp scope
if (ti->timestamp() >= lastDateTime) {
lastDateTime = ti->timestamp();
}
if (ti->timestamp() <= firstDateTime) {
firstDateTime = ti->timestamp();
}
quint64 requiredConfirmations = (ti->blockHeight() < ti->unlockTime()) ? ti->unlockTime() - ti->blockHeight() : 10;
// store last tx height
if (ti->confirmations() < requiredConfirmations && ti->blockHeight() >= lastTxHeight) {
lastTxHeight = ti->blockHeight();
// TODO: Fetch block time and confirmations needed from wallet2?
m_minutesToUnlock = (requiredConfirmations - ti->confirmations()) * 2;
m_locked = true;
}
}
}
emit refreshFinished();
if (m_firstDateTime != firstDateTime) {
@@ -98,20 +110,12 @@ QList<TransactionInfo *> TransactionHistory::getAll(quint32 accountIndex) const
m_lastDateTime = lastDateTime;
emit lastDateTimeChanged();
}
return m_tinfo;
}
void TransactionHistory::refresh(quint32 accountIndex)
{
// rebuilding transaction list in wallet_api;
m_pimpl->refresh();
// copying list here and keep track on every item to avoid memleaks
getAll(accountIndex);
}
quint64 TransactionHistory::count() const
{
QReadLocker locker(&m_lock);
return m_tinfo.count();
}
@@ -145,11 +149,6 @@ TransactionHistory::TransactionHistory(Monero::TransactionHistory *pimpl, QObjec
QString TransactionHistory::writeCSV(quint32 accountIndex, QString out)
{
QList<TransactionInfo *> history = this->getAll(accountIndex);
if(history.count() < 1){
return QString("");
}
// construct filename
qint64 now = QDateTime::currentDateTime().currentMSecsSinceEpoch();
QString fn = QString(QString("%1/monero-txs_%2.csv").arg(out, QString::number(now / 1000)));
@@ -164,15 +163,21 @@ QString TransactionHistory::writeCSV(quint32 accountIndex, QString out)
QTextStream output(&data);
output << "blockHeight,epoch,date,direction,amount,atomicAmount,fee,txid,label,subaddrAccount,paymentId\n";
foreach(const TransactionInfo *info, history)
{
QReadLocker locker(&m_lock);
for (const auto &tx : m_pimpl->getAll()) {
if (tx->subaddrAccount() != accountIndex) {
continue;
}
TransactionInfo info(tx, this);
// collect column data
double amount = info->amount();
quint64 atomicAmount = info->atomicAmount();
quint32 subaddrAccount = info->subaddrAccount();
QString fee = info->fee();
double amount = info.amount();
quint64 atomicAmount = info.atomicAmount();
quint32 subaddrAccount = info.subaddrAccount();
QString fee = info.fee();
QString direction = QString("");
TransactionInfo::Direction _direction = info->direction();
TransactionInfo::Direction _direction = info.direction();
if(_direction == TransactionInfo::Direction_In)
{
direction = QString("in");
@@ -183,14 +188,14 @@ QString TransactionHistory::writeCSV(quint32 accountIndex, QString out)
else {
continue; // skip TransactionInfo::Direction_Both
}
QString label = info->label();
QString label = info.label();
label.remove(QChar('"')); // reserved
quint64 blockHeight = info->blockHeight();
QDateTime timeStamp = info->timestamp();
QString date = info->date() + " " + info->time();
quint64 blockHeight = info.blockHeight();
QDateTime timeStamp = info.timestamp();
QString date = info.date() + " " + info.time();
uint epoch = timeStamp.toTime_t();
QString displayAmount = info->displayAmount();
QString paymentId = info->paymentId();
QString displayAmount = info.displayAmount();
QString paymentId = info.paymentId();
if(paymentId == "0000000000000000"){
paymentId = "";
}
@@ -199,7 +204,7 @@ QString TransactionHistory::writeCSV(quint32 accountIndex, QString out)
QString line = QString("%1,%2,%3,%4,%5,%6,%7,%8,\"%9\",%10,%11\n")
.arg(QString::number(blockHeight), QString::number(epoch), date)
.arg(direction, QString::number(amount), QString::number(atomicAmount))
.arg(info->fee(), info->hash(), label, QString::number(subaddrAccount))
.arg(info.fee(), info.hash(), label, QString::number(subaddrAccount))
.arg(paymentId);
output << line;
}

View File

@@ -29,8 +29,11 @@
#ifndef TRANSACTIONHISTORY_H
#define TRANSACTIONHISTORY_H
#include <functional>
#include <QObject>
#include <QList>
#include <QReadWriteLock>
#include <QDateTime>
namespace Monero {
@@ -49,9 +52,8 @@ class TransactionHistory : public QObject
Q_PROPERTY(bool locked READ locked)
public:
Q_INVOKABLE TransactionInfo *transaction(int index);
Q_INVOKABLE bool transaction(int index, std::function<void (TransactionInfo &)> callback);
// Q_INVOKABLE TransactionInfo * transaction(const QString &id);
Q_INVOKABLE QList<TransactionInfo*> getAll(quint32 accountIndex) const;
Q_INVOKABLE void refresh(quint32 accountIndex);
Q_INVOKABLE QString writeCSV(quint32 accountIndex, QString out);
quint64 count() const;
@@ -74,6 +76,7 @@ private:
private:
friend class Wallet;
mutable QReadWriteLock m_lock;
Monero::TransactionHistory * m_pimpl;
mutable QList<TransactionInfo*> m_tinfo;
mutable QDateTime m_firstDateTime;

View File

@@ -34,85 +34,81 @@
TransactionInfo::Direction TransactionInfo::direction() const
{
return static_cast<Direction>(m_pimpl->direction());
return m_direction;
}
bool TransactionInfo::isPending() const
{
return m_pimpl->isPending();
return m_pending;
}
bool TransactionInfo::isFailed() const
{
return m_pimpl->isFailed();
return m_failed;
}
double TransactionInfo::amount() const
{
// there's no unsigned uint64 for JS, so better use double
return WalletManager::instance()->displayAmount(m_pimpl->amount()).toDouble();
return displayAmount().toDouble();
}
quint64 TransactionInfo::atomicAmount() const
{
return m_pimpl->amount();
return m_amount;
}
QString TransactionInfo::displayAmount() const
{
return WalletManager::instance()->displayAmount(m_pimpl->amount());
return WalletManager::instance()->displayAmount(m_amount);
}
QString TransactionInfo::fee() const
{
if(m_pimpl->fee() == 0)
if(m_fee == 0)
return "";
return WalletManager::instance()->displayAmount(m_pimpl->fee());
return WalletManager::instance()->displayAmount(m_fee);
}
quint64 TransactionInfo::blockHeight() const
{
return m_pimpl->blockHeight();
return m_blockHeight;
}
QSet<quint32> TransactionInfo::subaddrIndex() const
{
QSet<quint32> result;
for (uint32_t i : m_pimpl->subaddrIndex())
result.insert(i);
return result;
return m_subaddrIndex;
}
quint32 TransactionInfo::subaddrAccount() const
{
return m_pimpl->subaddrAccount();
return m_subaddrAccount;
}
QString TransactionInfo::label() const
{
return QString::fromStdString(m_pimpl->label());
return m_label;
}
quint64 TransactionInfo::confirmations() const
{
return m_pimpl->confirmations();
return m_confirmations;
}
quint64 TransactionInfo::unlockTime() const
{
return m_pimpl->unlockTime();
return m_unlockTime;
}
QString TransactionInfo::hash() const
{
return QString::fromStdString(m_pimpl->hash());
return m_hash;
}
QDateTime TransactionInfo::timestamp() const
{
QDateTime result = QDateTime::fromTime_t(m_pimpl->timestamp());
return result;
return m_timestamp;
}
QString TransactionInfo::date() const
@@ -127,13 +123,13 @@ QString TransactionInfo::time() const
QString TransactionInfo::paymentId() const
{
return QString::fromStdString(m_pimpl->paymentId());
return m_paymentId;
}
QString TransactionInfo::destinations_formatted() const
{
QString destinations;
for (auto const& t: transfers()) {
for (auto const& t: m_transfers) {
if (!destinations.isEmpty())
destinations += "<br> ";
destinations += WalletManager::instance()->displayAmount(t->amount()) + ": " + t->address();
@@ -141,22 +137,29 @@ QString TransactionInfo::destinations_formatted() const
return destinations;
}
QList<Transfer*> TransactionInfo::transfers() const
TransactionInfo::TransactionInfo(const Monero::TransactionInfo *pimpl, QObject *parent)
: QObject(parent)
, m_amount(pimpl->amount())
, m_blockHeight(pimpl->blockHeight())
, m_confirmations(pimpl->confirmations())
, m_direction(static_cast<Direction>(pimpl->direction()))
, m_failed(pimpl->isFailed())
, m_fee(pimpl->fee())
, m_hash(QString::fromStdString(pimpl->hash()))
, m_label(QString::fromStdString(pimpl->label()))
, m_paymentId(QString::fromStdString(pimpl->paymentId()))
, m_pending(pimpl->isPending())
, m_subaddrAccount(pimpl->subaddrAccount())
, m_timestamp(QDateTime::fromTime_t(pimpl->timestamp()))
, m_unlockTime(pimpl->unlockTime())
{
if (!m_transfers.isEmpty()) {
return m_transfers;
}
for(auto const& t: m_pimpl->transfers()) {
TransactionInfo * parent = const_cast<TransactionInfo*>(this);
Transfer * transfer = new Transfer(t.amount, QString::fromStdString(t.address), parent);
for (auto const &t: pimpl->transfers())
{
Transfer *transfer = new Transfer(t.amount, QString::fromStdString(t.address), this);
m_transfers.append(transfer);
}
return m_transfers;
}
TransactionInfo::TransactionInfo(Monero::TransactionInfo *pimpl, QObject *parent)
: QObject(parent), m_pimpl(pimpl)
{
for (uint32_t i : pimpl->subaddrIndex())
{
m_subaddrIndex.insert(i);
}
}

View File

@@ -90,18 +90,25 @@ public:
//! only applicable for output transactions
//! used in tx details popup
QString destinations_formatted() const;
//! Could be useful later when addressbook is implemented
Q_INVOKABLE QList<Transfer*> transfers() const;
private:
explicit TransactionInfo(Monero::TransactionInfo * pimpl, QObject *parent = 0);
explicit TransactionInfo(const Monero::TransactionInfo *pimpl, QObject *parent = 0);
private:
friend class TransactionHistory;
Monero::TransactionInfo * m_pimpl;
mutable QList<Transfer*> m_transfers;
quint64 m_amount;
quint64 m_blockHeight;
quint64 m_confirmations;
Direction m_direction;
bool m_failed;
quint64 m_fee;
QString m_hash;
QString m_label;
QString m_paymentId;
bool m_pending;
quint32 m_subaddrAccount;
QSet<quint32> m_subaddrIndex;
QDateTime m_timestamp;
quint64 m_unlockTime;
};
// in order to wrap it to QVariant
Q_DECLARE_METATYPE(TransactionInfo*)
#endif // TRANSACTIONINFO_H

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