mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-24 11:35:52 +00:00
TxInfoDialog: added a clickable icon to view transaction on block explorer
This commit is contained in:
parent
19e8ed1b19
commit
484f61759e
4 changed files with 29 additions and 1 deletions
|
@ -34,6 +34,7 @@
|
||||||
<file>assets/images/copy.png</file>
|
<file>assets/images/copy.png</file>
|
||||||
<file>assets/images/cutexmrfox.png</file>
|
<file>assets/images/cutexmrfox.png</file>
|
||||||
<file>assets/images/edit.png</file>
|
<file>assets/images/edit.png</file>
|
||||||
|
<file>assets/images/external-link.svg</file>
|
||||||
<file>assets/images/exchange.png</file>
|
<file>assets/images/exchange.png</file>
|
||||||
<file>assets/images/exchange_white.png</file>
|
<file>assets/images/exchange_white.png</file>
|
||||||
<file>assets/images/expired.png</file>
|
<file>assets/images/expired.png</file>
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include "appcontext.h"
|
#include "appcontext.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "constants.h"
|
||||||
#include "libwalletqt/Coins.h"
|
#include "libwalletqt/Coins.h"
|
||||||
#include "libwalletqt/CoinsInfo.h"
|
#include "libwalletqt/CoinsInfo.h"
|
||||||
#include "libwalletqt/TransactionHistory.h"
|
#include "libwalletqt/TransactionHistory.h"
|
||||||
|
@ -16,6 +17,7 @@
|
||||||
#include "libwalletqt/WalletManager.h"
|
#include "libwalletqt/WalletManager.h"
|
||||||
#include "model/ModelUtils.h"
|
#include "model/ModelUtils.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
#include "utils/Icons.h"
|
||||||
|
|
||||||
TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txInfo, QWidget *parent)
|
TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txInfo, QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
|
@ -26,6 +28,10 @@ TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txIn
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ui->btn_viewOnBlockExplorer->setIcon(icons()->icon("external-link.svg"));
|
||||||
|
ui->btn_viewOnBlockExplorer->setToolTip("View on block explorer");
|
||||||
|
connect(ui->btn_viewOnBlockExplorer, &QPushButton::clicked, this, &TxInfoDialog::viewOnBlockExplorer);
|
||||||
|
|
||||||
m_txid = txInfo->hash();
|
m_txid = txInfo->hash();
|
||||||
ui->label_txid->setText(m_txid);
|
ui->label_txid->setText(m_txid);
|
||||||
|
|
||||||
|
@ -85,6 +91,9 @@ TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txIn
|
||||||
}
|
}
|
||||||
|
|
||||||
this->adjustSize();
|
this->adjustSize();
|
||||||
|
|
||||||
|
// Don't autofocus any of the buttons. There is probably a better way for this.
|
||||||
|
ui->label_txid->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TxInfoDialog::adjustHeight(QTextEdit *textEdit, qreal docHeight) {
|
void TxInfoDialog::adjustHeight(QTextEdit *textEdit, qreal docHeight) {
|
||||||
|
@ -168,4 +177,8 @@ void TxInfoDialog::createTxProof() {
|
||||||
m_txProofDialog->getTxKey();
|
m_txProofDialog->getTxKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TxInfoDialog::viewOnBlockExplorer() {
|
||||||
|
Utils::externalLinkWarning(this, Utils::blockExplorerLink(config()->get(Config::blockExplorer).toString(), constants::networkType, m_txid));
|
||||||
|
}
|
||||||
|
|
||||||
TxInfoDialog::~TxInfoDialog() = default;
|
TxInfoDialog::~TxInfoDialog() = default;
|
|
@ -34,6 +34,7 @@ private:
|
||||||
void setData(TransactionInfo *tx);
|
void setData(TransactionInfo *tx);
|
||||||
void updateData();
|
void updateData();
|
||||||
void adjustHeight(QTextEdit *textEdit, qreal docHeight);
|
void adjustHeight(QTextEdit *textEdit, qreal docHeight);
|
||||||
|
void viewOnBlockExplorer();
|
||||||
|
|
||||||
QScopedPointer<Ui::TxInfoDialog> ui;
|
QScopedPointer<Ui::TxInfoDialog> ui;
|
||||||
QSharedPointer<AppContext> m_ctx;
|
QSharedPointer<AppContext> m_ctx;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Transaction ID:</string>
|
<string>Transaction ID:</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_txid">
|
<widget class="QLabel" name="label_txid">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -30,6 +30,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_viewOnBlockExplorer">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue