1818#include < fstream>
1919#include < string>
2020
21+ #include < Qt>
2122#include < QApplication>
2223#include < QClipboard>
23- #include < QGroupBox>
2424#include < QHBoxLayout>
2525#include < QLabel>
2626#include < QPushButton>
2727#include < QVBoxLayout>
28+ #include < QWidget>
2829
2930WalletFrame::WalletFrame (const PlatformStyle* _platformStyle, QWidget* parent)
3031 : QFrame(parent),
@@ -39,9 +40,17 @@ WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, QWidget* parent)
3940 walletFrameLayout->addWidget (walletStack);
4041
4142 // hbox for no wallet
42- QGroupBox * no_wallet_group = new QGroupBox (walletStack);
43+ QWidget * no_wallet_group = new QWidget (walletStack);
4344 QVBoxLayout* no_wallet_layout = new QVBoxLayout (no_wallet_group);
4445
46+ m_label_alerts = new QLabel (this );
47+ m_label_alerts->setVisible (false );
48+ m_label_alerts->setStyleSheet (" QLabel { background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #F0D0A0, stop:1 #F8D488); color:#000000; }" );
49+ m_label_alerts->setWordWrap (true );
50+ m_label_alerts->setMargin (3 );
51+ m_label_alerts->setTextInteractionFlags (Qt::TextSelectableByMouse);
52+ no_wallet_layout->addWidget (m_label_alerts, 0 , Qt::AlignTop);
53+
4554 QLabel *noWallet = new QLabel (tr (" No wallet has been loaded.\n Go to File > Open Wallet to load a wallet.\n - OR -" ));
4655 noWallet->setAlignment (Qt::AlignCenter);
4756 no_wallet_layout->addWidget (noWallet, 0 , Qt::AlignHCenter | Qt::AlignBottom);
@@ -66,6 +75,11 @@ void WalletFrame::setClientModel(ClientModel *_clientModel)
6675 for (auto i = mapWalletViews.constBegin (); i != mapWalletViews.constEnd (); ++i) {
6776 i.value ()->setClientModel (_clientModel);
6877 }
78+
79+ if (_clientModel) {
80+ connect (_clientModel, &ClientModel::alertsChanged, this , &WalletFrame::updateAlerts);
81+ updateAlerts (_clientModel->getStatusBarWarnings ());
82+ }
6983}
7084
7185bool WalletFrame::addView (WalletView* walletView)
@@ -276,6 +290,12 @@ WalletView* WalletFrame::currentWalletView() const
276290 return qobject_cast<WalletView*>(walletStack->currentWidget ());
277291}
278292
293+ void WalletFrame::updateAlerts (const QString &warnings)
294+ {
295+ m_label_alerts->setVisible (!warnings.isEmpty ());
296+ m_label_alerts->setText (warnings);
297+ }
298+
279299WalletModel* WalletFrame::currentWalletModel () const
280300{
281301 WalletView* wallet_view = currentWalletView ();
0 commit comments