mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-21 17:42:37 +02:00
Merge #18036: gui: Break trivial circular dependencies
3aee10b80b
gui: Drop ShutdownWindow dependency to BitcoinGUI (João Barbosa)61eb058cc1
gui: Drop BanTableModel dependency to ClientModel (João Barbosa) Pull request description: `ShutdownWindow::showShutdownWindow` just needs a widget to center the shutdown window and to borrow its title. ACKs for top commit: hebasto: ACK3aee10b80b
, since previous review only suggested change `QWidget` --> `QMainWindow` jonasschnelli: utACK3aee10b80b
Tree-SHA512: e15cb6ee274730bd071d3d97b540c5059e5c655248d69a37c3fd00f2aacc6cfcb36b9a65755718027e15482ec8e5e85534c1dc13d0ddb4e0680df03fbf6571f2
This commit is contained in:
commit
cadb9d3342
@ -6,12 +6,13 @@
|
|||||||
|
|
||||||
#include <interfaces/node.h>
|
#include <interfaces/node.h>
|
||||||
#include <net_types.h> // For banmap_t
|
#include <net_types.h> // For banmap_t
|
||||||
#include <qt/clientmodel.h>
|
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDateTime>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QModelIndex>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
bool BannedNodeLessThan::operator()(const CCombinedBan& left, const CCombinedBan& right) const
|
bool BannedNodeLessThan::operator()(const CCombinedBan& left, const CCombinedBan& right) const
|
||||||
{
|
{
|
||||||
@ -78,10 +79,9 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
BanTableModel::BanTableModel(interfaces::Node& node, ClientModel *parent) :
|
BanTableModel::BanTableModel(interfaces::Node& node, QObject* parent) :
|
||||||
QAbstractTableModel(parent),
|
QAbstractTableModel(parent),
|
||||||
m_node(node),
|
m_node(node)
|
||||||
clientModel(parent)
|
|
||||||
{
|
{
|
||||||
columns << tr("IP/Netmask") << tr("Banned Until");
|
columns << tr("IP/Netmask") << tr("Banned Until");
|
||||||
priv.reset(new BanTablePriv());
|
priv.reset(new BanTablePriv());
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
class ClientModel;
|
|
||||||
class BanTablePriv;
|
class BanTablePriv;
|
||||||
|
|
||||||
namespace interfaces {
|
namespace interfaces {
|
||||||
@ -45,7 +44,7 @@ class BanTableModel : public QAbstractTableModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BanTableModel(interfaces::Node& node, ClientModel *parent = nullptr);
|
explicit BanTableModel(interfaces::Node& node, QObject* parent);
|
||||||
~BanTableModel();
|
~BanTableModel();
|
||||||
void startAutoRefresh();
|
void startAutoRefresh();
|
||||||
void stopAutoRefresh();
|
void stopAutoRefresh();
|
||||||
@ -72,7 +71,6 @@ public Q_SLOTS:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
interfaces::Node& m_node;
|
interfaces::Node& m_node;
|
||||||
ClientModel *clientModel;
|
|
||||||
QStringList columns;
|
QStringList columns;
|
||||||
std::unique_ptr<BanTablePriv> priv;
|
std::unique_ptr<BanTablePriv> priv;
|
||||||
};
|
};
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
|
|
||||||
#include <qt/forms/ui_helpmessagedialog.h>
|
#include <qt/forms/ui_helpmessagedialog.h>
|
||||||
|
|
||||||
#include <qt/bitcoingui.h>
|
|
||||||
|
|
||||||
#include <clientversion.h>
|
#include <clientversion.h>
|
||||||
#include <init.h>
|
#include <init.h>
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
@ -21,9 +19,10 @@
|
|||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QMainWindow>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QTextTable>
|
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
|
#include <QTextTable>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
/** "Help message" or "About" dialog box */
|
/** "Help message" or "About" dialog box */
|
||||||
@ -144,10 +143,9 @@ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f):
|
|||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *ShutdownWindow::showShutdownWindow(BitcoinGUI *window)
|
QWidget* ShutdownWindow::showShutdownWindow(QMainWindow* window)
|
||||||
{
|
{
|
||||||
if (!window)
|
assert(window != nullptr);
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
// Show a simple window indicating shutdown status
|
// Show a simple window indicating shutdown status
|
||||||
QWidget *shutdownWindow = new ShutdownWindow();
|
QWidget *shutdownWindow = new ShutdownWindow();
|
||||||
|
@ -6,9 +6,11 @@
|
|||||||
#define BITCOIN_QT_UTILITYDIALOG_H
|
#define BITCOIN_QT_UTILITYDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QObject>
|
#include <QWidget>
|
||||||
|
|
||||||
class BitcoinGUI;
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QMainWindow;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace interfaces {
|
namespace interfaces {
|
||||||
class Node;
|
class Node;
|
||||||
@ -46,7 +48,7 @@ class ShutdownWindow : public QWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ShutdownWindow(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::Widget);
|
explicit ShutdownWindow(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::Widget);
|
||||||
static QWidget *showShutdownWindow(BitcoinGUI *window);
|
static QWidget* showShutdownWindow(QMainWindow* window);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
@ -13,8 +13,6 @@ EXPECTED_CIRCULAR_DEPENDENCIES=(
|
|||||||
"index/txindex -> validation -> index/txindex"
|
"index/txindex -> validation -> index/txindex"
|
||||||
"policy/fees -> txmempool -> policy/fees"
|
"policy/fees -> txmempool -> policy/fees"
|
||||||
"qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel"
|
"qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel"
|
||||||
"qt/bantablemodel -> qt/clientmodel -> qt/bantablemodel"
|
|
||||||
"qt/bitcoingui -> qt/utilitydialog -> qt/bitcoingui"
|
|
||||||
"qt/bitcoingui -> qt/walletframe -> qt/bitcoingui"
|
"qt/bitcoingui -> qt/walletframe -> qt/bitcoingui"
|
||||||
"qt/bitcoingui -> qt/walletview -> qt/bitcoingui"
|
"qt/bitcoingui -> qt/walletview -> qt/bitcoingui"
|
||||||
"qt/clientmodel -> qt/peertablemodel -> qt/clientmodel"
|
"qt/clientmodel -> qt/peertablemodel -> qt/clientmodel"
|
||||||
|
Loading…
Reference in New Issue
Block a user