Commit graph

426 commits

Author SHA1 Message Date
Jonas Schnelli 3e21b690d1
[Qt] Restore < Qt5.6 compatibility for addAction 2018-12-16 20:24:43 -10:00
João Barbosa 95a5a9fccb qt: Remove ellipsis from sending/receiving addresses
Considering https://stackoverflow.com/a/637708 the ellipsis in these
menu actions should be removed.
2018-12-11 13:15:35 +00:00
João Barbosa a96c0df35e qt: Add Window menu 2018-12-11 13:15:35 +00:00
MarcoFalke f8456256c8
Merge #14783: gui: Fix boost::signals2::no_slots_error in early calls to InitWarning
6bbdb2077e squashme: connect thru node interface (João Barbosa)
a0f8df365d qt: Call noui_connect to prevent boost::signals2::no_slots_error in early calls to InitWarning (João Barbosa)

Pull request description:

  Adding the following to `bitcoin.conf`
  ```
  [xxx]
  disablewallet=1
  ```
  And running `bitcoin-qt` gives:
  ```
  libc++abi.dylib: terminating with uncaught exception of type boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::signals2::no_slots_error> >: boost::signals2::no_slots_error
  ```

  Fixes regression in #14708.

Tree-SHA512: 7c158376fad6ebcd80fc0dbe549d5b6e893fb82e7dc1e455825633d7f91b14dc34493487cab7642152e88f9eaf99bfa91988972d600e9fb289cf26afd64aff8a
2018-12-06 14:52:18 -05:00
Wladimir J. van der Laan ed12fd83ca
Merge #13966: gui: When private key is disabled, only show watch-only balance
82d6c5aad gui: Show watch-only eye instead of HD disabled (Chun Kuan Lee)
fe1ff5026 Hide spendable label if priveate key is disabled (Chun Kuan Lee)

