From 4f3851a722d7c3de451a5c05effebccfe6d2b380 Mon Sep 17 00:00:00 2001
From: Shafil Alam <36016500+alamshafil@users.noreply.github.com>
Date: Mon, 14 Jun 2021 00:54:13 -0400
Subject: [PATCH] Add tips section
Add more tips
Allow QT translations
Fix tips
---
src/qt/forms/overviewpage.ui | 47 +++++++++++++++++++++++++++++++++++-
src/qt/overviewpage.cpp | 22 +++++++++++++++++
src/qt/overviewpage.h | 1 +
3 files changed, 69 insertions(+), 1 deletion(-)
diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui
index 9c8992d63..2003585a3 100644
--- a/src/qt/forms/overviewpage.ui
+++ b/src/qt/forms/overviewpage.ui
@@ -549,12 +549,57 @@
+ -
+
+
+ 0
+
+
-
+
+
+
+ 75
+ true
+
+
+
+ Helpful tip of the day:
+
+
+
+ -
+
+
+ Tip
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Maximum
+
+
+
+ 20
+ 40
+
+
+
+
+
+
-
+
+
+
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index ba344f4db..cd879002e 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -129,6 +129,9 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
ui->labelTransactionsStatus->setIcon(icon);
ui->labelWalletStatus->setIcon(icon);
+ // Set tip of the day
+ UpdateTip();
+
// Recent transactions
ui->listTransactions->setItemDelegate(txdelegate);
ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE));
@@ -143,6 +146,25 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
connect(ui->labelTransactionsStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
}
+void OverviewPage::UpdateTip()
+{
+ QStringList tips = {
+ tr("Never share your wallet.dat file/your private key with anyone"),
+ tr("For more advanced settings use the console in 'Help' -> 'Debug Window'"),
+ tr("Encrypt your wallet with a strong passphrase for maximum security"),
+ tr("Make sure to keep your wallet updated."),
+ tr("Backup your private key to recover your coins, using 'File' > 'Backup Wallet'"),
+ tr("Always do your own research before using an external cryptocurrency service"),
+ tr("Never share your private key to an untrustworthy person."),
+ tr("Who own the private keys own the coins."),
+ tr("To see ongoing development and contribute, checkout Dogecoin repository on GitHub!"),
+ tr("Services that claim to double your dogecoins are always ponzi schemes")
+ };
+
+ int i = rand() % tips.length();
+ ui->label_tip->setText(tips[i]);
+}
+
void OverviewPage::handleTransactionClicked(const QModelIndex &index)
{
if(filter)
diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h
index d76b651ce..6c163ba3a 100644
--- a/src/qt/overviewpage.h
+++ b/src/qt/overviewpage.h
@@ -36,6 +36,7 @@ public:
void setClientModel(ClientModel *clientModel);
void setWalletModel(WalletModel *walletModel);
void showOutOfSyncWarning(bool fShow);
+ void UpdateTip();
public Q_SLOTS:
void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,