diff options
| author | Patrick Lodder <[email protected]> | 2021-07-22 22:44:32 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-22 22:44:32 +0200 |
| commit | dad797d01b134a6dd663b4e749093da3ef09fa40 (patch) | |
| tree | c0da1caa7e8f678f6e81598b51509bcd6f407d79 /src | |
| parent | Merge pull request #2413 from dogecoin/revert-2342-issue-2340-depends-build-d... (diff) | |
| parent | Add tips section (diff) | |
| download | discoin-dad797d01b134a6dd663b4e749093da3ef09fa40.tar.xz discoin-dad797d01b134a6dd663b4e749093da3ef09fa40.zip | |
Merge pull request #2308 from alamshafil/doge-tips
[QT] Add tips section
Diffstat (limited to 'src')
| -rw-r--r-- | src/qt/forms/overviewpage.ui | 47 | ||||
| -rw-r--r-- | src/qt/overviewpage.cpp | 22 | ||||
| -rw-r--r-- | src/qt/overviewpage.h | 1 |
3 files changed, 69 insertions, 1 deletions
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 @@ </property> </spacer> </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_tip_header"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Helpful tip of the day:</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_tip"> + <property name="text"> + <string>Tip</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Maximum</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </item> </layout> </item> </layout> </widget> - <resources/> + <resources> + <include location="../bitcoin.qrc"/> + </resources> <connections/> </ui> 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, |