dash/src/qt
W. J. van der Laan 06ea87040b
Merge bitcoin/bitcoin#20773: refactor: split CWallet::Create
489ebb7b34c403a3ce78ff6fb271f8e6ecb47304 wallet: make chain optional for CWallet::Create (Ivan Metlushko)
d73ae939649f3b30e52b5a2cccd7fafd1ab36766 CWallet::Create move chain init message up into calling code (Ivan Metlushko)
44c430ffac940e1d1dd7f5939a495470bc694489 refactor: Add CWallet:::AttachChain method (Russell Yanofsky)
e2a47ce08528dfb39c0340145c6977f6afd587f6 refactor: move first run detection to client code (Ivan Metlushko)

Pull request description:

  This is a followup for https://github.com/bitcoin/bitcoin/pull/20365#discussion_r522265003
  First part of a refactoring with overall goal to simplify `CWallet` and de-duplicate code with `wallettool`

  **Rationale**: split `CWallet::Create` and create `CWallet::AttachChain`.

  `CWallet::AttachChain` takes chain as first parameter on purpose. In future I suggest we can remove `chain` from `CWallet` constructor.

  The second commit is based on be164f9cf89b123f03b926aa980996919924ee64 from #15719 (thanks ryanofsky)

  cc ryanofsky achow101

ACKs for top commit:
  ryanofsky:
    Code review ACK 489ebb7b34c403a3ce78ff6fb271f8e6ecb47304. Only changes since last review were adding a const variable declaration, and implementing suggestion not to move feerate option checks to AttachChain. Thanks for updates and fast responses!