Pull request description:

  If a wallet is in private key disabled mode, the spendable balance is always zero, it does not have to show on GUI. Show the watch-only balance at normal balance column if a wallet is in that mode.

  ![image](https://user-images.githubusercontent.com/11154118/45662527-dfaab400-bb34-11e8-98c8-c06ac5c0b08a.png)

Tree-SHA512: 8b535427d26d3f8e61081f50e4773bd25656be042d378fd34cf647e9a0065cb4dfb67a8ab9fb4fbf5f196390df8cb983ebf2f0fa8a6503b7c046c56bec87ba72
2018-12-01 12:24:33 +01:00
João Barbosa a0f8df365d qt: Call noui_connect to prevent boost::signals2::no_slots_error in early calls to InitWarning 2018-11-22 17:41:01 +00:00
Wladimir J. van der Laan 5cdfd72b17
Merge #14228: Qt: Enable system tray icon by default if available
ec1201a368 Don't use systray icon on inappropriate systems (Hennadii Stepanov)

Pull request description:

  Prevent a user from losing access to the main window by minimizing it to the tray on the systems which have not “system tray” or “notification area” available (e.g. GNOME 3.26+).

  Tested on Fedora 28 + GNOME 3.28.

Tree-SHA512: c2dc26ff31c38a882dbd7d1ff71af99f1ba38a04a1c8b7fe7b99b93e4c0719f2916c7db0e620806a36582402d18939c635e1913c276b452ecbf939936067407b
2018-11-12 15:08:06 +01:00
Wladimir J. van der Laan 48223256cf
Merge #14123: gui: Add GUIUtil::bringToFront
0a656f85a9 qt: All tray menu actions call showNormalIfMinimized (João Barbosa)
6fc21aca6d qt: Use GUIUtil::bringToFront where possible (João Barbosa)
5796671e1d qt: Add GUIUtil::bringToFront (João Barbosa)
6b1d2972bf Remove obj_c for macOS Dock icon menu (Hennadii Stepanov)
2464925e7b Use Qt signal for macOS Dock icon click event (Hennadii Stepanov)
53bb6be3f8 Remove obj_c for macOS Dock icon setting (Hennadii Stepanov)

Pull request description:

  The sequence `show -> raise -> activateWindow` is factored out to the new function `GUIUtil::bringToFront` where a macOS fix is added in order to fix #13829.

  Also included:
   - simplification of `BitcoinGUI::showNormalIfMinimized`
   - simplified some connections to `BitcoinGUI::showNormalIfMinimized`
   - added missing connections to `BitcoinGUI::showNormalIfMinimized`.

Tree-SHA512: a8e301aebc359aa353821e2af352ae356f44555724921b01da907e128653ef9dc55d8764a1bff72a579e5ff96df8a681f6804bfe83acba441da92fedff974a55
2018-11-12 14:52:35 +01:00
Wladimir J. van der Laan edc715240c
Merge #12783: macOS: disable AppNap during sync
1e0f3c4499 macOS: disable AppNap during sync (Alexey Ivanov)

Pull request description:

  Code based on pull/5804. Tested only on macOS 10.13.3 and should support 10.9+.

  What macOS versions bitcoin core currently supports?

Tree-SHA512: 85809b8d8d8a05169437b4268988da0b7372c29c6da3223ebdc106dc16dcb6d3caa5c52ace3591467005b50a63fd8b2ab1cb071cb4f450032932df25d5063315
2018-11-10 10:37:59 +01:00
João Barbosa 0a656f85a9 qt: All tray menu actions call showNormalIfMinimized 2018-11-05 11:21:50 +00:00
João Barbosa 6fc21aca6d qt: Use GUIUtil::bringToFront where possible 2018-11-05 11:21:50 +00:00
Jim Posen 2068f089c8 scripted-diff: Move util files to separate directory.
-BEGIN VERIFY SCRIPT-
mkdir -p src/util
git mv src/util.h src/util/system.h
git mv src/util.cpp src/util/system.cpp
git mv src/utilmemory.h src/util/memory.h
git mv src/utilmoneystr.h src/util/moneystr.h
git mv src/utilmoneystr.cpp src/util/moneystr.cpp
git mv src/utilstrencodings.h src/util/strencodings.h
git mv src/utilstrencodings.cpp src/util/strencodings.cpp
git mv src/utiltime.h src/util/time.h
git mv src/utiltime.cpp src/util/time.cpp

sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')

sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h
sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h
sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h
sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h
sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h

sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am
sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am
sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am
sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am
sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am

sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh
sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh
sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh
sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh
sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj
-END VERIFY SCRIPT-
2018-11-04 22:46:07 -08:00
Hennadii Stepanov 6b1d2972bf
Remove obj_c for macOS Dock icon menu
Qt `setAsDockMenu()` does this work.
2018-11-04 02:42:18 +02:00
Hennadii Stepanov 2464925e7b
Use Qt signal for macOS Dock icon click event
This moves the Dock icon click reaction code to the common place and
allows some cleanup in obj_c code.

According to the Apple's docs `class_replaceMethod` behaves as
`class_addMethod`, if the method identified by name does not yet exist;
or as `method_setImplementation`, if it does exist.
2018-11-04 02:37:28 +02:00
Alexey Ivanov 1e0f3c4499
macOS: disable AppNap during sync
Signed-off-by: Alexey Ivanov <alexey.ivanes@gmail.com>
2018-11-01 18:22:06 +03:00
Hennadii Stepanov 53bb6be3f8
Remove obj_c for macOS Dock icon setting
Qt `setWindowIcon()` does this work.
2018-10-31 20:29:08 +02:00
Hennadii Stepanov 36323e2ac6
Clean systray icon menu for -disablewallet mode
Ref #3392
2018-10-06 02:46:45 +03:00
Hennadii Stepanov ec1201a368
Don't use systray icon on inappropriate systems
Prevent a user from losing access to the main window by minimizing it to
the tray on some systems (e.g. GNOME 3.26+).
2018-09-27 17:24:04 +03:00
Chun Kuan Lee 82d6c5aad3 gui: Show watch-only eye instead of HD disabled 2018-09-18 11:12:05 +08:00
MarcoFalke fa7e9694e1
qt: Also log and print messages or questions like bitcoind 2018-09-06 15:19:56 -04:00
Wladimir J. van der Laan 5c24d3b98c
Merge #13249: Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations.
f34c8c466a Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. (practicalswift)

Pull request description:

  Make objects in range declarations immutable by default.

  Rationale:
  * Immutable objects are easier to reason about.
  * Prevents accidental or hard-to-notice change of value.

Tree-SHA512: cad69d35f0cf8a938b848e65dd537c621d96fe3369be306b65ef0cd1baf6cc0a9f28bc230e1e383d810c555a6743d08cb6b2b0bd51856d4611f537a12e5abb8b
2018-09-04 15:50:08 +02:00
João Barbosa ee3a494f37 gui: Favor macOS show / hide action in dock menu 2018-09-02 19:09:36 +01:00
practicalswift f34c8c466a Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. 2018-08-27 18:19:33 +02:00
Wladimir J. van der Laan 6f5372a171
Merge #13961: util: Replace boost::signals2 with std::function
ddddce0e46 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  #13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1
2018-08-25 21:13:46 +02:00
MarcoFalke ddddce0e46
util: Replace boost::signals2 with std::function 2018-08-24 08:34:38 -04:00
João Barbosa f78558f1e3 qt: Use new Qt5 connect syntax 2018-08-21 09:43:54 +01:00
Wladimir J. van der Laan 2a583406c0
Merge #13248: [gui] Make proxy icon from statusbar clickable
6d5fcad576 [gui] Make proxy icon from statusbar clickable (Cristian Mircea Messel)

Pull request description:

  Clicking on the proxy icon will open settings showing the network tab

  https://github.com/bitcoin/bitcoin/pull/11491#issuecomment-336685303

Tree-SHA512: c3549749296918818694a371326d1a3b1075478918aaee940b5c7119a7e2cb991dcfda78f20d44d6d001157b9b82951f0d5157b17f4f0d1a0a242795efade036
2018-08-20 13:40:11 +02:00
DrahtBot eb7daf4d60 Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
Cristian Mircea Messel 6d5fcad576 [gui] Make proxy icon from statusbar clickable
Clicking on the proxy icon will open settings showing the network tab
Create enum Tab in OptionsModel
Use new connect syntax
Use lambda for private slots
2018-07-25 01:03:26 +03:00
João Barbosa 12dd101345 scripted-diff: Remove trailing whitespaces
-BEGIN VERIFY SCRIPT-

sed --in-place'' --regexp-extended 's/[[:space:]]+$//g' $(git grep -I --files-with-matches --extended-regexp '[[:space:]]+$' -- src test  ':!*.svg' ':!src/crypto/sha256_sse4*' ':!src/leveldb' ':!src/qt/locale' ':!src/secp256k1' ':!src/univalue')

-END VERIFY SCRIPT-
2018-07-24 20:46:23 +01:00
Wladimir J. van der Laan 79e677950b
Merge #13235: Break circular dependency: init -> * -> init by extracting shutdown.h
1fabd59e7 Break circular dependency: init -> * -> init by extracting shutdown.h (Ben Woosley)
e62fdfeea Drop unused init.h includes (Ben Woosley)

Pull request description:

  Most includers just wanted to react to pending shutdown.

  This isolates access to `fRequestShutdown` and limits access to the shutdown api functions, including the new `CancelShutdown` for setting it to `false`.

Tree-SHA512: df42f75dfbba163576710e9a67cf1228531fd99d70a2f187bfba0bcc476d6749cf88180a97e66a81bb5b6c3c7f0917de7402d26039ba7b644cb7509b02f7e267
2018-07-04 15:34:03 +02:00
MarcoFalke b877c39477
Merge #13528: qt: Move BitcoinGUI initializers to class, fix initializer order warning
bb3de15ad8 qt: Move BitcoinGUI initializers to class, fix initializer order warning (Wladimir J. van der Laan)

Pull request description:

  - C++11-ize the code (move initializers to class, change `0` to `nullptr` where appropriate)
  - Make sure `m_wallet_selector` is initialized
  - And fix the following warning:

      bitcoin/src/qt/bitcoingui.cpp:122:5: warning: field 'spinnerFrame' will be initialized after field 'm_wallet_selector_label' [-Wreorder]
          spinnerFrame(0),

Tree-SHA512: b81c8d4ac31b712c8dfaf941ba43b235eb466eb5528535d69d68c26d8706d2a658581513a413050e5dee08b72a4e7fc08bd8936ef5beb052059d2467eaeff84b
2018-06-25 13:12:53 -04:00
Wladimir J. van der Laan bb3de15ad8 qt: Move BitcoinGUI initializers to class, fix initializer order warning
- C++11-ize the code (move initializers to class, change 0 to `nullptr` where appropriate)
- Make sure `m_wallet_selector` is initialized
- And fix the following warning:

    bitcoin/src/qt/bitcoingui.cpp:122:5⚠️ field 'spinnerFrame' will be initialized after field 'm_wallet_selector_label' [-Wreorder]
        spinnerFrame(0),
2018-06-25 16:57:41 +02:00
Ben Woosley e62fdfeeab
Drop unused init.h includes
These were entirely unused, as based on successful compilation
and a grep for:
  \bStartShutdown\(\)|\bShutdownRequested\(\)|\bInterrupt\(\)|\bShutdown\(\)|\bInitLogging\(\)|\bInitParameterInteraction\(\)|\bAppInitBasicSetup\(\)|\bAppInitParameterInteraction\(\)|\bAppInitSanityChecks\(\)|\bAppInitLockDataDirectory\(\)|\bAppInitMain\(\)|\bSetupServerArgs\(\)|\bLicenseInfo\(\)|g_wallet_init_interface|init.h
2018-06-25 00:08:00 -04:00
Wladimir J. van der Laan dc53f7f251
Merge #13458: gui: Drop qt4 support
af6ac3b677 doc: Remove mention of Qt4 from build docs (Wladimir J. van der Laan)
462c71f71b test: Update travis to not test Qt4 anymore (Wladimir J. van der Laan)
907f73bbc5 gui: Remove QT_VERSION fallbacks for Qt < 5 (Wladimir J. van der Laan)
bad068ad9f build: Build system changes to support only Qt5 (Wladimir J. van der Laan)

Pull request description:

  Implements #8263.

  Qt4.x has been EOL since 2015, and at least Gentoo has, or is going to drop support for it. I wouldn't be surprised if other Linux distributions follow.

  This removes Qt4 detection from the build system, as well as removes all Qt4 fallbacks from the code. Turns out there's more than I expected: this is going to make maintenance of the GUI code, as well as adding new features significantly easier.

  (I know there's still some references left to qt4 in RPM and Debian build script, but I don't have the knowledge how to fix them)

Tree-SHA512: d495924fd4dda6f6566ba44ee96be7cbe62e69ba1ca993b80a8449f78da852b7f1bd3e8200d57cfa1d72233c340eeff4596fb0032ecbddc715d99aea63817d3f
2018-06-24 16:02:37 +02:00
João Barbosa 0ee77b2077 ui: Support wallets unloaded dynamically 2018-06-18 16:35:29 +01:00
Wladimir J. van der Laan 907f73bbc5 gui: Remove QT_VERSION fallbacks for Qt < 5
There were surprisingly many `#ifdef` fallbacks for Qt 4.

Remiving them simplifies maintenance, as well as adding new GUI
functionality.
2018-06-18 12:22:11 +02:00
Jonas Schnelli 2885c131b6
Qt: use [default wallet] as name for wallet with no name 2018-05-19 11:24:40 +02:00
Cristian Mircea Messel 73cd5b25b9 [gui] Add proxy icon in statusbar 2018-05-15 23:23:56 +03:00
Chun Kuan Lee 67bf2aa68e
qt:Show the entire Window when double clicking on taskbar 2018-04-17 02:38:10 +08: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
Russell Yanofsky a0704a8996 Remove most direct bitcoin calls from qt/walletmodel.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 fe6f27e6ea Remove direct bitcoin calls from qt/clientmodel.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
Wladimir J. van der Laan 3de01268b7
Merge #10742: scripted-diff: Use scoped enumerations (C++11, "enum class")
1f45e21 scripted-diff: Convert 11 enums into scoped enums (C++11) (practicalswift)

Pull request description:

  Rationale (from Bjarne Stroustrup's ["C++11 FAQ"](http://www.stroustrup.com/C++11FAQ.html#enum)):

  >
  > The enum classes ("new enums", "strong enums") address three problems with traditional C++ enumerations:
  >
  > * conventional enums implicitly convert to int, causing errors when someone does not want an enumeration to act as an integer.
  > * conventional enums export their enumerators to the surrounding scope, causing name clashes.
  > * the underlying type of an enum cannot be specified, causing confusion, compatibility problems, and makes forward declaration impossible.
  >
  > The new enums are "enum class" because they combine aspects of traditional enumerations (names values) with aspects of classes (scoped members and absence of conversions).

Tree-SHA512: 9656e1cf4c3cabd4378c7a38d0c2eaf79e4a54d204a3c5762330840e55ee7e141e188a3efb2b4daf0ef3110bbaff80d8b9253abf2a9b015cdc4d60b49ac2b914
2018-03-27 16:38:14 +02:00
Jonas Schnelli 25cf18f239
Merge #12610: Multiwallet for the GUI
779c5f984 Qt: hide RPCConsole wallet selector when no wallets are present (Jonas Schnelli)
dc6f150f3 Qt: show wallet name in request dlg in case of multiwallet (Jonas Schnelli)
4826ca4b8 Qt: show wallet name in send confirmation dlg in case of multiwallet (Jonas Schnelli)
cfa4133ce GUI: RPCConsole: Log wallet changes (Luke Dashjr)
b6d04fc7c Qt: Get wallet name from WalletModel rather than passing it around (Luke Dashjr)
12d8d2681 Qt: When multiple wallets are used, include in notifications the name (Jonas Schnelli)
d1ec34a76 Qt: QComboBox::setVisible doesn't work in toolbars, so defer adding it at all until needed (Luke Dashjr)
d49cc70e6 Qt: Add wallet selector to debug console (Jonas Schnelli)
d558f44c5 Bugfix: RPC: Add missing UnregisterHTTPHandler for /wallet/ (Luke Dashjr)
85d531971 Qt: Ensure UI updates only come from the currently selected walletView (Luke Dashjr)
e449f9a9e Qt: Add a combobox to toolbar to select from multiple wallets (Luke Dashjr)
3dba3c3ac Qt: Load all wallets into WalletModels (Luke Dashjr)

Pull request description:

  This is an overhaul of #11383 (plus some additions).
  It avoids unnecessary coupling of httpserver/jsonrpc and the wallet as well as it avoids pointer pure passing (and pointer deletion) of `CWallet` (plus other minor design changes).

  Additionally it adds the wallet name to the sendconfirmation and request dialog (in case multiwallet is active)

Tree-SHA512: 3d06e18badbc5d1821e488bf1dae463bb0be544cf11b2b618e025812bfdd13c5f39604bb93b4c705313930e7dc4e66f4848b9469ba14871bade58e7a027246a1
2018-03-26 18:51:38 +07:00
Luke Dashjr b6d04fc7cc
Qt: Get wallet name from WalletModel rather than passing it around 2018-03-26 18:40:26 +07:00
Jonas Schnelli 12d8d2681e
Qt: When multiple wallets are used, include in notifications the name 2018-03-26 18:40:26 +07:00