Commit graph

3914 commits

Author SHA1 Message Date
Hennadii Stepanov
f000cdcf0a
Merge bitcoin-core/gui#434: Keep InitExecutor in main gui thread
03a5fe06bd qt: Keep InitExecutor in main gui thread (João Barbosa)

Pull request description:

  The `InitExecutor` constructor moves the instance to a dedicated thread. This PR changes that by using `GUIUtil::ObjectInvoke` to run the relevant code in that thread.

  A possible follow-up is to ditch the dedicated thread and use `QThreadPool` or even `QtConcurrent::run` (if we want to enable that).

ACKs for top commit:
  hebasto:
    ACK 03a5fe06bd, tested on Linux Mint 20.2 (Qt 5.12.8).
  jarolrod:
    ACK 03a5fe06bd

Tree-SHA512: 8b40300371d4c04efb9913600a06ba4899af0b5f50fdb26ea23ec751df6d3bd52f8bd693a5e8f6a94ebf3790583dc96c6070e6878d247dece62347aa9bd99031
2021-09-28 23:26:29 +03:00
MarcoFalke
a9d0cec499
Merge bitcoin/bitcoin#23106: Ensure wallet is unlocked before signing PSBT with walletprocesspsbt and GUI
7e3ee4cdd0 GUI: Ask user to unlock wallet before signing psbt (Samuel Dobson)
0f3acecf33 Add test that walletprocesspsbt requires unlocked wallet when signing (Samuel Dobson)
0e895212bb Ensure wallet is unlocked before signing in walletprocesspsbt (Samuel Dobson)

Pull request description:

  If signing a PSBT, we need to ensure the wallet is unlocked.

  Fixes #22874, fixes bitcoin-core/gui#312

ACKs for top commit:
  achow101:
    ACK 7e3ee4cdd0
  lsilva01:
    Code Review ACK 7e3ee4cdd0
  benthecarman:
    ACK 7e3ee4cdd0

Tree-SHA512: 6726a873582747900ab454ea21153a92be86808a4c1517dc2856b389876a2da9e8df1ffa9b567b6bd017038342c3544ecf5ca3c97744e7debe0a5ee65563687d
2021-09-28 09:49:44 +02:00
Samuel Dobson
7e3ee4cdd0 GUI: Ask user to unlock wallet before signing psbt 2021-09-28 13:27:07 +13:00
João Barbosa
03a5fe06bd qt: Keep InitExecutor in main gui thread 2021-09-27 13:05:40 +01:00
Samuel Dobson
d96b000e94 Make GUI UTXO lock/unlock persistent 2021-09-25 23:50:06 +12:00
Russell Yanofsky
865ee1af20 Fix Qt test broken by #22219
It looks like this should have been caught by CI but perhaps there was a
conflict with a recently merged PR. Failure reported by fanquake <fanquake@gmail.com>
https://github.com/bitcoin/bitcoin/pull/22219#issuecomment-920496509
2021-09-15 22:22:10 -04:00
fanquake
528e08119f
Merge bitcoin/bitcoin#22219: multiprocess: Start using init makeNode, makeChain, etc methods
e4709c7b56 Start using init makeNode, makeChain, etc methods (Russell Yanofsky)

Pull request description:

  Use `interfaces::Init::make*` methods instead of `interfaces::Make*` functions, so interfaces can be constructed differently in different executable without having to change any code. (So for example `bitcoin-gui` can make an `interfaces::Node` pointer that communicates with a `bitcoin-node` subprocess, while `bitcoin-qt` can make an `interfaces::Node` pointer that controls node code in the same process.)

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). The commit was first part of larger PR #10102.

ACKs for top commit:
  jamesob:
    reACK e4709c7b56
  achow101:
    ACK e4709c7b56
  benthecarman:
    utACK e4709c7b56

Tree-SHA512: 580c1979dbb2ef444157c8e53041e70d15ddeee77e5cbdb34f70b6d228cc2d2fe3843825f172da84e506200c58f7e0932f7cd4c006bb5058c1f4e43259394834
2021-09-16 08:47:38 +08:00
Hennadii Stepanov
2161a05855
Merge bitcoin-core/gui#420: Ensure translator comments end in full stop
5cc783f5f3 qt: ensure translator comments end in full stop (Jarol Rodriguez)