Tree-SHA512: 00235abfe1b00874c56c449adcab8a36582424abb9ba27440bf750af8f3f217b68c11ca74eb30f78a2109ad1d9009315480effc78345e16a3074a1b5d8128721
2024-08-12 20:38:05 +07:00
..
android
forms Merge bitcoin-core/gui#176: Fix TxViewDelegate layout 2024-07-23 13:08:39 +07:00
locale 60%+: bg, ro, vi 2024-07-18 13:35:16 +03:00
res fix: removed maximum width of transaction list on overview page 2024-07-23 13:08:39 +07:00
test Merge bitcoin/bitcoin#20773: refactor: split CWallet::Create 2024-08-12 20:38:05 +07:00
addressbookpage.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
addressbookpage.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
addresstablemodel.cpp merge bitcoin-core/gui#166: Use enum type as switch argument in *TableModel 2024-06-09 17:33:59 +00:00
addresstablemodel.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
appearancewidget.cpp non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
appearancewidget.h non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
askpassphrasedialog.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
askpassphrasedialog.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
bantablemodel.cpp merge bitcoin-core/gui#166: Use enum type as switch argument in *TableModel 2024-06-09 17:33:59 +00:00
bantablemodel.h merge bitcoin#22915: Remove confusing CAddrDB 2024-06-04 13:31:31 +00:00
bitcoin.cpp merge bitcoin#22937: Forbid calling unsafe fs::path(std::string) constructor and fs::path::string() method 2024-08-06 18:00:38 +00:00
bitcoin.h Merge bitcoin-core/gui#260: Handle exceptions instead of crash 2024-04-11 02:26:03 +07:00
bitcoinaddressvalidator.cpp non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
bitcoinaddressvalidator.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
bitcoinamountfield.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
bitcoinamountfield.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
bitcoingui.cpp merge bitcoin-core/gui#399: Fix "Load PSBT" functionality when no wallet loaded 2024-07-23 17:45:24 +00:00
bitcoingui.h Merge bitcoin-core/gui#115: Replace "Hide tray icon" option with positive "Show tray icon" one 2024-04-10 03:19:40 +07:00
bitcoinunits.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
bitcoinunits.h non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
clientmodel.cpp merge bitcoin#21850: Remove GetDataDir(net_specific) function 2024-07-23 17:45:24 +00:00
clientmodel.h merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
coincontroldialog.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
coincontroldialog.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
coincontroltreewidget.cpp
coincontroltreewidget.h
createwalletdialog.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
createwalletdialog.h Merge #16528: Native Descriptor Wallets using DescriptorScriptPubKeyMan 2024-03-07 01:23:15 +07:00
csvmodelwriter.cpp
csvmodelwriter.h
dash_locale.qrc
dash.qrc partial bitcoin-core/gui#79: Embed monospaced font 2024-06-09 17:33:59 +00:00
dashstrings.cpp dashstrings 2024-07-18 12:45:48 +03:00
editaddressdialog.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
editaddressdialog.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
governancelist.cpp qt: add interface for CGovernanceObject querying 2024-02-27 09:56:08 -06:00
governancelist.h qt: add interface for CGovernanceObject querying 2024-02-27 09:56:08 -06:00
guiconstants.h non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
guiutil.cpp merge bitcoin#20744: Use std::filesystem. Remove Boost Filesystem & System 2024-08-06 18:00:39 +00:00
guiutil.h Merge bitcoin-core/gui#448: Add helper to load font 2024-06-11 08:39:42 -05:00
intro.cpp merge bitcoin#22937: Forbid calling unsafe fs::path(std::string) constructor and fs::path::string() method 2024-08-06 18:00:38 +00:00
intro.h merge bitcoin#21850: Remove GetDataDir(net_specific) function 2024-07-23 17:45:24 +00:00
macdockiconhandler.h
macdockiconhandler.mm
macnotificationhandler.h
macnotificationhandler.mm
macos_appnap.h
macos_appnap.mm
main.cpp
masternodelist.cpp scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
masternodelist.h non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
modaloverlay.cpp scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
modaloverlay.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
networkstyle.cpp non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
networkstyle.h non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
notificator.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
notificator.h
openuridialog.cpp
openuridialog.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
optionsdialog.cpp merge bitcoin#22834: respect -onlynet= when making outbound connections 2024-05-29 18:07:45 +00:00
optionsdialog.h Merge bitcoin-core/gui#115: Replace "Hide tray icon" option with positive "Show tray icon" one 2024-04-10 03:19:40 +07:00
optionsmodel.cpp merge bitcoin#21850: Remove GetDataDir(net_specific) function 2024-07-23 17:45:24 +00:00
optionsmodel.h Merge bitcoin-core/gui#115: Replace "Hide tray icon" option with positive "Show tray icon" one 2024-04-10 03:19:40 +07:00
overviewpage.cpp Merge bitcoin-core/gui#176: Fix TxViewDelegate layout 2024-07-23 13:08:39 +07:00
overviewpage.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
paymentserver.cpp Merge #6111: backport: bitcoin-core/gui#154, #176, #221, #248, #251 - qt improvements and related fixes 2024-07-23 14:17:33 -05:00
paymentserver.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
peertablemodel.cpp merge bitcoin-core/gui#325: Align numbers in the "Peer Id" column to the right 2024-06-09 17:34:00 +00:00
peertablemodel.h merge bitcoin-core/gui#179: Add Type column to peers window, update peer details name/tooltip 2024-06-09 17:33:59 +00:00
psbtoperationsdialog.cpp merge bitcoin#20744: Use std::filesystem. Remove Boost Filesystem & System 2024-08-06 18:00:39 +00:00
psbtoperationsdialog.h
qrdialog.cpp
qrdialog.h
qrimagewidget.cpp scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
qrimagewidget.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
qvalidatedlineedit.cpp
qvalidatedlineedit.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
qvaluecombobox.cpp
qvaluecombobox.h
README.md Merge bitcoin-core/gui#139: doc: Improve gui/src/qt README.md 2024-04-10 03:19:39 +07:00
receivecoinsdialog.cpp merge bitcoin-core/gui#214: Disable requests context menu actions when appropriate 2024-06-09 17:33:59 +00:00
receivecoinsdialog.h merge bitcoin-core/gui#214: Disable requests context menu actions when appropriate 2024-06-09 17:33:59 +00:00
receiverequestdialog.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
receiverequestdialog.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
recentrequeststablemodel.cpp Merge bitcoin/bitcoin#21353: interfaces: Stop exposing wallet destdata to gui 2024-04-23 09:15:20 -05:00
recentrequeststablemodel.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
rpcconsole.cpp merge bitcoin#25514: Move CNode::nServices and CNode::nLocalServices to Peer 2024-08-09 17:34:41 +07:00
rpcconsole.h Merge bitcoin-core/gui#221: qt, refactor: rpcconsole translatable string fixes and improvements 2024-07-23 13:08:39 +07:00
sendcoinsdialog.cpp merge bitcoin#20744: Use std::filesystem. Remove Boost Filesystem & System 2024-08-06 18:00:39 +00:00
sendcoinsdialog.h Merge bitcoin-core/gui#284: refactor: Simplify SendCoinsDialog::updateCoinControlState 2024-04-23 22:41:08 +07:00
sendcoinsentry.cpp
sendcoinsentry.h
sendcoinsrecipient.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
signverifymessagedialog.cpp non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
signverifymessagedialog.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
splashscreen.cpp non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
splashscreen.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
trafficgraphdata.cpp non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
trafficgraphdata.h non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
trafficgraphwidget.cpp Merge bitcoin-core/gui#248: Fix: For values of "Bytes transferred" and "Bytes/s" with 1000-based prefix names use 1000-based divisor instead of 1024-based 2024-07-23 13:08:39 +07:00
trafficgraphwidget.h qt: drop leftover boost::function usage in Qt, drop header from list 2024-04-23 15:34:48 +00:00
transactiondesc.cpp feat: make a support of Qt app to show Platform Transfer transaction as a new type of transaction 2024-08-07 08:27:32 +07:00
transactiondesc.h
transactiondescdialog.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
transactiondescdialog.h
transactionfilterproxy.cpp
transactionfilterproxy.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
transactionoverviewwidget.h Merge bitcoin-core/gui#176: Fix TxViewDelegate layout 2024-07-23 13:08:39 +07:00
transactionrecord.cpp feat: make a support of Qt app to show Platform Transfer transaction as a new type of transaction 2024-08-07 08:27:32 +07:00
transactionrecord.h feat: make a support of Qt app to show Platform Transfer transaction as a new type of transaction 2024-08-07 08:27:32 +07:00
transactiontablemodel.cpp feat: improve query categorisation in Qt App 2024-08-07 08:27:33 +07:00
transactiontablemodel.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
transactionview.cpp feat: make a support of Qt app to show Platform Transfer transaction as a new type of transaction 2024-08-07 08:27:32 +07:00
transactionview.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
utilitydialog.cpp scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
utilitydialog.h
walletcontroller.cpp partial Merge #20842: docs: consolidate typo & url fixing 2024-07-26 13:32:54 +07:00
walletcontroller.h
walletframe.cpp merge bitcoin#20744: Use std::filesystem. Remove Boost Filesystem & System 2024-08-06 18:00:39 +00:00
walletframe.h merge bitcoin-core/gui#399: Fix "Load PSBT" functionality when no wallet loaded 2024-07-23 17:45:24 +00:00
walletmodel.cpp Merge bitcoin/bitcoin#21353: interfaces: Stop exposing wallet destdata to gui 2024-04-23 09:15:20 -05:00
walletmodel.h Merge bitcoin/bitcoin#21353: interfaces: Stop exposing wallet destdata to gui 2024-04-23 09:15:20 -05:00
walletmodeltransaction.cpp
walletmodeltransaction.h
walletview.cpp merge bitcoin-core/gui#399: Fix "Load PSBT" functionality when no wallet loaded 2024-07-23 17:45:24 +00:00
walletview.h merge bitcoin-core/gui#399: Fix "Load PSBT" functionality when no wallet loaded 2024-07-23 17:45:24 +00:00
winshutdownmonitor.cpp
winshutdownmonitor.h

