diff --git a/src/assets.qrc b/src/assets.qrc
index a99d844..57e1677 100644
--- a/src/assets.qrc
+++ b/src/assets.qrc
@@ -33,6 +33,7 @@
assets/images/expired.png
assets/images/expired_icon.png
assets/images/eye1.png
+ assets/images/eye_blind.png
assets/images/feather.png
assets/images/file.png
assets/images/ghost.png
@@ -44,6 +45,7 @@
assets/images/ledger_unpaired.png
assets/images/lightning.png
assets/images/lock.png
+ assets/images/lock_icon.png
assets/images/lock.svg
assets/images/microphone.png
assets/images/network.png
diff --git a/src/assets/images/eye_blind.png b/src/assets/images/eye_blind.png
new file mode 100644
index 0000000..612e838
Binary files /dev/null and b/src/assets/images/eye_blind.png differ
diff --git a/src/assets/images/lock_icon.png b/src/assets/images/lock_icon.png
new file mode 100644
index 0000000..1116e48
Binary files /dev/null and b/src/assets/images/lock_icon.png differ
diff --git a/src/coinswidget.cpp b/src/coinswidget.cpp
index c659d69..21b5719 100644
--- a/src/coinswidget.cpp
+++ b/src/coinswidget.cpp
@@ -7,6 +7,7 @@
#include "utils/utils.h"
#include "dialog/outputinfodialog.h"
#include "dialog/outputsweepdialog.h"
+#include "mainwindow.h"
#include
#include
@@ -21,6 +22,7 @@ CoinsWidget::CoinsWidget(QWidget *parent)
, m_copyMenu(new QMenu("Copy",this))
{
ui->setupUi(this);
+ m_ctx = MainWindow::getContext();
// header context menu
ui->coins->header()->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -70,6 +72,12 @@ void CoinsWidget::setModel(CoinsModel * model, Coins * coins) {
ui->coins->setColumnHidden(CoinsModel::SpentHeight, true);
ui->coins->setColumnHidden(CoinsModel::Frozen, true);
+ if (!m_ctx->currentWallet->viewOnly()) {
+ ui->coins->setColumnHidden(CoinsModel::KeyImageKnown, true);
+ } else {
+ ui->coins->setColumnHidden(CoinsModel::KeyImageKnown, false);
+ }
+
ui->coins->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
ui->coins->header()->setSectionResizeMode(CoinsModel::AddressLabel, QHeaderView::Stretch);
ui->coins->header()->setSortIndicator(CoinsModel::BlockHeight, Qt::DescendingOrder);
diff --git a/src/coinswidget.h b/src/coinswidget.h
index 0ff1d8e..ba158eb 100644
--- a/src/coinswidget.h
+++ b/src/coinswidget.h
@@ -67,6 +67,7 @@ private:
Coins *m_coins;
CoinsModel * m_model;
CoinsProxyModel * m_proxyModel;
+ AppContext *m_ctx;
void showContextMenu(const QPoint & point);
void copy(copyField field);
diff --git a/src/model/CoinsModel.cpp b/src/model/CoinsModel.cpp
index ca788fc..f81cf52 100644
--- a/src/model/CoinsModel.cpp
+++ b/src/model/CoinsModel.cpp
@@ -19,6 +19,9 @@ CoinsModel::CoinsModel(QObject *parent, Coins *coins)
{
connect(m_coins, &Coins::refreshStarted, this, &CoinsModel::startReset);
connect(m_coins, &Coins::refreshFinished, this, &CoinsModel::endReset);
+
+ m_eye = QIcon(":/assets/images/eye1.png");
+ m_eyeBlind = QIcon(":/assets/images/eye_blind.png");
}
void CoinsModel::startReset(){
@@ -82,6 +85,19 @@ QVariant CoinsModel::data(const QModelIndex &index, int role) const
result = Qt::AlignRight;
}
}
+ else if (role == Qt::DecorationRole) {
+ switch (index.column()) {
+ case KeyImageKnown:
+ {
+ if (cInfo.keyImageKnown()) {
+ result = QVariant(m_eye);
+ }
+ else {
+ result = QVariant(m_eyeBlind);
+ }
+ }
+ }
+ }
else if (role == Qt::FontRole) {
switch(index.column()) {
case PubKey:
@@ -91,6 +107,16 @@ QVariant CoinsModel::data(const QModelIndex &index, int role) const
}
}
else if (role == Qt::ToolTipRole) {
+ switch(index.column()) {
+ case KeyImageKnown:
+ {
+ if (cInfo.keyImageKnown()) {
+ result = "Key image known";
+ } else {
+ result = "Key image unknown. Outgoing transactions that include this output will not be detected.";
+ }
+ }
+ }
if (cInfo.frozen()) {
result = "Output is frozen.";
}
diff --git a/src/model/CoinsModel.h b/src/model/CoinsModel.h
index db4cb3d..8914ba4 100644
--- a/src/model/CoinsModel.h
+++ b/src/model/CoinsModel.h
@@ -9,6 +9,7 @@
#include
#include
#include
+#include
class Coins;
class CoinsInfo;
@@ -20,7 +21,8 @@ Q_OBJECT
public:
enum ModelColumn
{
- PubKey = 0,
+ KeyImageKnown = 0,
+ PubKey,
OutputPoint,
Address,
AddressLabel,
@@ -49,6 +51,8 @@ private:
QVariant parseTransactionInfo(const CoinsInfo &cInfo, int column, int role) const;
Coins *m_coins;
+ QIcon m_eye;
+ QIcon m_eyeBlind;
};
#endif //FEATHER_COINSMODEL_H