Repository: dogecoin/dogecoin
File: src/qt/overviewpage.cpp (C++)

Code before:

    connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));

    // start with displaying the "out of sync" warnings
    showOutOfSyncWarning(true);
    connect(ui->labelWalletStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
    connect(ui->labelTransactionsStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
}

void OverviewPage::UpdateTip()
{
    QStringList tips = {
        "Never share your wallet.dat file/your private key with anyone",
        "Make sure to always update to the newest version",
        "Backup your wallet.dat/private key to prevent losing your coins",
        "To find your Dogecoin Core data directory go to 'Help' -> 'Debug Window'",
        "Make sure to backup your wallet",
        "To backup your wallet go to 'File' -> 'Backup Wallet...' and make sure to save the .dat file",
        "For more advanced settings use the console in 'Help' -> 'Debug Window'",
        "Encrypt your wallet with a strong passphrase for maximum security",
        "Make sure to keep your wallet updated.",
        "Never share your private key or your wallet.dat with anyone",
        "Always do your own research before using an external cryptocurrency service",
        "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)
        Q_EMIT transactionClicked(filter->mapToSource(index));
}

void OverviewPage::handleOutOfSyncWarningClicks()
{
    Q_EMIT outOfSyncWarningClicked();
}

OverviewPage::~OverviewPage()
{
    delete ui;
}

void OverviewPage::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance)
{
    int unit = walletModel->getOptionsModel()->getDisplayUnit();
    currentBalance = balance;
    currentUnconfirmedBalance = unconfirmedBalance;

Review comment (suggestion):
I'm not sure if here or in the list declaration, but it'd be good to call QT's `tr()` to allow for translations.

Code after:

    connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));

    // start with displaying the "out of sync" warnings
    showOutOfSyncWarning(true);
    connect(ui->labelWalletStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
    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)
        Q_EMIT transactionClicked(filter->mapToSource(index));
}

void OverviewPage::handleOutOfSyncWarningClicks()
{
    Q_EMIT outOfSyncWarningClicked();
}

OverviewPage::~OverviewPage()
{
    delete ui;
}

void OverviewPage::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance)
{
    int unit = walletModel->getOptionsModel()->getDisplayUnit();
    currentBalance = balance;
    currentUnconfirmedBalance = unconfirmedBalance;
    currentImmatureBalance = immatureBalance;
    currentWatchOnlyBalance = watchOnlyBalance;