Skip to content

Commit

Permalink
Merge bitcoin-core/gui#85: Remove unused "What's This" button in dial…
Browse files Browse the repository at this point in the history
…ogs on Windows OS

ac7ccd6 scripted-diff: Remove unused "What's This" button in dialogs on Windows (Hennadii Stepanov)
b695148 qt: Add flags to prevent a "What's This" button on Windows OS (Hennadii Stepanov)

Pull request description:

  Fix dashpay#74.

  From [Qt docs](https://doc.qt.io/qt-5/qdialog.html#QDialog):
  > The widget flags _f_ are passed on to the `QWidget` constructor. If, for example, you don't want a **What's This** button in the title bar of the dialog, pass `Qt::WindowTitleHint | Qt::WindowSystemMenuHint` in _f_.

  Screenshot on Windows 10 (2004):
  - master (3ba25e3)
  ![Screenshot from 2020-09-07 16-55-42](https://user-images.githubusercontent.com/32963518/92402384-20dc6a00-f138-11ea-9dcb-3e0f6373ff22.png)

  - this PR (e322fe7e19ac504272d14b9b4f9b28b13df888ed)
  ![Screenshot from 2020-09-07 18-31-16](https://user-images.githubusercontent.com/32963518/92402509-5aad7080-f138-11ea-8b63-9bbbf8b9b9e1.png)

ACKs for top commit:
  Bosch-0:
    tACK ac7ccd6 Tested on Windows 10.0.18363 Build 18363.
  promag:
    Code review ACK ac7ccd6 but with some suggestions.
  jonasschnelli:
    utACK ac7ccd6

Tree-SHA512: f6750a17b7203106cb4db5870becba1cef6a505d4edcc710ba131338bd3aae051510627e62c9bcb8345a7f497c614709e11aeb8f6ae3ea85967bbce2a8c69e64
  • Loading branch information
jonasschnelli authored and knst committed Jan 24, 2024
1 parent 1b9516a commit df896df
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/qt/addressbookpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel
};

AddressBookPage::AddressBookPage(Mode _mode, Tabs _tab, QWidget* parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::AddressBookPage),
model(nullptr),
mode(_mode),
Expand Down
2 changes: 1 addition & 1 deletion src/qt/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <QPushButton>

AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent, SecureString* passphrase_out) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::AskPassphraseDialog),
mode(_mode),
model(nullptr),
Expand Down
2 changes: 1 addition & 1 deletion src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool CCoinControlWidgetItem::operator<(const QTreeWidgetItem &other) const {
}

CoinControlDialog::CoinControlDialog(CCoinControl& coin_control, WalletModel* _model, QWidget* parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::CoinControlDialog),
m_coin_control(coin_control),
model(_model)
Expand Down
4 changes: 3 additions & 1 deletion src/qt/createwalletdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
#include <qt/createwalletdialog.h>
#include <qt/forms/ui_createwalletdialog.h>

#include <qt/guiutil.h>

#include <QPushButton>

CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::CreateWalletDialog)
{
ui->setupUi(this);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/editaddressdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <QMessageBox>

EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::EditAddressDialog),
mapper(nullptr),
mode(_mode),
Expand Down
3 changes: 3 additions & 0 deletions src/qt/guiutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ namespace GUIUtil
void setIcon(QAbstractButton* button, const QString& strIcon, ThemedColor color, ThemedColor colorAlternative, const QSize& size);
void setIcon(QAbstractButton* button, const QString& strIcon, ThemedColor color = ThemedColor::BLUE, const QSize& size = QSize(BUTTON_ICONSIZE, BUTTON_ICONSIZE));

// Use this flags to prevent a "What's This" button in the title bar of the dialog on Windows.
constexpr auto dialog_flags = Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;

// Create human-readable string from date
QString dateTimeStr(const QDateTime &datetime);
QString dateTimeStr(qint64 nTime);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/intro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int GetPruneTargetGB()
} // namespace

Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_size_gb) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::Intro),
thread(nullptr),
signalled(false),
Expand Down
2 changes: 1 addition & 1 deletion src/qt/openuridialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <QUrl>

OpenURIDialog::OpenURIDialog(QWidget *parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::OpenURIDialog)
{
ui->setupUi(this);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <QTimer>

OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::OptionsDialog),
model(nullptr),
mapper(nullptr),
Expand Down
2 changes: 1 addition & 1 deletion src/qt/psbtoperationsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


PSBTOperationsDialog::PSBTOperationsDialog(
QWidget* parent, WalletModel* wallet_model, ClientModel* client_model) : QDialog(parent),
QWidget* parent, WalletModel* wallet_model, ClientModel* client_model) : QDialog(parent, GUIUtil::dialog_flags),
m_ui(new Ui::PSBTOperationsDialog),
m_wallet_model(wallet_model),
m_client_model(client_model)
Expand Down
2 changes: 1 addition & 1 deletion src/qt/qrdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#endif

QRDialog::QRDialog(QWidget *parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::QRDialog)
{
ui->setupUi(this);
Expand Down
3 changes: 2 additions & 1 deletion src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <qt/forms/ui_receivecoinsdialog.h>

#include <qt/addresstablemodel.h>
#include <qt/guiutil.h>
#include <qt/optionsmodel.h>
#include <qt/receiverequestdialog.h>
#include <qt/recentrequeststablemodel.h>
Expand All @@ -18,7 +19,7 @@
#include <QTextDocument>

ReceiveCoinsDialog::ReceiveCoinsDialog(QWidget* parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::ReceiveCoinsDialog),
model(nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/qt/receiverequestdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#endif

ReceiveRequestDialog::ReceiveRequestDialog(QWidget *parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::ReceiveRequestDialog),
model(nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int getIndexForConfTarget(int target) {
}

SendCoinsDialog::SendCoinsDialog(bool _fCoinJoin, QWidget* parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::SendCoinsDialog),
clientModel(nullptr),
model(nullptr),
Expand Down
2 changes: 1 addition & 1 deletion src/qt/signverifymessagedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <QClipboard>

SignVerifyMessageDialog::SignVerifyMessageDialog(QWidget* parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::SignVerifyMessageDialog),
model(nullptr),
pageButtons(nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/qt/transactiondescdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <QString>

TransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *parent) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::TransactionDescDialog)
{
ui->setupUi(this);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/utilitydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

/** "Help message" or "About" dialog box */
HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, HelpMode helpMode) :
QDialog(parent),
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::HelpMessageDialog)
{
ui->setupUi(this);
Expand Down

0 comments on commit df896df

Please sign in to comment.