Pull request description:

  This is a follow-up to #318 which addresses this [nit](https://github.com/bitcoin-core/gui/pull/318#discussion_r706856893) by addressing it globally.

  This ensures that all GUI translator comments end in a full stop. If a comment does not end in a full stop, a translator may think  that the rest of the comment is being cut off.

  While here, add a colon to the word "see" for any comments touched which point to look at a link.

ACKs for top commit:
  hebasto:
    ACK 5cc783f5f3, I have reviewed the code and it looks OK, I agree it can be merged.
  shaavan:
    Code Review ACK 5cc783f5f3

Tree-SHA512: 67a1d56175c974e0af9b460fa44163f7ce139a7b81cfaf8ed2c0e7fb6d5120957c3135d96010aeb6229689468e36673fe9571b5a8c3e1c07e047aba1bd563444
2021-09-14 15:50:47 +03:00
Hennadii Stepanov
7ecb309c4e
Merge bitcoin-core/gui#419: Add missing tooltips to options menu settings
9bd168bf54 qt: add missing tooltips to options menu settings (Jarol Rodriguez)

Pull request description:

  This adds missing tooltips to the text of the `Size of database cache` and the `Number of script verification threads` settings.

  All settings in the Options window will now have appropriate tooltip texts.

ACKs for top commit:
  jonatack:
    ACK 9bd168bf54 tested on Debian 5.10.46-4 (2021-08-03)
  hebasto:
    ACK 9bd168bf54, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: d71946bfee33c624a8b79eafe514d2c902090a40bc25097be4c7da4a80270f53305002af1b27d5fd082a0f45f838e22036632f9445918c4b8898073b33c09c08
2021-09-13 16:14:42 +03:00
Jarol Rodriguez
9bd168bf54 qt: add missing tooltips to options menu settings 2021-09-13 01:58:41 -04:00
Jarol Rodriguez
5cc783f5f3 qt: ensure translator comments end in full stop
This ensures that all gui translator comments end in a full stop.
If a comment does not end in a full stop, a translator may think 
that the rest of the comment is being cut off.

While here, add a colon to the word "see" for any comments
touched which point to look at a link.
2021-09-12 18:25:06 -04:00
Hennadii Stepanov
5895a502cb
Merge bitcoin-core/gui#391: Add cancel button to configuration options popup
0b869df1c9 qt: Add cancel button to configuration options popup (Shashwat)

