Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ QT_MOC_CPP = \
qt/moc_coincontroldialog.cpp \
qt/moc_coincontroltreewidget.cpp \
qt/moc_csvmodelwriter.cpp \
qt/moc_dashb0rd.cpp \
qt/moc_dashb0rdpage.cpp \
qt/moc_editaddressdialog.cpp \
qt/moc_guiutil.cpp \
qt/moc_intro.cpp \
Expand All @@ -131,6 +133,7 @@ QT_MOC_CPP = \
qt/moc_sendcoinsdialog.cpp \
qt/moc_sendcoinsentry.cpp \
qt/moc_signverifymessagedialog.cpp \
qt/moc_sparklinewidget.cpp \
qt/moc_splashscreen.cpp \
qt/moc_trafficgraphwidget.cpp \
qt/moc_transactiondesc.cpp \
Expand Down Expand Up @@ -175,6 +178,8 @@ BITCOIN_QT_H = \
qt/coincontroldialog.h \
qt/coincontroltreewidget.h \
qt/csvmodelwriter.h \
qt/dashb0rd.h \
qt/dashb0rdpage.h \
qt/editaddressdialog.h \
qt/guiconstants.h \
qt/guiutil.h \
Expand All @@ -201,6 +206,7 @@ BITCOIN_QT_H = \
qt/sendcoinsdialog.h \
qt/sendcoinsentry.h \
qt/signverifymessagedialog.h \
qt/sparklinewidget.h \
qt/splashscreen.h \
qt/trafficgraphwidget.h \
qt/transactiondesc.h \
Expand Down Expand Up @@ -286,6 +292,8 @@ BITCOIN_QT_BASE_CPP = \
qt/bitcoinunits.cpp \
qt/clientmodel.cpp \
qt/csvmodelwriter.cpp \
qt/dashb0rd.cpp \
qt/dashb0rdpage.cpp \
qt/guiutil.cpp \
qt/intro.cpp \
qt/modaloverlay.cpp \
Expand All @@ -298,6 +306,7 @@ BITCOIN_QT_BASE_CPP = \
qt/qvalidatedlineedit.cpp \
qt/qvaluecombobox.cpp \
qt/rpcconsole.cpp \
qt/sparklinewidget.cpp \
qt/splashscreen.cpp \
qt/trafficgraphwidget.cpp \
qt/utilitydialog.cpp \
Expand Down
17 changes: 17 additions & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
appMenuBar(0),
overviewAction(0),
historyAction(0),
dashb0rdAction(0),
quitAction(0),
sendCoinsAction(0),
sendCoinsMenuAction(0),
Expand Down Expand Up @@ -327,6 +328,13 @@ void BitcoinGUI::createActions()
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(historyAction);

dashb0rdAction = new QAction(platformStyle->SingleColorIcon(":/icons/about"), tr("&Dashb0rd"), this);
dashb0rdAction->setStatusTip(tr("View dashboard metrics"));
dashb0rdAction->setToolTip(dashb0rdAction->statusTip());
dashb0rdAction->setCheckable(true);
dashb0rdAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(dashb0rdAction);

#ifdef ENABLE_WALLET
// 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.
Expand All @@ -342,6 +350,8 @@ void BitcoinGUI::createActions()
connect(receiveCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(dashb0rdAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(dashb0rdAction, SIGNAL(triggered()), this, SLOT(gotoDashb0rdPage()));
#endif // ENABLE_WALLET

quitAction = new QAction(platformStyle->TextColorIcon(":/icons/quit"), tr("E&xit"), this);
Expand Down Expand Up @@ -484,6 +494,7 @@ void BitcoinGUI::createToolBars()
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(dashb0rdAction);
overviewAction->setChecked(true);
}
}
Expand Down Expand Up @@ -714,6 +725,12 @@ void BitcoinGUI::gotoHistoryPage()
if (walletFrame) walletFrame->gotoHistoryPage();
}

void BitcoinGUI::gotoDashb0rdPage()
{
dashb0rdAction->setChecked(true);
if (walletFrame) walletFrame->gotoDashb0rdPage();
}

void BitcoinGUI::gotoReceiveCoinsPage()
{
receiveCoinsAction->setChecked(true);
Expand Down
3 changes: 3 additions & 0 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class BitcoinGUI : public QMainWindow
QMenuBar *appMenuBar;
QAction *overviewAction;
QAction *historyAction;
QAction *dashb0rdAction;
QAction *quitAction;
QAction *sendCoinsAction;
QAction *sendCoinsMenuAction;
Expand Down Expand Up @@ -200,6 +201,8 @@ private Q_SLOTS:
void gotoOverviewPage();
/** Switch to history (transactions) page */
void gotoHistoryPage();
/** Switch to dashboard page */
void gotoDashb0rdPage();
/** Switch to receive coins page */
void gotoReceiveCoinsPage();
/** Switch to send coins page */
Expand Down
41 changes: 41 additions & 0 deletions src/qt/dashb0rd.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) 2011-2016 The Bitcoin Core developers
// Copyright (c) 2021-2026 The Dogecoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "dashb0rd.h"

#include "dashb0rdpage.h"

#include <QVBoxLayout>

Dashb0rd::Dashb0rd(const PlatformStyle* platformStyle, QWidget* parent)
: QWidget(parent),
m_platformStyle(platformStyle),
m_page(nullptr)
{
// Embed the dashboard page directly so this wrapper can forward model updates.
QVBoxLayout* root = new QVBoxLayout(this);
root->setContentsMargins(0, 0, 0, 0);
root->setSpacing(0);

// Constructor order for Dashb0rdPage is (platformStyle, parent).
m_page = new Dashb0rdPage(m_platformStyle, this);
root->addWidget(m_page);
}

Dashb0rd::~Dashb0rd()
{
}

void Dashb0rd::setClientModel(ClientModel* model)
{
// Forward the shared client model to the underlying dashboard page.
if (m_page) m_page->setClientModel(model);
}

void Dashb0rd::setWalletModel(WalletModel* model)
{
// Forward the wallet model so page-level wallet features can use it.
if (m_page) m_page->setWalletModel(model);
}
32 changes: 32 additions & 0 deletions src/qt/dashb0rd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) 2011-2016 The Bitcoin Core developers
// Copyright (c) 2021-2026 The Dogecoin 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_DASHB0RD_H
#define BITCOIN_QT_DASHB0RD_H

#include <QWidget>

class ClientModel;
class WalletModel;
class PlatformStyle;
class Dashb0rdPage;

class Dashb0rd : public QWidget
{
Q_OBJECT

public:
explicit Dashb0rd(const PlatformStyle* platformStyle, QWidget* parent = nullptr);
~Dashb0rd();

void setClientModel(ClientModel* model);
void setWalletModel(WalletModel* model);

private:
const PlatformStyle* m_platformStyle;
Dashb0rdPage* m_page;
};

#endif // BITCOIN_QT_DASHB0RD_H
Loading
Loading