Commit graph

2607 commits

Author SHA1 Message Date
marcoagner
12ad33a8e4
[doc] qt: fixes broken link on readme 2018-05-01 21:17:54 +01:00
James O'Beirne
5109fc4a9c [tests] [qt] Add tests for address book manipulation via EditAddressDialog
Also modifies corresponding QT code to allow for use within test cases.
2018-04-25 13:13:24 -04:00
James O'Beirne
9c01be1b85 [tests] [qt] Introduce qt/test/util with a generalized ConfirmMessage
ConfirmMessage is reused in future tests apart from its single usage here.
2018-04-25 13:08:53 -04:00
James O'Beirne
8cdcaee4c7 [qt] Display more helpful message when adding a send address has failed
Addresses #12796.

When we're unable to add a sending address to the address book because it
already exists as a receiving address, display a message indicating as much.
This should help avoid confusion about an address supposedly already in the
book but which isn't currently visible in the interface.
2018-04-25 13:08:53 -04:00
James O'Beirne
c5b277033a Add purpose arg to Wallet::getAddress
Also make all arguments to getAddress required and document args at call sites.
2018-04-25 13:08:53 -04:00
Wladimir J. van der Laan
476cb35551
Merge #12909: wallet: Make fee settings to be non-static members
fac0db0 wallet: Make fee settings non-static members (MarcoFalke)

Pull request description:

  The wallet header defined some globals (they were called "settings"), that should be class members instead.

  This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc `settxfee` for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case)

Tree-SHA512: 4ab6ec2f5c714742396ded5e451ec3b1ceb771e3696492de29889d866de4365b3fbe4a2784d085c8b8bd11b1ebb8a1fec99ab2c62eee716791cfc67c0cf29e1b
2018-04-24 16:37:30 +02:00
MarcoFalke
bdda14d1c0
Merge #13055: qt: Don't log to console by default
aee80b0ef9 qt: Don't log to console by default (Wladimir J. van der Laan)

Pull request description:

  Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
  resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

  This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

  (fixes #13004)

Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890
2018-04-23 19:29:55 -04:00
Wladimir J. van der Laan
8609ddb368
Merge #12999: qt: Show the Window when double clicking the taskbar icon
67bf2aa qt:Show the entire Window when double clicking on taskbar (Chun Kuan Lee)

Pull request description:

  fix #12838

Tree-SHA512: 4498bc1fe52efeed3768d6bdd7941e4b036d52ae80d9c1b6679c6daa3a62aeda4cff0c91fe1c65afaea6049c59cb0296fdcbff63ecb342d518615a92361fda7f
2018-04-23 21:01:08 +02:00
MarcoFalke
fac0db0ff8
wallet: Make fee settings non-static members 2018-04-23 10:49:21 -04:00
Wladimir J. van der Laan
aee80b0ef9 qt: Don't log to console by default
Default `-printtoconsole` to false for the GUI. GUI programs should not
print to the console unnecessarily. For example, when launched by the
window manager, the output might end up in the X session log file,
resulting in duplicate logging. On Windows, it is pointless as well
because bitcoin-qt isn't a console application.
2018-04-23 09:25:34 +02:00
João Barbosa
373aee26c3 wallet: Add AddWallet, RemoveWallet, GetWallet and GetWallets
With these new functions all vpwallets usage are removed
and vpwallets is now a static variable (no external linkage).
2018-04-18 22:07:33 +01:00
Chun Kuan Lee
67bf2aa68e
qt:Show the entire Window when double clicking on taskbar 2018-04-17 02:38:10 +08:00
Jonas Schnelli
5f2a39946f
Merge #11200: Allow for aborting rescans in the GUI
ae1d2b030 Give an error when rescan is aborted by the user (Andrew Chow)
69b01e6f8 Add cancel button to rescan progress dialog (Andrew Chow)

Pull request description:

  A cancel button is added to the `showProgress` dialog that is used only for rescans. When clicked, `AbortRescan` is called directly to cancel the rescan.

  Rescans triggered from the debug console will now be cancelable by clicking the cancel button.

  Rescans triggered by a command (e.g. `importmulti`) will now give an error indicating that the rescan was aborted by the user (either by the `abortrescan` command or by clicking cancel).

Tree-SHA512: 4bb14998766de686e2318fbc9805758eccf5dbe628a7257d072c9ae2fb4f61303a0876f49988d6e5eddb261969b8a307c81c0c2df0a42ae909a43d738af3dc1b
2018-04-13 20:51:59 +02:00
Andrew Chow
69b01e6f8b Add cancel button to rescan progress dialog
Adds a cancel button to the rescan progress dialog. When it is clicked,
AbortRescan is called to abort a rescan
2018-04-12 17:00:30 -04:00
Wladimir J. van der Laan
f15b72f482
Merge #12650: gui: Fix issue: "default port not shown correctly in settings dialog"
40c5886 Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251)

