Compare commits

..
129 Commits
Author SHA1 Message Date
tobtoht eab5145f34 Merge pull request 'Fix: exchange tab hide/show' (#263) from tobtoht/feather:fix_exchange_tab into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/263
2020-12-25 22:19:46 +00:00
tobtoht a2c7245e46 Fix: exchange tab hide/show 2020-12-25 23:18:40 +01:00
tobtoht 4aa57f2684 Merge pull request 'Build: prepare beta-3' (#262) from tobtoht/feather:beta-3 into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/262
2020-12-25 21:37:49 +00:00
tobtoht d8625fdb29 Merge pull request 'Settings: allow changing default wallet directory' (#261) from tobtoht/feather:wizard_reset_restore_page into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/261
2020-12-25 21:37:26 +00:00
tobtoht 207180396f Build: prepare beta-3 2020-12-25 22:36:44 +01:00
tobtoht b544e6dfce Settings: allow changing default wallet directory 2020-12-25 22:07:48 +01:00
tobtoht bc2cac672a Merge pull request 'Wizard: reset restore page on initialize' (#260) from tobtoht/feather:wizard_reset_restore_page into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/260
2020-12-25 15:36:57 +00:00
tobtoht 6003ffebec Wizard: reset restore page on initialize 2020-12-25 16:28:50 +01:00
tobtoht 51b3781c09 Merge pull request 'Don't use unsigned ints' (#257) from tobtoht/feather:no_unsigned_ints into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/257
2020-12-25 14:44:48 +00:00
tobtoht 14e3422423 Don't use unsigned ints 2020-12-25 15:38:44 +01:00
tobtoht 0e5ab21205 Merge pull request 'BalanceDialog' (#259) from tobtoht/feather:balance_dialogg into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/259
2020-12-25 14:22:16 +00:00
tobtoht a11dc3f4b2 BalanceDialog 2020-12-25 15:20:39 +01:00
tobtoht f5255440e4 Merge pull request 'Status: constructing transaction' (#258) from tobtoht/feather:constructing_tx into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/258
2020-12-25 14:16:58 +00:00
tobtoht 0dc196e76d Status: constructing transaction 2020-12-24 15:46:56 +01:00
tobtoht 136f877778 Merge pull request 'TickerWidget: minor cleanup' (#256) from tobtoht/feather:ticker_clean into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/256
2020-12-24 12:52:13 +00:00
tobtoht 3b7731d44f Merge pull request 'Utils: improve bytes formatting' (#255) from tobtoht/feather:bytes_formatting into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/255
2020-12-24 12:52:01 +00:00
tobtoht b51e1f3b0c Merge pull request 'Contacts: disallow duplicates' (#254) from tobtoht/feather:contacts_duplicates into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/254
2020-12-24 12:51:46 +00:00
tobtoht ae3c214c3f TickerWidget: minor cleanup 2020-12-24 13:50:20 +01:00
tobtoht 200f16ecf2 Utils: improve bytes formatting 2020-12-24 13:21:06 +01:00
tobtoht ecd840c03a Contacts: disallow duplicates 2020-12-23 05:59:06 +01:00
tobtoht 7092116efd Merge pull request 'Wizard: autoselect open if wallets available & refresh wallets when wizard opened' (#253) from tobtoht/feather:wizard_open_refresh into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/253
2020-12-23 03:00:31 +00:00
tobtoht 68c493b736 Wizard: autoselect open if wallets available & refresh wallets when wizard opened 2020-12-23 03:57:01 +01:00
tobtoht 4f62d52e5e Merge pull request 'Nodes: double click to connect' (#251) from tobtoht/feather:nodes_doubleclick into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/251
2020-12-23 01:44:19 +00:00
tobtoht c8be1e4966 Merge pull request 'Status: fix negative blocks remaining' (#252) from tobtoht/feather:status_blocks_remaining into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/252
2020-12-23 01:44:00 +00:00
tobtoht c964cd5349 Status: fix negative blocks remaining 2020-12-23 02:42:22 +01:00
tobtoht 3fbf58f64d Nodes: double click to connect 2020-12-23 02:23:26 +01:00
tobtoht bd4400a7f2 Merge pull request 'Send: Show error when no connecting to daemon' (#250) from tobtoht/feather:send_no_daemon into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/250
2020-12-22 23:53:37 +00:00
tobtoht c0e4d48fae Send: Show error when no connecting to daemon 2020-12-23 00:46:42 +01:00
tobtoht 8668f2beb2 Merge pull request 'Send: re-enable send button on wallet close' (#248) from tobtoht/feather:send_reenable_wallet_close into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/248
2020-12-22 23:34:07 +00:00
tobtoht 628da207d0 Merge pull request 'History: don't allow rebroadcasting incoming transaction' (#249) from tobtoht/feather:send_rebroadcast_incoming into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/249
2020-12-22 23:33:54 +00:00
tobtoht 677f7df376 History: don't allow rebroadcasting incoming transaction 2020-12-23 00:33:24 +01:00
tobtoht 580675e8a0 Send: re-enable send button on wallet close 2020-12-23 00:24:10 +01:00
tobtoht 900a9b3fac Merge pull request 'Websocket: keep connection alive' (#247) from tobtoht/feather:websocket_keepalive into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/247
2020-12-22 23:11:56 +00:00
tobtoht f8f1e824a1 Merge pull request 'CSSWidget: don't filter funded proposals' (#246) from tobtoht/feather:ccs_no_filter into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/246
2020-12-22 23:11:27 +00:00
tobtoht 441c32bc30 Merge pull request 'Nodes: force reconnect when new wallet is opened' (#245) from tobtoht/feather:nodes_force_reconnect into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/245
2020-12-22 23:11:18 +00:00
tobtoht 41a0fb3b10 Websocket: keep connection alive 2020-12-23 00:08:17 +01:00
tobtoht a38912a348 CSSWidget: don't filter funded proposals 2020-12-22 20:54:30 +01:00
tobtoht d568e4e1b6 Nodes: force reconnect when new wallet is opened 2020-12-22 02:13:24 +01:00
tobtoht 12849c8571 Merge pull request 'Libwalletqt: don't inherit subaddress account from GUI' (#243) from tobtoht/feather:switch_to_primary into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/243
2020-12-22 00:10:13 +00:00
tobtoht f7fb051b67 Libwalletqt: don't inherit subaddress account from GUI 2020-12-22 01:07:39 +01:00
tobtoht 693a6bc0df Merge pull request 'DebugInfoDialog: Add entry to show if wallet only contains funds in primary account' (#242) from tobtoht/feather:balance_accounts into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/242
2020-12-20 14:25:46 +00:00
tobtoht ccd19edf2f Merge pull request 'Remove MorphToken, reason: Tor block' (#237) from tobtoht/feather:into_the_trash_it_goes into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/237
2020-12-20 14:25:11 +00:00
tobtoht f2f6bf30b3 DebugInfoDialog: Add entry to show if wallet only contains funds in primary account 2020-12-20 03:10:00 +01:00
tobtoht 45b3f1ebde Merge pull request 'Update banner' (#239) from tobtoht/feather:banner into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/239
2020-12-19 00:10:28 +00:00
tobtoht b4af2f75b1 Update banner 2020-12-19 01:09:03 +01:00
tobtoht fdabaf3374 Merge pull request 'Remove non-breaking space from currency strings' (#236) from tobtoht/feather:currencystring_nonbreaking into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/236
2020-12-18 23:32:07 +00:00
tobtoht 2e481507e8 Remove non-breaking space from currency strings 2020-12-19 00:29:22 +01:00
tobtoht 9b4e0e29e4 Merge pull request 'Wizard: Clean up open wallet UI' (#241) from tobtoht/feather:open_wallet_clean into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/241
2020-12-18 23:25:57 +00:00
tobtoht 80bd8e085d Merge pull request 'Store wallet immediately upon finishing sync' (#240) from tobtoht/feather:store_sync into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/240
2020-12-18 23:25:09 +00:00
tobtoht 7d2748c0bc Merge pull request 'ExternalLinkWarning: don't show Tor warning on Tails/Whonix' (#235) from tobtoht/feather:link_warning_tailswhonix into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/235
2020-12-18 23:24:41 +00:00
tobtoht 2c0b04559e Merge pull request 'TxConfDialog: Justify amounts' (#234) from tobtoht/feather:txconf_justify_amounts into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/234
2020-12-18 23:24:14 +00:00
tobtoht 4476741ace Wizard: Sort wallets by modified date 2020-12-19 00:13:33 +01:00
tobtoht 68f8be01ac Wizard: don't show stagenet wallet in mainnet mode 2020-12-18 23:39:27 +01:00
tobtoht d84ee4692d Store wallet immediately upon finishing sync 2020-12-18 23:07:27 +01:00
tobtoht a0fe51f318 Remove MorphToken, reason: Tor block 2020-12-17 03:57:43 +01:00
tobtoht 70810ce6a2 ExternalLinkWarning: don't show Tor warning on Tails/Whonix 2020-12-16 18:02:49 +01:00
tobtoht f75d1f546b TxConfDialog: Justify amounts 2020-12-16 17:31:25 +01:00
tobtoht 6c8255b12b Merge pull request 'Home: wrap text in tables' (#227) from tobtoht/feather:home_widget_wrap into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/227
2020-12-16 15:32:37 +00:00
tobtoht f39cdb393f Merge pull request 'TxInfoDialog: use frame to bundle destinations widgets' (#231) from tobtoht/feather:txinfo_destination_frame into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/231
2020-12-16 15:32:22 +00:00
tobtoht d4fda0f5f3 Merge pull request 'Statusbar: block remaining instead of absolute values' (#229) from tobtoht/feather:block_remaining into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/229
2020-12-16 15:32:11 +00:00
tobtoht 9afefa75a0 Merge pull request 'Wizard: improve title' (#228) from tobtoht/feather:welcome_to_feather into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/228
2020-12-16 15:31:56 +00:00
tobtoht 32c21ae81b Merge pull request 'DebugInfoDialog: cleanup ws status message' (#230) from tobtoht/feather:debuginfo_ws_status into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/230
2020-12-16 15:31:39 +00:00
tobtoht ca1c2fa5ba Merge pull request 'TxProofWidget: add help labels for proofs' (#232) from tobtoht/feather:txproofwidget_help_labels into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/232
2020-12-16 15:31:17 +00:00
tobtoht 6619927a7d Merge pull request 'Send: add help labels' (#233) from tobtoht/feather:send_help_labels into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/233
2020-12-16 15:31:00 +00:00
tobtoht e805dd04cb Send: add help labels 2020-12-16 16:29:52 +01:00
tobtoht dbc3bed669 TxProofWidget: add help labels for proofs 2020-12-16 15:55:04 +01:00
tobtoht 55aab1683f TxInfoDialog: use frame to bundle destinations widgets 2020-12-16 15:37:20 +01:00
tobtoht 33978bda4f Merge pull request 'Apply currency formatting to fiat column in transaction history' (#226) from blasty/feather:history_currencyformat into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/226
2020-12-16 14:13:51 +00:00
blasty 4c9ece5025 Apply currency formatting to fiat column in transaction history 2020-12-16 10:53:41 +01:00
tobtoht a984d64add Home: wrap text in tables 2020-12-16 04:40:32 +01:00
tobtoht cb95e89773 Wizard: improve title 2020-12-16 04:18:42 +01:00
tobtoht f8361fb31c Statusbar: block remaining instead of absolute values 2020-12-16 04:09:32 +01:00
tobtoht 5ceac87e6e DebugInfoDialog: cleanup ws status message 2020-12-15 21:02:53 +01:00
tobtoht e058f3bad1 Merge pull request 'CMakeLists.txt: only copy tor binary if it has been changed' (#225) from blasty/feather:update_cmakelists into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/225
2020-12-15 13:43:50 +00:00
blasty 460a44ba34 CMakeLists.txt: only copy tor binary if it has been changed 2020-12-15 14:31:49 +01:00
tobtoht 8c197f26ea Merge pull request 'build: prepare beta-2' (#224) from tobtoht/feather:beta-2 into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/224
2020-12-14 23:06:10 +00:00
tobtoht 6f17a1dfaa Merge pull request 'Update OpenSSL to 1.1.1i' (#223) from tobtoht/feather:openssl_1.1.1i into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/223
2020-12-14 23:04:58 +00:00
tobtoht 2217ae602a Merge pull request 'Allow resending failed transactions' (#212) from tobtoht/feather:black_holed_no_more into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/212
2020-12-14 22:27:12 +00:00
tobtoht 75743e8897 build: prepare beta-2 2020-12-14 23:10:54 +01:00
tobtoht 169d14ab3a Allow resending failed transactions 2020-12-14 23:07:50 +01:00
tobtoht 710556a580 Update OpenSSL to 1.1.1i 2020-12-14 21:55:52 +01:00
tobtoht 15211ce5fa Merge pull request 'Menu: add rescan spent' (#221) from tobtoht/feather:rescan_spent into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/221
2020-12-14 19:45:26 +00:00
tobtoht 66f53d865e Menu: add rescan spent 2020-12-14 20:44:37 +01:00
tobtoht ea81b308f7 Merge pull request 'TxInfoDialog: set blockheight to unconfirmed for mempool txs' (#220) from tobtoht/feather:tx_info_blockheight into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/220
2020-12-14 19:31:01 +00:00
tobtoht 9016fa13dc TxInfoDialog: set blockheight to unconfirmed for mempool txs 2020-12-14 20:30:15 +01:00
tobtoht cee70a997d Merge pull request 'TickerWidget: don't show percentage on balance' (#219) from tobtoht/feather:ticker_widget_no_perc into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/219
2020-12-14 19:19:40 +00:00
tobtoht 041c11f618 TickerWidget: don't show percentage on balance 2020-12-14 20:17:22 +01:00
tobtoht c5f0962e40 Merge pull request 'Replace showMessageBox with Qt builtin' (#218) from tobtoht/feather:messagebox_cleanup into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/218
2020-12-14 02:25:11 +00:00
tobtoht 85a06007a1 Replace showMessageBox with Qt builtin 2020-12-14 03:23:19 +01:00
tobtoht b6459d1b64 Merge pull request 'Remove user_agents.txt' (#217) from tobtoht/feather:remove_user_agents into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/217
2020-12-14 01:49:06 +00:00
tobtoht 653e59f5ec Remove user_agents.txt 2020-12-14 02:47:51 +01:00
tobtoht 71e28831d8 Merge pull request 'Coins: copy label' (#216) from tobtoht/feather:coins_copy_label into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/216
2020-12-14 01:33:29 +00:00
tobtoht 874748ea7f Coins: copy label 2020-12-14 02:30:30 +01:00
tobtoht d3e55c4510 Merge pull request 'Store wallet immediately after sending tx' (#215) from tobtoht/feather:store_on_send into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/215
2020-12-14 01:18:08 +00:00
tobtoht 147ee8ef8b Store wallet immediately after sending tx 2020-12-14 02:15:56 +01:00
tobtoht 5ec641bc6f Merge pull request 'Update fiat conversion label on donate' (#214) from tobtoht/feather:donation_fix into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/214
2020-12-14 01:01:00 +00:00
tobtoht 4a37be1ce7 Update fiat conversion label on donate 2020-12-14 01:59:32 +01:00
tobtoht d1b4db2be4 Merge pull request 'Core: rebase to v0.17.1.7' (#213) from tobtoht/feather:v0.17.1.7 into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/213
2020-12-13 13:21:29 +00:00
tobtoht 1e2fa51b98 Core: rebase to v0.17.1.7 2020-12-13 14:19:17 +01:00
tobtoht 743c5fa9a4 Merge pull request 'DebugInfoDialog: improve Tor status on Tails' (#211) from tobtoht/feather:tails_debug_info into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/211
2020-12-12 16:34:58 +00:00
tobtoht ae1d6a2d1c DebugInfoDialog: improve Tor status on Tails 2020-12-12 17:33:33 +01:00
tobtoht 5e246519c2 Merge pull request 'SeedDialog: improve UI' (#210) from tobtoht/feather:seed_dialog_height into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/210
2020-12-12 16:23:24 +00:00
tobtoht 8b5cb8ba2c SeedDialog: improve UI 2020-12-12 17:19:37 +01:00
tobtoht 3ea7e5932e Merge pull request 'Menu: remove disabled open wallet item' (#209) from tobtoht/feather:remove_open_wallet into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/209
2020-12-12 16:07:29 +00:00
tobtoht 97b4fcb958 Menu: remove disable open wallet item 2020-12-12 16:59:44 +01:00
tobtoht 80c1c66bea Merge pull request 'MorphToken: add statustext for missing states' (#208) from tobtoht/feather:morphtoken_processing_delay into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/208
2020-12-12 15:37:26 +00:00
tobtoht be61c803bf MorphToken: add statustext for missing states 2020-12-12 16:35:44 +01:00
tobtoht a0a307f3bd Merge pull request 'Remove sorry()' (#207) from tobtoht/feather:no_sorry into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/207
2020-12-12 14:56:18 +00:00
tobtoht 1d8f4f0bfd Remove sorry() 2020-12-12 15:54:43 +01:00
tobtoht 7c288570b1 Merge pull request 'Update calc icon' (#206) from tobtoht/feather:calc_icon into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/206
2020-12-12 14:48:57 +00:00
tobtoht 02d71ebf02 Update calc icon 2020-12-12 15:46:41 +01:00
tobtoht 6ef4eaa39f Merge pull request 'Rename XMRig tab to Mining' (#205) from tobtoht/feather:xmrig_mining into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/205
2020-12-12 14:29:30 +00:00
tobtoht d3ee2744d4 Merge pull request 'XMRig: squish settings UI' (#204) from tobtoht/feather:xmrig_cleanup into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/204
2020-12-12 14:24:02 +00:00
tobtoht 61b54efb97 Rename XMRig tab to Mining 2020-12-12 15:22:31 +01:00
tobtoht 91b00da4af XMRig: squish settings UI 2020-12-12 14:39:13 +01:00
tobtoht 2b72624ec0 Merge pull request 'Consolidate exchanges to exchange tab' (#203) from tobtoht/feather:consolidate_exchanges into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/203
2020-12-12 13:03:06 +00:00
tobtoht 55bb304dc2 Merge pull request 'Drone: optimize builds' (#202) from tobtoht/feather:drone_optimize_builds into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/202
2020-12-12 12:18:18 +00:00
tobtoht 8ffd2293f4 Consolidate exchanges to exchange tab 2020-12-12 02:49:33 +01:00
tobtoht 3df2e591fe Drone: optimize builds 2020-12-12 01:54:04 +01:00
tobtoht 785771cb90 Merge pull request 'Do not bundle XMRig' (#201) from tobtoht/feather:xmrip into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/201
2020-12-12 00:51:55 +00:00
tobtoht aa14a2dcbb Do not bundle XMRig binary 2020-12-12 01:18:09 +01:00
tobtoht c9e2ce3770 Merge pull request 'Spell it backwards' (#200) from tobtoht/feather:tobtoht into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/200
2020-12-11 19:50:08 +00:00
tobtoht 835e4aaca3 Spell it backwards 2020-12-11 20:46:24 +01:00
tobtoht 97900bcbe6 Merge pull request 'Home: add tabs for home widgets' (#199) from tobtoht/feather:main_tab into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/199
2020-12-11 13:33:32 +00:00
tobtoht a9ec69afd0 Home: add tabs for home widgets 2020-12-11 14:32:14 +01:00
tobtoht a008f1f45f Merge pull request 'Add reproducible build instructions' (#198) from tobtoht/feather:update_building into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/198
2020-12-10 17:16:54 +00:00
tobtoht fbd6b8eb53 Add reproducible build instructions 2020-12-10 18:13:21 +01:00
tobtoht 855755fea3 Merge pull request 'Add release signing key' (#197) from tobtoht/feather:signing_key into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/197
2020-12-09 21:14:31 +00:00
tobtoht 302e585af4 Add release signing key 2020-12-09 22:12:55 +01:00
116 changed files with 1522 additions and 9472 deletions
+4 -4
View File
@@ -16,8 +16,8 @@ steps:
- git config --global url."http://gitea:3000/".insteadOf https://github.com/
- git config --global url."http://gitea:3000/".insteadOf https://git.wownero.com/
- git submodule update --init monero
- git submodule update --init --recursive monero
- TOR="/usr/local/tor/bin/tor" XMRIG="/xmrig/xmrig" make -j8 release-static
- git submodule update --init --depth 1 --recursive monero
- TOR_BIN="/usr/local/tor/bin/tor" make -j8 release-static
environment:
OPENSSL_ROOT_DIR: /usr/local/openssl/
CMAKEFLAGS_EXTRA: -DFETCH_DEPS=Off
@@ -97,8 +97,8 @@ steps:
- git config --global url."http://gitea:3000/".insteadOf https://github.com/
- git config --global url."http://gitea:3000/".insteadOf https://git.wownero.com/
- git submodule update --init monero
- git submodule update --init --recursive monero
- PATH="/mxe/usr/bin/:$PATH" TOR="/mxe/usr/x86_64-w64-mingw32.static/bin/tor.exe" XMRIG="/xmrig/xmrig.exe" make -j8 windows-mxe-release
- git submodule update --init --depth 1 --recursive monero
- PATH="/mxe/usr/bin/:$PATH" TOR_BIN="/mxe/usr/x86_64-w64-mingw32.static/bin/tor.exe" make -j8 windows-mxe-release
environment:
CMAKEFLAGS_EXTRA: -DFETCH_DEPS=Off
- name: deploy
+41 -36
View File
@@ -10,6 +10,44 @@ Static builds via Docker are done in 3 steps:
2. Creating a base Docker image
3. Using the base image to compile a build
### Linux (reproducible)
The docker image for reproducible Linux static builds uses Ubuntu 16.04 and compiles the required libraries statically
so that the resulting Feather binary is static. For more information, check the Dockerfile: `Dockerfile`.
#### 1. Clone
```bash
git clone --branch master --recursive https://git.wownero.com/feather/feather.git
cd feather
```
Replace `master` with the desired version tag (e.g. `beta-1`) to build the release binary.
#### 2. Base image
```bash
docker build --tag feather:linux --build-arg THREADS=4 .
```
Building the base image takes a while. You only need to build the base image once.
#### 3. Build
```bash
docker run --rm -it -v $PWD:/feather --env OPENSSL_ROOT_DIR=/usr/local/openssl/ -w /feather feather:linux sh -c 'TOR_BIN="/usr/local/tor/bin/tor" make release-static -j4'
```
If you're re-running a build make sure to `rm -rf build/` first.
The resulting binary can be found in `build/bin/feather`.
Hashes for tagged commits should match:
```
beta-1: d1a52e3bac1abbae4adda1fc88cb2a7a06fbd61085868421897c6a4f3f4eb091 feather
```
### Windows
The docker image for Windows static compiles uses Ubuntu 18.04 and installs [mxe](https://mxe.cc) from [our git](https://git.wownero.com/feather/mxe/src/branch/feather-patch),
@@ -35,45 +73,12 @@ Note: You only need to build the base image once.
#### 3. Build
```bash
docker run --rm -it -v /tmp/ccache:/root/.ccache -v /root/feather:/feather -w /feather feather:win /bin/bash -c 'PATH="/mxe/usr/bin/:$PATH" TOR="/mxe/usr/x86_64-w64-mingw32.static/bin/tor.exe" XMRIG="/xmrig/xmrig.exe" make windows-mxe-release -j8'
```
Replace `PATH_TO_FEATHER` with the absolute path to Feather locally.
The resulting binary can be found in `build/bin/feather.exe`.
### Linux
The docker image for Linux static compiles uses Ubuntu 18.04 and compiles the required libraries statically so that
the resulting Feather binary is static. It comes with OpenSSL 1.1.1g, Qt 5.15.0 (OpenGL disabled). For more information,
check the Dockerfile: `Dockerfile`.
#### 1. Clone
```bash
git clone --recursive https://git.wownero.com/feather/feather.git
cd feather
```
#### 2. Base image
Warning: Building the base image takes a while, go prepare some dinner.
```bash
docker build --tag feather:linux --build-arg THREADS=8 .
```
Note: You only need to build the base image once.
#### 3. Build
```bash
docker run --env OPENSSL_ROOT_DIR=/usr/local/openssl/ --rm -it -v /tmp/ccache:/root/.ccache -v PATH_TO_FEATHER:/feather -w /feather feather:linux sh -c 'TOR="/usr/local/tor/bin/tor" XMRIG="/xmrig/xmrig" make release-static -j8'
docker run --rm -it -v /tmp/ccache:/root/.ccache -v PATH_TO_FEATHER:/feather -w /feather feather:win /bin/bash -c 'PATH="/mxe/usr/bin/:$PATH" TOR_BIN="/mxe/usr/x86_64-w64-mingw32.static/bin/tor.exe" make windows-mxe-release -j8'
```
Replace `PATH_TO_FEATHER` with the absolute path to Feather locally.
The resulting binary can be found in `build/bin/feather`.
The resulting binary can be found in `build/bin/feather.exe`.
## macOS
@@ -98,4 +103,4 @@ Build Feather.
CMAKE_PREFIX_PATH=~/Qt5.15.1/5.15.1/clang_64 make mac-release
```
The resulting Mac OS application can be found `build/bin/feather.app` and will **not** have Tor embedded.
The resulting Mac OS application can be found `build/bin/feather.app` and will **not** have Tor embedded.
+10 -29
View File
@@ -7,14 +7,13 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
set(VERSION_MAJOR "0")
set(VERSION_MINOR "1")
set(VERSION_REVISION "0")
set(VERSION "beta-1")
set(VERSION "beta-3")
option(FETCH_DEPS "Download dependencies if they are not found" ON)
option(XMRTO "Include Xmr.To module" ON)
option(MORPHTOKEN "Include MorphToken module" ON)
option(XMRIG "Path to XMRig binary to embed inside Feather" OFF)
option(TOR "Path to Tor binary to embed inside Feather" OFF)
option(TOR_VERSION "Optional git hash or tag of embedded Tor version" "tor-0.4.3.5")
option(XMRIG "Include XMRig module" ON)
option(TOR_BIN "Path to Tor binary to embed inside Feather" OFF)
option(STATIC "Link libraries statically, requires static Qt")
option(USE_DEVICE_TREZOR "Trezor support compilation" OFF)
option(DONATE_BEG "Prompt donation window every once in a while" ON)
@@ -31,7 +30,7 @@ if(DEBUG)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
set(MONERO_HEAD "1fffb4e27a317cdfaf58c7848c143eb7fc3110d9")
set(MONERO_HEAD "85b0b4f73aa6114e3ff91207aa94ad2a15c939a2")
set(BUILD_GUI_DEPS ON)
set(ARCH "x86-64")
set(BUILD_64 ON)
@@ -181,8 +180,8 @@ if("$ENV{DRONE}" STREQUAL "true")
message(STATUS "We are inside a static compile with Drone CI")
endif()
# To build Feather with embedded (and static) Tor, pass CMake -DTOR=/path/to/tor
if(TOR)
# To build Feather with embedded (and static) Tor, pass CMake -DTOR_BIN=/path/to/tor
if(TOR_BIN)
if(APPLE)
execute_process(COMMAND bash -c "touch ${CMAKE_CURRENT_SOURCE_DIR}/src/tor/libevent-2.1.7.dylib")
endif()
@@ -191,34 +190,16 @@ if(TOR)
# - linux: See `Dockerfile`
# - windows: https://github.com/mxe/mxe/blob/1024dc7d2db5eb7d5d3c64a2c12b5f592572f1ce/plugins/apps/tor.mk
# - macos: taken from Tor Browser official release
set(TOR_COPY_CMD "cp ${TOR} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/tor")
set(TOR_COPY_CMD "cp -u ${TOR_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/tor")
message(STATUS "${TOR_COPY_CMD}")
execute_process(COMMAND bash -c "${TOR_COPY_CMD}" RESULT_VARIABLE ret)
if(ret EQUAL "1")
message(FATAL_ERROR "Tor copy failure: ${TOR_COPY_CMD}")
endif()
message(STATUS "Embedding Tor binary at ${TOR}")
message(STATUS "Embedding Tor binary at ${TOR_BIN}")
else()
message(STATUS "Skipping Tor inclusion because -DTOR=Off")
endif()
# To build Feather with embedded (and static) XMRig, pass CMake -DXMRIG=/path/to/xmrig
if(XMRIG)
# on the buildbot XMRig is baked into the image
# - linux: See `Dockerfile`
# - windows: See `Dockerfile_windows`
# - macos: manually downloaded an official release
set(XMRIG_COPY_CMD "cp ${XMRIG} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/xmrig")
message(STATUS "${XMRIG_COPY_CMD}")
execute_process(COMMAND bash -c "${XMRIG_COPY_CMD}" RESULT_VARIABLE ret)
if(ret EQUAL "1")
message(FATAL_ERROR "XMRig copy failure: ${XMRIG_COPY_CMD}")
endif()
message(STATUS "Embedding XMRig binary at ${XMRIG}")
else()
message(STATUS "Skipping XMRig inclusion because -DXMRIG=Off")
message(STATUS "Skipping Tor inclusion because -DTOR_BIN=Off")
endif()
if(MINGW)
+5 -10
View File
@@ -174,11 +174,11 @@ RUN apt install -y wget && \
./b2 --with-atomic --with-system --with-filesystem --with-thread --with-date_time --with-chrono --with-regex --with-serialization --with-program_options --with-locale variant=release link=static runtime-link=static cflags="${CFLAGS}" cxxflags="${CXXFLAGS}" install -a --prefix=/usr && \
rm -rf $(pwd)
RUN wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz && \
echo "ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46 openssl-1.1.1g.tar.gz" | sha256sum -c && \
tar -xzf openssl-1.1.1g.tar.gz && \
rm openssl-1.1.1g.tar.gz && \
cd openssl-1.1.1g && \
RUN wget https://www.openssl.org/source/openssl-1.1.1i.tar.gz && \
echo "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242 openssl-1.1.1i.tar.gz" | sha256sum -c && \
tar -xzf openssl-1.1.1i.tar.gz && \
rm openssl-1.1.1i.tar.gz && \
cd openssl-1.1.1i && \
./config no-shared no-zlib-dynamic --prefix=/usr/local/openssl && \
make -j$THREADS && \
make -j$THREADS install && \
@@ -346,8 +346,3 @@ RUN git clone https://git.wownero.com/feather/monero-seed.git && \
make -Cbuild -j$THREADS && \
make -Cbuild install && \
rm -rf $(pwd)
RUN apt install -y curl && \
curl -LO "https://github.com/xmrig/xmrig/releases/download/v6.3.5/xmrig-6.3.5-linux-static-x64.tar.gz" && \
echo "24d4f07cf5850f00ab513b228f95769a5a5ed68d35808d98f9959b58d97985a0 xmrig-6.3.5-linux-static-x64.tar.gz" | sha256sum -c && \
tar xvf xmrig-6.3.5-linux-static-x64.tar.gz --one-top-level=/xmrig --strip 1
-7
View File
@@ -72,10 +72,3 @@ RUN git clone https://git.wownero.com/feather/monero-seed.git && \
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild && \
make -Cbuild -j$THREADS && \
make -Cbuild install
RUN apt install -y curl && \
curl -LO "https://github.com/xmrig/xmrig/releases/download/v6.3.5/xmrig-6.3.5-gcc-win64.zip" && \
echo "e45915ada7e6e30f6ab40abf33831056449d5914307d7706bb0ad439b6d64c12 xmrig-6.3.5-gcc-win64.zip" > hashsum.txt && \
sha256sum -c hashsum.txt && \
unzip -q xmrig-6.3.5-gcc-win64.zip -d /xmrig && \
mv /xmrig/xmrig-6.3.5/* /xmrig/
+2 -3
View File
@@ -42,9 +42,8 @@ via the `CMAKE_PREFIX_PATH` definition. For me this is:
There are some Monero/Feather related options/definitions that you may pass:
- `-DXMRTO=OFF` - disable Xmr.To feature
- `-DMORPHTOKEN=OFF` - diable MorphToken feature
- `-DTOR=/path/to/tor` - Embed a Tor executable inside Feather
- `-DXMRIG=/path/to/xmrig` - Embed a XMRig executable inside Feather
- `-DXMRIG=OFF` - disable XMRig feature
- `-DTOR_BIN=/path/to/tor` - Embed a Tor executable inside Feather
- `-DDONATE_BEG=OFF` - disable the dreaded donate requests
And:
+7 -12
View File
@@ -30,10 +30,9 @@ CMAKEFLAGS = \
-DARCH=x86_64 \
-DBUILD_64=On \
-DBUILD_TESTS=Off \
-DXMRTO=ON \
-DMORPHTOKEN=ON \
-DXMRIG=Off \
-DTOR=Off \
-DXMRTO=On \
-DXMRIG=On \
-DTOR_BIN=Off \
-DCMAKE_CXX_STANDARD=11 \
-DCMAKE_VERBOSE_MAKEFILE=On \
-DINSTALL_VENDORED_LIBUNBOUND=Off \
@@ -43,32 +42,28 @@ CMAKEFLAGS = \
$(CMAKEFLAGS_EXTRA)
release-static: CMAKEFLAGS += -DBUILD_TAG="linux-x64"
release-static: CMAKEFLAGS += -DTOR=$(or ${TOR},OFF)
release-static: CMAKEFLAGS += -DXMRIG=$(or ${XMRIG},OFF)
release-static: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
release-static: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
release-static:
cmake -Bbuild $(CMAKEFLAGS)
$(MAKE) -Cbuild
windows-mxe-release: CMAKEFLAGS += -DBUILD_TAG="win-x64"
windows-mxe-release: CMAKEFLAGS += -DTOR=$(or ${TOR},OFF)
windows-mxe-release: CMAKEFLAGS += -DXMRIG=$(or ${XMRIG},OFF)
windows-mxe-release: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
windows-mxe-release: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
windows-mxe-release:
cmake -Bbuild $(CMAKEFLAGS)
$(MAKE) -Cbuild
windows-mxe-debug: CMAKEFLAGS += -DBUILD_TAG="win-x64"
windows-mxe-debug: CMAKEFLAGS += -DTOR=$(or ${TOR},OFF)
windows-mxe-debug: CMAKEFLAGS += -DXMRIG=$(or ${XMRIG},OFF)
windows-mxe-debug: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
windows-mxe-debug: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Debug
windows-mxe-debug:
cmake -Bbuild $(CMAKEFLAGS)
$(MAKE) -Cbuild
mac-release: CMAKEFLAGS += -DSTATIC=Off
mac-release: CMAKEFLAGS += -DTOR=$(or ${TOR},OFF)
mac-release: CMAKEFLAGS += -DXMRIG=$(or ${XMRIG},OFF)
mac-release: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
mac-release: CMAKEFLAGS += -DBUILD_TAG="mac-x64"
mac-release: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
mac-release:
+1 -1
Submodule monero updated: 1fffb4e27a...85b0b4f73a
+5 -14
View File
@@ -42,7 +42,7 @@ file(GLOB SOURCE_FILES
"dialog/*.cpp"
)
if(TOR)
if(TOR_BIN)
if(APPLE)
set(ASSETS_TOR "assets_tor_macos.qrc")
else()
@@ -50,10 +50,6 @@ if(TOR)
endif()
endif()
if(XMRIG)
set(ASSETS_XMRIG "assets_mining.qrc")
endif()
set(EXECUTABLE_FLAG)
if(MINGW)
set(EXECUTABLE_FLAG WIN32)
@@ -77,8 +73,7 @@ add_executable(feather ${EXECUTABLE_FLAG} main.cpp
${SOURCE_FILES}
${RESOURCES}
${ASSETS_TOR}
${ASSETS_XMRIG}
)
)
# mac os bundle
set_target_properties(feather PROPERTIES
@@ -126,15 +121,11 @@ if(DONATE_BEG)
endif()
if(XMRTO)
target_compile_definitions(feather PRIVATE XMRTO=1)
target_compile_definitions(feather PRIVATE HAS_XMRTO=1)
endif()
if(MORPHTOKEN)
target_compile_definitions(feather PRIVATE HAS_MORPHTOKEN=1)
endif()
if(TOR)
target_compile_definitions(feather PRIVATE HAS_TOR=1)
if(TOR_BIN)
target_compile_definitions(feather PRIVATE HAS_TOR_BIN=1)
endif()
if(XMRIG)
-226
View File
@@ -1,226 +0,0 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#include "MorphTokenWidget.h"
#include "ui_MorphTokenWidget.h"
#include "mainwindow.h"
#include "qrcode/QrCode.h"
#include "dialog/qrcodedialog.h"
#include <QMessageBox>
MorphTokenWidget::MorphTokenWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::MorphTokenWidget)
{
ui->setupUi(this);
m_ctx = MainWindow::getContext();
m_network = new UtilsNetworking(this->m_ctx->network);
m_api = new MorphTokenApi(this, m_network);
connect(ui->btnCreateTrade, &QPushButton::clicked, this, &MorphTokenWidget::createTrade);
connect(ui->btn_lookupTrade, &QPushButton::clicked, this, &MorphTokenWidget::lookupTrade);
connect(ui->btn_getRates, &QPushButton::clicked, this, &MorphTokenWidget::getRates);
connect(m_api, &MorphTokenApi::ApiResponse, this, &MorphTokenWidget::onApiResponse);
connect(ui->combo_From, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index){
this->displayRate();
ui->label_refundAddress->setText(QString("Refund address (%1):").arg(ui->combo_From->currentText()));
});
connect(ui->combo_To, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index){
this->displayRate();
ui->label_destinationAddress->setText(QString("Destination address (%1):").arg(ui->combo_To->currentText()));
});
connect(ui->check_autorefresh, &QCheckBox::toggled, [this](bool toggled){
m_countdown = 30;
toggled ? m_countdownTimer.start(1000) : m_countdownTimer.stop();
ui->check_autorefresh->setText("Autorefresh");
});
connect(&m_countdownTimer, &QTimer::timeout, this, &MorphTokenWidget::onCountdown);
connect(ui->line_Id, &QLineEdit::textChanged, [this](const QString &text){
ui->btn_lookupTrade->setEnabled(!text.isEmpty());
ui->check_autorefresh->setEnabled(!text.isEmpty());
});
// Default to BTC -> XMR
ui->combo_From->setCurrentIndex(1);
ui->combo_To->setCurrentIndex(0);
ui->label_rate->setVisible(false);
m_ratesTimer.setSingleShot(true);
connect(&m_ratesTimer, &QTimer::timeout, [this]{
ui->label_rate->setVisible(false);
});
ui->qrCode->setVisible(false);
ui->label_depositAddress->setVisible(false);
connect(ui->qrCode, &ClickableLabel::clicked, this, &MorphTokenWidget::showQrCodeDialog);
ui->tabWidget->setTabVisible(2, false);
}
void MorphTokenWidget::createTrade() {
QString inputAsset = ui->combo_From->currentText();
QString outputAsset = ui->combo_To->currentText();
QString refundAddress = ui->line_refundAddress->text();
QString destinationAddress = ui->line_destinationAddress->text();
m_api->createTrade(inputAsset, outputAsset, refundAddress, destinationAddress);
}
void MorphTokenWidget::lookupTrade() {
QString morphId = ui->line_Id->text();
if (!morphId.isEmpty())
m_api->getTrade(morphId);
}
void MorphTokenWidget::getRates() {
m_api->getRates();
}
void MorphTokenWidget::onApiResponse(const MorphTokenApi::MorphTokenResponse &resp) {
if (!resp.ok) {
ui->check_autorefresh->setChecked(false);
QMessageBox::warning(this, "MorphToken error", QString("Request failed:\n\n%1").arg(resp.message));
return;
}
ui->debugInfo->setPlainText(QJsonDocument(resp.obj).toJson(QJsonDocument::Indented));
bool shouldShowQr = (resp.endpoint == MorphTokenApi::Endpoint::CREATE_TRADE || resp.endpoint == MorphTokenApi::Endpoint::GET_TRADE);
ui->qrCode->setVisible(shouldShowQr);
ui->label_depositAddress->setVisible(shouldShowQr);
if (resp.endpoint == MorphTokenApi::Endpoint::CREATE_TRADE || resp.endpoint == MorphTokenApi::Endpoint::GET_TRADE) {
ui->tabWidget->setCurrentIndex(1);
ui->line_Id->setText(resp.obj.value("id").toString());
auto obj = resp.obj;
auto input = obj["input"].toObject();
auto output = obj["output"].toArray()[0].toObject();
QString state = obj.value("state").toString();
QString statusText;
ui->trade->setTitle(QString("Trade (%1)").arg(state));
statusText += QString("Morph ID: %1\n\n").arg(obj["id"].toString());
if (state == "PENDING") {
statusText += QString("Waiting for a deposit, send %1 to %2\n").arg(input["asset"].toString(),
input["deposit_address"].toString());
statusText += QString("Rate: 1 %1 -> %2 %3\n\n").arg(input["asset"].toString(),
output["seen_rate"].toString(),
output["asset"].toString());
statusText += "Limits:\n";
statusText += QString(" Minimum amount accepted: %1 %2\n").arg(formatAmount(input["asset"].toString(), input["limits"].toObject()["min"].toDouble()),
input["asset"].toString());
statusText += QString(" Maximum amount accepted: %1 %2\n").arg(formatAmount(input["asset"].toString(), input["limits"].toObject()["max"].toDouble()),
input["asset"].toString());
statusText += QString("\nSend a single deposit. If the amount is outside the limits, a refund will happen.");
m_depositAddress = input["deposit_address"].toString();
const QrCode qrc(m_depositAddress, QrCode::Version::AUTO, QrCode::ErrorCorrectionLevel::MEDIUM);
int width = ui->qrCode->width();
if (qrc.isValid()) {
ui->qrCode->setPixmap(qrc.toPixmap(1).scaled(width, width, Qt::KeepAspectRatio));
}
} else if (state == "PROCESSING" || state == "TRADING" || state == "CONFIRMING") {
if (state == "CONFIRMING") {
statusText += QString("Waiting for confirmations\n");
} else if (state == "TRADING") {
statusText += QString("Your transaction has been received and is confirmed. MorphToken is now executing your trade.\n"
"Usually this step takes no longer than a minute, "
"but in rare cases it can take a couple hours.\n"
"Wait a bit before contacting support.\n");
}
statusText += QString("Converting %1 to %2\n").arg(input["asset"].toString(), output["asset"].toString());
statusText += QString("Sending to %1\n").arg(output["address"].toString());
statusText += QString("Stuck? Contact support at contact@morphtoken.com");
} else if (state == "COMPLETE") {
if (output["txid"].toString().isEmpty()) {
statusText += QString("MorphToken is sending your transaction.\n");
statusText += QString("MorphToken will send %1 %2 to %2").arg(this->formatAmount(output["asset"].toString(), output["converted_amount"].toDouble() - output["network_fee"].toObject()["fee"].toDouble()),
output["asset"].toString(),
output["address"].toString());
} else {
statusText += QString("Sent %1 %2 to %3\ntxid: {}").arg(this->formatAmount(output["asset"].toString(), output["converted_amount"].toDouble() - output["network_fee"].toObject()["fee"].toDouble()),
output["asset"].toString(),
output["address"].toString(),
output["txid"].toString());
}
} else if (state == "PROCESSING_REFUND" || state == "COMPLETE_WITH_REFUND") {
statusText += QString("MorphToken will refund %1 %2\nReason: %3\n").arg(obj["final_amount"].toString(),
obj["asset"].toString(),
obj["reason"].toString());
if (obj.contains("txid")) {
statusText += QString("txid: %1").arg(obj["txid"].toString());
}
} else if (state == "COMPLETE_WITHOUT_REFUND") {
statusText += "Deposit amount below network fee, too small to refund.";
}
ui->label_status->setText(statusText);
} else if (resp.endpoint == MorphTokenApi::Endpoint::GET_RATES) {
m_rates = resp.obj.value("data").toObject();
this->displayRate();
ui->label_rate->setVisible(true);
m_ratesTimer.start(120 * 1000);
}
if (resp.endpoint == MorphTokenApi::Endpoint::CREATE_TRADE) {
QMessageBox::information(this, "MorphToken", "Trade created!\n\nMake sure to save your Morph ID. You may need it in case something goes wrong.");
}
}
void MorphTokenWidget::onCountdown() {
if (m_countdown > 0) {
m_countdown -= 1;
} else {
this->lookupTrade();
m_countdown = 30;
}
ui->check_autorefresh->setText(QString("Autorefresh (%1)").arg(m_countdown));
}
void MorphTokenWidget::displayRate() {
QString inputAsset = ui->combo_From->currentText();
QString outputAsset = ui->combo_To->currentText();
QString outputRate = m_rates.value(inputAsset).toObject().value(outputAsset).toString("1");
QString rateStr = QString("1 %1 -> %2 %3").arg(inputAsset, outputRate, outputAsset);
ui->label_rate->setText(rateStr);
}
void MorphTokenWidget::showQrCodeDialog() {
QrCode qr(m_depositAddress, QrCode::Version::AUTO, QrCode::ErrorCorrectionLevel::HIGH);
auto *dialog = new QrCodeDialog(this, qr, "Deposit address");
dialog->exec();
dialog->deleteLater();
}
QString MorphTokenWidget::formatAmount(const QString &asset, double amount) {
double displayAmount;
double div;
if (asset == "ETH")
div = 1e18;
else if (asset == "XMR")
div = 1e12;
else
div = 1e8;
displayAmount = amount / div;
return QString::number(displayAmount, 'f', 8);
}
MorphTokenWidget::~MorphTokenWidget() {
delete ui;
}
-47
View File
@@ -1,47 +0,0 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#ifndef FEATHER_MORPHTOKENWIDGET_H
#define FEATHER_MORPHTOKENWIDGET_H
#include <QWidget>
#include "appcontext.h"
#include "utils/MorphTokenApi.h"
namespace Ui {
class MorphTokenWidget;
}
class MorphTokenWidget : public QWidget
{
Q_OBJECT
public:
explicit MorphTokenWidget(QWidget *parent = nullptr);
~MorphTokenWidget() override;
private:
void createTrade();
void lookupTrade();
void getRates();
void onApiResponse(const MorphTokenApi::MorphTokenResponse &resp);
void onCountdown();
void displayRate();
void showQrCodeDialog();
QString formatAmount(const QString &asset, double amount);
Ui::MorphTokenWidget *ui;
AppContext *m_ctx;
MorphTokenApi *m_api;
UtilsNetworking *m_network;
QTimer m_countdownTimer;
int m_countdown = 30;
QJsonObject m_rates;
QTimer m_ratesTimer;
QString m_depositAddress;
};
#endif //FEATHER_MORPHTOKENWIDGET_H
-423
View File
@@ -1,423 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MorphTokenWidget</class>
<widget class="QWidget" name="MorphTokenWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1036</width>
<height>614</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tabCreateTrade">
<attribute name="title">
<string>Create trade</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>From:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_From">
<item>
<property name="text">
<string>XMR</string>
</property>
</item>
<item>
<property name="text">
<string>BTC</string>
</property>
</item>
<item>
<property name="text">
<string>ETH</string>
</property>
</item>
<item>
<property name="text">
<string>BCH</string>
</property>
</item>
<item>
<property name="text">
<string>LTC</string>
</property>
</item>
<item>
<property name="text">
<string>DASH</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>To:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_To">
<item>
<property name="text">
<string>XMR</string>
</property>
</item>
<item>
<property name="text">
<string>BTC</string>
</property>
</item>
<item>
<property name="text">
<string>ETH</string>
</property>
</item>
<item>
<property name="text">
<string>BCH</string>
</property>
</item>
<item>
<property name="text">
<string>LTC</string>
</property>
</item>
<item>
<property name="text">
<string>DASH</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_rate">
<property name="text">
<string>rate</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_refundAddress">
<property name="text">
<string>Refund address (XMR):</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_refundAddress"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_destinationAddress">
<property name="text">
<string>Destination address (XMR):</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="line_destinationAddress"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Powered by MorphToken.com</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_getRates">
<property name="text">
<string>Get Rates</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnCreateTrade">
<property name="text">
<string>Create Trade</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabLookupTrade">
<attribute name="title">
<string>Lookup trade</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Morph ID or MorphToken deposit address:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="line_Id"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="check_autorefresh">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Autorefresh</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_lookupTrade">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Lookup trade</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="trade">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Trade</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_status">
<property name="text">
<string>No trade loaded.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="ClickableLabel" name="qrCode">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>qrcode</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_depositAddress">
<property name="text">
<string>Deposit address</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabDebug">
<attribute name="title">
<string>Debug</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QPlainTextEdit" name="debugInfo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ClickableLabel</class>
<extends>QLabel</extends>
<header>components.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+39 -39
View File
@@ -37,6 +37,7 @@ WalletKeysFilesModel *AppContext::wallets = nullptr;
TxFiatHistory *AppContext::txFiatHistory = nullptr;
double AppContext::balance = 0;
QMap<QString, QString> AppContext::txDescriptionCache;
QMap<QString, QString> AppContext::txCache;
AppContext::AppContext(QCommandLineParser *cmdargs) {
this->network = new QNetworkAccessManager();
@@ -79,13 +80,19 @@ AppContext::AppContext(QCommandLineParser *cmdargs) {
this->accountName = Utils::getUnixAccountName();
this->homeDir = QDir::homePath();
QString walletDir = config()->get(Config::walletDirectory).toString();
if (walletDir.isEmpty()) {
#if defined(Q_OS_LINUX) or defined(Q_OS_MAC)
this->defaultWalletDir = QString("%1/Monero/wallets").arg(this->configRoot);
this->defaultWalletDirRoot = QString("%1/Monero").arg(this->configRoot);
this->defaultWalletDir = QString("%1/Monero/wallets").arg(this->configRoot);
this->defaultWalletDirRoot = QString("%1/Monero").arg(this->configRoot);
#elif defined(Q_OS_WIN)
this->defaultWalletDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/Monero";
this->defaultWalletDirRoot = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
this->defaultWalletDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/Monero";
this->defaultWalletDirRoot = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
#endif
} else {
this->defaultWalletDir = walletDir;
this->defaultWalletDirRoot = walletDir;
}
// Create wallet dirs
if (!QDir().mkpath(defaultWalletDir))
@@ -96,7 +103,6 @@ AppContext::AppContext(QCommandLineParser *cmdargs) {
if(!this->configDirectory.endsWith('/'))
this->configDirectory = QString("%1/").arg(this->configDirectory);
#endif
this->sorry();
// Config
createConfigDirectory(this->configDirectory);
@@ -134,11 +140,11 @@ AppContext::AppContext(QCommandLineParser *cmdargs) {
auto genesis_timestamp = this->restoreHeights[NetworkType::Type::MAINNET]->data.firstKey();
AppContext::txFiatHistory = new TxFiatHistory(genesis_timestamp, this->configDirectory);
connect(this->ws, &WSClient::connectionEstablished, AppContext::txFiatHistory, &TxFiatHistory::onUpdateDatabase);
connect(AppContext::txFiatHistory, &TxFiatHistory::requestYear, [=](unsigned int year){
connect(AppContext::txFiatHistory, &TxFiatHistory::requestYear, [=](int year){
QByteArray data = QString(R"({"cmd": "txFiatHistory", "data": {"year": %1}})").arg(year).toUtf8();
this->ws->sendMsg(data);
});
connect(AppContext::txFiatHistory, &TxFiatHistory::requestYearMonth, [=](unsigned int year, unsigned int month) {
connect(AppContext::txFiatHistory, &TxFiatHistory::requestYearMonth, [=](int year, int month) {
QByteArray data = QString(R"({"cmd": "txFiatHistory", "data": {"year": %1, "month": %2}})").arg(year).arg(month).toUtf8();
this->ws->sendMsg(data);
});
@@ -147,7 +153,7 @@ AppContext::AppContext(QCommandLineParser *cmdargs) {
AppContext::prices = new Prices();
// xmr.to
#ifdef XMRTO
#ifdef HAS_XMRTO
this->XMRTo = new XmrTo(this);
#endif
@@ -378,22 +384,22 @@ void AppContext::onWSMessage(const QJsonObject &msg) {
auto changed = false;
if(!this->heights.contains("mainnet")) {
this->heights["mainnet"] = (unsigned int) mainnet;
this->heights["mainnet"] = mainnet;
changed = true;
}
else {
if (mainnet > this->heights["mainnet"]) {
this->heights["mainnet"] = (unsigned int) mainnet;
this->heights["mainnet"] = mainnet;
changed = true;
}
}
if(!this->heights.contains("stagenet")) {
this->heights["stagenet"] = (unsigned int) stagenet;
this->heights["stagenet"] = stagenet;
changed = true;
}
else {
if (stagenet > this->heights["stagenet"]) {
this->heights["stagenet"] = (unsigned int) stagenet;
this->heights["stagenet"] = stagenet;
changed = true;
}
}
@@ -419,7 +425,7 @@ void AppContext::onWSMessage(const QJsonObject &msg) {
QJsonObject fiat_rates = msg.value("data").toObject();
AppContext::prices->fiatPricesReceived(fiat_rates);
}
#if defined(XMRTO)
#if defined(HAS_XMRTO)
else if(cmd == "xmrto_rates") {
auto xmr_rates = msg.value("data").toObject();
this->XMRTo->onRatesReceived(xmr_rates);
@@ -526,9 +532,8 @@ void AppContext::onWSCCS(const QJsonArray &ccs_data) {
void AppContext::createConfigDirectory(const QString &dir) {
QString config_dir_tor = QString("%1%2").arg(dir).arg("tor");
QString config_dir_tordata = QString("%1%2").arg(dir).arg("tor/data");
QString config_dir_xmrig = QString("%1%2").arg(dir).arg("xmrig");
QStringList createDirs({dir, config_dir_tor, config_dir_tordata, config_dir_xmrig});
QStringList createDirs({dir, config_dir_tor, config_dir_tordata});
for(const auto &d: createDirs) {
if(!Utils::dirExists(d)) {
qDebug() << QString("Creating directory: %1").arg(d);
@@ -606,7 +611,7 @@ void AppContext::initRestoreHeights() {
restoreHeights[NetworkType::MAINNET] = RestoreHeightLookup::fromFile(":/assets/restore_heights_monero_mainnet.txt", NetworkType::MAINNET);
}
void AppContext::onSetRestoreHeight(unsigned int height){
void AppContext::onSetRestoreHeight(quint64 height){
auto seed = this->currentWallet->getCacheAttribute("feather.seed");
if(!seed.isEmpty()) {
const auto msg = "This wallet has a 14 word mnemonic seed which has the restore height embedded.";
@@ -681,15 +686,6 @@ void AppContext::donateBeg() {
config()->set(Config::donateBeg, donationCounter);
}
void AppContext::sorry() {
auto msg = "Unable to start Feather, error code 0xd34db33f. If this problem "
"persists, please contact Technical Support.";
QStringList paths = {"C:\\ProgramData\\ryo", this->homeDir + "/.ryo"};
for(const QString &ryo: paths)
if(Utils::dirExists(ryo))
throw std::runtime_error(msg);
}
AppContext::~AppContext() {
this->walletClose(false);
}
@@ -731,7 +727,8 @@ void AppContext::onWalletRefreshed(bool success) {
if (!this->refreshed) {
refreshModels();
this->refreshed = true;
this->storeWallet();
// store wallet immediately upon finishing synchronization
this->currentWallet->store();
}
qDebug() << "Wallet refresh status: " << success;
@@ -764,23 +761,28 @@ void AppContext::onHeightRefreshed(quint64 walletHeight, quint64 daemonHeight, q
}
void AppContext::onTransactionCreated(PendingTransaction *tx, const QString &address, const QString &paymentId, quint32 mixin) {
if(address == this->featherDonationAddress)
this->featherDonationSending = true;
if(address == this->donationAddress)
this->donationSending = true;
// Let UI know that the transaction was constructed
emit endTransaction();
// tx created, but not sent yet. ask user to verify first.
emit createTransactionSuccess(tx, address, mixin);
emit endTransaction();
}
void AppContext::onTransactionCommitted(bool status, PendingTransaction *tx, const QStringList& txid){
this->currentWallet->history()->refresh(this->currentWallet->currentSubaddressAccount());
this->currentWallet->coins()->refresh(this->currentWallet->currentSubaddressAccount());
this->storeWallet();
// Store wallet immediately so we don't risk losing tx key if wallet crashes
this->currentWallet->store();
emit transactionCommitted(status, tx, txid);
// this tx was a donation to Feather, stop our nagging
if(this->featherDonationSending) {
this->featherDonationSending = false;
if(this->donationSending) {
this->donationSending = false;
config()->set(Config::donateBeg, -1);
}
}
@@ -797,16 +799,14 @@ void AppContext::storeWallet() {
}
void AppContext::updateBalance() {
if(!this->currentWallet)
if (!this->currentWallet)
return;
AppContext::balance = this->currentWallet->balance() / globals::cdiv;
auto balance_str = QString::number(balance, 'f');
quint64 balance_u = this->currentWallet->balance();
AppContext::balance = balance_u / globals::cdiv;
double spendable = this->currentWallet->unlockedBalance();
double unlocked = this->currentWallet->unlockedBalance() / globals::cdiv;
auto unlocked_str = QString::number(unlocked, 'f');
emit balanceUpdated(balance, unlocked, balance_str, unlocked_str);
emit balanceUpdated(balance_u, spendable);
}
void AppContext::syncStatusUpdated(quint64 height, quint64 target) {
+13 -12
View File
@@ -39,9 +39,11 @@ public:
bool isTails = false;
bool isWhonix = false;
bool isDebug = false;
const QString featherDonationAddress = "47ntfT2Z5384zku39pTM6hGcnLnvpRYW2Azm87GiAAH2bcTidtq278TL6HmwyL8yjMeERqGEBs3cqC8vvHPJd1cWQrGC65f";
const int featherDonationAmount = 50; // euro
bool featherDonationSending = false;
// Donation config
const QString donationAddress = "47ntfT2Z5384zku39pTM6hGcnLnvpRYW2Azm87GiAAH2bcTidtq278TL6HmwyL8yjMeERqGEBs3cqC8vvHPJd1cWQrGC65f";
const int donationAmount = 25; // euro
bool donationSending = false;
QCommandLineParser *cmdargs;
@@ -64,9 +66,9 @@ public:
static void createConfigDirectory(const QString &dir) ;
QMap<QString, unsigned int> heights;
QMap<QString, int> heights;
QMap<NetworkType::Type, RestoreHeightLookup*> restoreHeights;
const unsigned int kdfRounds = 1;
const quint64 kdfRounds = 1;
PendingTransaction::Priority tx_priority = PendingTransaction::Priority::Priority_Low;
quint32 tx_mixin = static_cast<const quint32 &>(10);
QString seedLanguage = "English"; // 14 word `monero-seed` only has English
@@ -84,10 +86,10 @@ public:
static WalletKeysFilesModel *wallets;
static double balance;
static QMap<QString, QString> txDescriptionCache;
static QMap<QString, QString> txCache;
static TxFiatHistory *txFiatHistory;
// libwalletqt
unsigned int blockHeight = 0;
bool refreshed = false;
WalletManager *walletManager;
Wallet *currentWallet = nullptr;
@@ -113,7 +115,7 @@ public slots:
void onSweepOutput(const QString &keyImage, QString address, bool churn, int outputs) const;
void onCreateTransactionError(const QString &msg);
void onOpenAliasResolve(const QString &openAlias);
void onSetRestoreHeight(unsigned int height);
void onSetRestoreHeight(quint64 height);
void onPreferredFiatCurrencyChanged(const QString &symbol);
private slots:
@@ -135,11 +137,11 @@ private slots:
void onConnectionStatusChanged(int status);
signals:
void balanceUpdated(double balance, double unlocked, QString balance_str, QString unlocked_str);
void balanceUpdated(quint64 balance, quint64 spendable);
void blockchainSync(int height, int target);
void refreshSync(int height, int target);
void synchronized();
void blockHeightWSUpdated(QMap<QString, unsigned int> heights);
void blockHeightWSUpdated(QMap<QString, int> heights);
void walletSynchronized();
void walletOpened();
void walletClosed();
@@ -161,7 +163,7 @@ signals:
void openAliasResolveError(const QString &msg);
void openAliasResolved(const QString &address, const QString &openAlias);
void setRestoreHeightError(const QString &msg);
void customRestoreHeightSet(unsigned int height);
void customRestoreHeightSet(int height);
void closeApplication();
void donationNag();
void initiateTransaction();
@@ -170,8 +172,7 @@ signals:
void setTitle(const QString &title); // set window title
private:
void sorry();
const unsigned int m_donationBoundary = 15;
const int m_donationBoundary = 15;
UtilsNetworking *m_utilsNetworkingNodes;
QTimer *m_storeTimer = new QTimer(this);
QUrl m_wsUrl = QUrl(QStringLiteral("ws://7e6egbawekbkxzkv4244pqeqgoo4axko2imgjbedwnn6s5yb6b7oliqd.onion/ws"));
+5 -5
View File
@@ -11,6 +11,9 @@
<file>assets/images/appicons/128x128.png</file>
<file>assets/images/appicons/256x256.png</file>
<file>assets/images/arrow.svg</file>
<file>assets/images/banners/1.png</file>
<file>assets/images/banners/2.png</file>
<file>assets/images/banners/3.png</file>
<file>assets/images/bitcoin.png</file>
<file>assets/images/camera_dark.png</file>
<file>assets/images/camera_white.png</file>
@@ -36,8 +39,7 @@
<file>assets/images/eye_blind.png</file>
<file>assets/images/feather.png</file>
<file>assets/images/file.png</file>
<file>assets/images/ghost.png</file>
<file>assets/images/ghost_icon.png</file>
<file>assets/images/gnome-calc.png</file>
<file>assets/images/history.png</file>
<file>assets/images/info.png</file>
<file>assets/images/key.png</file>
@@ -48,11 +50,10 @@
<file>assets/images/lock_icon.png</file>
<file>assets/images/lock.svg</file>
<file>assets/images/microphone.png</file>
<file>assets/images/morphtoken.png</file>
<file>assets/images/mining.png</file>
<file>assets/images/network.png</file>
<file>assets/images/offline_tx.png</file>
<file>assets/images/person.svg</file>
<file>assets/images/photos/1.png</file>
<file>assets/images/preferences.png</file>
<file>assets/images/preferences.svg</file>
<file>assets/images/qrcode.png</file>
@@ -103,6 +104,5 @@
<file>assets/mnemonic_25_english.txt</file>
<file>assets/restore_heights_monero_mainnet.txt</file>
<file>assets/restore_heights_monero_stagenet.txt</file>
<file>assets/user_agents.txt</file>
</qresource>
</RCC>
+4 -2
View File
@@ -1,8 +1,10 @@
The wallet UI is heavily inspired by Electrum. We would like to recognize Thomas Voegtlin for his pioneering work on Bitcoin.
Feather uses monero-seed written by Tevador, for 14 word mnemonic seeds.
Initial CMake support for the Monero GUI was coded by TheCharlatan/xiphon.
Wizard banner art was adapted from a paper wallet design by the themonera (themonera.art).
The wallet UI is heavily inspired by Electrum. We would like to recognize Thomas Voegtlin for his pioneering work on Bitcoin.
Initial CMake support for the Monero GUI was coded by TheCharlatan/xiphon.
Huge thanks to nioc, fluffypony, wowario, thrmo for help during development.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

File diff suppressed because it is too large Load Diff
-5
View File
@@ -1,5 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file>assets/exec/xmrig</file>
</qresource>
</RCC>
+6 -1
View File
@@ -14,6 +14,7 @@
#include <QKeyEvent>
#include <QMenu>
#include <QAction>
#include <QMessageBox>
CoinsWidget::CoinsWidget(QWidget *parent)
: QWidget(parent)
@@ -36,6 +37,7 @@ CoinsWidget::CoinsWidget(QWidget *parent)
m_copyMenu->addAction("Key Image", this, [this]{copy(copyField::KeyImage);});
m_copyMenu->addAction("Transaction ID", this, [this]{copy(copyField::TxID);});
m_copyMenu->addAction("Address", this, [this]{copy(copyField::Address);});
m_copyMenu->addAction("Label", this, [this]{copy(copyField::Label);});
m_copyMenu->addAction("Height", this, [this]{copy(copyField::Height);});
m_copyMenu->addAction("Amount", this, [this]{copy(copyField::Amount);});
@@ -196,7 +198,7 @@ void CoinsWidget::onSweepOutput() {
qCritical() << "key image: " << keyImage;
if (!keyImageKnown) {
Utils::showMessageBox("Unable to sweep output", "Unable to sweep output: key image unknown", true);
QMessageBox::warning(this, "Unable to sweep output", "Unable to sweep output: key image unknown");
return;
}
@@ -229,6 +231,9 @@ void CoinsWidget::copy(copyField field) {
case Address:
data = c.address();
break;
case Label:
data = c.addressLabel();
break;
case Height:
data = QString::number(c.blockHeight());
break;
+1
View File
@@ -48,6 +48,7 @@ private:
KeyImage,
TxID,
Address,
Label,
Height,
Amount
};
+42 -13
View File
@@ -5,17 +5,17 @@
#include "ui_contactswidget.h"
#include "dialog/contactsdialog.h"
#include "model/ModelUtils.h"
#include "utils/utils.h"
#include "mainwindow.h"
#include "libwalletqt/AddressBook.h"
#include <QClipboard>
#include <QDebug>
#include <QKeyEvent>
#include <QMessageBox>
ContactsWidget::ContactsWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::ContactsWidget)
{
ui->setupUi(this);
m_ctx = MainWindow::getContext();
// header context menu
ui->contacts->header()->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -28,15 +28,16 @@ ContactsWidget::ContactsWidget(QWidget *parent) :
// context menu
ui->contacts->setContextMenuPolicy(Qt::CustomContextMenu);
m_contextMenu = new QMenu(ui->contacts);
m_contextMenu->addAction(QIcon(":/assets/images/person.svg"), "New contact", this, &ContactsWidget::newContact);
m_contextMenu->addAction(QIcon(":/assets/images/person.svg"), "New contact", [this]{
this->newContact();
});
// row context menu
m_rowMenu = new QMenu(ui->contacts);
m_rowMenu->addAction(QIcon(":/assets/images/copy.png"), "Copy address", this, &ContactsWidget::copyAddress);
m_rowMenu->addAction(QIcon(":/assets/images/copy.png"), "Copy name", this, &ContactsWidget::copyName);
m_rowMenu->addAction(QIcon(":/assets/images/appicons/128x128.png"), "Pay to", this, &ContactsWidget::payTo);
m_deleteEntryAction = m_rowMenu->addAction("Delete", this, &ContactsWidget::deleteContact);
m_rowMenu->addAction("Pay to", this, &ContactsWidget::payTo);
m_rowMenu->addAction("Delete", this, &ContactsWidget::deleteContact);
connect(ui->contacts, &QTreeView::customContextMenuRequested, [=](const QPoint & point){
QModelIndex index = ui->contacts->indexAt(point);
@@ -95,16 +96,44 @@ void ContactsWidget::showHeaderMenu(const QPoint& position)
m_headerMenu->exec(QCursor::pos());
}
void ContactsWidget::newContact()
void ContactsWidget::newContact(QString address, QString name)
{
auto * dialog = new ContactsDialog(this);
auto * dialog = new ContactsDialog(this, address, name);
int ret = dialog->exec();
if (!ret) return;
QString address = dialog->getAddress();
QString name = dialog->getName();
address = dialog->getAddress();
name = dialog->getName();
emit addContact(address, name);
bool addressValid = WalletManager::addressValid(address, m_ctx->currentWallet->nettype());
if (!addressValid) {
QMessageBox::warning(this, "Invalid address", "Invalid address");
return;
}
int num_addresses = m_ctx->currentWallet->addressBook()->count();
QString address_entry;
QString name_entry;
for (int i=0; i<num_addresses; i++) {
m_ctx->currentWallet->addressBook()->getRow(i, [&address_entry, &name_entry](const AddressBookInfo &entry){
address_entry = entry.address();
name_entry = entry.description();
});
if (address == address_entry) {
QMessageBox::warning(this, "Unable to add contact", "Duplicate address");
ui->contacts->setCurrentIndex(m_model->index(i,0)); // Highlight duplicate address
return;
}
if (name == name_entry) {
QMessageBox::warning(this, "Unable to add contact", "Duplicate label");
this->newContact(address, name);
return;
}
}
m_ctx->currentWallet->addressBook()->addRow(address, "", name);
m_ctx->storeWallet();
}
void ContactsWidget::deleteContact()
+5 -5
View File
@@ -6,6 +6,7 @@
#include "model/AddressBookModel.h"
#include "model/AddressBookProxyModel.h"
#include "appcontext.h"
#include <QWidget>
#include <QMenu>
@@ -21,29 +22,28 @@ class ContactsWidget : public QWidget
public:
explicit ContactsWidget(QWidget *parent = nullptr);
void setModel(AddressBookModel * model);
~ContactsWidget();
~ContactsWidget() override;
public slots:
void copyAddress();
void copyName();
void payTo();
void newContact();
void newContact(QString address = "", QString name = "");
void deleteContact();
void setShowFullAddresses(bool show);
void setSearchFilter(const QString &filter);
signals:
void addContact(QString &address, QString &name);
void fillAddress(QString &address);
private slots:
void showHeaderMenu(const QPoint& position);
void showHeaderMenu(const QPoint &position);
private:
Ui::ContactsWidget *ui;
AppContext *m_ctx;
QAction *m_showFullAddressesAction;
QAction *m_deleteEntryAction;
QMenu *m_rowMenu;
QMenu *m_contextMenu;
QMenu *m_headerMenu;
+27
View File
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#include "balancedialog.h"
#include "ui_balancedialog.h"
#include "libwalletqt/WalletManager.h"
BalanceDialog::BalanceDialog(QWidget *parent, Wallet *wallet)
: QDialog(parent)
, ui(new Ui::BalanceDialog)
{
ui->setupUi(this);
ui->label_unconfirmed_help->setHelpText("Outputs require 10 confirmations before they become spendable. "
"This will take 20 minutes on average.");
ui->label_unconfirmed->setText(WalletManager::displayAmount(wallet->balance() - wallet->unlockedBalance()));
ui->label_spendable->setText(WalletManager::displayAmount(wallet->unlockedBalance()));
ui->label_total->setText(WalletManager::displayAmount(wallet->balance()));
this->adjustSize();
}
BalanceDialog::~BalanceDialog() {
delete ui;
}
+27
View File
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#ifndef FEATHER_BALANCEDIALOG_H
#define FEATHER_BALANCEDIALOG_H
#include "libwalletqt/Wallet.h"
#include <QDialog>
namespace Ui {
class BalanceDialog;
}
class BalanceDialog : public QDialog
{
Q_OBJECT
public:
explicit BalanceDialog(QWidget *parent, Wallet *wallet);
~BalanceDialog() override;
private:
Ui::BalanceDialog *ui;
};
#endif //FEATHER_BALANCEDIALOG_H
+142
View File
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BalanceDialog</class>
<widget class="QDialog" name="BalanceDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>405</width>
<height>162</height>
</rect>
</property>
<property name="windowTitle">
<string>Balance</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="HelpLabel" name="label_unconfirmed_help">
<property name="text">
<string>Unconfirmed</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_unconfirmed">
<property name="text">
<string>0.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_spendable_help">
<property name="text">
<string>Spendable</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_spendable">
<property name="text">
<string>0.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Total</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_total">
<property name="text">
<string>0.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>HelpLabel</class>
<extends>QLabel</extends>
<header>components.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>BalanceDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>BalanceDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+7 -2
View File
@@ -3,10 +3,11 @@
#include "broadcasttxdialog.h"
#include "ui_broadcasttxdialog.h"
#include "utils/nodes.h"
#include <QMessageBox>
BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, AppContext *ctx)
BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, AppContext *ctx, const QString &transactionHex)
: QDialog(parent)
, m_ctx(ctx)
, ui(new Ui::BroadcastTxDialog)
@@ -23,6 +24,10 @@ BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, AppContext *ctx)
connect(m_rpc, &DaemonRpc::ApiResponse, this, &BroadcastTxDialog::onApiResponse);
if (!transactionHex.isEmpty()) {
ui->transaction->setPlainText(transactionHex);
}
this->adjustSize();
}
@@ -33,7 +38,7 @@ void BroadcastTxDialog::broadcastTx() {
QString node;
if (ui->radio_useCustom->isChecked())
node = ui->customNode->text();
else
else if (ui->radio_useDefault->isChecked())
node = m_ctx->nodes->connection().full;
if (!node.startsWith("http://"))
+1 -1
View File
@@ -17,7 +17,7 @@ class BroadcastTxDialog : public QDialog
Q_OBJECT
public:
explicit BroadcastTxDialog(QWidget *parent, AppContext *ctx);
explicit BroadcastTxDialog(QWidget *parent, AppContext *ctx, const QString &transactionHex = "");
~BroadcastTxDialog() override;
private slots:
-10
View File
@@ -63,16 +63,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>All transactions are broadcast over Tor</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
+7 -1
View File
@@ -4,13 +4,19 @@
#include "ui_contactsdialog.h"
#include "contactsdialog.h"
ContactsDialog::ContactsDialog(QWidget *parent)
ContactsDialog::ContactsDialog(QWidget *parent, const QString &address, const QString &name)
: QDialog(parent)
, ui(new Ui::ContactsDialog)
{
ui->setupUi(this);
setMinimumWidth(400);
ui->lineEdit_address->setText(address);
ui->lineEdit_name->setText(name);
if (!name.isEmpty()) {
ui->lineEdit_name->setFocus();
}
connect(ui->buttonBox, &QDialogButtonBox::accepted, [&](){
m_address = ui->lineEdit_address->text();
m_name = ui->lineEdit_name->text();
+1 -1
View File
@@ -15,7 +15,7 @@ class ContactsDialog : public QDialog
Q_OBJECT
public:
explicit ContactsDialog(QWidget *parent = nullptr);
explicit ContactsDialog(QWidget *parent = nullptr, const QString &address = "", const QString &name = "");
~ContactsDialog() override;
QString getAddress();
+11 -2
View File
@@ -27,7 +27,15 @@ DebugInfoDialog::DebugInfoDialog(AppContext *ctx, QWidget *parent)
void DebugInfoDialog::updateInfo() {
QString torStatus;
if(m_ctx->isTorSocks)
// Special case for Tails because we know the status of the daemon by polling tails-tor-has-bootstrapped.target
if(m_ctx->isTails) {
if(m_ctx->tor->torConnected)
torStatus = "Connected";
else
torStatus = "Disconnected";
}
else if(m_ctx->isTorSocks)
torStatus = "Torsocks";
else if(m_ctx->tor->localTor)
torStatus = "Local (assumed to be running)";
@@ -49,11 +57,12 @@ void DebugInfoDialog::updateInfo() {
ui->label_remoteNode->setText(node.full);
ui->label_walletStatus->setText(this->statusToString(m_ctx->currentWallet->connectionStatus()));
ui->label_torStatus->setText(torStatus);
ui->label_websocketStatus->setText(Utils::QtEnumToString(m_ctx->ws->webSocket.state()));
ui->label_websocketStatus->setText(Utils::QtEnumToString(m_ctx->ws->webSocket.state()).remove("State"));
ui->label_netType->setText(Utils::QtEnumToString(m_ctx->currentWallet->nettype()));
ui->label_seedType->setText(m_ctx->currentWallet->getCacheAttribute("feather.seed").isEmpty() ? "25 word" : "14 word");
ui->label_viewOnly->setText(m_ctx->currentWallet->viewOnly() ? "True" : "False");
ui->label_primaryOnly->setText(m_ctx->currentWallet->balance(0) == m_ctx->currentWallet->balanceAll() ? "True" : "False");
QString os = QSysInfo::prettyProductName();
if (m_ctx->isTails) {
+19 -5
View File
@@ -258,14 +258,14 @@
</property>
</widget>
</item>
<item row="19" column="0">
<item row="20" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Timestamp:</string>
</property>
</widget>
</item>
<item row="19" column="1">
<item row="20" column="1">
<widget class="QLabel" name="label_timestamp">
<property name="text">
<string>TextLabel</string>
@@ -275,14 +275,14 @@
</property>
</widget>
</item>
<item row="18" column="0">
<item row="19" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Operating system:</string>
</property>
</widget>
</item>
<item row="18" column="1">
<item row="19" column="1">
<widget class="QLabel" name="label_OS">
<property name="text">
<string>TextLabel</string>
@@ -292,7 +292,7 @@
</property>
</widget>
</item>
<item row="17" column="1">
<item row="18" column="1">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -316,6 +316,20 @@
</property>
</widget>
</item>
<item row="17" column="1">
<widget class="QLabel" name="label_primaryOnly">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="17" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Primary only:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
+1 -1
View File
@@ -24,7 +24,7 @@ RestoreDialog::RestoreDialog(AppContext *ctx, QWidget *parent)
}
}
unsigned int RestoreDialog::getHeight() {
int RestoreDialog::getHeight() {
return ui->restoreHeightWidget->getHeight();
}
+1 -1
View File
@@ -24,7 +24,7 @@ Q_OBJECT
public:
explicit RestoreDialog(AppContext *ctx, QWidget *parent = nullptr);
void initRestoreHeights(RestoreHeightLookup *lookup);
unsigned int getHeight();
int getHeight();
~RestoreDialog() override;
signals:
+2 -2
View File
@@ -21,12 +21,12 @@ SeedDialog::SeedDialog(Wallet *wallet, QWidget *parent)
this->setSeed(seed_25_words);
} else {
this->setSeed(seed_14_words);
ui->widgetRestoreHeight->setVisible(false);
ui->frameRestoreHeight->setVisible(false);
}
connect(ui->check_toggleSeedType, &QCheckBox::toggled, [this, seed_25_words, seed_14_words](bool toggled){
this->setSeed(toggled ? seed_25_words : seed_14_words);
ui->widgetRestoreHeight->setVisible(toggled);
ui->frameRestoreHeight->setVisible(toggled);
});
ui->label_restoreHeightHelp->setHelpText("Should you restore your wallet in the future, "
+33 -17
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>590</width>
<height>346</height>
<width>519</width>
<height>330</height>
</rect>
</property>
<property name="windowTitle">
@@ -49,7 +49,7 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>125</height>
<height>100</height>
</size>
</property>
<property name="maximumSize">
@@ -64,20 +64,14 @@
</widget>
</item>
<item>
<widget class="QWidget" name="widgetRestoreHeight" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<widget class="QFrame" name="frameRestoreHeight">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="HelpLabel" name="label_restoreHeightHelp">
<property name="text">
@@ -124,14 +118,36 @@
</item>
<item>
<widget class="QLabel" name="label_warning">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>warning</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
+6 -4
View File
@@ -30,9 +30,13 @@ TransactionInfoDialog::TransactionInfoDialog(Wallet *wallet, TransactionInfo *tx
ui->label_txKey->setText(txKey);
}
QString blockHeight = QString::number(txInfo->blockHeight());
if (blockHeight == "0")
blockHeight = "Unconfirmed";
ui->label_status->setText(QString("Status: %1 confirmations").arg(txInfo->confirmations()));
ui->label_date->setText(QString("Date: %1").arg(txInfo->timestamp().toString("yyyy-MM-dd HH:mm")));
ui->label_blockHeight->setText(QString("Block height: %1").arg(txInfo->blockHeight()));
ui->label_blockHeight->setText(QString("Block height: %1").arg(blockHeight));
QString direction = txInfo->direction() == TransactionInfo::Direction_In ? "received" : "sent";
ui->label_amount->setText(QString("Amount %1: %2").arg(direction, txInfo->displayAmount()));
@@ -45,9 +49,7 @@ TransactionInfoDialog::TransactionInfoDialog(Wallet *wallet, TransactionInfo *tx
QString destinations = txInfo->destinations_formatted();
if (destinations.isEmpty()) {
ui->destinations->setHidden(true);
ui->label_destinations->setHidden(true);
ui->line_2->setHidden(true);
ui->frameDestinations->hide();
} else {
ui->destinations->setText(destinations);
}
+46 -22
View File
@@ -132,30 +132,54 @@
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QFrame" name="frameDestinations">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_destinations">
<property name="text">
<string>Destinations:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="destinations">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_destinations">
<property name="text">
<string>Destinations:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="destinations">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
+14 -7
View File
@@ -32,16 +32,22 @@ TxConfDialog::TxConfDialog(AppContext *ctx, PendingTransaction *tx, const QStrin
};
QString amount = WalletManager::displayAmount(tx->amount());
QString amount_fiat = convert(tx->amount() / globals::cdiv);
ui->label_amount->setText(QString("%1 (%2 %3)").arg(amount, amount_fiat, preferredCur));
QString fee = WalletManager::displayAmount(tx->fee());
QString fee_fiat = convert(tx->fee() / globals::cdiv);
ui->label_fee->setText(QString("%1 (%2 %3)").arg(fee, fee_fiat, preferredCur));
QString total = WalletManager::displayAmount(tx->amount() + tx->fee());
QVector<QString> amounts = {amount, fee, total};
int maxLength = Utils::maxLength(amounts);
std::for_each(amounts.begin(), amounts.end(), [maxLength](QString& amount){amount = amount.rightJustified(maxLength, ' ');});
QString amount_fiat = convert(tx->amount() / globals::cdiv);
QString fee_fiat = convert(tx->fee() / globals::cdiv);
QString total_fiat = convert((tx->amount() + tx->fee()) / globals::cdiv);
ui->label_total->setText(QString("%1 (%2 %3)").arg(total, total_fiat, preferredCur));
QVector<QString> amounts_fiat = {amount_fiat, fee_fiat, total_fiat};
int maxLengthFiat = Utils::maxLength(amounts_fiat);
std::for_each(amounts_fiat.begin(), amounts_fiat.end(), [maxLengthFiat](QString& amount){amount = amount.rightJustified(maxLengthFiat, ' ');});
ui->label_amount->setText(QString("%1 (%2 %3)").arg(amounts[0], amounts_fiat[0], preferredCur));
ui->label_fee->setText(QString("%1 (%2 %3)").arg(amounts[1], amounts_fiat[1], preferredCur));
ui->label_total->setText(QString("%1 (%2 %3)").arg(amounts[2], amounts_fiat[2], preferredCur));
ui->label_address->setText(ModelUtils::displayAddress(address, 2));
ui->label_address->setFont(ModelUtils::getMonospaceFont());
@@ -51,6 +57,7 @@ TxConfDialog::TxConfDialog(AppContext *ctx, PendingTransaction *tx, const QStrin
connect(ui->btn_Advanced, &QPushButton::clicked, this, &TxConfDialog::setShowAdvanced);
AppContext::txCache[tx->txid()[0]] = tx->signedTxToHex(0);
this->adjustSize();
}
+38 -20
View File
@@ -25,20 +25,9 @@ HistoryWidget::HistoryWidget(QWidget *parent)
m_copyMenu->addAction("Transaction ID", this, [this]{copy(copyField::TxID);});
m_copyMenu->addAction("Date", this, [this]{copy(copyField::Date);});
m_copyMenu->addAction("Amount", this, [this]{copy(copyField::Amount);});
auto spendProof = m_copyMenu->addAction("Spend proof", this, &HistoryWidget::getSpendProof);
ui->history->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->history, &QTreeView::customContextMenuRequested, [=](const QPoint & point){
QModelIndex index = ui->history->indexAt(point);
if (index.isValid()) {
TransactionInfo::Direction direction;
m_txHistory->transaction(m_model->mapToSource(index).row(), [&direction](TransactionInfo &tInfo) {
direction = tInfo.direction();
});
spendProof->setVisible(direction == TransactionInfo::Direction_Out);
m_contextMenu->exec(ui->history->viewport()->mapToGlobal(point));
}
});
connect(ui->history, &QTreeView::customContextMenuRequested, this, &HistoryWidget::showContextMenu);
connect(ui->search, &QLineEdit::textChanged, this, &HistoryWidget::setSearchFilter);
connect(ui->history, &QTreeView::doubleClicked, [this](QModelIndex index){
@@ -50,6 +39,43 @@ HistoryWidget::HistoryWidget(QWidget *parent)
}
void HistoryWidget::showContextMenu(const QPoint &point) {
QModelIndex index = ui->history->indexAt(point);
if (!index.isValid()) {
return;
}
QMenu menu(this);
TransactionInfo::Direction direction;
QString txid;
bool unconfirmed;
m_txHistory->transaction(m_model->mapToSource(index).row(), [&direction, &txid, &unconfirmed](TransactionInfo &tInfo) {
direction = tInfo.direction();
txid = tInfo.hash();
unconfirmed = tInfo.isFailed() || tInfo.isPending();
});
if (AppContext::txCache.contains(txid) && unconfirmed && direction != TransactionInfo::Direction_In) {
menu.addAction(QIcon(":/assets/images/info.png"), "Resend transaction", this, &HistoryWidget::onResendTransaction);
}
menu.addMenu(m_copyMenu);
menu.addAction(QIcon(":/assets/images/info.png"), "Show details", this, &HistoryWidget::showTxDetails);
menu.addAction(QIcon(":/assets/images/network.png"), "View on block explorer", this, &HistoryWidget::onViewOnBlockExplorer);
menu.exec(ui->history->viewport()->mapToGlobal(point));
}
void HistoryWidget::onResendTransaction() {
QModelIndex index = ui->history->currentIndex();
QString txid;
m_txHistory->transaction(m_model->mapToSource(index).row(), [&txid](TransactionInfo &tInfo) {
txid = tInfo.hash();
});
emit resendTransaction(txid);
}
void HistoryWidget::setModel(TransactionHistoryProxyModel *model, Wallet *wallet)
{
m_model = model;
@@ -86,14 +112,6 @@ void HistoryWidget::onViewOnBlockExplorer() {
emit viewOnBlockExplorer(txid);
}
void HistoryWidget::getSpendProof() {
QModelIndex index = ui->history->currentIndex();
m_txHistory->transaction(m_model->mapToSource(index).row(), [this](TransactionInfo &tInfo) {
emit spendProof(tInfo.hash());
});
}
void HistoryWidget::setSearchText(const QString &text) {
ui->search->setText(text);
}
+3 -2
View File
@@ -29,14 +29,14 @@ public slots:
void setSearchText(const QString &text);
signals:
void spendProof(QString txid);
void viewOnBlockExplorer(QString txid);
void resendTransaction(QString txid);
private slots:
void showTxDetails();
void onViewOnBlockExplorer();
void getSpendProof();
void setSearchFilter(const QString &filter);
void onResendTransaction();
private:
enum copyField {
@@ -46,6 +46,7 @@ private:
};
void copy(copyField field);
void showContextMenu(const QPoint &point);
Ui::HistoryWidget *ui;
QMenu *m_contextMenu;
+4
View File
@@ -76,6 +76,10 @@ QString CoinsInfo::address() const {
}
QString CoinsInfo::addressLabel() const {
if (m_subaddrIndex == 0) {
return m_coinbase ? "Coinbase" : "Change";
}
return m_addressLabel;
}
+1 -1
View File
@@ -39,7 +39,7 @@ namespace {
static const int DAEMON_BLOCKCHAIN_TARGET_HEIGHT_CACHE_TTL_SECONDS = 30;
static const int WALLET_CONNECTION_STATUS_CACHE_TTL_SECONDS = 5;
static constexpr char ATTRIBUTE_SUBADDRESS_ACCOUNT[] ="gui.subaddress_account";
static constexpr char ATTRIBUTE_SUBADDRESS_ACCOUNT[] = "feather.subaddress_account";
}
Wallet::Wallet(QObject * parent)
+2 -6
View File
@@ -26,16 +26,12 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(assets);
#if defined(Q_OS_MAC) && defined(HAS_TOR)
#if defined(Q_OS_MAC) && defined(HAS_TOR_BIN)
Q_INIT_RESOURCE(assets_tor_macos);
#elif defined(HAS_TOR)
#elif defined(HAS_TOR_BIN)
Q_INIT_RESOURCE(assets_tor);
#endif
#if defined(HAS_XMRIG)
Q_INIT_RESOURCE(assets_mining);
#endif
#ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
freopen("CONOUT$", "w", stdout);
+123 -118
View File
@@ -21,12 +21,14 @@
#include "dialog/broadcasttxdialog.h"
#include "dialog/tximportdialog.h"
#include "dialog/passworddialog.h"
#include "dialog/balancedialog.h"
#include "utils/utils.h"
#include "utils/config.h"
#include "utils/daemonrpc.h"
#include "components.h"
#include "calcwindow.h"
#include "ui_mainwindow.h"
#include "globals.h"
// libwalletqt
#include "libwalletqt/WalletManager.h"
@@ -79,7 +81,7 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connected ? m_statusBtnTor->setIcon(QIcon(":/assets/images/tor_logo.png"))
: m_statusBtnTor->setIcon(QIcon(":/assets/images/tor_logo_disabled.png"));});
connect(m_ctx->nodes, &Nodes::updateStatus, [=](const QString &msg){
m_statusLabelStatus->setText(msg);
this->setStatusText(msg);
});
// menu connects
@@ -104,9 +106,9 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
"Try to explain not only what the bug is, but how it occurs.</body>");
});
connect(ui->actionShow_debug_info, &QAction::triggered, this, &MainWindow::showDebugInfo);
connect(ui->actionOfficialWebsite, &QAction::triggered, [=] { Utils::externalLinkWarning("https://featherwallet.org"); });
connect(ui->actionOfficialWebsite, &QAction::triggered, [=] { Utils::externalLinkWarning(this, "https://featherwallet.org"); });
#if defined(XMRTO)
#if defined(HAS_XMRTO)
// xmr.to connects/widget
connect(ui->xmrToWidget, &XMRToWidget::viewOrder, m_ctx->XMRTo, &XmrTo::onViewOrder);
connect(ui->xmrToWidget, &XMRToWidget::getRates, m_ctx->XMRTo, &XmrTo::onGetRates);
@@ -115,14 +117,10 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connect(m_ctx->XMRTo, &XmrTo::connectionError, ui->xmrToWidget, &XMRToWidget::onConnectionError);
connect(m_ctx->XMRTo, &XmrTo::connectionSuccess, ui->xmrToWidget, &XMRToWidget::onConnectionSuccess);
connect(m_ctx, &AppContext::balanceUpdated, ui->xmrToWidget, &XMRToWidget::onBalanceUpdated);
connect(m_ctx->XMRTo, &XmrTo::openURL, this, [=](const QString &url){ Utils::externalLinkWarning(url); });
connect(m_ctx->XMRTo, &XmrTo::openURL, this, [=](const QString &url){ Utils::externalLinkWarning(this, url); });
ui->xmrToWidget->setHistoryModel(m_ctx->XMRTo->tableModel);
#else
ui->tabWidget->setTabVisible(Tabs::XMR_TO, false);
#endif
#ifndef HAS_MORPHTOKEN
ui->tabWidget->setTabVisible(Tabs::MORPHTOKEN, false);
ui->tabExchanges->setTabVisible(0, false);
#endif
#if defined(Q_OS_LINUX)
@@ -162,7 +160,7 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
ui->tickerLayout->addWidget(tickerWidget);
}
m_balanceWidget = new TickerWidget(this, "XMR", "Balance", true);
m_balanceWidget = new TickerWidget(this, "XMR", "Balance", true, true);
ui->fiatTickerLayout->addWidget(m_balanceWidget);
// Send widget
@@ -190,26 +188,13 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
ui->tabWidget->setTabVisible(Tabs::XMRIG, false);
#endif
// CCS/Reddit widget
m_ccsWidget = new CCSWidget(this);
m_redditWidget = new RedditWidget(this);
connect(ui->ccsWidget, &CCSWidget::selected, this, &MainWindow::showSendScreen);
connect(m_ctx, &AppContext::ccsUpdated, ui->ccsWidget->model(), &CCSModel::updateEntries);
connect(m_ctx, &AppContext::redditUpdated, ui->redditWidget->model(), &RedditModel::updatePosts);
m_ccsWidget->hide();
m_redditWidget->hide();
ui->coolLayout->addWidget(m_ccsWidget);
ui->coolLayout->addWidget(m_redditWidget);
connect(m_ctx, &AppContext::ccsEmpty, [=] {
if(m_ccsWidget->isVisible()) {
// display Reddit widget instead
m_ccsWidget->show();
m_redditWidget->show();
}
connect(ui->tabHomeWidget, &QTabWidget::currentChanged, [](int index){
config()->set(Config::homeWidget, TabsHome(index));
});
connect(m_ctx, &AppContext::ccsUpdated, m_ccsWidget->model(), &CCSModel::updateEntries);
connect(m_ctx, &AppContext::redditUpdated, m_redditWidget->model(), &RedditModel::updatePosts);
connect(m_ccsWidget, &CCSWidget::selected, this, &MainWindow::showSendScreen);
connect(m_ctx, &AppContext::donationNag, [=]{
auto msg = "Feather is a 100% community-sponsored endeavor. Please consider supporting "
@@ -229,7 +214,6 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connect(this, &MainWindow::walletClosed, ui->xmrToWidget, &XMRToWidget::onWalletClosed);
connect(this, &MainWindow::walletClosed, ui->sendWidget, &SendWidget::onWalletClosed);
connect(m_ctx, &AppContext::balanceUpdated, this, &MainWindow::onBalanceUpdated);
connect(m_ctx, &AppContext::balanceUpdated, ui->xmrToWidget, &XMRToWidget::onBalanceUpdated);
connect(m_ctx, &AppContext::walletOpened, this, &MainWindow::onWalletOpened);
connect(m_ctx, &AppContext::walletClosed, this, QOverload<>::of(&MainWindow::onWalletClosed));
connect(m_ctx, &AppContext::walletOpenedError, this, &MainWindow::onWalletOpenedError);
@@ -251,18 +235,34 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connect(m_ctx, &AppContext::initiateTransaction, ui->xmrToWidget, &XMRToWidget::onInitiateTransaction);
connect(m_ctx, &AppContext::endTransaction, ui->xmrToWidget, &XMRToWidget::onEndTransaction);
connect(m_ctx, &AppContext::initiateTransaction, [this]{
m_statusDots = 0;
m_constructingTransaction = true;
m_txTimer.start(1000);
});
connect(m_ctx, &AppContext::endTransaction, [this]{
// Todo: endTransaction can fail to fire when the node is switched during tx creation
m_constructingTransaction = false;
m_txTimer.stop();
this->setStatusText(m_statusText);
});
connect(&m_txTimer, &QTimer::timeout, [this]{
m_statusLabelStatus->setText("Constructing transaction" + this->statusDots());
});
// testnet/stagenet warning
auto worthlessWarning = QString("Feather wallet is currently running in %1 mode. This is meant "
"for developers only. Your coins are WORTHLESS.");
if(m_ctx->networkType == NetworkType::STAGENET) {
if (config()->get(Config::warnOnStagenet).toBool()) {
Utils::showMessageBox("Warning", worthlessWarning.arg("stagenet"), true);
QMessageBox::warning(this, "Warning", worthlessWarning.arg("stagenet"));
config()->set(Config::warnOnStagenet, false);
}
}
else if(m_ctx->networkType == NetworkType::TESTNET){
if (config()->get(Config::warnOnTestnet).toBool()) {
Utils::showMessageBox("Warning", worthlessWarning.arg("testnet"), true);
QMessageBox::warning(this, "Warning", worthlessWarning.arg("testnet"));
config()->set(Config::warnOnTestnet, false);
}
}
@@ -282,9 +282,6 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_ctx, &AppContext::onPreferredFiatCurrencyChanged);
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, ui->sendWidget, QOverload<>::of(&SendWidget::onPreferredFiatCurrencyChanged));
// CCS/Reddit widget
connect(m_windowSettings, &Settings::homeWidgetChanged, this, &MainWindow::homeWidgetChanged);
// Skin
connect(m_windowSettings, &Settings::skinChanged, this, &MainWindow::skinChanged);
@@ -305,14 +302,10 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
});
// History
connect(ui->historyWidget, &HistoryWidget::spendProof, [&](const QString &txid){
TxProof txproof = m_ctx->currentWallet->getSpendProof(txid, "");
Utils::copyToClipboard(txproof.proof);
});
connect(ui->historyWidget, &HistoryWidget::viewOnBlockExplorer, this, &MainWindow::onViewOnBlockExplorer);
connect(ui->historyWidget, &HistoryWidget::resendTransaction, this, &MainWindow::onResendTransaction);
// Contacts
connect(ui->contactWidget, &ContactsWidget::addContact, this, &MainWindow::onAddContact);
connect(ui->contactWidget, &ContactsWidget::fillAddress, ui->sendWidget, &SendWidget::fillAddress);
// Open alias
@@ -419,26 +412,18 @@ void MainWindow::initMenu() {
m_tabShowHideMapper["Calc"] = new ToggleTab(ui->tabCalc, "Calc", "Calc", ui->actionShow_calc, Config::showTabCalc);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_calc, "Calc");
#if defined(HAS_MORPHTOKEN)
connect(ui->actionShow_MorphToken, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["MorphToken"] = new ToggleTab(ui->tabMorphToken, "MorphToken", "MorphToken", ui->actionShow_MorphToken, Config::showTabMorphToken);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_MorphToken, "MorphToken");
#if defined(HAS_XMRTO)
connect(ui->actionShow_Exchange, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["Exchange"] = new ToggleTab(ui->tabExchange, "Exchange", "Exchange", ui->actionShow_Exchange, Config::showTabExchange);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_Exchange, "Exchange");
#else
ui->actionShow_MorphToken->setVisible(false);
#endif
#if defined(XMRTO)
connect(ui->actionShow_xmr_to, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["XMRto"] = new ToggleTab(ui->tabXmrTo, "XMRto", "XMR.to", ui->actionShow_xmr_to, Config::showTabXMRto);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_xmr_to, "XMRto");
#else
ui->actionShow_xmr_to->setVisible(false);
ui->actionShow_Exchanges->setVisible(false);
#endif
#if defined(HAS_XMRIG)
connect(ui->actionShow_XMRig, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["XMRig"] = new ToggleTab(ui->tabXmrRig, "XMRig", "XMRig", ui->actionShow_XMRig, Config::showTabXMRig);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_XMRig, "XMRig");
m_tabShowHideMapper["Mining"] = new ToggleTab(ui->tabXmrRig, "Mining", "Mining", ui->actionShow_XMRig, Config::showTabXMRig);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_XMRig, "Mining");
#else
ui->actionShow_XMRig->setVisible(false);
#endif
@@ -457,15 +442,16 @@ void MainWindow::initMenu() {
connect(ui->actionPassword, &QAction::triggered, this, &MainWindow::showPasswordDialog);
connect(ui->actionKeys, &QAction::triggered, this, &MainWindow::showKeysDialog);
connect(ui->actionViewOnly, &QAction::triggered, this, &MainWindow::showViewOnlyDialog);
connect(ui->actionStore_wallet, &QAction::triggered, [&]{
connect(ui->actionStore_wallet, &QAction::triggered, [this]{
m_ctx->currentWallet->store();
});
connect(ui->actionRefresh_tabs, &QAction::triggered, [&]{
connect(ui->actionRefresh_tabs, &QAction::triggered, [this]{
m_ctx->refreshModels();
});
connect(ui->actionUpdate_balance, &QAction::triggered, [&]{
connect(ui->actionUpdate_balance, &QAction::triggered, [this]{
m_ctx->updateBalance();
});
connect(ui->actionRescan_spent, &QAction::triggered, this, &MainWindow::rescanSpent);
connect(ui->actionExportKeyImages, &QAction::triggered, this, &MainWindow::exportKeyImages);
connect(ui->actionImportKeyImages, &QAction::triggered, this, &MainWindow::importKeyImages);
connect(ui->actionExportOutputs, &QAction::triggered, this, &MainWindow::exportOutputs);
@@ -473,7 +459,7 @@ void MainWindow::initMenu() {
// set restore height
connect(ui->actionChange_restore_height, &QAction::triggered, this, &MainWindow::showRestoreHeightDialog);
connect(m_ctx, &AppContext::customRestoreHeightSet, [=](unsigned int height){
connect(m_ctx, &AppContext::customRestoreHeightSet, [=](int height){
auto msg = QString("The restore height for this wallet has been set to %1. "
"Please re-open the wallet. Feather will now quit.").arg(height);
QMessageBox::information(this, "Cannot set custom restore height", msg);
@@ -487,7 +473,7 @@ void MainWindow::initMenu() {
if(fn.isEmpty()) return;
if(!fn.endsWith(".csv")) fn += ".csv";
m_ctx->currentWallet->history()->writeCSV(fn);
Utils::showMessageBox("CSV export", QString("Transaction history exported to %1").arg(fn), false);
QMessageBox::information(this, "CSV export", QString("Transaction history exported to %1").arg(fn));
});
// Contact widget
@@ -495,7 +481,7 @@ void MainWindow::initMenu() {
if(m_ctx->currentWallet == nullptr) return;
auto *model = m_ctx->currentWallet->addressBookModel();
if (model->rowCount() <= 0){
Utils::showMessageBox("Error", "Addressbook empty", true);
QMessageBox::warning(this, "Error", "Addressbook empty");
return;
}
@@ -505,7 +491,7 @@ void MainWindow::initMenu() {
qint64 now = QDateTime::currentDateTime().currentMSecsSinceEpoch();
QString fn = QString("%1/monero-contacts_%2.csv").arg(targetDir, QString::number(now / 1000));
if(model->writeCSV(fn))
Utils::showMessageBox("Address book exported", QString("Address book exported to %1").arg(fn), false);
QMessageBox::information(this, "Address book exported", QString("Address book exported to %1").arg(fn));
});
connect(ui->actionImportContactsCSV, &QAction::triggered, this, &MainWindow::importContacts);
@@ -523,9 +509,8 @@ void MainWindow::initMenu() {
connect(ui->actionAbout, &QAction::triggered, this, &MainWindow::menuAboutClicked);
connect(ui->actionDonate_to_Feather, &QAction::triggered, this, &MainWindow::donateButtonClicked);
// Close / Open
// Close wallet
connect(ui->actionClose, &QAction::triggered, this, &MainWindow::menuWalletCloseClicked);
connect(ui->actionOpen, &QAction::triggered, this, &MainWindow::menuWalletOpenClicked);
}
void MainWindow::menuToggleTabVisible(const QString &key){
@@ -538,20 +523,14 @@ void MainWindow::menuToggleTabVisible(const QString &key){
}
void MainWindow::initWidgets() {
auto homeWidget = config()->get(Config::homeWidget).toString();
if(homeWidget == QString("ccs")) {
m_ccsWidget->show();
} else if (homeWidget == "reddit") {
m_redditWidget->show();
} else {
config()->set(Config::homeWidget, "ccs");
m_ccsWidget->show();
}
int homeWidget = config()->get(Config::homeWidget).toInt();
ui->tabHomeWidget->setCurrentIndex(TabsHome(homeWidget));
}
WalletWizard *MainWindow::createWizard(WalletWizard::Page startPage){
auto *wizard = new WalletWizard(m_ctx, startPage, this);
connect(wizard, &WalletWizard::openWallet, m_ctx, &AppContext::onOpenWallet);
connect(wizard, &WalletWizard::defaultWalletDirChanged, m_windowSettings, &Settings::updatePaths);
return wizard;
}
@@ -592,7 +571,7 @@ void MainWindow::touchbarShowWallet() {
}
void MainWindow::onWalletCreatedError(const QString &err) {
Utils::showMessageBox("Wallet creation error", err, true);
QMessageBox::warning(this, "Wallet creation error", err);
this->showWizard(WalletWizard::Page_CreateWallet);
}
@@ -639,9 +618,9 @@ void MainWindow::onWalletOpened() {
this->activateWindow();
this->setEnabled(true);
if(!m_ctx->tor->torConnected)
m_statusLabelStatus->setText("Wallet opened - Starting Tor (may take a while)");
this->setStatusText("Wallet opened - Starting Tor (may take a while)");
else
m_statusLabelStatus->setText("Wallet opened - Searching for node");
this->setStatusText("Wallet opened - Searching for node");
connect(m_ctx->currentWallet, &Wallet::connectionStatusChanged, this, &MainWindow::onConnectionStatusChanged);
@@ -683,40 +662,47 @@ void MainWindow::onWalletOpened() {
this->touchbarShowWallet();
this->updatePasswordIcon();
m_updateBytes.start(1000);
m_updateBytes.start(100);
}
void MainWindow::onBalanceUpdated(double balance, double unlocked, const QString &balance_str, const QString &unlocked_str) {
void MainWindow::onBalanceUpdated(quint64 balance, quint64 spendable) {
qDebug() << Q_FUNC_INFO;
bool hide = config()->get(Config::hideBalance).toBool();
auto label_str = QString("Balance: %1 XMR").arg(unlocked_str);
if(balance > unlocked)
label_str += QString(" (+%1 XMR unconfirmed)").arg(QString::number(balance - unlocked, 'f'));
QString label_str = QString("Balance: %1 XMR").arg(QString::number(spendable / globals::cdiv, 'f'));
if (balance > spendable)
label_str += QString(" (+%1 XMR unconfirmed)").arg(QString::number((balance - spendable) / globals::cdiv, 'f'));
if (hide) {
if (hide)
label_str = "Balance: HIDDEN";
}
m_statusLabelBalance->setToolTip("Click for details");
m_statusLabelBalance->setText(label_str);
m_balanceWidget->setHidden(hide);
}
void MainWindow::setStatusText(const QString &text) {
m_statusText = text;
if (!m_constructingTransaction)
m_statusLabelStatus->setText(text);
}
void MainWindow::onSynchronized() {
this->updateNetStats();
m_statusLabelStatus->setText("Synchronized");
this->setStatusText("Synchronized");
this->onConnectionStatusChanged(Wallet::ConnectionStatus_Connected);
}
void MainWindow::onBlockchainSync(int height, int target) {
QString heightText = QString("Blockchain sync: %1/%2").arg(height).arg(target);
m_statusLabelStatus->setText(heightText);
QString blocks = (target >= height) ? QString::number(target - height) : "?";
QString heightText = QString("Blockchain sync: %1 blocks remaining").arg(blocks);
this->setStatusText(heightText);
}
void MainWindow::onRefreshSync(int height, int target) {
QString heightText = QString("Wallet refresh: %1/%2").arg(height).arg(target);
m_statusLabelStatus->setText(heightText);
this->updateNetStats();
QString blocks = (target >= height) ? QString::number(target - height) : "?";
QString heightText = QString("Wallet refresh: %1 blocks remaining").arg(blocks);
this->setStatusText(heightText);
}
void MainWindow::onConnectionStatusChanged(int status)
@@ -730,7 +716,7 @@ void MainWindow::onConnectionStatusChanged(int status)
switch(status){
case Wallet::ConnectionStatus_Disconnected:
statusIcon = ":/assets/images/status_disconnected.svg";
m_statusLabelStatus->setText("Disconnected");
this->setStatusText("Disconnected");
break;
case Wallet::ConnectionStatus_Connected:
if (m_ctx->currentWallet->synchronized()) {
@@ -741,11 +727,11 @@ void MainWindow::onConnectionStatusChanged(int status)
break;
case Wallet::ConnectionStatus_Connecting:
statusIcon = ":/assets/images/status_lagging.svg";
m_statusLabelStatus->setText("Connecting to daemon");
this->setStatusText("Connecting to daemon");
break;
case Wallet::ConnectionStatus_WrongVersion:
statusIcon = ":/assets/images/status_disconnected.svg";
m_statusLabelStatus->setText("Incompatible daemon");
this->setStatusText("Incompatible daemon");
break;
default:
statusIcon = ":/assets/images/status_disconnected.svg";
@@ -769,12 +755,12 @@ void MainWindow::onCreateTransactionSuccess(PendingTransaction *tx, const QStrin
err = QString("%1 %2").arg(err).arg(tx_err);
qDebug() << Q_FUNC_INFO << err;
Utils::showMessageBox("Transaction error", err, true);
QMessageBox::warning(this, "Transactions error", err);
m_ctx->currentWallet->disposeTransaction(tx);
} else if (tx->txCount() == 0) {
err = QString("%1 %2").arg(err).arg("No unmixable outputs to sweep.");
qDebug() << Q_FUNC_INFO << err;
Utils::showMessageBox("Transaction error", err, true);
QMessageBox::warning(this, "Transaction error", err);
m_ctx->currentWallet->disposeTransaction(tx);
} else {
const auto &description = m_ctx->tmpTxDescription;
@@ -847,9 +833,11 @@ void MainWindow::create_status_bar() {
m_statusLabelNetStats->setTextInteractionFlags(Qt::TextSelectableByMouse);
this->statusBar()->addWidget(m_statusLabelNetStats);
m_statusLabelBalance = new QLabel("Balance: 0.00 XMR", this);
m_statusLabelBalance = new ClickableLabel(this);
m_statusLabelBalance->setText("Balance: 0.00 XMR");
m_statusLabelBalance->setTextInteractionFlags(Qt::TextSelectableByMouse);
this->statusBar()->addPermanentWidget(m_statusLabelBalance);
connect(m_statusLabelBalance, &ClickableLabel::clicked, this, &MainWindow::showBalanceDialog);
m_statusBtnConnectionStatusIndicator = new StatusBarButton(QIcon(":/assets/images/status_disconnected.svg"), "Connection status");
connect(m_statusBtnConnectionStatusIndicator, &StatusBarButton::clicked, this, &MainWindow::showConnectionStatusDialog);
@@ -1000,12 +988,12 @@ void MainWindow::menuWalletOpenClicked() {
QFileInfo infoPath(path);
if(!infoPath.isReadable()) {
Utils::showMessageBox("Cannot read wallet file", "Permission error.", true);
QMessageBox::warning(this, "Cannot read wallet file", "Permission error.");
return;
}
if(path == m_ctx->walletPath) {
Utils::showMessageBox("Wallet already opened", "Please open another wallet.", true);
QMessageBox::warning(this, "Wallet already opened", "Please open another wallet.");
return;
}
@@ -1047,16 +1035,6 @@ void MainWindow::skinChanged(const QString &skinName) {
qDebug() << QString("Skin changed to %1").arg(skinName);
}
void MainWindow::homeWidgetChanged(const QString &widgetName) {
if(widgetName == "ccs"){
m_ccsWidget->show();
m_redditWidget->hide();
} else if(widgetName == "reddit") {
m_ccsWidget->hide();
m_redditWidget->show();
}
}
void MainWindow::closeEvent(QCloseEvent *event) {
cleanupBeforeClose();
@@ -1064,11 +1042,11 @@ void MainWindow::closeEvent(QCloseEvent *event) {
}
void MainWindow::donateButtonClicked() {
double donation = AppContext::prices->convert("EUR", "XMR", m_ctx->featherDonationAmount);
if(donation <= 0)
donation = 1.337;
double donation = AppContext::prices->convert("EUR", "XMR", m_ctx->donationAmount);
if (donation <= 0)
donation = 0.1337;
ui->sendWidget->fill(m_ctx->featherDonationAddress, "Donation to the Feather development team", donation);
ui->sendWidget->fill(m_ctx->donationAddress, "Donation to the Feather development team", donation);
ui->tabWidget->setCurrentIndex(Tabs::SEND);
}
@@ -1093,17 +1071,21 @@ void MainWindow::showSendScreen(const CCSEntry &entry) {
void MainWindow::onViewOnBlockExplorer(const QString &txid) {
QString blockExplorerLink = Utils::blockExplorerLink(config()->get(Config::blockExplorer).toString(), m_ctx->networkType, txid);
Utils::externalLinkWarning(blockExplorerLink);
Utils::externalLinkWarning(this, blockExplorerLink);
}
void MainWindow::onAddContact(const QString &address, const QString &name) {
bool addressValid = WalletManager::addressValid(address, m_ctx->currentWallet->nettype());
if (!addressValid)
QMessageBox::warning(this, "Invalid address", "Invalid address");
else {
m_ctx->currentWallet->addressBook()->addRow(address, "", name);
m_ctx->storeWallet();
void MainWindow::onResendTransaction(const QString &txid) {
if (!AppContext::txCache.contains(txid)) {
QMessageBox::warning(this, "Unable to resend transaction", "Transaction was not found in transaction cache. Unable to resend.");
return;
}
// Connect to a different node so chances of successful relay are higher
m_ctx->nodes->autoConnect(true);
auto dialog = new BroadcastTxDialog(this, m_ctx, AppContext::txCache[txid]);
dialog->exec();
dialog->deleteLater();
}
void MainWindow::importContacts() {
@@ -1344,6 +1326,29 @@ void MainWindow::updateNetStats() {
m_statusLabelNetStats->setText(QString("(D: %1)").arg(Utils::formatBytes(m_ctx->currentWallet->getBytesReceived())));
}
void MainWindow::rescanSpent() {
if (!m_ctx->currentWallet->rescanSpent()) {
QMessageBox::warning(this, "Rescan spent", m_ctx->currentWallet->errorString());
} else {
QMessageBox::information(this, "Rescan spent", "Successfully rescanned spent outputs.");
}
}
void MainWindow::showBalanceDialog() {
if (!m_ctx->currentWallet) {
return;
}
auto *dialog = new BalanceDialog(this, m_ctx->currentWallet);
dialog->exec();
dialog->deleteLater();
}
QString MainWindow::statusDots() {
m_statusDots++;
m_statusDots = m_statusDots % 4;
return QString(".").repeated(m_statusDots);
}
MainWindow::~MainWindow() {
delete ui;
}
+18 -12
View File
@@ -76,11 +76,15 @@ public:
RECEIVE,
COINS,
CALC,
MORPHTOKEN,
XMR_TO,
EXCHANGES,
XMRIG
};
enum TabsHome {
CCS,
REDDIT
};
public slots:
void initWidgets();
void initMenu();
@@ -102,7 +106,6 @@ public slots:
void showSendTab();
void showHistoryTab();
void showSendScreen(const CCSEntry &entry);
void homeWidgetChanged(const QString &widgetName);
void skinChanged(const QString &skinName);
void menuTorClicked();
void onBlockchainSync(int height, int target);
@@ -114,7 +117,7 @@ public slots:
void menuWalletOpenClicked();
void onWalletOpenPasswordRequired(bool invalidPassword, const QString &path);
void onViewOnBlockExplorer(const QString &txid);
void onAddContact(const QString &address, const QString &name);
void onResendTransaction(const QString &txid);
void importContacts();
void showRestoreHeightDialog();
void importTransaction();
@@ -130,7 +133,7 @@ public slots:
void loadSignedTxFromText();
// libwalletqt
void onBalanceUpdated(double balance, double unlocked, const QString &balance_str, const QString &unlocked_str);
void onBalanceUpdated(quint64 balance, quint64 spendable);
void onSynchronized();
void onWalletOpened();
void onWalletClosed();
@@ -164,22 +167,20 @@ private:
void touchbarShowWallet();
void updatePasswordIcon();
void updateNetStats();
void rescanSpent();
void setStatusText(const QString &text);
void showBalanceDialog();
QString statusDots();
WalletWizard *createWizard(WalletWizard::Page startPage);
Ui::MainWindow *ui;
Settings *m_windowSettings = nullptr;
CalcWindow *m_windowCalc = nullptr;
SignVerifyDialog *m_windowSignVerify = nullptr;
RestoreDialog *m_restoreDialog = nullptr;
AboutDialog *m_aboutDialog = nullptr;
XMRigWidget *m_xmrig = nullptr;
bool m_windowSpawned = false;
CCSWidget *m_ccsWidget = nullptr;
RedditWidget *m_redditWidget = nullptr;
QSystemTrayIcon *m_trayIcon;
QMenu m_trayMenu;
QAction *m_trayActionCalc;
@@ -191,7 +192,7 @@ private:
TickerWidget *m_balanceWidget;
// lower status bar
QLabel *m_statusLabelBalance;
ClickableLabel *m_statusLabelBalance;
QLabel *m_statusLabelStatus;
QLabel *m_statusLabelNetStats;
StatusBarButton *m_statusBtnConnectionStatusIndicator;
@@ -217,6 +218,11 @@ private:
QTimer m_updateBytes;
QString m_statusText;
int m_statusDots;
bool m_constructingTransaction = false;
QTimer m_txTimer;
private slots:
void menuToggleTabVisible(const QString &key);
};
+106 -70
View File
@@ -87,31 +87,65 @@
</layout>
</item>
<item>
<widget class="Line" name="homeLine">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="coolLayout">
<property name="spacing">
<number>9</number>
<widget class="QTabWidget" name="tabHomeWidget">
<property name="currentIndex">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<property name="documentMode">
<bool>true</bool>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>CCS</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>40</height>
</size>
<property name="topMargin">
<number>0</number>
</property>
</spacer>
</item>
</layout>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="CCSWidget" name="ccsWidget" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>/r/Monero</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="RedditWidget" name="redditWidget" native="true"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
@@ -227,7 +261,7 @@
<widget class="QWidget" name="tabCalc">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/coldcard.png</normaloff>:/assets/images/coldcard.png</iconset>
<normaloff>:/assets/images/gnome-calc.png</normaloff>:/assets/images/gnome-calc.png</iconset>
</attribute>
<attribute name="title">
<string>Calc</string>
@@ -238,29 +272,15 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabMorphToken">
<widget class="QWidget" name="tabExchange">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/morphtoken.png</normaloff>:/assets/images/morphtoken.png</iconset>
<normaloff>:/assets/images/update.png</normaloff>:/assets/images/update.png</iconset>
</attribute>
<attribute name="title">
<string>MorphToken</string>
<string>Exchange</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="MorphTokenWidget" name="morphtokenWidget" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabXmrTo">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/xmrto.png</normaloff>:/assets/images/xmrto.png</iconset>
</attribute>
<attribute name="title">
<string>XMR.to</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="leftMargin">
<number>0</number>
</property>
@@ -271,36 +291,50 @@
<number>0</number>
</property>
<property name="bottomMargin">
<number>1</number>
<number>0</number>
</property>
<item>
<widget class="XMRToWidget" name="xmrToWidget" native="true"/>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QTabWidget" name="tabExchanges">
<property name="currentIndex">
<number>0</number>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
<widget class="QWidget" name="tabXMRto">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/xmrto.png</normaloff>:/assets/images/xmrto.png</iconset>
</attribute>
<attribute name="title">
<string>XMR.to</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="XMRToWidget" name="xmrToWidget" native="true"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabXmrRig">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/xmrig.ico</normaloff>:/assets/images/xmrig.ico</iconset>
<normaloff>:/assets/images/mining.png</normaloff>:/assets/images/mining.png</iconset>
</attribute>
<attribute name="title">
<string>XMRig</string>
<string>Mining</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
@@ -326,7 +360,6 @@
<property name="title">
<string>File</string>
</property>
<addaction name="actionOpen"/>
<addaction name="actionClose"/>
<addaction name="actionQuit"/>
<addaction name="separator"/>
@@ -370,6 +403,7 @@
<addaction name="actionStore_wallet"/>
<addaction name="actionUpdate_balance"/>
<addaction name="actionRefresh_tabs"/>
<addaction name="actionRescan_spent"/>
<addaction name="separator"/>
<addaction name="actionChange_restore_height"/>
<addaction name="menuExport"/>
@@ -431,8 +465,7 @@
</property>
<addaction name="actionShow_Coins"/>
<addaction name="actionShow_calc"/>
<addaction name="actionShow_MorphToken"/>
<addaction name="actionShow_xmr_to"/>
<addaction name="actionShow_Exchange"/>
<addaction name="actionShow_XMRig"/>
</widget>
<addaction name="menuFile"/>
@@ -441,14 +474,6 @@
<addaction name="menuTools"/>
<addaction name="menuHelp"/>
</widget>
<action name="actionOpen">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Open wallet</string>
</property>
</action>
<action name="actionQuit">
<property name="text">
<string>Quit application</string>
@@ -641,7 +666,7 @@
</action>
<action name="actionShow_XMRig">
<property name="text">
<string>Show XMRig</string>
<string>Show Mining</string>
</property>
</action>
<action name="actionImportTransaction">
@@ -679,9 +704,14 @@
<string>Import transaction</string>
</property>
</action>
<action name="actionShow_MorphToken">
<action name="actionShow_Exchange">
<property name="text">
<string>Show MorphToken</string>
<string>Show Exchange</string>
</property>
</action>
<action name="actionRescan_spent">
<property name="text">
<string>Rescan spent</string>
</property>
</action>
</widget>
@@ -729,9 +759,15 @@
<container>1</container>
</customwidget>
<customwidget>
<class>MorphTokenWidget</class>
<class>CCSWidget</class>
<extends>QWidget</extends>
<header>MorphTokenWidget.h</header>
<header>widgets/ccswidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>RedditWidget</class>
<extends>QWidget</extends>
<header>widgets/redditwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
-2
View File
@@ -22,8 +22,6 @@ void CCSModel::updateEntries(const QList<QSharedPointer<CCSEntry>>& entries) {
m_entries.clear();
for (const auto& entry : entries) {
if (entry->raised_amount > entry->target_amount)
continue;
m_entries.push_back(entry);
}
-5
View File
@@ -180,12 +180,7 @@ QVariant CoinsModel::parseTransactionInfo(const CoinsInfo &cInfo, int column, in
case Address:
return ModelUtils::displayAddress(cInfo.address(), 1, "");
case AddressLabel:
{
if (cInfo.subaddrIndex() == 0) {
return cInfo.coinbase() ? "Coinbase" : "Change";
}
return cInfo.addressLabel();
}
case Spent:
return cInfo.spent();
case SpentHeight:
+1 -1
View File
@@ -5,7 +5,7 @@
#include <utils/nodes.h>
#include "appcontext.h"
NodeModel::NodeModel(unsigned int nodeSource, QObject *parent)
NodeModel::NodeModel(int nodeSource, QObject *parent)
: QAbstractTableModel(parent)
, m_nodeSource(nodeSource)
, m_offline(QIcon(":/assets/images/expired_icon.png"))
+2 -2
View File
@@ -19,7 +19,7 @@ public:
COUNT
};
explicit NodeModel(unsigned int nodeSource, QObject *parent = nullptr);
explicit NodeModel(int nodeSource, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
@@ -34,7 +34,7 @@ private:
QList<FeatherNode> m_nodes;
QIcon m_offline;
QIcon m_online;
unsigned int m_nodeSource;
int m_nodeSource;
};
#endif //FEATHER_NODEMODEL_H
+2 -2
View File
@@ -169,7 +169,7 @@ QVariant TransactionHistoryModel::parseTransactionInfo(const TransactionInfo &tI
usd_amount = AppContext::prices->convert("USD", this->preferredFiatSymbol, usd_amount);
double fiat_rounded = ceil(Utils::roundSignificant(usd_amount, 3) * 100.0) / 100.0;
return QString("%1%2").arg(this->preferredFiatSign).arg(QString::number(fiat_rounded));
return QString("%1").arg(Utils::amountToCurrencyString(fiat_rounded, this->preferredFiatSymbol));
}
default:
{
@@ -239,4 +239,4 @@ Qt::ItemFlags TransactionHistoryModel::flags(const QModelIndex &index) const {
return QAbstractTableModel::flags(index) | Qt::ItemIsEditable;
return QAbstractTableModel::flags(index);
}
}
+23 -8
View File
@@ -12,6 +12,7 @@ SendWidget::SendWidget(QWidget *parent) :
ui(new Ui::SendWidget)
{
ui->setupUi(this);
m_ctx = MainWindow::getContext();
QString amount_rx = R"(^\d{0,8}[\.,]\d{0,12}|(all)$)";
QRegExp rx;
@@ -30,6 +31,16 @@ SendWidget::SendWidget(QWidget *parent) :
ui->label_conversionAmount->hide();
ui->btn_openAlias->hide();
ui->label_PayTo->setHelpText("Recipient of the funds.\n\n"
"You may enter a Monero address, or an alias (email-like address that forwards to a Monero address)");
ui->label_Description->setHelpText("Description of the transaction (optional).\n\n"
"The description is not sent to the recipient of the funds. It is stored in your wallet cache, "
"and displayed in the 'History' tab.");
ui->label_Amount->setHelpText("Amount to be sent.\n\nThis is the exact amount the recipient will receive. "
"In addition to this amount a transaction fee will be subtracted from your balance. "
"You will be able to review the transaction fee before the transaction is broadcast.\n\n"
"To send all your balance, click the Max button to the right.");
this->setupComboBox();
}
@@ -55,17 +66,13 @@ void SendWidget::fill(double amount) {
ui->lineAmount->setText(QString::number(amount));
}
void SendWidget::fill(const QString &address, const QString& description){
ui->lineDescription->setText(description);
ui->lineAddress->setText(address);
ui->lineAddress->setCursorPosition(0);
}
void SendWidget::fill(const QString &address, const QString &description, double amount) {
ui->lineDescription->setText(description);
ui->lineAmount->setText(QString::number(amount));
ui->lineAddress->setText(address);
ui->lineAddress->setCursorPosition(0);
if (amount > 0)
ui->lineAmount->setText(QString::number(amount));
this->updateConversionLabel();
}
void SendWidget::fillAddress(const QString &address) {
@@ -74,7 +81,14 @@ void SendWidget::fillAddress(const QString &address) {
}
void SendWidget::sendClicked() {
double amount = 0.0;
if (m_ctx->currentWallet->connectionStatus() != Wallet::ConnectionStatus_Connected) {
QMessageBox::warning(this, "Error", "Unable to create transaction:\n\n"
"Wallet is not connected to a node.\n"
"Go to File -> Settings -> Node to manually connect to a node.");
return;
}
double amount;
QString currency = ui->comboCurrencySelection->currentText();
QString recipient = ui->lineAddress->text().simplified().remove(' ');
QString description = ui->lineDescription->text();
@@ -177,6 +191,7 @@ void SendWidget::clearFields() {
void SendWidget::onWalletClosed() {
this->clearFields();
ui->btnSend->setEnabled(true);
}
void SendWidget::onInitiateTransaction() {
+1 -2
View File
@@ -19,8 +19,7 @@ Q_OBJECT
public:
explicit SendWidget(QWidget *parent = nullptr);
void fill(const CCSEntry &entry);
void fill(const QString &address, const QString& description);
void fill(const QString &address, const QString& description, double amount);
void fill(const QString &address, const QString& description, double amount = 0);
void fill(double amount);
void clearFields();
~SendWidget() override;
+11 -4
View File
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>603</width>
<width>647</width>
<height>175</height>
</rect>
</property>
@@ -39,7 +39,7 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<widget class="HelpLabel" name="label_PayTo">
<property name="text">
<string>Pay to</string>
</property>
@@ -53,7 +53,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<widget class="HelpLabel" name="label_Description">
<property name="text">
<string>Description</string>
</property>
@@ -63,7 +63,7 @@
<widget class="QLineEdit" name="lineDescription"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<widget class="HelpLabel" name="label_Amount">
<property name="text">
<string>Amount</string>
</property>
@@ -184,6 +184,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>HelpLabel</class>
<extends>QLabel</extends>
<header>components.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
<slots>
+18 -17
View File
@@ -7,6 +7,8 @@
#include "utils/config.h"
#include "mainwindow.h"
#include <QFileDialog>
Settings::Settings(QWidget *parent) :
QDialog(parent),
ui(new Ui::Settings)
@@ -38,16 +40,11 @@ Settings::Settings(QWidget *parent) :
ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool());
// setup comboboxes
auto settingsHomeWidget = config()->get(Config::homeWidget).toString();
if (m_homeWidgets.contains(settingsHomeWidget))
ui->comboBox_homeWidget->setCurrentIndex(m_homeWidgets.indexOf(settingsHomeWidget));
this->setupSkinCombobox();
auto settingsSkin = config()->get(Config::skin).toString();
if (m_skins.contains(settingsSkin))
ui->comboBox_skin->setCurrentIndex(m_skins.indexOf(settingsSkin));
connect(ui->comboBox_homeWidget, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &Settings::comboBox_homeWidgetChanged);
connect(ui->comboBox_skin, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &Settings::comboBox_skinChanged);
connect(ui->comboBox_blockExplorer, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &Settings::comboBox_blockExplorerChanged);
@@ -63,16 +60,26 @@ Settings::Settings(QWidget *parent) :
connect(ui->comboBox_fiatCurrency, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &Settings::fiatCurrencySelected);
// setup path tab
#if defined(Q_OS_LINUX)
ui->textEditPaths->appendPlainText(m_ctx->applicationPath);
#endif
ui->textEditPaths->appendPlainText(m_ctx->configDirectory);
ui->textEditPaths->appendPlainText(m_ctx->defaultWalletDir);
// setup paths tab
this->updatePaths();
connect(ui->btn_browseDefaultWalletDir, &QPushButton::clicked, [this]{
QString walletDir = QFileDialog::getExistingDirectory(this, "Select wallet directory ", m_ctx->defaultWalletDir, QFileDialog::ShowDirsOnly);
if (walletDir.isEmpty()) return;
m_ctx->defaultWalletDir = walletDir;
m_ctx->defaultWalletDirRoot = walletDir;
config()->set(Config::walletDirectory, walletDir);
ui->lineEdit_defaultWalletDir->setText(m_ctx->defaultWalletDir);
});
this->adjustSize();
}
void Settings::updatePaths() {
ui->lineEdit_defaultWalletDir->setText(m_ctx->defaultWalletDir);
ui->lineEdit_configDir->setText(m_ctx->configDirectory);
ui->lineEdit_applicationDir->setText(m_ctx->applicationPath);
}
void Settings::fiatCurrencySelected(int index) {
QString selection = ui->comboBox_fiatCurrency->itemText(index);
config()->set(Config::preferredFiatCurrency, selection);
@@ -83,12 +90,6 @@ void Settings::comboBox_skinChanged(int pos) {
emit skinChanged(m_skins.at(pos));
}
void Settings::comboBox_homeWidgetChanged(int pos) {
config()->set(Config::homeWidget, m_homeWidgets.at(pos));
emit homeWidgetChanged(m_homeWidgets.at(pos));
}
void Settings::comboBox_blockExplorerChanged(int pos) {
QString blockExplorer = ui->comboBox_blockExplorer->currentText();
config()->set(Config::blockExplorer, blockExplorer);
+1 -3
View File
@@ -26,21 +26,19 @@ public:
signals:
void closed();
void preferredFiatCurrencyChanged(QString currency);
void homeWidgetChanged(QString widgetName);
void skinChanged(QString skinName);
void showHomeCCS(bool);
void blockExplorerChanged(QString blockExplorer);
public slots:
void updatePaths();
void copyToClipboard();
void checkboxExternalLinkWarn();
void fiatCurrencySelected(int index);
void comboBox_homeWidgetChanged(int pos);
void comboBox_skinChanged(int pos);
void comboBox_blockExplorerChanged(int post);
private:
const QStringList m_homeWidgets{"ccs", "reddit"};
QStringList m_skins{"Native", "QDarkStyle", "Breeze/Dark", "Breeze/Light"};
private:
+74 -32
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1019</width>
<height>358</height>
<width>1123</width>
<height>555</height>
</rect>
</property>
<property name="windowTitle">
@@ -121,44 +121,23 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Home screen widget:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_homeWidget">
<item>
<property name="text">
<string>CCS proposals</string>
</property>
</item>
<item>
<property name="text">
<string>/r/monero</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Appearance:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_skin"/>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Block explorer:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_blockExplorer">
<item>
<property name="text">
@@ -182,14 +161,14 @@
</item>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="0">
<widget class="QCheckBox" name="checkBox_externalLink">
<property name="text">
<string>Warn before opening external link</string>
</property>
</widget>
</item>
<item row="5" column="0">
<item row="4" column="0">
<widget class="QCheckBox" name="checkBox_hideBalance">
<property name="text">
<string>Hide balance</string>
@@ -303,11 +282,74 @@
</widget>
</item>
<item>
<widget class="QPlainTextEdit" name="textEditPaths">
<property name="readOnly">
<bool>true</bool>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLineEdit" name="lineEdit_defaultWalletDir">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_browseDefaultWalletDir">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Wallet directory:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Config directory:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_configDir">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Application directory:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_applicationDir">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
-93
View File
@@ -1,93 +0,0 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#include "MorphTokenApi.h"
MorphTokenApi::MorphTokenApi(QObject *parent, UtilsNetworking *network, QString baseUrl)
: QObject(parent)
, m_network(network)
, m_baseUrl(std::move(baseUrl))
{
}
void MorphTokenApi::createTrade(const QString &inputAsset, const QString &outputAsset, const QString &refundAddress, const QString &outputAddress) {
QJsonObject trade;
QJsonObject input;
input["asset"] = inputAsset;
input["refund"] = refundAddress;
QJsonArray output;
QJsonObject outputObj;
outputObj["asset"] = outputAsset;
outputObj["weight"] = 10000;
outputObj["address"] = outputAddress;
output.append(outputObj);
trade["input"] = input;
trade["output"] = output;
QString url = QString("%1/morph").arg(m_baseUrl);
QNetworkReply *reply = m_network->postJson(url, trade);
connect(reply, &QNetworkReply::finished, std::bind(&MorphTokenApi::onResponse, this, reply, Endpoint::CREATE_TRADE));
}
void MorphTokenApi::getTrade(const QString &morphId) {
QString url = QString("%1/morph/%2").arg(m_baseUrl, morphId);
QNetworkReply *reply = m_network->getJson(url);
connect(reply, &QNetworkReply::finished, std::bind(&MorphTokenApi::onResponse, this, reply, Endpoint::GET_TRADE));
}
void MorphTokenApi::getRates() {
QString url = QString("%1/rates").arg(m_baseUrl);
QNetworkReply *reply = m_network->getJson(url);
connect(reply, &QNetworkReply::finished, std::bind(&MorphTokenApi::onResponse, this, reply, Endpoint::GET_RATES));
}
void MorphTokenApi::getLimits(const QString &inputAsset, const QString &outputAsset) {
QJsonObject limits;
QJsonObject input;
input["asset"] = inputAsset;
QJsonArray output;
QJsonObject outputObj;
outputObj["asset"] = outputAsset;
outputObj["weight"] = 10000;
output.append(outputObj);
limits["input"] = input;
limits["output"] = output;
QString url = QString("%1/limits").arg(m_baseUrl);
QNetworkReply *reply = m_network->postJson(url, limits);
connect(reply, &QNetworkReply::finished, std::bind(&MorphTokenApi::onResponse, this, reply, Endpoint::GET_LIMITS));
}
void MorphTokenApi::onResponse(QNetworkReply *reply, Endpoint endpoint) {
const auto ok = reply->error() == QNetworkReply::NoError;
const auto err = reply->errorString();
QByteArray data = reply->readAll();
QJsonObject obj;
if (!data.isEmpty() && Utils::validateJSON(data)) {
auto doc = QJsonDocument::fromJson(data);
obj = doc.object();
}
else if (!ok) {
emit ApiResponse(MorphTokenResponse(false, endpoint, err, {}));
return;
}
else {
emit ApiResponse(MorphTokenResponse(false, endpoint, "Invalid response from MorphToken", {}));
return;
}
if (obj.contains("success")) {
emit ApiResponse(MorphTokenResponse(false, endpoint, obj.value("description").toString(), obj));
return;
}
reply->deleteLater();
emit ApiResponse(MorphTokenResponse(true, endpoint, "", obj));
}
-51
View File
@@ -1,51 +0,0 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#ifndef FEATHER_MORPHTOKENAPI_H
#define FEATHER_MORPHTOKENAPI_H
#include <QObject>
#include <utility>
#include "utils/networking.h"
class MorphTokenApi : public QObject {
Q_OBJECT
public:
enum Endpoint {
CREATE_TRADE = 0,
GET_TRADE,
GET_RATES,
GET_LIMITS
};
struct MorphTokenResponse {
explicit MorphTokenResponse(bool ok, Endpoint endpoint, QString message, QJsonObject obj)
: ok(ok), endpoint(endpoint), message(std::move(message)), obj(std::move(obj)) {};
bool ok;
Endpoint endpoint;
QString message;
QJsonObject obj;
};
explicit MorphTokenApi(QObject *parent, UtilsNetworking *network, QString baseUrl = "https://api.morphtoken.com");
void createTrade(const QString &inputAsset, const QString &outputAsset, const QString &refundAddress, const QString &outputAddress);
void getTrade(const QString &morphId);
void getRates();
void getLimits(const QString &inputAsset, const QString &outputAsset);
signals:
void ApiResponse(MorphTokenResponse resp);
private slots:
void onResponse(QNetworkReply *reply, Endpoint endpoint);
private:
QString m_baseUrl;
UtilsNetworking *m_network;
};
#endif //FEATHER_MORPHTOKENAPI_H
+1 -2
View File
@@ -41,8 +41,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::nodeSource,{QS("nodeSource"), 0}},
{Config::useOnionNodes,{QS("useOnionNodes"), false}},
{Config::showTabCoins,{QS("showTabCoins"), false}},
{Config::showTabMorphToken, {QS("showTabMorphToken"), false}},
{Config::showTabXMRto,{QS("showTabXMRto"), true}},
{Config::showTabExchange, {QS("showTabExchange"), true}},
{Config::showTabXMRig,{QS("showTabXMRig"), false}},
{Config::showTabCalc,{QS("showTabCalc"), true}},
{Config::geometry, {QS("geometry"), {}}},
+1 -2
View File
@@ -39,8 +39,7 @@ public:
nodeSource,
useOnionNodes,
showTabCoins,
showTabMorphToken,
showTabXMRto,
showTabExchange,
showTabCalc,
showTabXMRig,
geometry,
+34 -20
View File
@@ -19,7 +19,7 @@
using namespace std::chrono;
WalletKeysFiles::WalletKeysFiles(const QFileInfo &info, quint8 networkType, QString address) :
WalletKeysFiles::WalletKeysFiles(const QFileInfo &info, int networkType, QString address) :
m_fileName(info.fileName()),
m_modified(info.lastModified().toSecsSinceEpoch()),
m_path(QDir::toNativeSeparators(info.absoluteFilePath())),
@@ -42,23 +42,15 @@ QString WalletKeysFiles::path() const {
return m_path;
}
quint8 WalletKeysFiles::networkType() const {
int WalletKeysFiles::networkType() const {
return m_networkType;
}
WalletKeysFilesModel::WalletKeysFilesModel(AppContext *ctx, QObject *parent) :
QAbstractTableModel(parent),
m_ctx(ctx) {
this->walletDirectories << m_ctx->defaultWalletDirRoot;
auto walletPath = config()->get(Config::walletPath).toString();
if(!walletPath.isEmpty() && Utils::fileExists(walletPath)) {
QDir d = QFileInfo(walletPath).absoluteDir();
this->walletDirectories << d.absolutePath();
}
this->walletDirectories << m_ctx->homeDir;
this->walletDirectories.removeDuplicates();
WalletKeysFilesModel::WalletKeysFilesModel(AppContext *ctx, QObject *parent)
: QAbstractTableModel(parent)
, m_ctx(ctx)
{
this->updateDirectories();
this->m_walletKeysFilesItemModel = qobject_cast<QAbstractItemModel *>(this);
}
@@ -71,6 +63,20 @@ void WalletKeysFilesModel::clear() {
void WalletKeysFilesModel::refresh() {
this->clear();
this->findWallets();
endResetModel();
}
void WalletKeysFilesModel::updateDirectories() {
this->walletDirectories.clear();
this->walletDirectories << m_ctx->defaultWalletDirRoot;
auto walletPath = config()->get(Config::walletPath).toString();
if(!walletPath.isEmpty() && Utils::fileExists(walletPath)) {
QDir d = QFileInfo(walletPath).absoluteDir();
this->walletDirectories << d.absolutePath();
}
this->walletDirectories << m_ctx->homeDir;
this->walletDirectories.removeDuplicates();
}
void WalletKeysFilesModel::findWallets() {
@@ -133,7 +139,7 @@ int WalletKeysFilesModel::rowCount(const QModelIndex & parent) const {
}
int WalletKeysFilesModel::columnCount(const QModelIndex &) const {
return 3;
return 4;
}
QVariant WalletKeysFilesModel::data(const QModelIndex &index, int role) const {
@@ -162,13 +168,15 @@ QVariant WalletKeysFilesModel::data(const QModelIndex &index, int role) const {
#endif
return fp;
}
case ModelColumns::Modified:
return walletKeyFile.modified();
default:
break;
}
} else if(role == Qt::UserRole) {
switch(index.column()) {
case ModelColumns::NetworkType:
return static_cast<uint>(walletKeyFile.networkType());
return static_cast<int>(walletKeyFile.networkType());
case ModelColumns::FileName:
return walletKeyFile.fileName();
case ModelColumns::Modified:
@@ -201,9 +209,15 @@ QVariant WalletKeysFilesModel::headerData(int section, Qt::Orientation orientati
return QVariant();
}
WalletKeysFilesProxyModel::WalletKeysFilesProxyModel(QObject *parent) :
QSortFilterProxyModel(parent) {}
WalletKeysFilesProxyModel::WalletKeysFilesProxyModel(QObject *parent, NetworkType::Type nettype)
: QSortFilterProxyModel(parent)
, m_nettype(nettype)
{
}
bool WalletKeysFilesProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
return true;
QModelIndex nettypeIndex = sourceModel()->index(sourceRow, WalletKeysFilesModel::NetworkType, sourceParent);
NetworkType::Type nettype = static_cast<NetworkType::Type>(sourceModel()->data(nettypeIndex, Qt::UserRole).toInt());
return (m_nettype == nettype);
}
+9 -4
View File
@@ -12,19 +12,19 @@
class WalletKeysFiles
{
public:
WalletKeysFiles(const QFileInfo &info, quint8 networkType, QString address);
WalletKeysFiles(const QFileInfo &info, int networkType, QString address);
QString fileName() const;
qint64 modified() const;
QString path() const;
quint8 networkType() const;
int networkType() const;
QString address() const;
private:
QString m_fileName;
qint64 m_modified;
QString m_path;
quint8 m_networkType;
int m_networkType;
QString m_address;
};
@@ -54,6 +54,8 @@ public:
QStringList walletDirectories;
private:
void updateDirectories();
AppContext *m_ctx;
QList<WalletKeysFiles> m_walletKeyFiles;
QAbstractItemModel *m_walletKeysFilesItemModel;
@@ -64,8 +66,11 @@ class WalletKeysFilesProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit WalletKeysFilesProxyModel(QObject *parent = nullptr);
explicit WalletKeysFilesProxyModel(QObject *parent, NetworkType::Type nettype);
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
private:
NetworkType::Type m_nettype;
};
#endif // KEYSFILES_H
+1 -1
View File
@@ -101,7 +101,7 @@ void Nodes::connectToNode() {
// auto connect
m_wsExhaustedWarningEmitted = false;
m_customExhaustedWarningEmitted = false;
this->autoConnect();
this->autoConnect(true);
}
void Nodes::connectToNode(const FeatherNode &node) {
+25 -25
View File
@@ -19,44 +19,44 @@
struct RestoreHeightLookup {
NetworkType::Type type;
QMap<unsigned int, unsigned int> data;
QMap<int, int> data;
explicit RestoreHeightLookup(NetworkType::Type type) : type(type) {}
unsigned int dateToRestoreHeight(unsigned int date) {
int dateToRestoreHeight(int date) {
// restore height based on a given timestamp using a lookup
// table. If it cannot find the date in the lookup table, it
// will calculate the blockheight based off the last known
// date: ((now - lastKnownDate) / blockTime) - clearance
if(this->type == NetworkType::TESTNET) return 1;
unsigned int blockTime = 120;
unsigned int blocksPerDay = 86400 / blockTime;
unsigned int blockCalcClearance = blocksPerDay * 5;
QList<unsigned int> values = this->data.keys();
int blockTime = 120;
int blocksPerDay = 86400 / blockTime;
int blockCalcClearance = blocksPerDay * 5;
QList<int> values = this->data.keys();
if(date <= values.at(0))
return this->data[values.at(0)];
for(unsigned int i = 0; i != values.count(); i++) {
for(int i = 0; i != values.count(); i++) {
if(values[i] > date) {
return i - 1 < 0 ? this->data[values[i]] : this->data[values[i-1]] - blockCalcClearance;
}
}
// lookup failed, calculate blockheight from last known checkpoint
unsigned int lastBlockHeightTime = values.at(values.count() - 1);
unsigned int lastBlockHeight = this->data[lastBlockHeightTime];
unsigned int deltaTime = date - lastBlockHeightTime;
unsigned int deltaBlocks = deltaTime / blockTime;
unsigned int blockHeight = (lastBlockHeight + deltaBlocks) - blockCalcClearance;
int lastBlockHeightTime = values.at(values.count() - 1);
int lastBlockHeight = this->data[lastBlockHeightTime];
int deltaTime = date - lastBlockHeightTime;
int deltaBlocks = deltaTime / blockTime;
int blockHeight = (lastBlockHeight + deltaBlocks) - blockCalcClearance;
qDebug() << "Calculated blockheight: " << blockHeight << " from epoch " << date;
return blockHeight;
}
unsigned int restoreHeightToDate(unsigned int height) {
int restoreHeightToDate(int height) {
// @TODO: most likely inefficient, refactor
QMap<unsigned int, unsigned int>::iterator i;
unsigned int timestamp = 0;
QMap<int, int>::iterator i;
int timestamp = 0;
for (i = this->data.begin(); i != this->data.end(); ++i) {
unsigned int ts = i.key();
int ts = i.key();
if (i.value() > height)
return timestamp;
timestamp = ts;
@@ -68,7 +68,7 @@ struct RestoreHeightLookup {
// initialize this class using a lookup table, e.g `:/assets/restore_heights_monero_mainnet.txt`/
auto rtn = new RestoreHeightLookup(type);
auto data = Utils::barrayToString(Utils::fileOpen(fn));
QMap<unsigned int, unsigned int> _data;
QMap<int, int> _data;
for(const auto &line: data.split('\n')) {
if(line.trimmed().isEmpty()) continue;
auto spl = line.trimmed().split(':');
@@ -82,7 +82,7 @@ struct FeatherSeed {
QString mnemonicSeed;
QString spendKey;
time_t time = 0;
unsigned int restoreHeight = 0;
int restoreHeight = 0;
RestoreHeightLookup *lookup = nullptr;
QString language;
std::string coinName;
@@ -124,7 +124,7 @@ struct FeatherSeed {
return rtn;
}
Wallet *writeWallet(WalletManager *manager, NetworkType::Type type, const QString &path, const QString &password, unsigned int kdfRounds) {
Wallet *writeWallet(WalletManager *manager, NetworkType::Type type, const QString &path, const QString &password, quint64 kdfRounds) {
// writes both 14/25 word mnemonic seeds.
Wallet *wallet = nullptr;
if(this->lookup == nullptr) return wallet;
@@ -136,25 +136,25 @@ struct FeatherSeed {
this->restoreHeight = _seed.restoreHeight;
this->spendKey = _seed.spendKey;
}
wallet = manager->createDeterministicWalletFromSpendKey(path, password, this->language, type, this->spendKey, this->restoreHeight, (quint64)kdfRounds);
wallet = manager->createDeterministicWalletFromSpendKey(path, password, this->language, type, this->spendKey, this->restoreHeight, kdfRounds);
wallet->setCacheAttribute("feather.seed", this->mnemonicSeed);
} else {
wallet = manager->recoveryWallet(path, password, this->mnemonicSeed, "", type, this->restoreHeight, (quint64) kdfRounds);
wallet = manager->recoveryWallet(path, password, this->mnemonicSeed, "", type, this->restoreHeight, kdfRounds);
}
wallet->setPassword(password);
return wallet;
}
unsigned int setRestoreHeight() {
int setRestoreHeight() {
if(this->lookup == nullptr) return 1;
if(this->time == 0) return 1;
this->restoreHeight = this->lookup->dateToRestoreHeight((unsigned int)this->time);
this->restoreHeight = this->lookup->dateToRestoreHeight(this->time);
return this->restoreHeight;
}
unsigned int setRestoreHeight(unsigned int height) {
auto now = (unsigned int)std::time(nullptr);
int setRestoreHeight(int height) {
auto now = std::time(nullptr);
auto nowClearance = 3600 * 24;
auto currentBlockHeight = this->lookup->dateToRestoreHeight(now - nowClearance);
if(height >= currentBlockHeight + nowClearance) {
+1 -1
View File
@@ -43,7 +43,7 @@ Tor::Tor(AppContext *ctx, QObject *parent)
return;
}
#ifndef HAS_TOR
#ifndef HAS_TOR_BIN
qCritical() << "Feather built without embedded Tor. Assuming --use-local-tor";
this->localTor = true;
return;
+4 -4
View File
@@ -7,7 +7,7 @@
#include "txfiathistory.h"
#include "utils/utils.h"
TxFiatHistory::TxFiatHistory(unsigned int genesis_timestamp, const QString &configDirectory, QObject *parent) :
TxFiatHistory::TxFiatHistory(int genesis_timestamp, const QString &configDirectory, QObject *parent) :
QObject(parent),
m_genesis_timestamp(genesis_timestamp),
m_configDirectory(configDirectory) {
@@ -15,7 +15,7 @@ TxFiatHistory::TxFiatHistory(unsigned int genesis_timestamp, const QString &conf
this->loadDatabase();
}
double TxFiatHistory::get(unsigned int timestamp) {
double TxFiatHistory::get(int timestamp) {
QDateTime ts;
ts.setTime_t(timestamp);
auto key = ts.toString("yyyyMMdd");
@@ -59,7 +59,7 @@ void TxFiatHistory::onUpdateDatabase() {
auto now = QDate::currentDate();
auto nowKey = now.toString("yyyyMMdd");
unsigned int year = genesis.toString("yyyy").toUInt();
int year = genesis.toString("yyyy").toInt();
auto yearCurrent = now.year();
// if current year is genesis year we'll refresh regardless.
@@ -71,7 +71,7 @@ void TxFiatHistory::onUpdateDatabase() {
// keep local fiatTxHistory database up to date, loop for missing dates
for(year; year != yearCurrent + 1; year += 1){
for(unsigned int month = 1; month != 13; month++) {
for(int month = 1; month != 13; month++) {
if(year == yearCurrent && month == now.month() && now.day() == 1) break;
QDateTime _now;
_now.setDate(QDate(year, month, 1));
+5 -5
View File
@@ -6,17 +6,17 @@ class TxFiatHistory : public QObject {
Q_OBJECT
public:
explicit TxFiatHistory(unsigned int genesis_timestamp, const QString &configDirectory, QObject *parent = nullptr);
explicit TxFiatHistory(int genesis_timestamp, const QString &configDirectory, QObject *parent = nullptr);
double get(const QString &date);
double get(unsigned int timestamp);
double get(int timestamp);
public slots:
void onUpdateDatabase();
void onWSData(const QJsonObject &data);
signals:
void requestYear(unsigned int year);
void requestYearMonth(unsigned int year, unsigned int month);
void requestYear(int year);
void requestYearMonth(int year, int month);
private:
void loadDatabase();
@@ -25,7 +25,7 @@ private:
QString m_configDirectory;
bool m_initialized = false;
QMap<QString, double> m_database;
unsigned int m_genesis_timestamp;
int m_genesis_timestamp;
};
#endif //FEATHER_TXFIATHISTORY_H
+44 -36
View File
@@ -22,6 +22,7 @@
#include "utils.h"
#include "utils/config.h"
#include "utils/tails.h"
#include "utils/whonix.h"
// Application log for current session
QVector<logMessage> applicationLog = QVector<logMessage>(); // todo: replace with ring buffer
@@ -276,7 +277,7 @@ bool Utils::testSocks5(const QString &host, quint16 port){
return false;
}
void Utils::externalLinkWarning(const QString &url){
void Utils::externalLinkWarning(QWidget *parent, const QString &url){
if(!config()->get(Config::warnOnExternalLink).toBool()) {
QDesktopServices::openUrl(QUrl(url));
return;
@@ -284,9 +285,11 @@ void Utils::externalLinkWarning(const QString &url){
QString body = "You are about to open the following link:\n\n";
body += QString("%1\n\n").arg(url);
body += "You will NOT be using Tor.";
switch (Utils::showMessageBox("External link warning", body, true)) {
if (!(TailsOS::detect() || WhonixOS::detect()))
body += "You will NOT be using Tor.";
switch (QMessageBox::warning(parent, "External link warning", body, QMessageBox::Cancel|QMessageBox::Ok)) {
case QMessageBox::Cancel:
break;
default:
@@ -327,26 +330,6 @@ bool Utils::walletExists(QString name, const QString &path) {
return Utils::fileExists(walletPath);
}
int Utils::showMessageBox(const QString &windowTitle, const QString &body, bool warning){
QMessageBox msgBox(QApplication::activeWindow());
msgBox.setWindowTitle(windowTitle);
msgBox.setText(body);
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
if(warning) {
QPixmap iconWarning = QPixmap(":/assets/images/ghost_icon.png");
msgBox.setIconPixmap(iconWarning);
}
else {
QPixmap iconInfo = QPixmap(":/assets/images/info.png")
.scaled(QSize(48,48), Qt::KeepAspectRatio, Qt::SmoothTransformation);
msgBox.setIconPixmap(iconInfo);
}
return msgBox.exec();
}
void Utils::copyToClipboard(const QString &string){
QClipboard * clipboard = QApplication::clipboard();
if (!clipboard) {
@@ -570,30 +553,55 @@ QString Utils::formatBytes(quint64 bytes)
int i;
double _data;
for (i = 0; i < sizes.count() && bytes >= 1000; i++, bytes /= 1000)
for (i = 0; i < sizes.count() && bytes >= 10000; i++, bytes /= 1000)
_data = bytes / 1000.0;
if (_data < 0)
_data = 0;
// unrealistic
if (_data > 1000)
if (_data > 10000)
_data = 0;
return QString("%1 %2").arg(QString::number(_data, 'f', 1), sizes[i]);
}
QString Utils::amountToCurrencyString(double amount, const QString &currencyCode) {
QMap<QString, QLocale> Utils::localeCache = {};
QLocale Utils::getCurrencyLocale(const QString &currencyCode) {
QLocale locale;
QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);
for (const auto& locale_: allLocales) {
if (locale_.currencySymbol(QLocale::CurrencyIsoCode) == currencyCode) {
locale = locale_;
if (localeCache.contains(currencyCode)) {
locale = localeCache[currencyCode];
} else {
QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);
for (const auto& locale_: allLocales) {
if (locale_.currencySymbol(QLocale::CurrencyIsoCode) == currencyCode) {
locale = locale_;
}
}
localeCache[currencyCode] = locale;
}
return locale;
}
QString Utils::amountToCurrencyString(double amount, const QString &currencyCode) {
QLocale locale = getCurrencyLocale(currencyCode);
// \xC2\xA0 = UTF-8 non-breaking space, it looks off.
if (currencyCode == "USD")
return locale.toCurrencyString(amount, "$").remove("\xC2\xA0");
return locale.toCurrencyString(amount).remove("\xC2\xA0");
}
int Utils::maxLength(const QVector<QString> &array) {
int maxLength = 0;
for (const auto &str: array) {
auto length = str.length();
if (length > maxLength) {
maxLength = length;
}
}
if (currencyCode == "USD")
return locale.toCurrencyString(amount, "$");
return locale.toCurrencyString(amount);
}
return maxLength;
}
+4 -4
View File
@@ -75,8 +75,7 @@ public:
static QStringList readJsonStringToQStringList(const QString &input);
static void applicationLogHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg);
static void openWindow(QWidget *w);
static void externalLinkWarning(const QString &url);
static int showMessageBox(const QString &windowTitle, const QString &body, bool warning);
static void externalLinkWarning(QWidget *parent, const QString &url);
static QList<processStruct> procList();
static bool dirExists(const QString &path);
static QString barrayToString(const QByteArray &data);
@@ -96,9 +95,10 @@ public:
static QFont relativeFont(int delta);
static double roundSignificant(double N, double n);
static QString formatBytes(quint64 bytes);
static QLocale getCurrencyLocale(const QString &currencyCode);
static QString amountToCurrencyString(double amount, const QString &currencyCode);
static QStringList randomHTTPAgents;
static int maxLength(const QVector<QString> &array);
static QMap<QString, QLocale> localeCache;
template<typename QEnum>
static QString QtEnumToString (const QEnum value)
+8
View File
@@ -21,6 +21,14 @@ WSClient::WSClient(AppContext *ctx, const QUrl &url, QObject *parent) :
connect(&this->webSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error), this, &WSClient::onError);
m_tor = url.host().endsWith(".onion");
// Keep websocket connection alive
connect(&m_pingTimer, &QTimer::timeout, [this]{
if (this->webSocket.state() == QAbstractSocket::ConnectedState)
this->webSocket.ping();
});
m_pingTimer.setInterval(30 * 1000);
m_pingTimer.start();
}
void WSClient::sendMsg(const QByteArray &data) {
+1
View File
@@ -33,6 +33,7 @@ private slots:
private:
QTimer m_connectionTimer;
QTimer m_pingTimer;
AppContext *m_ctx;
bool m_tor = true;
};
+1 -36
View File
@@ -9,22 +9,13 @@
#include "utils/utils.h"
#include "utils/xmrig.h"
#include "appcontext.h"
XmRig::XmRig(const QString &configDir, QObject *parent) : QObject(parent) {
this->rigDir = QDir(configDir).filePath("xmrig");
}
void XmRig::prepare() {
// unpack and set process signals
if(!this->unpackBins()) {
qCritical() << "failed to write XMRig to config directory";
return;
}
m_process.setProcessChannelMode(QProcess::MergedChannels);
connect(&m_process, &QProcess::readyReadStandardOutput, this, &XmRig::handleProcessOutput);
connect(&m_process, &QProcess::errorOccurred, this, &XmRig::handleProcessError);
@@ -42,7 +33,7 @@ void XmRig::stop() {
}
void XmRig::start(const QString &path,
unsigned int threads,
int threads,
const QString &address,
const QString &username,
const QString &password,
@@ -110,29 +101,3 @@ void XmRig::handleProcessError(QProcess::ProcessError err) {
emit error(QString("XMRig binary failed to start: %1").arg(path));
}
}
bool XmRig::unpackBins() {
QString rigFile;
rigFile = ":/assets/exec/xmrig";
if (!Utils::fileExists(rigFile))
return false;
// write to disk
QFile f(rigFile);
QFileInfo fileInfo(f);
this->rigPath = QDir(this->rigDir).filePath(fileInfo.fileName());
#if defined(Q_OS_WIN)
if(!this->rigPath.endsWith(".exe"))
this->rigPath += ".exe";
#endif
qDebug() << "Writing XMRig executable to " << this->rigPath;
f.copy(rigPath);
f.close();
#if defined(Q_OS_UNIX)
QFile rigBin(this->rigPath);
rigBin.setPermissions(QFile::ExeGroup | QFile::ExeOther | QFile::ExeOther | QFile::ExeUser);
#endif
return true;
}
+1 -1
View File
@@ -23,7 +23,7 @@ public:
explicit XmRig(const QString &configDir, QObject *parent = nullptr);
void prepare();
void start(const QString &path, unsigned int threads, const QString &address, const QString &username, const QString &password, bool tor = false, bool tls = true);
void start(const QString &path, int threads, const QString &address, const QString &username, const QString &password, bool tor = false, bool tls = true);
void stop();
bool unpackBins();
+3 -1
View File
@@ -31,6 +31,8 @@ CCSWidget::CCSWidget(QWidget *parent) :
connect(ui->tableView, &QHeaderView::customContextMenuRequested, this, &CCSWidget::showContextMenu);
connect(ui->tableView, &QTableView::doubleClicked, this, &CCSWidget::linkClicked);
ui->tableView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
CCSModel* CCSWidget::model() {
@@ -42,7 +44,7 @@ void CCSWidget::linkClicked() {
auto entry = m_model->entry(index.row());
if (entry)
Utils::externalLinkWarning(entry->url);
Utils::externalLinkWarning(this, entry->url);
}
void CCSWidget::donateClicked() {
-33
View File
@@ -48,39 +48,6 @@
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="warnLabel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Powered by ccs.getmonero.org</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
+60 -81
View File
@@ -18,10 +18,10 @@
#include "utils/nodes.h"
#include "mainwindow.h"
NodeWidget::NodeWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::NodeWidget),
m_contextMenu(new QMenu(this)) {
NodeWidget::NodeWidget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::NodeWidget)
{
ui->setupUi(this);
connect(ui->btn_add_custom, &QPushButton::clicked, this, &NodeWidget::onCustomAddClicked);
@@ -35,112 +35,91 @@ NodeWidget::NodeWidget(QWidget *parent) :
}
});
m_contextActionRemove = new QAction("Remove", this);
m_contextActionConnect = new QAction(QIcon(":/assets/images/connect.svg"), "Connect to node", this);
m_contextActionOpenStatusURL = new QAction(QIcon(":/assets/images/network.png"), "Visit status page", this);
m_contextActionCopy = new QAction(QIcon(":/assets/images/copy.png"), "Copy", this);
connect(m_contextActionConnect, &QAction::triggered, this, &NodeWidget::onContextConnect);
connect(m_contextActionRemove, &QAction::triggered, this, &NodeWidget::onContextCustomNodeRemove);
connect(m_contextActionOpenStatusURL, &QAction::triggered, this, &NodeWidget::onContextStatusURL);
connect(m_contextActionCopy, &QAction::triggered, this, &NodeWidget::onContextNodeCopy);
connect(m_contextActionRemove, &QAction::triggered, this, &NodeWidget::onContextCustomNodeRemove);
ui->wsView->setContextMenuPolicy(Qt::CustomContextMenu);
ui->customView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->wsView, &QTreeView::customContextMenuRequested, this, &NodeWidget::onShowWSContextMenu);
connect(ui->customView, &QTreeView::customContextMenuRequested, this, &NodeWidget::onShowCustomContextMenu);
connect(ui->customView, &QTreeView::doubleClicked, this, &NodeWidget::onContextConnect);
connect(ui->wsView, &QTreeView::doubleClicked, this, &NodeWidget::onContextConnect);
}
void NodeWidget::onShowWSContextMenu(const QPoint &pos) {
QModelIndex index = ui->wsView->indexAt(pos);
if (!index.isValid()) return;
m_activeView = ui->wsView;
FeatherNode node = this->selectedNode();
if (node.full.isEmpty()) return;
FeatherNode node = m_wsModel->node(index.row());
this->showContextMenu(pos, node);
}
void NodeWidget::onShowCustomContextMenu(const QPoint &pos) {
QModelIndex index = ui->customView->indexAt(pos);
if (!index.isValid()) return;
m_activeView = ui->customView;
FeatherNode node = this->selectedNode();
if (node.full.isEmpty()) return;
FeatherNode node = m_customModel->node(index.row());
this->showContextMenu(pos, node);
}
void NodeWidget::showContextMenu(const QPoint &pos, const FeatherNode &node) {
bool custom = node.custom;
m_activeView = custom ? ui->customView : ui->wsView;
QMenu menu(this);
m_contextActionRemove = new QAction("Remove");
m_contextActionConnect = new QAction("Connect to node");
m_contextActionConnect->setIcon(QIcon(":/assets/images/connect.svg"));
m_contextActionOpenStatusURL = new QAction("Visit status page");
m_contextActionOpenStatusURL->setIcon(QIcon(":/assets/images/network.png"));
m_contextActionCopy = new QAction("Copy");
m_contextActionCopy->setIcon(QIcon(":/assets/images/copy.png"));
if(!node.isActive) {
connect(m_contextActionConnect, &QAction::triggered, this, &NodeWidget::onContextConnect);
m_contextMenu->addAction(m_contextActionConnect);
if (!node.isActive) {
menu.addAction(m_contextActionConnect);
}
m_contextMenu->addAction(m_contextActionOpenStatusURL);
m_contextMenu->addAction(m_contextActionCopy);
menu.addAction(m_contextActionOpenStatusURL);
menu.addAction(m_contextActionCopy);
if(custom) {
connect(m_contextActionRemove, &QAction::triggered, this, &NodeWidget::onContextCustomNodeRemove);
m_contextMenu->addAction(m_contextActionRemove);
if (m_activeView == ui->customView)
menu.addAction(m_contextActionRemove);
connect(m_contextActionOpenStatusURL, &QAction::triggered, this, &NodeWidget::onContextCustomStatusURL);
connect(m_contextActionCopy, &QAction::triggered, this, &NodeWidget::onContextCustomNodeCopy);
} else {
connect(m_contextActionOpenStatusURL, &QAction::triggered, this, &NodeWidget::onContextWSStatusURL);
connect(m_contextActionCopy, &QAction::triggered, this, &NodeWidget::onContextWSNodeCopy);
}
m_contextMenu->exec(m_activeView->viewport()->mapToGlobal(pos));
m_contextActionRemove->deleteLater();
m_contextActionConnect->deleteLater();
m_contextActionOpenStatusURL->deleteLater();
m_contextActionCopy->deleteLater();
menu.exec(m_activeView->viewport()->mapToGlobal(pos));
}
void NodeWidget::onContextConnect() {
QObject *obj = sender();
if (obj == ui->customView)
m_activeView = ui->customView;
else
m_activeView = ui->wsView;
FeatherNode node = this->selectedNode();
if (!node.full.isEmpty())
emit connectToNode(node);
}
void NodeWidget::onContextStatusURL() {
FeatherNode node = this->selectedNode();
if (!node.full.isEmpty())
Utils::externalLinkWarning(this, node.as_url());
}
void NodeWidget::onContextNodeCopy() {
FeatherNode node = this->selectedNode();
Utils::copyToClipboard(node.full);
}
FeatherNode NodeWidget::selectedNode() {
QModelIndex index = m_activeView->currentIndex();
if (!index.isValid()) return;
if (!index.isValid()) return FeatherNode();
if(m_activeView->objectName() == "wsView"){
FeatherNode node = m_wsModel->node(index.row());
emit connectToNode(node);
FeatherNode node;
if (m_activeView == ui->customView) {
node = m_customModel->node(index.row());
} else {
FeatherNode node = m_customModel->node(index.row());
emit connectToNode(node);
node = m_wsModel->node(index.row());
}
}
void NodeWidget::onContextWSStatusURL() {
QModelIndex index = ui->wsView->currentIndex();
if (!index.isValid()) return;
FeatherNode node = m_wsModel->node(index.row());
Utils::externalLinkWarning(node.as_url());
}
void NodeWidget::onContextCustomStatusURL() {
QModelIndex index = ui->customView->currentIndex();
if (!index.isValid()) return;
FeatherNode node = m_customModel->node(index.row());
Utils::externalLinkWarning(node.as_url());
}
void NodeWidget::onContextDisconnect() {
QModelIndex index = ui->customView->currentIndex();
if (!index.isValid()) return;
FeatherNode node = m_customModel->node(index.row());
Utils::copyToClipboard(node.full);
}
void NodeWidget::onContextWSNodeCopy() {
QModelIndex index = ui->wsView->currentIndex();
if (!index.isValid()) return;
FeatherNode node = m_wsModel->node(index.row());
Utils::copyToClipboard(node.full);
}
void NodeWidget::onContextCustomNodeCopy() {
return node;
}
void NodeWidget::onContextCustomNodeRemove() {
+3 -7
View File
@@ -35,12 +35,9 @@ public slots:
private slots:
void onContextConnect();
void onContextDisconnect();
void onContextCustomNodeRemove();
void onContextWSStatusURL();
void onContextCustomStatusURL();
void onContextWSNodeCopy();
void onContextCustomNodeCopy();
void onContextStatusURL();
void onContextNodeCopy();
signals:
void connectToNode(FeatherNode node);
@@ -54,14 +51,13 @@ private:
QTreeView *m_activeView;
QMenu *m_contextMenu;
QAction *m_contextActionConnect;
QAction *m_contextActionDisconnect;
QAction *m_contextActionRemove;
QAction *m_contextActionOpenStatusURL;
QAction *m_contextActionCopy;
void showContextMenu(const QPoint &pos, const FeatherNode &node);
FeatherNode selectedNode();
};
#endif // NODEWIDGET_H
+3 -1
View File
@@ -26,6 +26,8 @@ RedditWidget::RedditWidget(QWidget *parent) :
connect(ui->tableView, &QHeaderView::customContextMenuRequested, this, &RedditWidget::showContextMenu);
connect(ui->tableView, &QTableView::doubleClicked, this, &RedditWidget::linkClicked);
ui->tableView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
RedditModel* RedditWidget::model() {
@@ -37,7 +39,7 @@ void RedditWidget::linkClicked() {
auto post = m_model->post(index.row());
if (post) {
Utils::externalLinkWarning(post->url);
Utils::externalLinkWarning(this, post->url);
}
}
-30
View File
@@ -51,36 +51,6 @@
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Powered by Reddit</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
+32 -18
View File
@@ -17,15 +17,10 @@ RestoreHeightWidget::RestoreHeightWidget(QWidget *parent) :
{
ui->setupUi(this);
ui->lineEdit_restoreHeight->setValidator(new QIntValidator(0, 2147483647, this));
connect(ui->lineEdit_restoreHeight, &QLineEdit::textEdited, [=](const QString &val){
// update slider on lineEdit change
if(val.isEmpty()) return;
auto height = val.toUInt();
if(height <= 1) return;
auto timestamp = m_restoreHeightLookup->restoreHeightToDate(height);
ui->restoreSlider->blockSignals(true);
ui->restoreSlider->setValue(timestamp);
ui->restoreSlider->blockSignals(false);
connect(ui->lineEdit_restoreHeight, &QLineEdit::textEdited, [this](const QString &val){
if (val.isEmpty()) return;
this->setHeight(val.toInt());
});
}
@@ -33,26 +28,45 @@ void RestoreHeightWidget::hideSlider(){
ui->restoreGrid->hide();
}
void RestoreHeightWidget::setHeight(int height) {
if (height < 0)
height = 0;
// Update lineEdit
ui->lineEdit_restoreHeight->setText(QString::number(height));
// Update slider
int date = m_restoreHeightLookup->restoreHeightToDate(height);
ui->restoreSlider->setValue(date);
this->updateTimestamp(date);
}
void RestoreHeightWidget::initRestoreHeights(RestoreHeightLookup *lookup) {
// init slider
m_restoreHeightLookup = lookup;
auto now = (unsigned int)std::time(nullptr);
QList<unsigned int> blockDates = m_restoreHeightLookup->data.keys();
int now = std::time(nullptr);
QList<int> blockDates = m_restoreHeightLookup->data.keys();
ui->restoreSlider->setMinimum(blockDates[0]);
ui->restoreSlider->setMaximum(now);
connect(ui->restoreSlider, &QSlider::valueChanged, this, &RestoreHeightWidget::onValueChanged);
connect(ui->restoreSlider, &QSlider::sliderMoved, [this](int date){
// Update lineEdit
int blockHeight = m_restoreHeightLookup->dateToRestoreHeight(date);
ui->lineEdit_restoreHeight->setText(QString::number(blockHeight));
this->updateTimestamp(date);
});
}
void RestoreHeightWidget::onValueChanged(int date) {
void RestoreHeightWidget::updateTimestamp(int date) {
QDateTime timestamp;
timestamp.setTime_t((unsigned int) date);
timestamp.setTime_t(date);
ui->label_restoreHeightDate->setText(timestamp.toString("yyyy-MM-dd"));
auto blockHeight = m_restoreHeightLookup->dateToRestoreHeight((unsigned int) date);
ui->lineEdit_restoreHeight->setText(QString::number(blockHeight));
}
unsigned int RestoreHeightWidget::getHeight() {
return ui->lineEdit_restoreHeight->text().toUInt();
int RestoreHeightWidget::getHeight() {
return ui->lineEdit_restoreHeight->text().toInt();
}
RestoreHeightWidget::~RestoreHeightWidget() {
+5 -5
View File
@@ -20,14 +20,14 @@ class RestoreHeightWidget : public QWidget
public:
explicit RestoreHeightWidget(QWidget *parent = nullptr);
void initRestoreHeights(RestoreHeightLookup *lookup);
unsigned int getHeight();
void setHeight(int height);
int getHeight();
void hideSlider();
~RestoreHeightWidget();
private slots:
void onValueChanged(int date);
~RestoreHeightWidget() override;
private:
void updateTimestamp(int date);
RestoreHeightLookup *m_restoreHeightLookup = nullptr;
Ui::RestoreHeightWidget *ui;
};
+13 -14
View File
@@ -8,11 +8,12 @@
#include "utils/config.h"
#include "mainwindow.h"
TickerWidget::TickerWidget(QWidget *parent, QString symbol, QString title, bool convertBalance) :
TickerWidget::TickerWidget(QWidget *parent, QString symbol, QString title, bool convertBalance, bool hidePercent) :
QWidget(parent),
ui(new Ui::TickerWidget),
m_symbol(std::move(symbol)),
m_convertBalance(convertBalance)
m_convertBalance(convertBalance),
m_hidePercent(hidePercent)
{
ui->setupUi(this);
m_ctx = MainWindow::getContext();
@@ -27,6 +28,8 @@ TickerWidget::TickerWidget(QWidget *parent, QString symbol, QString title, bool
this->setPctText(defaultPct, true);
this->setFiatText(defaultFiat, 0.0);
ui->tickerPct->setHidden(hidePercent);
connect(AppContext::prices, &Prices::fiatPricesUpdated, this, &TickerWidget::init);
connect(AppContext::prices, &Prices::cryptoPricesUpdated, this, &TickerWidget::init);
if (convertBalance)
@@ -47,15 +50,19 @@ void TickerWidget::init() {
double amount = m_convertBalance ? AppContext::balance : 1.0;
double conversion = AppContext::prices->convert(m_symbol, fiatCurrency, amount);
if (conversion < 0) return;
setPercentHidden(conversion == 0);
auto markets = AppContext::prices->markets;
if(!markets.contains(m_symbol)) return;
auto pct24h = markets[m_symbol].price_usd_change_pct_24h;
auto pct24hText = QString::number(pct24h, 'f', 2);
bool hidePercent = (conversion == 0 || m_hidePercent);
if (hidePercent) {
ui->tickerPct->hide();
} else {
auto pct24h = markets[m_symbol].price_usd_change_pct_24h;
auto pct24hText = QString::number(pct24h, 'f', 2);
this->setPctText(pct24hText, pct24h >= 0.0);
}
this->setPctText(pct24hText, pct24h >= 0.0);
this->setFiatText(fiatCurrency, conversion);
}
@@ -81,14 +88,6 @@ void TickerWidget::setFontSizes() {
ui->tickerFiat->setFont(Utils::relativeFont(0));
}
void TickerWidget::removePctContainer() {
ui->tickerPct->deleteLater();
}
void TickerWidget::setPercentHidden(bool hidden) {
ui->tickerPct->setVisible(!hidden);
}
TickerWidget::~TickerWidget() {
delete ui;
}
+2 -4
View File
@@ -17,8 +17,7 @@ class TickerWidget : public QWidget
Q_OBJECT
public:
explicit TickerWidget(QWidget *parent, QString symbol, QString title = "", bool convertBalance = false);
void removePctContainer();
explicit TickerWidget(QWidget *parent, QString symbol, QString title = "", bool convertBalance = false, bool hidePercent = false);
void setFiatText(QString &fiatCurrency, double amount);
void setPctText(QString &text, bool positive);
void setFontSizes();
@@ -29,11 +28,10 @@ public slots:
void init();
private:
void setPercentHidden(bool hidden);
Ui::TickerWidget *ui;
QString m_symbol;
bool m_convertBalance;
bool m_hidePercent;
AppContext *m_ctx;
};
+5
View File
@@ -32,6 +32,11 @@ TxProofWidget::TxProofWidget(QWidget *parent, Wallet *wallet, TransactionInfo *t
connect(ui->btn_copySpendProof, &QPushButton::clicked, this, &TxProofWidget::copySpendProof);
connect(ui->btn_copyTxProof, &QPushButton::clicked, this, &TxProofWidget::copyTxProof);
ui->label_SpendProof->setHelpText("A SpendProof proves authorship of a transaction.\n\n"
"SpendProofs do not prove that a particular amount was sent to an address, for that use OutProofs.");
ui->label_InOutProof->setHelpText("An InProof proves ownership of an output.\n"
"An OutProof shows the prover sent an output to an address.");
}
void TxProofWidget::copySpendProof() {
+9 -2
View File
@@ -48,7 +48,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<widget class="HelpLabel" name="label_SpendProof">
<property name="text">
<string>SpendProof</string>
</property>
@@ -72,7 +72,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<widget class="HelpLabel" name="label_InOutProof">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -98,6 +98,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>HelpLabel</class>
<extends>QLabel</extends>
<header>components.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+6 -25
View File
@@ -36,7 +36,7 @@ XMRigWidget::XMRigWidget(AppContext *ctx, QWidget *parent) :
// threads
ui->threadSlider->setMinimum(1);
int threads = QThread::idealThreadCount();
m_threads = (unsigned int) threads / 2;
m_threads = threads / 2;
ui->threadSlider->setMaximum(threads);
ui->threadSlider->setValue(m_threads);
ui->label_threads->setText(QString("CPU threads: %1").arg(m_threads));
@@ -55,15 +55,12 @@ XMRigWidget::XMRigWidget(AppContext *ctx, QWidget *parent) :
ui->check_tls->setChecked(true);
ui->label_status->setTextInteractionFlags(Qt::TextSelectableByMouse);
ui->label_status->hide();
ui->pathFrame->hide();
ui->soloFrame->hide();
ui->poolFrame->hide();
// XMRig binary
auto path = config()->get(Config::xmrigPath).toString();
if(!path.isEmpty()) {
ui->pathFrame->show();
ui->check_custompath->setChecked(true);
ui->lineEdit_path->setText(path);
}
@@ -99,7 +96,6 @@ XMRigWidget::XMRigWidget(AppContext *ctx, QWidget *parent) :
});
// checkbox connects
connect(ui->check_custompath, &QCheckBox::stateChanged, this, &XMRigWidget::onCustomPathChecked);
connect(ui->check_solo, &QCheckBox::stateChanged, this, &XMRigWidget::onSoloChecked);
}
@@ -127,7 +123,7 @@ void XMRigWidget::onWalletOpened(){
}
void XMRigWidget::onThreadsValueChanged(int threads) {
m_threads = (unsigned int) threads;
m_threads = threads;
ui->label_threads->setText(QString("CPU threads: %1").arg(m_threads));
}
@@ -150,12 +146,7 @@ void XMRigWidget::onClearClicked() {
void XMRigWidget::onStartClicked() {
QString xmrigPath;
bool solo = ui->check_solo->isChecked();
bool customBinary = ui->check_custompath->isChecked();
if(customBinary)
xmrigPath = config()->get(Config::xmrigPath).toString();
else
xmrigPath = m_ctx->XMRig->rigPath;
xmrigPath = config()->get(Config::xmrigPath).toString();
// username is receiving address usually
auto username = m_ctx->currentWallet->getCacheAttribute("feather.xmrig_username");
@@ -164,7 +155,7 @@ void XMRigWidget::onStartClicked() {
if(username.isEmpty()) {
QString err = "Please specify a receiving address on the Settings screen";
ui->console->appendPlainText(err);
Utils::showMessageBox("Error", err, true);
QMessageBox::warning(this, "Error", err);
return;
}
@@ -245,7 +236,7 @@ void XMRigWidget::onDownloads(const QJsonObject &data) {
os_assets = const_cast<QJsonArray *>(&_linux);
}
unsigned int i = 0;
int i = 0;
for(const auto &entry: *os_assets) {
auto _obj = entry.toObject();
auto _name = _obj.value("name").toString();
@@ -280,16 +271,6 @@ void XMRigWidget::showContextMenu(const QPoint &pos) {
m_contextMenu->exec(ui->tableView->viewport()->mapToGlobal(pos));
}
void XMRigWidget::onCustomPathChecked(int state) {
if(state == 2) {
ui->pathFrame->show();
} else {
ui->lineEdit_path->setText("");
config()->set(Config::xmrigPath, "");
ui->pathFrame->hide();
}
}
void XMRigWidget::onSoloChecked(int state) {
if(state == 2) {
ui->poolFrame->hide();
@@ -305,7 +286,7 @@ void XMRigWidget::onSoloChecked(int state) {
void XMRigWidget::linkClicked() {
QModelIndex index = ui->tableView->currentIndex();
auto download_link = m_urls.at(index.row());
Utils::externalLinkWarning(download_link);
Utils::externalLinkWarning(this, download_link);
}
QStandardItemModel *XMRigWidget::model() {
+2 -3
View File
@@ -22,7 +22,7 @@ class XMRigWidget : public QWidget
public:
explicit XMRigWidget(AppContext *ctx, QWidget *parent = nullptr);
~XMRigWidget();
~XMRigWidget() override;
QStandardItemModel *model();
public slots:
@@ -36,7 +36,6 @@ public slots:
void onProcessError(const QString &msg);
void onProcessOutput(const QByteArray &msg);
void onHashrate(const QString &hashrate);
void onCustomPathChecked(int state);
void onSoloChecked(int state);
private slots:
@@ -55,7 +54,7 @@ private:
Ui::XMRigWidget *ui;
QStandardItemModel *m_model;
QMenu *m_contextMenu;
unsigned int m_threads;
int m_threads;
QStringList m_urls;
QStringList m_pools{"pool.xmr.pt:9000", "pool.supportxmr.com:9000", "mine.xmrpool.net:443", "xmrpool.eu:9999", "xmr-eu1.nanopool.org:14433", "pool.minexmr.com:6666", "us-west.minexmr.com:6666", "monerohash.com:9999", "cryptonote.social:5555", "cryptonote.social:5556"};
};
+89 -156
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>556</height>
<width>1329</width>
<height>540</height>
</rect>
</property>
<property name="windowTitle">
@@ -161,38 +161,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QCheckBox" name="check_solo">
<property name="text">
<string>Solo mine</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_custompath">
<property name="text">
<string>Custom XMRig executable</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>0</width>
<height>20</height>
</size>
</property>
@@ -221,27 +190,47 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLineEdit" name="lineEdit_path">
<property name="placeholderText">
<string>/path/to/xmrig</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_browse">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="check_tls">
<property name="text">
<string>TLS</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="relayTor">
<property name="text">
<string>Tor</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_solo">
<property name="text">
<string>Solo mine</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
@@ -267,15 +256,15 @@
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Pool</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Pool</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_pools">
<property name="sizePolicy">
@@ -329,15 +318,15 @@
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Node address</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Node address</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_solo">
<property name="text">
@@ -368,80 +357,54 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Receiving address</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_address"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Receiving address</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_address"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Password (optional)</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_password"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>XMRig executable</string>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLineEdit" name="lineEdit_password"/>
<widget class="QLineEdit" name="lineEdit_path">
<property name="placeholderText">
<string>/path/to/xmrig</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QPushButton" name="btn_browse">
<property name="text">
<string>Browse</string>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>60</width>
<height>20</height>
</size>
</property>
</spacer>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QCheckBox" name="check_tls">
<property name="text">
<string>TLS</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="relayTor">
<property name="text">
<string>Tor</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
@@ -494,7 +457,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>2000</height>
<height>0</height>
</size>
</property>
</spacer>
@@ -552,36 +515,6 @@
</attribute>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Powered by Github API v3</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
+8
View File
@@ -34,7 +34,11 @@ CreateWalletPage::CreateWalletPage(AppContext *ctx, QWidget *parent) :
connect(ui->btnChange, &QPushButton::clicked, [=] {
QString walletDir = QFileDialog::getExistingDirectory(this, "Select wallet directory ", m_ctx->defaultWalletDir, QFileDialog::ShowDirsOnly);
if(walletDir.isEmpty()) return;
m_ctx->defaultWalletDir = walletDir;
m_ctx->defaultWalletDirRoot = walletDir;
ui->directory->setText(walletDir);
config()->set(Config::walletDirectory, walletDir);
emit defaultWalletDirChanged(walletDir);
});
connect(ui->directory, &QLineEdit::textChanged, [=](const QString &data) {
@@ -47,6 +51,10 @@ CreateWalletPage::CreateWalletPage(AppContext *ctx, QWidget *parent) :
});
}
void CreateWalletPage::initializePage() {
ui->directory->setText(m_ctx->defaultWalletDir);
}
bool CreateWalletPage::validateWidgets(){
ui->walletName->setStyleSheet("");
ui->directory->setStyleSheet("");
+2 -1
View File
@@ -20,15 +20,16 @@ class CreateWalletPage : public QWizardPage
public:
explicit CreateWalletPage(AppContext *ctx, QWidget *parent = nullptr);
void initializePage() override;
bool validatePage() override;
int nextId() const override;
signals:
void createWallet();
void defaultWalletDirChanged(QString walletDir);
private:
AppContext *m_ctx;
QLabel *topLabel;
Ui::CreateWalletPage *ui;
QString m_walletDir;
bool validateWidgets();

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