This directory contains the source code for the Dash Core graphical user interface (GUI). It uses the Qt cross-platform framework.

The current precise version for Qt 5 is specified in qt.mk. Qt 4 is not supported.

Compile and run

See build instructions: Unix, macOS, Windows, FreeBSD, NetBSD, OpenBSD

When following your systems build instructions, make sure to install the Qt dependencies.

To run:

./src/qt/dash-qt

Files and Directories

forms/

  • A directory that contains Designer UI files. These files specify the characteristics of form elements in XML. Qt UI files can be edited with Qt Creator or using any text editor.

locale/

  • Contains translations. They are periodically updated and an effort is made to support as many languages as possible. The process of contributing translations is described in doc/translation_process.md.

res/

  • Contains graphical resources used to enhance the UI experience.

test/

  • Functional tests used to ensure proper functionality of the GUI. Significant changes to the GUI code normally require new or updated tests.

bitcoingui.(h/cpp)

  • Represents the main window of the Dash UI.

*model.(h/cpp)

  • The model. When it has a corresponding controller, it generally inherits from QAbstractTableModel. Models that are used by controllers as helpers inherit from other Qt classes like QValidator.
  • ClientModel is used by the main application dashgui and several models like peertablemodel.

*page.(h/cpp)

  • A controller. :NAMEpage.cpp generally includes :NAMEmodel.h and forms/:NAME.page.ui with a similar :NAME.

