Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: Update connect statements to conform to Qt 5 standard #2281

Merged
merged 11 commits into from
Aug 20, 2021
30 changes: 8 additions & 22 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,16 @@ void BitcoinGUI::createActions()
boincAction->setStatusTip(tr("Gridcoin rewards distributed computing with BOINC"));
boincAction->setMenuRole(QAction::TextHeuristicRole);

connect(overviewAction, &QAction::triggered, this, &BitcoinGUI::showNormalIfMinimizedDefault);
// We use lambdas here to squash the argument to showNormalIfMinized.
connect(overviewAction, &QAction::triggered, this, [this]{ this->showNormalIfMinimized(); });
connect(overviewAction, &QAction::triggered, this, &BitcoinGUI::gotoOverviewPage);
connect(sendCoinsAction, &QAction::triggered, this, &BitcoinGUI::showNormalIfMinimizedDefault);
connect(sendCoinsAction, &QAction::triggered, this, [this]{ this->showNormalIfMinimized(); });
connect(sendCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoSendCoinsPage);
connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::showNormalIfMinimizedDefault);
connect(receiveCoinsAction, &QAction::triggered, this, [this]{ this->showNormalIfMinimized(); });
connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
connect(historyAction, &QAction::triggered, this, &BitcoinGUI::showNormalIfMinimizedDefault);
connect(historyAction, &QAction::triggered, this, [this]{ this->showNormalIfMinimized(); });
connect(historyAction, &QAction::triggered, this, &BitcoinGUI::gotoHistoryPage);
connect(addressBookAction, &QAction::triggered, this, &BitcoinGUI::showNormalIfMinimizedDefault);
connect(addressBookAction, &QAction::triggered, this, [this]{ this->showNormalIfMinimized(); });
connect(addressBookAction, &QAction::triggered, this, &BitcoinGUI::gotoAddressBookPage);
connect(votingAction, &QAction::triggered, this, &BitcoinGUI::gotoVotingPage);

Expand Down Expand Up @@ -417,8 +418,8 @@ void BitcoinGUI::createActions()
connect(changePassphraseAction, &QAction::triggered, this, &BitcoinGUI::changePassphrase);
connect(unlockWalletAction, &QAction::triggered, this, &BitcoinGUI::unlockWallet);
connect(lockWalletAction, &QAction::triggered, this, &BitcoinGUI::lockWallet);
connect(signMessageAction, &QAction::triggered, this, &BitcoinGUI::gotoSignMessageTabDefault);
connect(verifyMessageAction, &QAction::triggered, this, &BitcoinGUI::gotoVerifyMesageTabDefault);
connect(signMessageAction, &QAction::triggered, this, [this]{ this->gotoSignMessageTab(QString {}); });
connect(verifyMessageAction, &QAction::triggered, this, [this]{ this->gotoVerifyMessageTab(QString {}); });
connect(diagnosticsAction, &QAction::triggered, this, &BitcoinGUI::diagnosticsClicked);
connect(snapshotAction, &QAction::triggered, this, &BitcoinGUI::snapshotClicked);
connect(resetblockchainAction, &QAction::triggered, this, &BitcoinGUI::resetblockchainClicked);
Expand Down Expand Up @@ -1406,11 +1407,6 @@ void BitcoinGUI::gotoSignMessageTab(QString addr)
signVerifyMessageDialog->setAddress_SM(addr);
}

void BitcoinGUI::gotoSignMessageTabDefault()
{
gotoSignMessageTab(QString {});
}

void BitcoinGUI::gotoVerifyMessageTab(QString addr)
{
// call show() in showTab_VM()
Expand All @@ -1420,11 +1416,6 @@ void BitcoinGUI::gotoVerifyMessageTab(QString addr)
signVerifyMessageDialog->setAddress_VM(addr);
}

void BitcoinGUI::gotoVerifyMesageTabDefault()
{
gotoVerifyMessageTab(QString {});
}

void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
{
// Accept only URIs
Expand Down Expand Up @@ -1587,11 +1578,6 @@ void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
hide();
}

void BitcoinGUI::showNormalIfMinimizedDefault()
{
showNormalIfMinimized(false);
}

void BitcoinGUI::toggleHidden()
jamescowens marked this conversation as resolved.
Show resolved Hide resolved
{
showNormalIfMinimized(true);
Expand Down
9 changes: 0 additions & 9 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,10 @@ private slots:
void gotoSendCoinsPage();
/** Switch to voting page */
void gotoVotingPage();

/** Show Sign/Verify Message dialog and switch to sign message tab */
void gotoSignMessageTab(QString addr = "");
/** Show Sign/Verify Message dialog and switch to sign message tab with no address */
void gotoSignMessageTabDefault();

/** Show Sign/Verify Message dialog and switch to verify message tab */
void gotoVerifyMessageTab(QString addr = "");
/** Show Sign/Verify Message dialog and switch to verify message tab with no address */
void gotoVerifyMesageTabDefault();

/** Show configuration dialog */
void optionsClicked();
/** Switch the active light/dark theme */
Expand Down Expand Up @@ -276,8 +269,6 @@ private slots:
/** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */
void showNormalIfMinimized(bool fToggleHidden = false);
/** Show window if hidden, unminimize when minimized, rise when obscured */
void showNormalIfMinimizedDefault();
/** simply calls showNormalIfMinimized(true) for use in connect */
void toggleHidden();

void updateWeight();
Expand Down