Pull request description:

  This PR renames the **OK** button to **Continue** and adds a **Cancel** button to the configuration options pop-up.

  This feature will give the user an option to abort opening the configuration file if they want to. This is an essential helpful feature that was missing in the master branch.

  In some windows managers such as Windows I3. The exit button at the top right corner is missing. So this feature becomes crucial there. And even when the exit button is there, it doesn't prevent the opening of the configuration file even when pressed.

  Additionally, it will always be possible to close using Keyboard Shortcut. This PR helps accessibility for those who need to use a mouse.

  <table>
    <tr>
     <td>Master
     </td>
     <td>PR
     </td>
    </tr>
    <tr>
     <td>

  ![Cancel-conf master(1)](https://user-images.githubusercontent.com/85434418/127555137-7a16dffd-109d-4024-917b-6b85f4df4f4a.png)

     </td>
     <td>

  ![Screenshot from 2021-09-07 20-15-28](https://user-images.githubusercontent.com/85434418/132365729-14f71f92-220b-4bb6-bed4-8315bd5697e6.png)

     </td>
    </tr>
  </table>

ACKs for top commit:
  hebasto:
    ACK 0b869df1c9, tested on Linux Mint 20.2 (Qt 5.12.8):
  prayank23:
    tACK 0b869df1c9

Tree-SHA512: c314e8b84064134f028f66f5015eb0f6ba33d5d4174c9ff49dcb5d2b577dce6019f59f9c7913393a415a323ea98c26febf5ca26e3e2102e7a1d31171e01937f1
2021-09-12 19:21:55 +03:00
Hennadii Stepanov
ee1db7b6dc
Merge bitcoin-core/gui#318: Add Copy address Peers Tab Context Menu Action
3ec061d9da qt: Add "Copy address" item to the context menu in the Peers table (Hennadii Stepanov)

Pull request description:

  Picking up #264

  This adds a `Copy Address` context menu action to the `Peers Tab`.

  Based on the first commit of PR #317 so that we can use `Qt::DisplayRole` in the `copyEntryData` function.

  | Master        | PR               |
  | ----------- | ----------- |
  |  ![Screen Shot 2021-05-05 at 4 51 11 AM](https://user-images.githubusercontent.com/23396902/117117822-fb067400-ad5d-11eb-9466-228456108e52.png) | ![Screen Shot 2021-05-05 at 4 49 15 AM](https://user-images.githubusercontent.com/23396902/117117835-fe99fb00-ad5d-11eb-8de0-f6a9acdbf40e.png) |

ACKs for top commit:
  shaavan:
    tACK 3ec061d9da
  luke-jr:
    utACK 3ec061d9da
  hebasto:
    ACK 3ec061d9da, tested on Linux Mint 20.2 (Qt 5.12.8):

Tree-SHA512: be0d7324592aae3928fa3cc522294f17226419fe8cbe3587df12a36bd4fa9c81bead377b13051e950b9a3fcd290b273861e70d6c76b75cdf76eaf58224b834cd
2021-09-12 19:00:25 +03:00
Shashwat
0b869df1c9 qt: Add cancel button to configuration options popup
This adds a cancel buttion to the configuration options window
2021-09-10 19:02:54 +05:30
MarcoFalke
896649996b
Merge bitcoin/bitcoin#22915: Remove confusing CAddrDB
fade9a1a4d Remove confusing CAddrDB (MarcoFalke)
fa7f77b7d1 Fix addrdb includes (MarcoFalke)
fa3f5d0dae Move addrman includes from .h to .cpp (MarcoFalke)

Pull request description:

  Split out from #22762 to avoid having to carry it around in (an)other rebase(s)

ACKs for top commit:
  ryanofsky:
    Code review ACK fade9a1a4d
  lsilva01:
    Code Review ACK fade9a1a4d

Tree-SHA512: 7615fb0b6235d0c1e6f8cd6263dd18c4d95890567c2b797fe6fce6cb12cc85ce6eacbe07dbb6d81b05d179ef03b42edfd61c940e35a1044ce6d363b54c2dae5c
2021-09-09 08:09:39 +02:00
fanquake
da67b75c5c
Merge bitcoin/bitcoin#22903: Enable clang-tidy bugprone-argument-comment and fix violations
fa57fa1a2e Enable clang-tidy bugprone-argument-comment and fix violations (MarcoFalke)

Pull request description:

  Named arguments can be dangerous when they are wrong, because they are not enforced by the compiler. Currently there are only minor typos, no actual bugs.

  Fix the typos and add the `.clang-tidy` file to make it easier to find them in the future.

ACKs for top commit:
  practicalswift:
    cr ACK fa57fa1a2e
  fanquake:
    ACK fa57fa1a2e

Tree-SHA512: b66f01e0a1e77e56ed8454002176df660cc2cc0947a90785aa33cc5b8003a1f99fd8b2f8f89f2a0bf180ff2c42c031d69e669d127bb557b879c17975275a220b
2021-09-09 11:33:58 +08:00
MarcoFalke
fa7f77b7d1
Fix addrdb includes 2021-09-07 10:44:48 +02:00
MarcoFalke
fa3f5d0dae
Move addrman includes from .h to .cpp
This is a follow-up to the code move in commit a820e79512
2021-09-07 10:44:43 +02:00
MarcoFalke
fa57fa1a2e
Enable clang-tidy bugprone-argument-comment and fix violations 2021-09-07 09:11:10 +02:00
Hennadii Stepanov
503194d2ee
Merge bitcoin-core/gui#398: refactor: Pass WalletModel object to the WalletView constructor
d319c4dae9 qt, refactor: Replace WalletFrame::addWallet with WalletFrame::addView (Hennadii Stepanov)
92ddc02a16 qt, refactor: Declare getWalletModel with const and noexcept qualifiers (Hennadii Stepanov)
ca0e680bdc qt, refactor: Drop redundant checks of walletModel (Hennadii Stepanov)
404373bc6a qt, refactor: Pass WalletModel object to WalletView constructor (Hennadii Stepanov)

Pull request description:

  An instance of the `WalletView` class without the `walletModel` data member being set is invalid. So, it is better to set it in the constructor.

  Establishing one more `WalletView` class's invariant in constructor:
  - allows to drop all of checks of the`walletModel` in member functions
  - makes reasoning about the code that uses instances of the `WalletView` class  easier

  Possible follow ups could extend this approach to other classes, e.g., `OverviewPage`, `TransactionView`, `ReceiveCoinsDialog`, `SendCoinsDialog`, `AddressBookPage`.

ACKs for top commit:
  ShaMan239:
    Code review ACK d319c4dae9
  promag:
    Code review ACK d319c4dae9.
  jarolrod:
    ACK d319c4dae9

Tree-SHA512: b0c61f82811bb5aba2738067b53dc9ea4439230d547ce5c8fd85c480d8d70ea15f9942dbf13842383acbce467fba1ab4e132e37c56b654b46ba897301a41066e
2021-09-07 08:48:52 +03:00
Hennadii Stepanov
3ec061d9da qt: Add "Copy address" item to the context menu in the Peers table
Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
2021-09-05 15:37:14 -04:00
Russell Yanofsky
93b9800fec scripted-diff: Rename overloaded int GetArg to GetIntArg
Improve readability of code, simplify future scripted diff cleanup PRs, and be
more consistent with naming for GetBoolArg.

This will also be useful for replacing runtime settings type checking
with compile time checking.

-BEGIN VERIFY SCRIPT-
git grep -l GetArg | xargs sed -i 's/GetArg(\([^)]*\( [0-9]\+\|-1\|port\|BaseParams().RPCPort()\|Params().GetDefaultPort()\|_TIMEOUT\|Height\|_WORKQUEUE\|_THREADS\|_CONNECTIONS\|LIMIT\|SigOp\|Bytes\|_VERSION\|_AGE\|_CHECKS\|Checks() ? 1 : 0\|_BANTIME\|Cache\|BLOCKS\|LEVEL\|Weight\|Version\|BUFFER\|TARGET\|WEIGHT\|TXN\|TRANSACTIONS\|ADJUSTMENT\|i64\|Size\|nDefault\|_EXPIRY\|HEIGHT\|SIZE\|SNDHWM\|_TIME_MS\)\))/GetIntArg(\1)/g'
-END VERIFY SCRIPT-

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2021-09-27 06:57:20 -04:00
Hennadii Stepanov
d319c4dae9
qt, refactor: Replace WalletFrame::addWallet with WalletFrame::addView
No need to pass an instance of the WalletModel class to this method.

Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
2021-09-03 00:27:14 +03:00
MarcoFalke
33707a2a88
Merge bitcoin/bitcoin#22782: Remove unused MaybeSetAddrName
fa9eade142 Remove GetAddrName (MarcoFalke)
fa786570a5 Remove unused RecursiveMutex cs_addrName (MarcoFalke)
fa82f4ea96 Remove unused MaybeSetAddrName (MarcoFalke)

Pull request description:

  .

ACKs for top commit:
  jnewbery:
    Code review ACK fa9eade142
  naumenkogs:
    utACK fa9eade142

Tree-SHA512: 61501a699add59225dc8127b6dfdda450d768c86f958fdf94e9c28309c3705ecfbee4b064d44228b8c1190c19c39272becc7ede8386ac1406699ea2285881c72
2021-08-27 11:46:26 +02:00
W. J. van der Laan
19364c0ddf
Merge bitcoin/bitcoin#20586: Fix Windows build with --enable-werror
b367745cfe ci: Make Cirrus CI Windows build with --enable-werror (Hennadii Stepanov)
c713bb2b24 Fix Windows build with --enable-werror on Ubuntu Focal (Hennadii Stepanov)

Pull request description:

  This PR makes possible to cross-compile Windows build with `--enable-werror --enable-suppress-external-warnings`.
  Some problems are fixed, others are silenced.

  Also `--enable-werror` is enabled for Cirrus CI Windows build (the last one on Cirrus CI without `--enable-werror`).

ACKs for top commit:
  practicalswift:
    cr ACK b367745cfe: patch looks correct
  laanwj:
    Code review ACK b367745cfe
  vasild:
    ACK b367745cfe
  jarolrod:
    ACK b367745cfe

Tree-SHA512: 64f5c99b7dad4c0efce80cd45d7074f275bd8411235dc9e0841287bdab64b812c6f8f9d632c35531d0b8210148531f53aaaac77be7699b29d2d6aaae304dbee0
2021-08-27 08:31:45 +02:00
Hennadii Stepanov
b8d45a3c20
Merge bitcoin-core/gui#384: Add copy IP/Netmask action for banned peer
ab1461d5d3 qt: Add copy IP/Netmask action for banned peer (Shashwat)

Pull request description:

  This PR adds a Copy IP/Netmask context menu action to the Banned Peers Table.

  This feature is helpful if a node using GUI might want to alert its peer about a particular malicious user. So it can copy that user’s IP/Netmask and broadcast it to its peers so they can ban it instantly using the setban command in the console.

  | Master        | PR               |
  | ----------- | ----------- |
  | ![Screenshot_from_2021-07-21_00-01-331](https://user-images.githubusercontent.com/23396902/126377808-bd23bb19-3f47-4f1b-8371-39baa9747bbe.png) | ![Screenshot from 2021-08-20 20-13-28(1)(1)](https://user-images.githubusercontent.com/85434418/130251441-a8d0f816-a2e9-4e63-a22d-94885c5cec98.png) |

ACKs for top commit:
  jarolrod:
    re-ACK ab1461d
  hebasto:
    re-ACK ab1461d5d3, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: a528f089bd4cb5b51fec987550d21c2587459ad80f854b55850bc62c776c21f3fa31052a17e2b0e9e9d0b3468799c8070ed306543730fb7b324f283847151e17
2021-08-26 22:51:46 +03:00
Shashwat
ab1461d5d3 qt: Add copy IP/Netmask action for banned peer
This adds a copy IP/Netmask context menu action for peers in the banned peer table
2021-08-26 23:33:27 +05:30
Hennadii Stepanov
92ddc02a16
qt, refactor: Declare getWalletModel with const and noexcept qualifiers 2021-08-26 16:28:00 +03:00
Hennadii Stepanov
ca0e680bdc
qt, refactor: Drop redundant checks of walletModel
The walletModel member is set in the WalletView constructor now.
2021-08-26 16:28:00 +03:00
Hennadii Stepanov
404373bc6a
qt, refactor: Pass WalletModel object to WalletView constructor
An instance of the WalletView class without walletModel data member
being set is invalid. So, it is better to set it in the constructor.
2021-08-26 16:27:56 +03:00
Hennadii Stepanov
774a4f517c
Merge bitcoin-core/gui#403: refactor: Make paths to update Encryption and HD wallet statuses simpler
b8aa84b1a1 qt, refactor: Replace `if` check with `assert` (Hennadii Stepanov)
fcdc8b0fcb qt, refactor: Drop redundant signalling in WalletView::setWalletModel (Hennadii Stepanov)
37dcf161d3 qt, refactor: Emit WalletView::encryptionStatusChanged signal directly (Hennadii Stepanov)
7d0d4c0490 qt: Add WalletFrame::currentWalletSet signal (Hennadii Stepanov)

Pull request description:

  This PR makes signal-slot paths to reach `setHDStatus` and `setEncryptionStatus` functions shorter and easier to reason about them.

  Required to simplify #398 (see https://github.com/bitcoin-core/gui/pull/398#discussion_r686094883).

  ---

  **Note for reviewers.** Please verify that "Encrypt Wallet..." menu item, and the following icons

  ![DeepinScreenshot_select-area_20210811202120](https://user-images.githubusercontent.com/32963518/129074601-13fa998a-ac47-4ad2-be00-ba400b12c18a.png)

  and updated properly in each and every possible scenario.

ACKs for top commit:
  jarolrod:
    tACK b8aa84b1a1
  Talkless:
    Code review ACK b8aa84b1a1. Did build on Debian Sid with Qt 5.15.2 but no actual testing performed.
  ryanofsky:
    Code review ACK b8aa84b1a1. Only change since last review was rebase

Tree-SHA512: 275737cdba02baff71049df41bc24089e916f96326dd2dea26ec607c7949cb3aae368eeabbe3ad5a0a27651503a1d65536873726de854c5f6af259bcc29727e7
2021-08-26 15:56:18 +03:00
MarcoFalke
fa9eade142
Remove GetAddrName
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html#c131-avoid-trivial-getters-and-setters
2021-08-26 10:44:26 +02:00
fanquake
3ae503c95b
refactor: replace QDateTime::toTime_t with QDateTime::toSecsSinceEpoch 2021-08-24 15:08:04 +08:00
fanquake
27257b39bf
refactor: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch 2021-08-24 15:06:46 +08:00
Hennadii Stepanov
d3203a99d8
Merge bitcoin-core/gui#408: Add missing mnemonics in menu bar options
7c33e3a572 qt: Add missing mnemonics in menu bar options (Shashwat)

Pull request description:

  Since #362 we have defaulted to add mnemonic shortcuts for the context menus.
  The Window -> Minimize option and File -> Load PSBT from clipboard were hitherto missing a mnemonic shortcut. This PR adds mnemonic shortcuts for them

  Changes introduced in this PR:
  | Master | PR |
  | ----------| ---- |
  | ![Screenshot from 2021-08-23 23-10-07](https://user-images.githubusercontent.com/85434418/130494098-c65ec9da-c3f1-4243-9b3d-0c87cb677825.png) | ![Screenshot from 2021-08-23 23-08-41](https://user-images.githubusercontent.com/85434418/130494083-849ffd14-05e9-4a6d-bdc3-b3e55b8a8861.png)|
  |![Screenshot from 2021-08-23 23-10-21](https://user-images.githubusercontent.com/85434418/130494233-1b2e8838-c5d4-48a8-9abf-a4acc8d6146c.png)|![Screenshot from 2021-08-23 23-09-00](https://user-images.githubusercontent.com/85434418/130494181-dcdbf119-a2c6-469d-a6c9-3021506ab40b.png)|

ACKs for top commit:
  jarolrod:
    tACK 7c33e3a572
  hebasto:
    ACK 7c33e3a572, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: 32f201ae7716b19ca123856292f8bfa0d805f6c7271ac1b5e08eff6b95017443754c8a76e8396ccca1869a57384e11016cbd99d63ccdd2fae6da4eaf3ae32298
2021-08-23 22:15:29 +03:00
Shashwat
7c33e3a572 qt: Add missing mnemonics in menu bar options
The Window -> Minimize an File -> Load PSBT from clipboard options were missing a mnemonic
shortcut. This PR adds mnemonic shortcuts for them.
2021-08-23 23:06:55 +05:30
Hennadii Stepanov
2b3d8f3dde
qt: Handle new added plurals in bitcoin_en.ts
This step was missed. See translation_process.md
2021-08-22 00:03:31 +03:00
Russell Yanofsky
e4709c7b56 Start using init makeNode, makeChain, etc methods
Use interfaces::Init::make* methods instead of interfaces::Make*
functions, so interfaces can be constructed differently in different
executables without having to change any code. (So for example
bitcoin-gui can make an interfaces::Node pointer that communicates with
a bitcoin-node subprocess, while bitcoin-qt can make an interfaces::Node
pointer that starts node code in the same process.)
2021-08-17 03:05:15 -05:00
Russell Yanofsky
62a09a3077 refactor: remove ::vpwallets and related global variables
Move global wallet variables to WalletContext struct
2021-08-17 04:05:15 -04:00
Hennadii Stepanov
b8aa84b1a1
qt, refactor: Replace if check with assert
There are no ways BitcoinGUI::updateWalletStatus being called without
an instance of the WalletFrame class.
2021-08-14 19:19:03 +03:00
Hennadii Stepanov
fcdc8b0fcb
qt, refactor: Drop redundant signalling in WalletView::setWalletModel
This job will be done by WalletFrame::currentWalletSet signal being
emitted in the WalletFrame::setCurrentWallet function.
2021-08-14 19:19:03 +03:00
Hennadii Stepanov
37dcf161d3
qt, refactor: Emit WalletView::encryptionStatusChanged signal directly 2021-08-14 19:19:03 +03:00
Hennadii Stepanov
7d0d4c0490
qt: Add WalletFrame::currentWalletSet signal
The connection of the WalletFrame::currentWalletSet signal to
the BitcoinGUI::updateWalletStatus is a shorter and more descriptive way
to call both the setHDStatus and setEncryptionStatus member functions of
the BitcoinGUI class in comparison to using of the
WalletView::updateEncryptionStatus slot.
2021-08-14 19:18:54 +03:00
Hennadii Stepanov
439e58c4d8
Merge bitcoin-core/gui#360: Unregister wallet notifications before unloading wallets
93cc53a2b2 gui: Unregister wallet notifications before unloading wallets (Russell Yanofsky)

Pull request description:

  This change was originally part of both bitcoin/bitcoin#10102 and bitcoin/bitcoin#19101 and is required for both because it avoids the IPC wallet implementation in bitcoin/bitcoin#10102 and the WalletContext implementation in bitcoin/bitcoin#19101 needing to deal with notification objects that have stale pointers to deleted wallets.

ACKs for top commit:
  promag:
    Code review ACK 93cc53a2b2.
  hebasto:
    ACK 93cc53a2b2

Tree-SHA512: 805f50a493291ad0f7c48725fbc5058d58ebbdb0770befd51d8aa241209a13f8a46f5982481336ab8338cdc83e9017668089a71deccf1587308e841cf8697825
2021-08-12 20:03:00 +03:00
Hennadii Stepanov
9948f114f8
Merge bitcoin-core/gui#390: Add SubFeeFromAmount to options
62b125fd19 qt, refactor: Fix indentation (Prateek Sancheti)
ad28b66e98 qt: Add SubFeeFromAmount option (Prateek Sancheti)

Pull request description:

  This PR adds **_SubFeeFromAmount_** option which lets the user select their preferred setting of whether fee for a transaction is to be subtracted from the amount or not for future transactions. The setting chosen by the user is remembered even when the GUI mode is turned off.

  **_Functionality and Usage:_**

  - Go to `Settings > Options > Wallet` on _Windows/Linux_ or `bitcoin-qt > Preferences > Wallet` on _macOS_.
  - The checkbox **Subtract Fee From Amount** corresponds to the added option **SubFeeFromAmount**.
  - The preferred setting intended to be the default for all future send transactions should be selected by the user.
  - Click on **OK**.
  - Go to the **Send** tab in the wallet.
  - You shall notice, any new Send transaction created will have the preferred setting as chosen by the user.<br> (Try clicking on Add recipient or even restarting the Node in GUI)

  Attaching ScreenRecordings to explain the added feature.

  > Master.mov: Master Branch

  https://user-images.githubusercontent.com/54016434/127763378-be91837d-d0ab-4ae5-87c0-d303fa70a336.mov

  > PR.mov: PullRequest

  https://user-images.githubusercontent.com/54016434/127763404-05b834c1-4082-4fbd-9b05-1528ac898a21.mov

  Close #386

ACKs for top commit:
  Talkless:
    tACK 62b125fd19, tested on Debian Sid with 5.15.2 and it works as described.
  hebasto:
    re-ACK 62b125fd19, only removed the unused `SubFeeFromAmountChanged` signal since my [previous](https://github.com/bitcoin-core/gui/pull/390#pullrequestreview-726531766) review.
  meshcollider:
    utACK 62b125fd19

Tree-SHA512: 932ca89ae578a1e1c426561400d87cf005c231944feaf0f662ff8d88f32bdd65a927a090ea41510a15f8ec0ebcd5529672e9917720eb5ea85f413f081e45d5bb
2021-08-12 02:29:10 +03:00
Hennadii Stepanov
e614cc8cd8
Merge bitcoin-core/gui#399: Fix "Load PSBT" functionality when no wallet loaded
0237d95323 qt: Add Load PSBT functionaliy with nowallet (Prateek Sancheti)

Pull request description:

  This PR provides a fix to the issue mentioned in #232.

  Currently, the **_Load PSBT_** functionality works well in case a wallet is loaded but does nothing when a wallet isn't loaded.

  If a function cannot work without a wallet being loaded, it is disabled by default (It is unclickable as shown in the image).

  For e.g. One cannot `Close Wallet` or `Backup Wallet` or `Sign Messages` without a wallet being loaded. And hence they are disabled. But if you notice, `Load PSBT` options are not disabled by default even when a wallet isn't loaded.

  >  ![Screenshot 2021-08-07 at 11 46 30 PM](https://user-images.githubusercontent.com/54016434/128610208-45376026-0e91-4268-abdf-342e3cec5917.png)

  As mentioned by hebasto in the issue description :

  ```
  <hebasto> achow101: does "File" -> "Load PSBT from {file|clipboard}" make any sense when no wallet is loaded?
  <achow101> hebasto: yes, for finalize and sending
  ```

  This means **_Load PSBT_**  should be working just as similar whether wallets are being loaded or not.

  After making the required changes to the code, The **_Load PSBT_** works as expected even with no wallet loaded and the PSBT is finalized.

  | Master | PR |
  |-------------|---------------|
  | ![Hnet com-image (1)](https://user-images.githubusercontent.com/54016434/128611454-4dfc3fd3-ecc0-48f0-8408-60eb98035694.gif) | ![Hnet com-image (2)](https://user-images.githubusercontent.com/54016434/128611461-982468d2-9cd0-4f9b-9392-c25b6c8857e2.gif) |

  Close #232

ACKs for top commit:
  achow101:
    re-ACK 0237d95323
  hebasto:
    ACK 0237d95323, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: 8d928c5bfd3c2b286ddcacd0b367c872de8bc3d3d9d82280faeadc60d738b86af328c060b5763ade364c9b386b23f95580c2eb1147b16373fbb713170c100350
2021-08-11 22:29:31 +03:00
Hennadii Stepanov
77e23ca945
Merge bitcoin-core/gui#317: Add Direction column to Peers Tab
6971e790c3 gui: add Direction column to peers tab (Jon Atack)

Pull request description:

  Picking up #289

  This adds a `Direction column`, making the peers tab the same as the `Direction/Type` row in the peer details and the direction and type columns in our other user-facing peer connections table in `-netinfo`.

  Users can now sort the peers table by direction. The default sort is set to inbound, then outbound.

  | Master        | PR               |
  | ----------- | ----------- |
  | ![Screen Shot 2021-05-05 at 3 51 09 AM](https://user-images.githubusercontent.com/23396902/117111864-38ff9a00-ad56-11eb-889d-f1c838c845e6.png) | ![Screen Shot 2021-05-05 at 3 35 40 AM](https://user-images.githubusercontent.com/23396902/117111892-4157d500-ad56-11eb-82b1-5bd3e88a4cff.png) |

ACKs for top commit:
  jonatack:
    Tested ACK 6971e790c3
  ShaMan239:
    tACK 6971e790c3
  hebasto:
    ACK 6971e790c3, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: 9716cdedd435f88245a097fed6d4b2b486104d0dd09df739bdb4f2bfad709cbd9c9a231168cc3326e94fa5fddc77dd68f992f20417d04d94930db9fccdbb7de1
2021-08-11 16:55:36 +03:00
Hennadii Stepanov
3d9cdb1689
Merge bitcoin-core/gui#354: Refactor open date range to use std::optional
4830f4912a qt: Refactor open date range to use std::optional (João Barbosa)

Pull request description:

  Use `std::nullopt` for open date range instead of `TransactionFilterProxy::MIN_DATE` and `TransactionFilterProxy::MAX_DATE`.

ACKs for top commit:
  hebasto:
    re-ACK 4830f4912a, only missed header included since my [previous](https://github.com/bitcoin-core/gui/pull/354#pullrequestreview-682108182) review.
  Talkless:
    tACK 4830f4912a, tested on Debian Sid, filtering seems to work as expected.

Tree-SHA512: dcecbcc129cb401d6ac13a20f015b8cb2a7434fae6bd3e5b19fca5531e8bd915e2a0835f9c601371381750cdc8cd6fcf4f8c6669177d679773046cbe13bed68b
2021-08-11 16:22:03 +03:00
Prateek Sancheti
0237d95323 qt: Add Load PSBT functionaliy with nowallet 2021-08-11 15:40:39 +05:30
Prateek Sancheti
62b125fd19 qt, refactor: Fix indentation 2021-08-11 14:48:35 +05:30