Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore ability to display addresses in GUI #5861

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/qt/forms/optionsdialog.ui
Expand Up @@ -451,6 +451,16 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="displayAddresses">
<property name="toolTip">
<string>Whether to show Bitcoin addresses in the transaction list or not.</string>
</property>
<property name="text">
<string>&amp;Display addresses in transaction list</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_Display">
<item>
Expand Down
1 change: 1 addition & 0 deletions src/qt/optionsdialog.cpp
Expand Up @@ -185,6 +185,7 @@ void OptionsDialog::setMapper()
/* Display */
mapper->addMapping(ui->lang, OptionsModel::Language);
mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);
mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses);
mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls);
}

Expand Down
10 changes: 10 additions & 0 deletions src/qt/optionsmodel.cpp
Expand Up @@ -59,6 +59,10 @@ void OptionsModel::Init()
settings.setValue("nDisplayUnit", BitcoinUnits::BTC);
nDisplayUnit = settings.value("nDisplayUnit").toInt();

if (!settings.contains("bDisplayAddresses"))
settings.setValue("bDisplayAddresses", false);
bDisplayAddresses = settings.value("bDisplayAddresses", false).toBool();

if (!settings.contains("strThirdPartyTxUrls"))
settings.setValue("strThirdPartyTxUrls", "");
strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString();
Expand Down Expand Up @@ -196,6 +200,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
#endif
case DisplayUnit:
return nDisplayUnit;
case DisplayAddresses:
return bDisplayAddresses;
case ThirdPartyTxUrls:
return strThirdPartyTxUrls;
case Language:
Expand Down Expand Up @@ -290,6 +296,10 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
case DisplayUnit:
setDisplayUnit(value);
break;
case DisplayAddresses:
bDisplayAddresses = value.toBool();
settings.setValue("bDisplayAddresses", bDisplayAddresses);
break;
case ThirdPartyTxUrls:
if (strThirdPartyTxUrls != value.toString()) {
strThirdPartyTxUrls = value.toString();
Expand Down
3 changes: 3 additions & 0 deletions src/qt/optionsmodel.h
Expand Up @@ -34,6 +34,7 @@ class OptionsModel : public QAbstractListModel
ProxyPort, // int
Fee, // qint64
DisplayUnit, // BitcoinUnits::Unit
DisplayAddresses, // bool
ThirdPartyTxUrls, // QString
Language, // QString
CoinControlFeatures, // bool
Expand All @@ -57,6 +58,7 @@ class OptionsModel : public QAbstractListModel
bool getMinimizeToTray() { return fMinimizeToTray; }
bool getMinimizeOnClose() { return fMinimizeOnClose; }
int getDisplayUnit() { return nDisplayUnit; }
bool getDisplayAddresses() { return bDisplayAddresses; }
QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; }
bool getProxySettings(QNetworkProxy& proxy) const;
bool getCoinControlFeatures() { return fCoinControlFeatures; }
Expand All @@ -72,6 +74,7 @@ class OptionsModel : public QAbstractListModel
bool fMinimizeOnClose;
QString language;
int nDisplayUnit;
bool bDisplayAddresses;
QString strThirdPartyTxUrls;
bool fCoinControlFeatures;
/* settings that were overriden by command-line */
Expand Down
2 changes: 1 addition & 1 deletion src/qt/transactiontablemodel.cpp
Expand Up @@ -346,7 +346,7 @@ QString TransactionTableModel::lookupAddress(const std::string &address, bool to
{
description += label + QString(" ");
}
if(label.isEmpty() || tooltip)
if(label.isEmpty() || walletModel->getOptionsModel()->getDisplayAddresses() || tooltip)
{
description += QString("(") + QString::fromStdString(address) + QString(")");
}
Expand Down