*dialog.(h/cpp)

  • Various dialogs, e.g. to open a URL. Inherit from QDialog.

paymentserver.(h/cpp)

  • (Deprecated) Used to process BIP21 payment URI requests. Also handles URI-based application switching (e.g. when following a dash:... link from a browser).

Used to process BIP21 payment URI requests. Also handles URI based application switching (e.g. when following a dash:... link from a browser).

walletview.(h/cpp)

  • Represents the view to a single wallet.

Other .h/cpp files

  • UI elements like BitcoinAmountField, which inherit from QWidget.
  • bitcoinstrings.cpp: automatically generated
  • bitcoinunits.(h/cpp): BTC / mBTC / etc. handling
  • callback.h
  • guiconstants.h: UI colors, app name, etc.
  • guiutil.h: several helper functions
  • macdockiconhandler.(h/mm): macOS dock icon handler
  • macnotificationhandler.(h/mm): display notifications in macOS

Contribute

See CONTRIBUTING.md for general guidelines.

Note: Do not change local/dash_en.ts. It is updated automatically.

Using Qt Creator as an IDE

Qt Creator is a powerful tool which packages a UI designer tool (Qt Designer) and a C++ IDE into one application. This is especially useful if you want to change the UI layout.

Download Qt Creator

On Unix and macOS, Qt Creator can be installed through your package manager. Alternatively, you can download a binary from the Qt Website.

Note: If installing from a binary grabbed from the Qt Website: During the installation process, uncheck everything except for Qt Creator.

macOS
brew install qt-creator
Ubuntu & Debian
sudo apt-get install qtcreator

Setup Qt Creator

  1. Make sure you've installed all dependencies specified in your systems build instructions
  2. Follow the compile instructions for your system, run ./configure with the --enable-debug flag
  3. Start Qt Creator. At the start page, do: New -> Import Project -> Import Existing Project
  4. Enter dash-qt as the Project Name and enter the absolute path to src/qt as Location
  5. Check over the file selection, you may need to select the forms directory (necessary if you intend to edit *.ui files)
  6. Confirm the Summary page
  7. In the Projects tab, select Manage Kits...

macOS

  • Under Kits: select the default "Desktop" kit
  • Under Compilers: select "Clang (x86 64bit in /usr/bin)"
  • Under Debuggers: select "LLDB" as debugger (you might need to set the path to your LLDB installation)

Ubuntu & Debian

Note: Some of these options may already be set

  • Under Kits: select the default "Desktop" kit
  • Under Compilers: select "GCC (x86 64bit in /usr/bin)"
  • Under Debuggers: select "GDB" as debugger
  1. While in the Projects tab, ensure that you have the dash-qt executable specified under Run
  • If the executable is not specified: click "Choose...", navigate to src/qt, and select dash-qt
  1. You're all set! Start developing, building, and debugging the Dash Core GUI