mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-04 08:22:36 +02:00
GUI: Add a new tab for pairing
This commit is contained in:
parent
2649e679a7
commit
87d1248b71
@ -64,6 +64,7 @@ QT_MOC_CPP = \
|
|||||||
qt/moc_optionsdialog.cpp \
|
qt/moc_optionsdialog.cpp \
|
||||||
qt/moc_optionsmodel.cpp \
|
qt/moc_optionsmodel.cpp \
|
||||||
qt/moc_overviewpage.cpp \
|
qt/moc_overviewpage.cpp \
|
||||||
|
qt/moc_pairingpage.cpp \
|
||||||
qt/moc_peertablemodel.cpp \
|
qt/moc_peertablemodel.cpp \
|
||||||
qt/moc_peertablesortproxy.cpp \
|
qt/moc_peertablesortproxy.cpp \
|
||||||
qt/moc_paymentserver.cpp \
|
qt/moc_paymentserver.cpp \
|
||||||
@ -140,6 +141,7 @@ BITCOIN_QT_H = \
|
|||||||
qt/optionsdialog.h \
|
qt/optionsdialog.h \
|
||||||
qt/optionsmodel.h \
|
qt/optionsmodel.h \
|
||||||
qt/overviewpage.h \
|
qt/overviewpage.h \
|
||||||
|
qt/pairingpage.h \
|
||||||
qt/paymentserver.h \
|
qt/paymentserver.h \
|
||||||
qt/peertablemodel.h \
|
qt/peertablemodel.h \
|
||||||
qt/peertablesortproxy.h \
|
qt/peertablesortproxy.h \
|
||||||
@ -265,6 +267,7 @@ BITCOIN_QT_WALLET_CPP = \
|
|||||||
qt/editaddressdialog.cpp \
|
qt/editaddressdialog.cpp \
|
||||||
qt/openuridialog.cpp \
|
qt/openuridialog.cpp \
|
||||||
qt/overviewpage.cpp \
|
qt/overviewpage.cpp \
|
||||||
|
qt/pairingpage.cpp \
|
||||||
qt/paymentserver.cpp \
|
qt/paymentserver.cpp \
|
||||||
qt/psbtoperationsdialog.cpp \
|
qt/psbtoperationsdialog.cpp \
|
||||||
qt/qrimagewidget.cpp \
|
qt/qrimagewidget.cpp \
|
||||||
|
@ -280,6 +280,13 @@ void BitcoinGUI::createActions()
|
|||||||
historyAction->setShortcut(QKeySequence(QStringLiteral("Alt+4")));
|
historyAction->setShortcut(QKeySequence(QStringLiteral("Alt+4")));
|
||||||
tabGroup->addAction(historyAction);
|
tabGroup->addAction(historyAction);
|
||||||
|
|
||||||
|
m_action_pairing = new QAction(platformStyle->SingleColorIcon(":/icons/connect_1"), tr("&Pairing"), this);
|
||||||
|
m_action_pairing->setStatusTip(tr("Pair other software or devices with your node"));
|
||||||
|
m_action_pairing->setToolTip(m_action_pairing->statusTip());
|
||||||
|
m_action_pairing->setCheckable(true);
|
||||||
|
m_action_pairing->setShortcut(QKeySequence(QStringLiteral("Alt+5")));
|
||||||
|
tabGroup->addAction(m_action_pairing);
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
// These showNormalIfMinimized are needed because Send Coins and Receive Coins
|
// These showNormalIfMinimized are needed because Send Coins and Receive Coins
|
||||||
// can be triggered from the tray menu, and need to show the GUI to be useful.
|
// can be triggered from the tray menu, and need to show the GUI to be useful.
|
||||||
@ -291,6 +298,8 @@ void BitcoinGUI::createActions()
|
|||||||
connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
|
connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
|
||||||
connect(historyAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
connect(historyAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
||||||
connect(historyAction, &QAction::triggered, this, &BitcoinGUI::gotoHistoryPage);
|
connect(historyAction, &QAction::triggered, this, &BitcoinGUI::gotoHistoryPage);
|
||||||
|
connect(m_action_pairing, &QAction::triggered, this, [this]{ showNormalIfMinimized(); });
|
||||||
|
connect(m_action_pairing, &QAction::triggered, this, &BitcoinGUI::gotoPairingPage);
|
||||||
#endif // ENABLE_WALLET
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
quitAction = new QAction(tr("E&xit"), this);
|
quitAction = new QAction(tr("E&xit"), this);
|
||||||
@ -615,6 +624,7 @@ void BitcoinGUI::createToolBars()
|
|||||||
toolbar->addAction(sendCoinsAction);
|
toolbar->addAction(sendCoinsAction);
|
||||||
toolbar->addAction(receiveCoinsAction);
|
toolbar->addAction(receiveCoinsAction);
|
||||||
toolbar->addAction(historyAction);
|
toolbar->addAction(historyAction);
|
||||||
|
toolbar->addAction(m_action_pairing);
|
||||||
overviewAction->setChecked(true);
|
overviewAction->setChecked(true);
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
@ -839,7 +849,6 @@ void BitcoinGUI::removeAllWallets()
|
|||||||
|
|
||||||
void BitcoinGUI::setWalletActionsEnabled(bool enabled)
|
void BitcoinGUI::setWalletActionsEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
overviewAction->setEnabled(enabled);
|
|
||||||
sendCoinsAction->setEnabled(enabled);
|
sendCoinsAction->setEnabled(enabled);
|
||||||
receiveCoinsAction->setEnabled(enabled);
|
receiveCoinsAction->setEnabled(enabled);
|
||||||
historyAction->setEnabled(enabled);
|
historyAction->setEnabled(enabled);
|
||||||
@ -1022,6 +1031,12 @@ void BitcoinGUI::gotoOverviewPage()
|
|||||||
if (walletFrame) walletFrame->gotoOverviewPage();
|
if (walletFrame) walletFrame->gotoOverviewPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BitcoinGUI::gotoPairingPage()
|
||||||
|
{
|
||||||
|
m_action_pairing->setChecked(true);
|
||||||
|
if (walletFrame) walletFrame->gotoPairingPage();
|
||||||
|
}
|
||||||
|
|
||||||
void BitcoinGUI::gotoHistoryPage()
|
void BitcoinGUI::gotoHistoryPage()
|
||||||
{
|
{
|
||||||
historyAction->setChecked(true);
|
historyAction->setChecked(true);
|
||||||
|
@ -135,6 +135,7 @@ private:
|
|||||||
QMenuBar* appMenuBar = nullptr;
|
QMenuBar* appMenuBar = nullptr;
|
||||||
QToolBar* appToolBar = nullptr;
|
QToolBar* appToolBar = nullptr;
|
||||||
QAction* overviewAction = nullptr;
|
QAction* overviewAction = nullptr;
|
||||||
|
QAction* m_action_pairing = nullptr;
|
||||||
QAction* historyAction = nullptr;
|
QAction* historyAction = nullptr;
|
||||||
QAction* quitAction = nullptr;
|
QAction* quitAction = nullptr;
|
||||||
QAction* sendCoinsAction = nullptr;
|
QAction* sendCoinsAction = nullptr;
|
||||||
@ -283,6 +284,8 @@ public Q_SLOTS:
|
|||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
/** Switch to overview (home) page */
|
/** Switch to overview (home) page */
|
||||||
void gotoOverviewPage();
|
void gotoOverviewPage();
|
||||||
|
/** Switch to pairing page */
|
||||||
|
void gotoPairingPage();
|
||||||
/** Switch to history (transactions) page */
|
/** Switch to history (transactions) page */
|
||||||
void gotoHistoryPage();
|
void gotoHistoryPage();
|
||||||
/** Switch to receive coins page */
|
/** Switch to receive coins page */
|
||||||
|
10
src/qt/pairingpage.cpp
Normal file
10
src/qt/pairingpage.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Copyright (c) 2018 The Bitcoin Core developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#include <qt/pairingpage.h>
|
||||||
|
|
||||||
|
PairingPage::PairingPage(QWidget *parent) :
|
||||||
|
QWidget(parent)
|
||||||
|
{
|
||||||
|
}
|
18
src/qt/pairingpage.h
Normal file
18
src/qt/pairingpage.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) 2018 The Bitcoin Core developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#ifndef BITCOIN_QT_PAIRINGPAGE_H
|
||||||
|
#define BITCOIN_QT_PAIRINGPAGE_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class PairingPage : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit PairingPage(QWidget *parent = nullptr);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BITCOIN_QT_PAIRINGPAGE_H
|
@ -2,6 +2,7 @@
|
|||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#include <qt/pairingpage.h>
|
||||||
#include <qt/walletframe.h>
|
#include <qt/walletframe.h>
|
||||||
|
|
||||||
#include <node/interface_ui.h>
|
#include <node/interface_ui.h>
|
||||||
@ -55,6 +56,9 @@ WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, QWidget* parent)
|
|||||||
no_wallet_group->setLayout(no_wallet_layout);
|
no_wallet_group->setLayout(no_wallet_layout);
|
||||||
|
|
||||||
walletStack->addWidget(no_wallet_group);
|
walletStack->addWidget(no_wallet_group);
|
||||||
|
|
||||||
|
m_page_pairing = new PairingPage(this);
|
||||||
|
m_global_stack->addWidget(m_page_pairing);
|
||||||
}
|
}
|
||||||
|
|
||||||
WalletFrame::~WalletFrame() = default;
|
WalletFrame::~WalletFrame() = default;
|
||||||
@ -158,6 +162,11 @@ void WalletFrame::gotoOverviewPage()
|
|||||||
m_global_stack->setCurrentWidget(walletStack);
|
m_global_stack->setCurrentWidget(walletStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WalletFrame::gotoPairingPage()
|
||||||
|
{
|
||||||
|
m_global_stack->setCurrentWidget(m_page_pairing);
|
||||||
|
}
|
||||||
|
|
||||||
void WalletFrame::gotoHistoryPage()
|
void WalletFrame::gotoHistoryPage()
|
||||||
{
|
{
|
||||||
QMap<WalletModel*, WalletView*>::const_iterator i;
|
QMap<WalletModel*, WalletView*>::const_iterator i;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
class ClientModel;
|
class ClientModel;
|
||||||
|
class PairingPage;
|
||||||
class PlatformStyle;
|
class PlatformStyle;
|
||||||
class SendCoinsRecipient;
|
class SendCoinsRecipient;
|
||||||
class WalletModel;
|
class WalletModel;
|
||||||
@ -57,6 +58,8 @@ private:
|
|||||||
ClientModel *clientModel;
|
ClientModel *clientModel;
|
||||||
QMap<WalletModel*, WalletView*> mapWalletViews;
|
QMap<WalletModel*, WalletView*> mapWalletViews;
|
||||||
|
|
||||||
|
PairingPage *m_page_pairing;
|
||||||
|
|
||||||
bool bOutOfSync;
|
bool bOutOfSync;
|
||||||
|
|
||||||
const PlatformStyle *platformStyle;
|
const PlatformStyle *platformStyle;
|
||||||
@ -70,6 +73,8 @@ public:
|
|||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
/** Switch to overview (home) page */
|
/** Switch to overview (home) page */
|
||||||
void gotoOverviewPage();
|
void gotoOverviewPage();
|
||||||
|
/** Switch to pairing page */
|
||||||
|
void gotoPairingPage();
|
||||||
/** Switch to history (transactions) page */
|
/** Switch to history (transactions) page */
|
||||||
void gotoHistoryPage();
|
void gotoHistoryPage();
|
||||||
/** Switch to receive coins page */
|
/** Switch to receive coins page */
|
||||||
|
Loading…
Reference in New Issue
Block a user