3a0e76fc12b91b2846d756981e15f09b767a9c37 Replace remaining 0 with nullptr in Qt code (Ben Woosley)
9096276e0b2d5b7e19af9a5f3c144ef108ee55e0 Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant) (practicalswift)
Pull request description:
This corrects all violations of `-Wzero-as-null-pointer-constant` identified in the Qt codebase.
These changes are extracted from #15112 as suggested by @MarcoFalke to ease review. This is in service of enabling `-Wzero-as-null-pointer-constant`, which should eliminate this as a concern going forward.
Note there are 2 non-Qt changes: `src/test/allocator_tests.cpp` and `src/wallet/db.cpp`.
Tree-SHA512: 206bd668802147ba42bc413c2d7d259cb59aca9ec1da74a6bf2ca3932e60ae492faacbc61bcee0fd6b4b49a4d59d075b7e5404f0526b36c47718f9b0587e7768
* qt: Update the application font if the font family gets changed
* qt: Make sure recent transactions have the correct font family
Introduced because QListView is ignored in GUIUtil::updateFonts, so its base font family doesn't change, hence the recent transactions don't adjust because the painter's font doesn't change.
* Store initial font size
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Bring back setMinimumHeight for recent tx list
This partially reverts a3604f5c7c
Turns out that we still need this at least on Windows (not sure why but tx list looks clipped there atm)
* Reduce number of items in recent tx list by 1 (for PS enabled cases only)
Most users will never see immature funds and the list is going to be too long for them most of the time
* qt: Make sure font size in MasternodeList gets scaled as expected
* qt: Make sure font size in ShutdownWindow gets scaled as expected
* qt: Drop obsolete application font updates
* qt: Scale QMenu and QMessageBox globally
To make sure non-custom context menus + QMessageBox instances createy by
static calls like QMessageBox::critical are scaled also.
* qt: Avoid redundant scaling for tooltips and menus
* qt: Only update widget's font if required
* qt: Merge GUIUtil::mapFontSizeUpdates into GUIUtil::mapNormalFontUpdates
* qt: Remove obsolete setFixedPitchFont call
* qt: Use setFixedPitchFont in SendCoinsEntry
* qt: Scale font size in increments of 0.25
* qt: Properly scale network traffic stats depending on font metrics
* qt: Update min/max width of OptionsDialog depending on buttons width
* qt: Emit a signal whenever any attribute of AppearanceWidget changed
* qt: Update OptionsDialog width if the appearance changed
* qt: Calculate the initial wide right after the window showed up
Make sure the visibility state of the widgets is correct before width calculations.
* qt: Call parent class showEvent + override it explicit
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Let OptionsDialog emit a signal if appearance gets changed
* qt: Resize main toolbar depending on visible buttons / font attributes
* qt: Reset max width after it has been set to still allow window resizing
* qt: Properly update the weight of widgets with default font attributes
* qt: Handle updates to the font attributes
* qt: Use resize() instead of setMaximumWidth()
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Call GUIUtil::updateFonts in ModalOverlay constructor
* qt: Make sure default fonts are stored properly for the related widget
* qt: Ignore some low level classes in GUIUtil::updateFont
* rpc: Remove obsolete `.arg()` call
* qt: Drop fixedPitchFont
* qt: Avoid redundant font updates. Let GUIUtil::updateFont handle them
* qt: Scale recent transactions on OverviewPage
They were scaled by font inheritance before
* qt: Ignore QListView in GUIUtil::updateFonts
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Add PrivateSend tab in OptionsDialog, allow to show/hide PS UI
* qt: Decrease height of OptionsDialog
* Apply suggestions from code review
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Remove obsolete visibility adjustments
Not longer needed since the page is just not reachable if the button is
hidden.
* qt: Make sure PrivateSend related parts are always initialized properly
Not only if its enabled on startup..
* qt: Make updatePrivateSendVisibility a slot to fix the signal connection
* qt: Fix UI updates on OverviewPage if PrivateSend enabled gets toggled
Other way of connecting the slot with true as parameter didn't work..
* qt: Only update and emit the signal for advanced PS UI if required
* qt: Update fPrivateSendEnabled in OptionsModel instead of OptionsDialog
* qt: Recover the PrivateSend enabled state if OptionsDialog gets rejected
* qt: Enable PrivateSend UI by default
* qt: Add some brackets
* qt: Add a comment
* qt: Add a linebreak to the "Enable PrivateSend features" tooltip
* qt: Remove obsolete comment
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
* qt: Move comment
* qt: Properly reset the previous PS state if OptionsDialog gets rejected
Handle all reject reasons not only the cancle button.
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
* qt: Adjust "Recent Transactions" in Overview tab
Make sure they follow the same format as the transactions in
TransactionsView.
- Removed the transaction type representing arrows
- Apply the same coloring like like in the transaction tab for
the different transaction types (orange = internal, red = outgoing,
green = incoming)
* qt: Cleanup layout of OverviewPage in css
* qt: Add three spacer (left, middle, right) and adjust layout stretch.
This allows to have the elements on the screen aligned symetrically
around the center independent from the window size/resizing.
* qt: Inrease date/amount size for "Recent Transactions" in Overview tab
* qt: Inrease number of "Recent Transactions" displayed in Overview tab
Just to fill the empty space
* qt: Make sure PS elements show as expected and adjust number of recent transactions based on PS
* qt: Adjust transaction entry generation
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Adjust warning message box
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
* Move tx list style to css
* Fix tx list style for the traditional theme
* Drop (no longer needed?) min height offset in SetupTransactionList
Can't reproduce the tx list scrolling issue anymore
* Avoid recreating transaction filter from scratch every time SetupTransactionList is called
We call SetupTransactionList every second now (from privateSendStatus()) and this makes GUI unresponsive for huge wallets (I have ~400k txes in my testnet wallet) because of filter recreation/sorting. There is no need to go through all setup steps really, simply updating the limit works just fine and fixes the issue.
* qt: Fix an `if` statement
* qt: Just some refactoring
* fix code style
* bail out if `filter->rowCount() == nNumItems`
* qt: Make sure number of transactions is always correct
* Drop spacer to let recent tx list occupy max height available
* TransactionFilterProxy::setLimit should emit signals to let coresponding layouts update themselves
https://doc.qt.io/qt-5/qabstractitemmodel.html#layoutAboutToBeChangedhttps://doc.qt.io/qt-5/qabstractitemmodel.html#layoutChanged
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Add PlatformStyle::Icon + only show icons on menu if enabled
Now icons are disabled everywhere if imagesOnButtons is disabled. There were still buttons on each menu item.
* qt: Disable all PlatformStyle related changes
* qt: Drop PlatformStyle
- Makes it singleton to make sure we always only have one instance of it
- Protects its members by making them private and adding set/getters
- Makes it thread safe
With the introduction of better mutliwallet support, privatesend only worked for your first wallet. This commit implements multiwallet for privatesend such that the wallet you start the mixing from is the wallet mixing will occur in.
Signed-off-by: pasta <pasta@dashboost.org>
* qt: Draw a border around net traffic graph
* qt: ReceiveRequestDialog - Improve QR code image
- Fix issue with bluriness
- Refine sizing/layout of QR code and address
- Adjust coloring to match the themes
* qt: Give the TransactionView's instantsendWidget a name
Required to access it in css
* qt: Rename conflicting label in SendCoinsDialog
- Was named the same as the the label in EditAddressDialog so it couldn't be accessed properly in css
* qt: Give the TransactionView's search field the first focus on startup
* qt: Some updates to the PrivateSend widget on the OverviewPage
- Hide denom labels if inactive
- Enable wordwrap for denom label
- Add some spacer
- Make sure it gets its basic initialization on startup
* qt: Fix some layout issues in SendCoinsDialog's UI file.
- Added some margins for fee selection radio buttons to align them centered to their options
- Removed a weird placed spacer
* qt: Fix vertical alignment of the two balance labels in SendCoinsDialog
* qt: Add newline in textedit of receiverequest
* qt: OptionsDialog - Hide override hint if there is nothing overridden
* qt: Allow stylesheet modifications for auto completition popup
- Inheritance doesn't work here obviously because of QCompleter is parent of the popup
- QStyledItemDelegate delegate is required. Without its not possible to access `::item` selectors from css.
* qt: Make the progress label in the status bar accessible in css
* qt: Update weekend colors of QCalendarWidget on style changes
Its obviously not possible to do this in stylesheets thats why i added
this as workaround.
* qt: Load stylesheets for Intro
This is the datadir selection dialog.
* Drop labelPrivateSendLastMessage
* Add a space
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
* qt: Set parents properly to inherit css and remove redundant loading
The stylesheet is inherited from the parent so its enough to set it for the main window and use this as parent for all other windows.
Except for the ShutdownDialog. This needs to have its own stylesheet set because we can't have the main window as parent of the ShutdownDialog.
* qt: Adding Qt::Window flag to the constructor of RPCConsole
This is required now as RPCConsole does not longer show as extra window with a parent set (For stylesheet inheritance).
* qt: Add UI debug mode (-debug-ui)
If this mode is enabled the content of the css files will become pushed to the UI if there were any changes made to the stylesheet files in the custom css directory. It also forces some UI elements to show up which are actually only shown under special conditions (e.g. watch balance labels). Its required to set a custom css directory with -custom-css-dir to enable this.
* qt: Adjust the description of -debug-ui
* qt: Update theme colors in GUIUtil
- Adds ThemedColor::GREEN
- Changes ThemedColor::NEGATIVE to ThemedColor::RED
- Color adjustments to align with css colors
* qt: Give links a more eye friendly blue
* qt: Use themed colors in net traffic graph
* qt: Use themed styles/color in overview page
* qt: Use themed stylesheets in Intro
* qt: Modified QR code image painting to match the theme colors
* enable privatesend by default in litemode
Signed-off-by: Pasta <pasta@dashboost.org>
* remove useless litemode check in CPrivateSendServer::ProcessMessage, must be MN, so must have litemode off already
Signed-off-by: Pasta <pasta@dashboost.org>
* change litemode to mean, doesn't validate governance, but has all other dash features
Signed-off-by: Pasta <pasta@dashboost.org>
* litemode must be off for MNs cont
Signed-off-by: Pasta <pasta@dashboost.org>
* change litemode help text
Signed-off-by: Pasta <pasta@dashboost.org>
* don't skip MN sync in litemode
Signed-off-by: Pasta <pasta@dashboost.org>
* drop fLiteMode in bitcoingui.cpp
Signed-off-by: Pasta <pasta@dashboost.org>
* skip governance sync in litemode
Signed-off-by: pasta <pasta@dashboost.org>
* remove fLiteMode in walletview.cpp
Signed-off-by: pasta <pasta@dashboost.org>
* add back
Signed-off-by: pasta <pasta@dashboost.org>
* fix comments
* fix cache loading
* fix scheduled tasks
* Fix help text for some rpcs (revert what's left of 3478)
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* Implement GetDsqThreshold to unify dsq rejection threshold calculations
* Use much simpler/lighter criteria to check if a candidate mixing MN is going to be paid in next 8 blocks
Drop CMasternodePayments::IsScheduled()
* Fix decomposition of txes with 2 outputs
Recognise creation of denoms for txes with 1 denom + 1 change
Fixes an issue introduced in #3347
* Tweak few labels
s/anonymize/mix/
* Prefer larger denoms when starting new mixing queues
Fixes an issue introduced in #3346
* Add an explanation about GetDsqThreshold
* Move GetDsqThreshold comment a bit higher
* Use item data to figure out PS rounds for the input selected in CoinControl dialog
* Access GetRealOutpointPrivateSendRounds through WalletModel in CoinControl dialog
Instead of accessing the walet directly
* Make OverviewPage::privateSendStatus() mockable
GetTimeMillis() -> GetTime()
* Refactor PS related code in overviewpage to access wallet via wallet model
* scripted-diff: Replace #include "" with #include <> (ryanofsky)
-BEGIN VERIFY SCRIPT-
for f in \
src/*.cpp \
src/*.h \
src/bench/*.cpp \
src/bench/*.h \
src/compat/*.cpp \
src/compat/*.h \
src/consensus/*.cpp \
src/consensus/*.h \
src/crypto/*.cpp \
src/crypto/*.h \
src/crypto/ctaes/*.h \
src/policy/*.cpp \
src/policy/*.h \
src/primitives/*.cpp \
src/primitives/*.h \
src/qt/*.cpp \
src/qt/*.h \
src/qt/test/*.cpp \
src/qt/test/*.h \
src/rpc/*.cpp \
src/rpc/*.h \
src/script/*.cpp \
src/script/*.h \
src/support/*.cpp \
src/support/*.h \
src/support/allocators/*.h \
src/test/*.cpp \
src/test/*.h \
src/wallet/*.cpp \
src/wallet/*.h \
src/wallet/test/*.cpp \
src/wallet/test/*.h \
src/zmq/*.cpp \
src/zmq/*.h
do
base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
done
-END VERIFY SCRIPT-
Signed-off-by: Pasta <pasta@dashboost.org>
* scripted-diff: Replace #include "" with #include <> (Dash Specific)
-BEGIN VERIFY SCRIPT-
for f in \
src/bls/*.cpp \
src/bls/*.h \
src/evo/*.cpp \
src/evo/*.h \
src/governance/*.cpp \
src/governance/*.h \
src/llmq/*.cpp \
src/llmq/*.h \
src/masternode/*.cpp \
src/masternode/*.h \
src/privatesend/*.cpp \
src/privatesend/*.h
do
base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
done
-END VERIFY SCRIPT-
Signed-off-by: Pasta <pasta@dashboost.org>
* build: Remove -I for everything but project root
Remove -I from build system for everything but the project root,
and built-in dependencies.
Signed-off-by: Pasta <pasta@dashboost.org>
# Conflicts:
# src/Makefile.test.include
* qt: refactor: Use absolute include paths in .ui files
* qt: refactor: Changes to make include paths absolute
This makes all include paths in the GUI absolute.
Many changes are involved as every single source file in
src/qt/ assumes to be able to use relative includes.
Signed-off-by: Pasta <pasta@dashboost.org>
# Conflicts:
# src/qt/dash.cpp
# src/qt/optionsmodel.cpp
# src/qt/test/rpcnestedtests.cpp
* test: refactor: Use absolute include paths for test data files
* Recommend #include<> syntax in developer notes
* refactor: Include obj/build.h instead of build.h
* END BACKPORT #11651 Remove trailing whitespace causing travis failure
* fix backport 11651
Signed-off-by: Pasta <pasta@dashboost.org>
* More of 11651
* fix blockchain.cpp
Signed-off-by: pasta <pasta@dashboost.org>
* Add missing "qt/" in includes
* Add missing "test/" in includes
* Fix trailing whitespaces
Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Co-authored-by: MeshCollider <dobsonsa68@gmail.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
64fb0ac Declare single-argument (non-converting) constructors "explicit" (practicalswift)
Pull request description:
Declare single-argument (non-converting) constructors `explicit`.
In order to avoid unintended implicit conversions.
For a more thorough discussion, see ["C.46: By default, declare single-argument constructors explicit"](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit) in the C++ Core Guidelines (Stroustrup & Sutter).
Tree-SHA512: e0c6922e56b11fa402621a38656d8b1122d16dd8f160e78626385373cf184ac7f26cb4c1851eca47e9b0dbd5e924e39a85c3cbdcb627a05ee3a655ecf5f7a0f1
* Copy light(-hires).css -> dark(-hires).css (with no changes yet)
* Add dark(-hires).css to makefile/qrc and show them in theme selector
* Dark theme (css part)
* Do not style unit selector in status bar via platform styles, use css instead
* No coloring via forms (*.ui)
* Implement and use helpers to style parts of rich text differently for light and dark themes
* Remove dark-hires due to #3217
* Revert changes to light-hires.css to avoid merge conflicts with #3217
* Update Dash app and toolbar icons
* Update icons and images
* Remove menubar icons
* Add Dash logo to top-right of menubar
* Remove the small PrivateSend buttons
* Remove image entirely from About modal
* Update CSS for new theme changes
* Restore splash testnet image
* Make entire toolbar button clickable
* Fix address book and shrink transaction icons
* Revert "Restore splash testnet image"
This reverts commit 2df07ff7d3.
* Restore original direction for tx in/out arrows
* Add transparency to icons
* Remove unused icons
* Resize way too small icons
* `mogrify src/qt/res/*/*.png`
* Drop `light` from `optimize-pngs.py`
* `python3 contrib/devtools/optimize-pngs.py`
"Total reduction: 42507 bytes"
* Restore old remove icon as console_remove
* Remove crownium files
* Remove trad theme files
* Remove drkblue theme files
* Remove light-retro theme files
* Remove old themes from optimize-pngs script
* Remove refs to old themes in Makefile.qt
* Remove more old theme file references
* Remove old themes from options dialog
* No need to care about themes for images and icons anymore
* Bring `trad` back
* Drop remaining `drkblue` references
Rename files that are actually used and drop no longer needed ones
* Merge #8694: Basic multiwallet support
c237bd7 wallet: Update formatting (Luke Dashjr)
9cbe8c8 wallet: Forbid -salvagewallet, -zapwallettxes, and -upgradewallet with multiple wallets (Luke Dashjr)
a2a5f3f wallet: Base backup filenames on original wallet filename (Luke Dashjr)
b823a4c wallet: Include actual backup filename in recovery warning message (Luke Dashjr)
84dcb45 Bugfix: wallet: Fix warningStr, errorStr argument order (Luke Dashjr)
008c360 Wallet: Move multiwallet sanity checks to CWallet::Verify, and do other checks on all wallets (Luke Dashjr)
0f08575 Wallet: Support loading multiple wallets if -wallet used more than once (Luke Dashjr)
b124cf0 Wallet: Replace pwalletMain with a vector of wallet pointers (Luke Dashjr)
19b3648 CWalletDB: Store the update counter per wallet (Luke Dashjr)
74e8738 Bugfix: ForceSetArg should replace entr(ies) in mapMultiArgs, not append (Luke Dashjr)
23fb9ad wallet: Move nAccountingEntryNumber from static/global to CWallet (Luke Dashjr)
9d15d55 Bugfix: wallet: Increment "update counter" when modifying account stuff (Luke Dashjr)
f28eb80 Bugfix: wallet: Increment "update counter" only after actually making the applicable db changes to avoid potential races (Luke Dashjr)
Tree-SHA512: 23f5dda58477307bc07997010740f1dc729164cdddefd2f9a2c9c7a877111eb1516d3e2ad4f9b104621f0b7f17369c69fcef13d28b85cb6c01d35f09a8845f23
* pwalletMain -> vpwallets
Signed-off-by: Pasta <pasta@dashboost.org>
* add gArgs
Signed-off-by: Pasta <pasta@dashboost.org>
* continued pwalletsMain -> vpwallets
Signed-off-by: Pasta <pasta@dashboost.org>
* remove external pwalletMains and pwalletMain -> vpwallet
Signed-off-by: Pasta <pasta@dashboost.org>
* add external referance to vpwallets
Signed-off-by: Pasta <pasta@dashboost.org>
* more pWalletMain -> vpwallets[0]
Signed-off-by: Pasta <pasta@dashboost.org>
* code review
Signed-off-by: Pasta <pasta@dashboost.org>
* revert LOCK(cs_main) move
Signed-off-by: Pasta <pasta@dashboost.org>
* import wallet.h and remove extern
Signed-off-by: Pasta <pasta@dashboost.org>
* batch.* -> WriteIC and EraseIC
Signed-off-by: Pasta <pasta@dashboost.org>
* wrap wallet.h include inside of an ifdef
Signed-off-by: Pasta <pasta@dashboost.org>
* drop wallet.h
Signed-off-by: Pasta <pasta@dashboost.org>
* add dropped "!"
Signed-off-by: Pasta <pasta@dashboost.org>
* Remove ppszTypeName from protocol.cpp and reimplement GetCommand
This removes the need to carefully maintain ppszTypeName, which required
correct order and also did not allow to permanently remove old message
types.
To get the command name for an INV type, GetCommandInternal uses a switch
which needs to be maintained from now on.
The way this is implemented also resembles the way it is implemented in
Bitcoin today, but it's not identical. The original PR that introduced the
switch case in Bitcoin was part of the Segwit changes and thus never got
backported. I decided to implement it in a slightly different way that
avoids throwing exceptions when an unknown INV type is encountered.
IsKnownType will now also leverage GetCommandInternal() to figure out if
the INV type is known locally. This has the side effect of old/legacy
message types to return false from now on. We will depend on this side
effect in later commits when we remove legacy InstantSend code.
* Stop handling/relaying legacy IX messages
When we receive an IX message, we simply treat it as a regular TX and relay
it as such.
We'll however still request IX messages when they are announced to us. We
can't simply revert to requesting TX messages in this case as it might
result in the other peer not answering due to the TX not being in mapRelay
yet. We should at some point in the future completely drop handling of IX
messages instead.
* Remove IsNewInstantSendEnabled() and only use IsInstantSendEnabled()
* Remove legacy InstantSend from GUI
* Remove InstantSend from Bitcoin/Dash URIs
* Remove legacy InstantSend from RPC commands
* Remove legacy InstantSend from wallet
* Remove legacy instantsend.h include
* Remove legacy InstantSend from validation code
* Completely remove remaining legacy InstantSend code
* Remove now unused spork
* Fix InstantSend related test failures
* Remove now obsolete auto IS tests
* Make spork2 and spork3 disabled by default
This should have no influence on mainnet as these sporks are actually set
there. This will however affect regtest, which shouldn't have LLMQ based
InstantSend enabled by default.
* Remove instantsend tests from dip3-deterministicmns.py
These were only testing legacy InstantSend
* Fix .QCheckBox#checkUsePrivateSend styling a bit
* s/TXLEGACYLOCKREQUEST/LEGACYTXLOCKREQUEST/
* Revert "verified via InstantSend" back to "verified via LLMQ based InstantSend"
* Use cmd == nullptr instead of !cmd
* Remove last parameter from AvailableCoins call
This was for fUseInstantSend which is not present anymore since rebase
* Decouple lite mode and client-side PrivateSend
`-enableprivatesend`:
1. off by default in lite mode but can be overridden
2. does not start mixing, use `-privatesendautostart` (default is off) or `privatesend` rpc instead
* Disable PS when there is no wallet, do not auto-start mixing when wallet is locked
* Check for `!fEnablePrivateSend` and `!fPrivateSendRunning` instead of `!pwalletMain` in ps client code
* Add meaningful `privatesend` rpc error messages for various cases when mmixing is disabled