Commit graph

238 commits

Author SHA1 Message Date
Hennadii Stepanov f220368220
qt: Do not use QClipboard::Selection on Windows and macOS.
Windows and macOS do not support the global mouse selection.

Github-Pull: bitcoin-core/gui#277
Rebased-From: 7f3a5980c1d54988a707b961fd2ef647cebb4c5b
2021-07-11 12:03:11 +03:00
Luke Dashjr 1ccb9f30c0 Move Win32 defines to configure.ac to ensure they are globally defined
common.vcxproj used for MSVC builds
2020-08-20 17:55:06 +00:00
Sebastian Falbesoner f0fce0675d util: make EncodeBase58 consume Spans 2020-08-12 16:25:50 +02:00
Wladimir J. van der Laan d626a3be31
Merge #19210: qt: Get rid of cursor in out-of-focus labels
bd315eb5e2 qt: Get rid of cursor in out-of-focus labels (Hennadii Stepanov)

Pull request description:

  After clicking on `QLabel` with selectable text the cursor remains forever:

  ![47532924-65e7b200-d8ba-11e8-9254-7bde658961cb](https://user-images.githubusercontent.com/32963518/84038485-ad945200-a9a8-11ea-89e3-c7c17d02a611.png)

  This PR fixes this visual bug.

  Earlier attempts to fix this issue:
  - #14577
  - #14810 (combined with other UX feature)

ACKs for top commit:
  promag:
    Code review ACK bd315eb5e2.
  laanwj:
    Tested ACK bd315eb5e2

Tree-SHA512: 6bf89362412e5ce9a4dec6944b62fe44fc31ca49cda7f6e2eb37e847fac9dccb68bca7ac6877b19e42add2333e40d0b4265757ead105ac0a5d28f8ab43b322c3
2020-07-15 16:48:03 +02:00
Hennadii Stepanov bd315eb5e2
qt: Get rid of cursor in out-of-focus labels
This change is a temporary fix of QTBUG-59514.
2020-07-03 18:29:24 +03:00
Hennadii Stepanov 25f3554351
scripted-diff: Make SeparatorStyle a scoped enum
-BEGIN VERIFY SCRIPT-
# General rename helper: $1 -> $2
rename_global() { sed -i "s/\<$1\>/$2/g" $(git grep -l "$1"); }

# Helper to rename SeparatorStyle enumerators
rename_value() {
  sed -i "s/    $1/    $2/g" src/qt/bitcoinunits.h;
  rename_global $1 "SeparatorStyle::$2";
}

rename_global 'enum SeparatorStyle' 'enum class SeparatorStyle'
rename_value 'separatorNever' 'NEVER'
rename_value 'separatorStandard' 'STANDARD'
rename_value 'separatorAlways' 'ALWAYS'
-END VERIFY SCRIPT-
2020-06-18 15:30:15 +03:00
Vasil Dimov 189ae0c38b
util: dedup code in callers of serviceFlagToStr()
Introduce `serviceFlagsToStr()` which hides the internals of the bitmask
and simplifies callers of `serviceFlagToStr()`.
2020-05-29 18:59:37 +02:00
Vasil Dimov fbacad1880
util: simplify the interface of serviceFlagToStr()
Don't take two redundant arguments in `serviceFlagToStr()`.

As a side effect this fixes an issue introduced in
https://github.com/bitcoin/bitcoin/pull/18165 due to which the GUI could
print something like `UNKNOWN[1033] & UNKNOWN[1033] & UNKNOWN[2^10]`
instead of `NETWORK & WITNESS`.
2020-05-29 18:49:26 +02:00
Jonas Schnelli de369c7ea5
Merge #18165: Consolidate service flag bit-to-name conversion to a shared serviceFlagToStr function
c31bc5bcfd Consolidate service flag bit-to-name conversion to a shared serviceFlagToStr function (Luke Dashjr)
cea91a1e40 Bugfix: GUI: Use unsigned long long type to avoid implicit conversion of MSB check (Luke Dashjr)

Pull request description:

  Side effect: this results in the RPC showing unknown service bits as "UNKNOWN[n]" like the GUI.

  Note that there is no common mask-to-`vector<string>` function because both GUI and RPC would need to iterate through it to convert to their desired target formats.

ACKs for top commit:
  jonasschnelli:
    utACK ~~cea91a1e40e12029140ebfba969ce3ef2965029c~~ c31bc5bcfd

Tree-SHA512: 32c7ba8ac7ef2d4087f4f317447ae93a328ec9fb9ad81301df2fbaeeb21a3db7a503187a369552b05a9414251b7cf8e15bcde74c1ea2ef36591ea7ffb6721f60
2020-05-29 11:06:08 +02:00
Jonas Schnelli 0d5c18204b
Merge #17956: gui: Disable unavailable context menu items in transactions tab
2b18fd2242 Disable unavailable context menu items in transactions tab (Kristaps Kaupe)

Pull request description:

  Fixes #9192.

ACKs for top commit:
  jonatack:
    Re-ACK 2b18fd2242
  jonasschnelli:
    codereview utACK 2b18fd2242

Tree-SHA512: 4ea19c7b5976f1f0b1baecccb3077cf82f078af7257f92162686bcce2188efe49511a5f557853bc5fe0b10616708957d61c006944babbe60b8105e78751e865f
2020-05-29 10:29:14 +02:00
Hennadii Stepanov 1122817c19
qt: Remove QFont warnings with QPA=minimal 2020-05-13 16:02:38 +03:00
Jonas Schnelli afa577c323
Merge #15768: gui: Add close window shortcut
f5a3a5b9ab gui: Add close window shortcut (Miguel Herranz)

Pull request description:

  CMD+W is the standard shortcut in macOS to close a window without
  exiting the program.

  This adds support to use the shortcut in both main and debug windows.

ACKs for top commit:
  jonasschnelli:
    Tested ACK f5a3a5b9ab
  hebasto:
    ACK f5a3a5b9ab, tested on Linux Mint 19.3 by manually opening available dialogs and sub-windows, and applying the `Ctrl+W` shortcut. Also tested with "Minimize on close" option enabled / disabled.

Tree-SHA512: 39851f6680cf97c334d5759c6f8597cb45685359417493ff8b0566672edbd32303fa15ac4260ec8ab5ea1458a600a329153014f25609e1db9cf399aa851ae2f9
2020-05-04 11:53:34 +02:00
MarcoFalke fa488f131f
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-04-16 13:33:09 -04:00
Kristaps Kaupe 2b18fd2242
Disable unavailable context menu items in transactions tab 2020-04-16 19:06:58 +03:00
Ben Woosley 7a810b1d7a
refactor: Convert ping wait time from double to int64_t 2020-03-04 13:45:29 -05:00
Ben Woosley b054c46977
refactor: Convert ping time from double to int64_t 2020-03-04 13:44:25 -05:00
Luke Dashjr c31bc5bcfd Consolidate service flag bit-to-name conversion to a shared serviceFlagToStr function
Side effect: this results in the RPC showing unknown service bits as "UNKNOWN[n]" like the GUI.

Note that there is no common mask-to-vector<string> function because both GUI and RPC would need to iterate through it to convert to their desired target formats.
2020-02-21 19:10:04 +00:00
Luke Dashjr cea91a1e40 Bugfix: GUI: Use unsigned long long type to avoid implicit conversion of MSB check 2020-02-21 19:10:04 +00:00
Miguel Herranz f5a3a5b9ab gui: Add close window shortcut
CMD+W/CTRL+W is the standard shortcut to close a window without
exiting the program.
2020-02-05 07:13:01 +01:00
Hennadii Stepanov a004673c54
qt: Add LogQtInfo() function 2020-01-05 23:40:01 +02:00
MarcoFalke 5948398b18
Merge #17474: Bugfix: GUI: Recognise NETWORK_LIMITED in formatServicesStr
4341bffb6e GUI: Refactor formatServicesStr to warn when a ServicesFlag is missing (Luke Dashjr)
df77de8c21 Bugfix: GUI: Recognise NETWORK_LIMITED in formatServicesStr (Luke Dashjr)

Pull request description:

  Currently, only the bottom 8 service bits are shown in the GUI peer details view.

  `NODE_NETWORK_LIMITED` is the 11th bit (2^10).

  The first commit expands the range to cover the full 64 bits, and properly label `"NETWORK_LIMITED"`.
  The second commit refactors the code so that any future omitted service bits will trigger a compile warning.

ACKs for top commit:
  jonasschnelli:
    utACK 4341bffb6e
  jonasschnelli:
    Tested ACK 4341bffb6e
  hebasto:
    Concept ACK 4341bffb6e

Tree-SHA512: 8338737d03fbcd92024159aabd7e632d46e13c72436d935b504d2bf7ee92b7d124e89a5917bf64d51c87f12a64de703270c2d7b4c6711fa8ed08ea7887d817c7
2019-12-11 17:00:27 -05:00
fanquake 27d82b63fb
gui: remove macOS start on login code
The macOS startup item code was disabled for builds targeting macOS >
10.11 in #15208. Now that we require macOS 10.12 as a minimum, #17550,
we can remove the startup item code entirely, as the API we were using
was removed in macOS 10.12.
2019-11-22 18:44:43 -05:00
Hennadii Stepanov 567cb44eb9
refactor: Nuke guiutil circular dependency
Co-authored-by: Gregory Sanders <gsanders87@gmail.com>
2019-11-19 17:07:18 +02:00
Hennadii Stepanov 73b5505cfe
refactor: Move SendCoinsRecipient in own header
Co-authored-by: Gregory Sanders <gsanders87@gmail.com>
2019-11-19 17:05:35 +02:00
Luke Dashjr 4341bffb6e GUI: Refactor formatServicesStr to warn when a ServicesFlag is missing 2019-11-14 05:02:16 +00:00
Luke Dashjr df77de8c21 Bugfix: GUI: Recognise NETWORK_LIMITED in formatServicesStr 2019-11-14 05:01:50 +00:00
Jorge Timón 052c54ecb0
Testchains: Generic selection with -chain=<str> in addition of -testnet and -regtest 2019-09-06 22:05:33 +02:00
fanquake 7d6f63cc2c
Merge #16720: qt: Replace objc_msgSend() function calls with the native Objective-C syntax
0bb33b5348 qt: Replace objc_msgSend with native syntax (Hennadii Stepanov)

Pull request description:

  Changes in Xcode 11 Objective-C Runtime cause an error (#16387) during building on MacOS 10.15 Catalina.

  This PR fixes this issue by replacing `objc_msgSend()` function calls with the native Objective-C syntax.

  Refs:
  - [changes in `objc_msgSend` function](https://developer.apple.com/documentation/objectivec/1456712-objc_msgsend?changes=latest_minor&language=objc)
  - [`OBJC_OLD_DISPATCH_PROTOTYPES` macro](https://developer.apple.com/documentation/objectivec/objc_old_dispatch_prototypes?language=objc)

ACKs for top commit:
  l2a5b1:
    ACK 0bb33b5 - Diff looks good. Sending messages via native Objective-C code feels more robust and is more readable than casting all the `objc_msgSend` function calls to the appropriate function signature (which would also have fixed the issue).
  jonasschnelli:
    utACK 0bb33b5348 - Confirmed that the called macOS framework function is available on our build targets.
  fanquake:
    ACK 0bb33b5348 - Still works as expected.

Tree-SHA512: c09cb684d06bd1da053a17c182b7bb1642e45bb347d26c76e1c5d835c320567caee366d85e34bb7f2be38e63ed041e0d06a56c2a9d89f7e5bece9b19cc5c6772
2019-09-01 16:20:26 +08:00
Hennadii Stepanov 0bb33b5348
qt: Replace objc_msgSend with native syntax 2019-08-31 12:25:34 +03:00
Hennadii Stepanov 8b6f5aabb9
qt: Replace QFontMetrics::width() with TextWidth() 2019-08-29 19:13:19 +03:00
Hennadii Stepanov c6dd32da69
qt: Replace obsolete functions of QDesktopWidget 2019-08-25 08:46:32 +03:00
Hennadii Stepanov 1260ecd812
qt: Add TextWidth() wrapper
In Qt 5.12 and before the QFontMetrics::width() is used and it is
deprecated since Qt 13.0.
In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced.
2019-08-23 21:27:50 +03:00
Wladimir J. van der Laan e5abb59a9a
Merge #16379: Fix autostart filenames on Linux for testnet/regtest
ae311bc036 Fix autostart filenames on Linux (Hennadii Stepanov)

Pull request description:

  Currently, on master the `bitcoin-test.lnk` and `bitcoin-regtest.lnk` files do not work as autostart application `.desktop` files.

  This PR fixes it.

  Refs:
  - #7045
  - [Autostart Of Applications During Startup](https://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html)

ACKs for top commit:
  promag:
    utACK ae311bc, weird why extension `.lnk` was used in #7045.
  laanwj:
    Code review ACK ae311bc036

Tree-SHA512: 210cc346600d52b0a262c81ed5f258365a3cea2e5522f4b5f4798fd3b54f45ed82aba68eefae59a6b6f1d8e4d00221476c23bdffc038f16f2f45c1acc837f522
2019-07-18 14:27:25 +02:00
MarcoFalke fa0d0ff6e1
Remove unused bits from the service flags enum 2019-07-12 14:14:54 -04:00
Hennadii Stepanov ae311bc036
Fix autostart filenames on Linux 2019-07-12 19:01:05 +03:00
shannon1916 6e6494b3fb qt: fix opening bitcoin.conf via Preferences on macOS; see #15409 2019-06-03 10:32:15 +08:00
Jonas Schnelli 3a0d6da098
Merge #15371: gui: Uppercase bech32 addresses in qr codes
3407b446c gui: Uppercase bech32 addresses in qr codes (Ben Carman)

Pull request description:

  Closes #12191

ACKs for commit 3407b4:
  meshcollider:
    utACK 3407b446cc
  jonasschnelli:
    Re utACK 3407b446cc

Tree-SHA512: d63ecf8e9805c46c9f554cc929661a37837bc3ba9b7b931331c2a5c2b81468742e1819c9add73966083011709cc15ae1870a454348af8591b3d75d3765dca568
2019-04-29 09:04:40 +02:00
251 fa1c8e2978 Resolve the qt/guiutil <-> qt/optionsmodal CD
This pull request attempts to resolve the `qt/guiutil` <-> `qt/optionsmodel`
circular dependency.

The circular dependency is resolved by moving the `Intro::getDefaultDataDirectory`
member function to `GUIUtil::getDefaultDataDirectory`.
2019-04-23 13:26:06 +02:00
Ben Carman 3407b446cc
gui: Uppercase bech32 addresses in qr codes 2019-02-09 12:33:26 -06:00
Chun Kuan Lee 1bd9ffdd44 windows: Set _WIN32_WINNT to 0x0601 (Windows 7)
Also remove all defines in many places and define it in configure stage to keep consistency.
2019-01-23 16:28:27 +08:00
Jonas Schnelli da6011826a
Fix macOS launch-at-startup memory issue 2019-01-21 22:43:03 -10:00
Jonas Schnelli 516437a1b7
Qt: remove macOS launch-at-startup option when compiled with > macOS 10.11 2019-01-21 22:42:51 -10:00
Hennadii Stepanov 7c572c488d
Add workaround for QProgressDialog bug on macOS
See: QTBUG-65750, QTBUG-70357.
2019-01-15 01:28:00 +02:00
Hennadii Stepanov 0b4a5786bb
Use window() instead of obsolete topLevelWidget() 2018-11-25 11:32:59 +02:00
Hennadii Stepanov 2bc3f114d0
Bump the minimum Qt version to 5.2 2018-11-14 01:32:51 +02: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
João Barbosa 5796671e1d qt: Add GUIUtil::bringToFront 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
Chun Kuan Lee a554cc901a Move boost/std fstream to fsbridge 2018-09-26 08:47:42 +08:00
Chun Kuan Lee 2c3eade704 Make fs::path::string() always return utf-8 string 2018-09-23 03:43:25 +08:00