Pull request description:

  In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method:

  29fad97c32/src/qt/optionsmodel.cpp (L129)

  29fad97c32/src/qt/optionsmodel.cpp (L139)

  This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`.

  This PR attempts to resolve #12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug.

  The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value.

Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d
2018-04-11 14:44:24 +02:00
251
40c58866c7 Fix illegal default addProxy and addrSeparateProxyTor settings. 2018-04-10 22:22:55 +02:00
Darko Janković
7039319db5
Docs: fixed link, replaced QT with Qt 2018-04-09 22:55:36 +02:00
Wladimir J. van der Laan
0700b6f778
Merge #11851: scripted-diff: Rename wallet database classes
9b0f0c5 Add m_ prefix to WalletBatch::m_batch (Russell Yanofsky)
398c6f0 Update walletdb comment after renaming. (Russell Yanofsky)
ea23945 scripted-diff: Rename wallet database classes (Russell Yanofsky)

Pull request description:

  Scripted diff to rename some wallet classes. Motivated by discussion in https://github.com/bitcoin/bitcoin/pull/11687#discussion_r155354119

  | Current          | New                 |
  | ---------------- | ------------------- |
  | CDBEnv           | BerkeleyEnvironment |
  | CDB              | BerkeleyBatch       |
  | CWalletDBWrapper | WalletDatabase      |
  | CWalletDB        | WalletBatch         |

  Berkeley\* classes are intended to contain BDB specific code, while Wallet\* classes are intended to be more backend-agnostic.

  Also renamed associated variables:

  | Current             | New             |
  | ------------------- | --------------- |
  | dbw                 | database        |
  | pwalletdb           | batch           |
  | pwalletdbEncryption | encrypted_batch |

Tree-SHA512: 372f2e24b2deb59d4792b5ed578aaf0cce51b6db41c400bef5d0c2cd7833e62ae4d4afa0f6000268d52e15b20f737c5a55f1cecf7768556a782fd8cd6fe051d9
2018-04-09 19:29:54 +02:00
practicalswift
280023f31d Remove duplicate includes 2018-04-09 09:18:49 +02:00
Jonas Schnelli
25c56cdbe7
Merge #12878: [refactor] Config handling refactoring in preparation for network-specific sections
77a733a99 [tests] Add additional unit tests for -nofoo edge cases (Anthony Towns)
af173c2be [tests] Check GetChainName works with config entries (Anthony Towns)
fa27f1c23 [tests] Add unit tests for ReadConfigStream (Anthony Towns)
087c5d204 ReadConfigStream: assume the stream is good (Anthony Towns)
6d5815aad Separate out ReadConfigStream from ReadConfigFile (Anthony Towns)
834d30341 [tests] Add unit tests for GetChainName (Anthony Towns)
11b6b5b86 Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName (Anthony Towns)

Pull request description:

  This does a bit of refactoring of the configuration handling code in order to add additional tests to make adding support for [test]/[regtest] sections in the config file in #11862 easier. Should not cause any behaviour changes.

Tree-SHA512: 8d2ce1449fc180de03414e7e569d1a21ba1e9f6564e13d3faf3961f710adc725fa0d4ab49b89ebd2baa11ea36ac5018377f693a84037d386a8b8697c9d6db3e9
2018-04-08 16:24:30 +02:00
MarcoFalke
048ac8326b
Merge #12906: Avoid interface keyword to fix windows gitian build
17780d6f35 scripted-diff: Avoid `interface` keyword to fix windows gitian build (Russell Yanofsky)

Pull request description:

  Rename `interface` to `interfaces`

  Build failure reported by ken2812221 in https://github.com/bitcoin/bitcoin/pull/10244#issuecomment-379434756

Tree-SHA512: e02c97c728540f344202c13b036f9f63af23bd25e25ed7a5cfe9e2c2f201a12ff232cc94a93fbe37ef6fb6bf9e036fe62210ba798ecd30de191d09338754a8d0
2018-04-07 15:19:47 -04:00
Russell Yanofsky
ea23945dbc scripted-diff: Rename wallet database classes
-BEGIN VERIFY SCRIPT-

sed -i 's/\<CWalletDBWrapper\>/BerkeleyDatabase/g' src/wallet/db.h src/wallet/db.cpp
sed -i '/statuses/i/** Backend-agnostic database type. */\nusing WalletDatabase = BerkeleyDatabase\;\n' src/wallet/walletdb.h
ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' ':(exclude)*dbwrapper*' test | xargs sed -i "s:\<$1\>:$2:g"; }
ren CDBEnv           BerkeleyEnvironment
ren CDB              BerkeleyBatch
ren CWalletDBWrapper WalletDatabase
ren CWalletDB        WalletBatch
ren dbw              database
ren m_dbw            m_database
ren walletdb         batch
ren pwalletdb        batch
ren pwalletdbIn      batch_in
ren wallet/batch.h   wallet/walletdb.h
ren pwalletdbEncryption encrypted_batch

-END VERIFY SCRIPT-
2018-04-07 11:48:27 -05:00
Russell Yanofsky
17780d6f35 scripted-diff: Avoid interface keyword to fix windows gitian build
Rename `interface` to `interfaces`

Build failure reported by Chun Kuan Lee <ken2812221@gmail.com>
https://github.com/bitcoin/bitcoin/pull/10244#issuecomment-379434756

-BEGIN VERIFY SCRIPT-

git mv src/interface src/interfaces
ren() { git grep -l "$1" | xargs sed -i "s,$1,$2,g"; }
ren interface/            interfaces/
ren interface::           interfaces::
ren BITCOIN_INTERFACE_    BITCOIN_INTERFACES_
ren "namespace interface" "namespace interfaces"

-END VERIFY SCRIPT-
2018-04-07 03:42:02 -04:00
João Barbosa
39bc2faa2e wallet: Make WalletInitInterface and DummyWalletInit private 2018-04-05 21:09:21 +01:00
Anthony Towns
11b6b5b86e Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName 2018-04-06 04:46:02 +10:00
Wladimir J. van der Laan
5f0c6a7b0e
Merge #10244: Refactor: separate gui from wallet and node
9960137 Add developer notes about blocking GUI code (Russell Yanofsky)
9a61eed Use WalletBalances struct in Qt (Russell Yanofsky)
56f33ca Remove direct bitcoin calls from qt/sendcoinsdialog.cpp (Russell Yanofsky)
e872c93 Remove direct bitcoin access from qt/guiutil.cpp (Russell Yanofsky)
5884558 Remove direct bitcoin calls from qt transaction table files (Russell Yanofsky)
3cab2ce Remove direct bitcoin calls from qt/paymentserver.cpp (Russell Yanofsky)
3ec2ebc Remove direct bitcoin calls from qt/addresstablemodel.cpp (Russell Yanofsky)
827de03 Remove direct bitcoin calls from qt/coincontroldialog.cpp (Russell Yanofsky)
a0704a8 Remove most direct bitcoin calls from qt/walletmodel.cpp (Russell Yanofsky)
90d4640 Remove direct bitcoin calls from qt/optionsdialog.cpp (Russell Yanofsky)
582daf6 Remove direct bitcoin calls from qt/rpcconsole.cpp (Russell Yanofsky)
3034a46 Remove direct bitcoin calls from qt/bantablemodel.cpp (Russell Yanofsky)
e0b66a3 Remove direct bitcoin calls from qt/peertablemodel.cpp (Russell Yanofsky)
d7c2c95 Remove direct bitcoin calls from qt/intro.cpp (Russell Yanofsky)
fe6f27e Remove direct bitcoin calls from qt/clientmodel.cpp (Russell Yanofsky)
5fba3af Remove direct bitcoin calls from qt/splashscreen.cpp (Russell Yanofsky)
c2f672f Remove direct bitcoin calls from qt/utilitydialog.cpp (Russell Yanofsky)
3d619e9 Remove direct bitcoin calls from qt/bitcoingui.cpp (Russell Yanofsky)
c0f2756 Remove direct bitcoin calls from qt/optionsmodel.cpp (Russell Yanofsky)
71e0d90 Remove direct bitcoin calls from qt/bitcoin.cpp (Russell Yanofsky)
ea73b84 Add src/interface/README.md (Russell Yanofsky)

Pull request description:

  This is a refactoring PR that does not change behavior in any way. This change:

  1. Creates abstract [`Node`](https://github.com/ryanofsky/bitcoin/blob/pr/ipc-local/src/interface/node.h) and [`Wallet`](https://github.com/ryanofsky/bitcoin/blob/pr/ipc-local/src/interface/wallet.h) interfaces in [`src/interface/`](https://github.com/ryanofsky/bitcoin/tree/pr/ipc-local/src/interface)
  1. Updates Qt code to call the new interfaces. This largely consists of diffs of the form:

  ```diff
  -    InitLogging();
  -    InitParameterInteraction();
  +    node.initLogging();
  +    node.initParameterInteraction();
  ```

  This change allows followup PR #10102 (makes `bitcoin-qt` control `bitcoind` over an IPC socket) to work without any significant updates to Qt code. Additionally:

  * It provides a single place to describe the interface between GUI and daemon code.
  * It can make better GUI testing possible, because Node and Wallet objects have virtual methods that can be overloaded for mocking.
  * It can be used to help make the GUI more responsive (see https://github.com/bitcoin/bitcoin/issues/10504)

  Other notes:

  * I used python scripts [hide-globals.py](https://github.com/ryanofsky/home/blob/master/src/2017/hide-globals/hide-globals.py) and [replace-syms.py](https://github.com/ryanofsky/home/blob/master/src/2017/hide-globals/replace-syms.py) to identify all the places where Qt code was accessing libbitcoin global variables and calling functions accessing those global variables.
  * These changes were originally part of #10102. Thanks to @JeremyRubin for the suggestion of splitting them out.

  Commits:

  - [`ea73b84d2d` Add src/interface/README.md](ea73b84d2d)
  - [`71e0d90876` Remove direct bitcoin calls from qt/bitcoin.cpp](71e0d90876)
  - [`c0f2756be5` Remove direct bitcoin calls from qt/optionsmodel.cpp](c0f2756be5)
  - [`3d619e9d36` Remove direct bitcoin calls from qt/bitcoingui.cpp](3d619e9d36)
  - [`c2f672fb19` Remove direct bitcoin calls from qt/utilitydialog.cpp](c2f672fb19)
  - [`5fba3af21e` Remove direct bitcoin calls from qt/splashscreen.cpp](5fba3af21e)
  - [`fe6f27e6ea` Remove direct bitcoin calls from qt/clientmodel.cpp](fe6f27e6ea)
  - [`d7c2c95948` Remove direct bitcoin calls from qt/intro.cpp](d7c2c95948)
  - [`e0b66a3b7c` Remove direct bitcoin calls from qt/peertablemodel.cpp](e0b66a3b7c)
  - [`3034a462a5` Remove direct bitcoin calls from qt/bantablemodel.cpp](3034a462a5)
  - [`582daf6d22` Remove direct bitcoin calls from qt/rpcconsole.cpp](582daf6d22)
  - [`90d4640b7e` Remove direct bitcoin calls from qt/optionsdialog.cpp](90d4640b7e)
  - [`a0704a8996` Remove most direct bitcoin calls from qt/walletmodel.cpp](a0704a8996)
  - [`827de038ab` Remove direct bitcoin calls from qt/coincontroldialog.cpp](827de038ab)
  - [`3ec2ebcd9b` Remove direct bitcoin calls from qt/addresstablemodel.cpp](3ec2ebcd9b)
  - [`3cab2ce5f9` Remove direct bitcoin calls from qt/paymentserver.cpp](3cab2ce5f9)
  - [`58845587e1` Remove direct bitcoin calls from qt transaction table files](58845587e1)
  - [`e872c93ee8` Remove direct bitcoin access from qt/guiutil.cpp](e872c93ee8)
  - [`56f33ca349` Remove direct bitcoin calls from qt/sendcoinsdialog.cpp](56f33ca349)
  - [`9a61eed1fc` Use WalletBalances struct in Qt](9a61eed1fc)
  - [`9960137697` Add developer notes about blocking GUI code](9960137697)

Tree-SHA512: 7b9eff2f37d4ea21972d7cc6a3dbe144248595d6c330524396d867f3cd2841d666cdc040fd3605af559dab51b075812402f61d628d16cf13719335c1d8bf8ed3
2018-04-05 18:19:35 +02:00
Wladimir J. van der Laan
bd59c4395c
Merge #12859: Bugfix: Include <memory> for std::unique_ptr
a5bca13 Bugfix: Include <memory> for std::unique_ptr (Luke Dashjr)

Pull request description:

  Not sure why all these includes were missing, but it's breaking builds for some users:

  https://bugs.gentoo.org/show_bug.cgi?id=652142

  (Added to all files with a reference to `std::unique_ptr`)

Tree-SHA512: 8a2c67513ca07b9bb52c34e8a20b15e56f8af2530310d9ee9b0a69694dd05e02e7a3683f14101a2685d457672b56addec591a0bb83900a0eb8e2a43d43200509
2018-04-05 09:31:53 +02:00
Russell Yanofsky
9a61eed1fc Use WalletBalances struct in Qt
Suggested by John Newbery <john@johnnewbery.com>
https://github.com/bitcoin/bitcoin/pull/10244#discussion_r177504284
2018-04-04 16:52:41 -04:00
Russell Yanofsky
56f33ca349 Remove direct bitcoin calls from qt/sendcoinsdialog.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
e872c93ee8 Remove direct bitcoin access from qt/guiutil.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
58845587e1 Remove direct bitcoin calls from qt transaction table files 2018-04-04 16:52:40 -04:00
Russell Yanofsky
3cab2ce5f9 Remove direct bitcoin calls from qt/paymentserver.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
3ec2ebcd9b Remove direct bitcoin calls from qt/addresstablemodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
827de038ab Remove direct bitcoin calls from qt/coincontroldialog.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
a0704a8996 Remove most direct bitcoin calls from qt/walletmodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
90d4640b7e Remove direct bitcoin calls from qt/optionsdialog.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
582daf6d22 Remove direct bitcoin calls from qt/rpcconsole.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
3034a462a5 Remove direct bitcoin calls from qt/bantablemodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
e0b66a3b7c Remove direct bitcoin calls from qt/peertablemodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
d7c2c95948 Remove direct bitcoin calls from qt/intro.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
fe6f27e6ea Remove direct bitcoin calls from qt/clientmodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
5fba3af21e Remove direct bitcoin calls from qt/splashscreen.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
c2f672fb19 Remove direct bitcoin calls from qt/utilitydialog.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
3d619e9d36 Remove direct bitcoin calls from qt/bitcoingui.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
c0f2756be5 Remove direct bitcoin calls from qt/optionsmodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
71e0d90876 Remove direct bitcoin calls from qt/bitcoin.cpp 2018-04-04 16:52:37 -04:00
Ben Woosley
b386970d07
[moveonly] Extract HelpRequested to dry up the help options testing
This ensures consistency across interfaces and makes the version handling more clear.
2018-04-02 15:42:06 -07:00
Luke Dashjr
a5bca13095 Bugfix: Include <memory> for std::unique_ptr 2018-04-02 18:31:52 +00:00
MarcoFalke
0c5f67b8e5
Merge #12757: Clarify include guard naming convention
3bcc0059b8 Add lint-include-guards.sh which checks include guard consistency (practicalswift)
8fd6af89a0 Fix missing or inconsistent include guards (practicalswift)
8af65d96f4 Document include guard convention (practicalswift)

Pull request description:

  * **Documentation**: Document include guard convention
  * **Fix**: Fix missing or inconsistent include guards
  * **Regression test**: Add `lint-include-guards.sh` which checks include guard consistency

Tree-SHA512: 8171878f60fd08ccbea943a11e835195750592abb9d7ab74eaa4265ae7fac523b1da9d31ca13d6ab73dd596e49986bfb7593c696e5f39567c93e610165bc2acc
2018-04-01 18:30:21 -04:00
MarcoFalke
be299c4a47
Merge #12780: Reduce variable scopes
6a318e48a6 Reduce variable scopes (practicalswift)

Pull request description:

  Reduce variable scopes.

Tree-SHA512: 5c7735344024cb6cd310e739886dc811a64b640a0d6aac8b3d04f49e5987d6ff6676d978890bc84f1460527d92217176a79b007f0bf6b4147c04abfec2c67714
2018-03-30 11:40:46 -04:00