#53 Allow copying addr from tx table
This commit is contained in:
@@ -796,11 +796,20 @@ void MainWindow::setupTransactionsTab() {
|
|||||||
|
|
||||||
QString txid = txModel->getTxId(index.row());
|
QString txid = txModel->getTxId(index.row());
|
||||||
QString memo = txModel->getMemo(index.row());
|
QString memo = txModel->getMemo(index.row());
|
||||||
|
QString addr = txModel->getAddr(index.row());
|
||||||
|
|
||||||
menu.addAction("Copy txid", [=] () {
|
menu.addAction("Copy txid", [=] () {
|
||||||
QGuiApplication::clipboard()->setText(txid);
|
QGuiApplication::clipboard()->setText(txid);
|
||||||
ui->statusBar->showMessage("Copied to clipboard", 3 * 1000);
|
ui->statusBar->showMessage("Copied to clipboard", 3 * 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!addr.isEmpty()) {
|
||||||
|
menu.addAction("Copy Address", [=] () {
|
||||||
|
QGuiApplication::clipboard()->setText(addr);
|
||||||
|
ui->statusBar->showMessage("Copied to clipboard", 3 * 1000);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
menu.addAction("View on block explorer", [=] () {
|
menu.addAction("View on block explorer", [=] () {
|
||||||
QString url;
|
QString url;
|
||||||
if (Settings::getInstance()->isTestnet()) {
|
if (Settings::getInstance()->isTestnet()) {
|
||||||
@@ -810,6 +819,7 @@ void MainWindow::setupTransactionsTab() {
|
|||||||
}
|
}
|
||||||
QDesktopServices::openUrl(QUrl(url));
|
QDesktopServices::openUrl(QUrl(url));
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!memo.isEmpty()) {
|
if (!memo.isEmpty()) {
|
||||||
menu.addAction("View Memo", [=] () {
|
menu.addAction("View Memo", [=] () {
|
||||||
QMessageBox::information(this, "Memo", memo, QMessageBox::Ok);
|
QMessageBox::information(this, "Memo", memo, QMessageBox::Ok);
|
||||||
|
|||||||
@@ -163,3 +163,7 @@ QString TxTableModel::getTxId(int row) {
|
|||||||
QString TxTableModel::getMemo(int row) {
|
QString TxTableModel::getMemo(int row) {
|
||||||
return modeldata->at(row).memo;
|
return modeldata->at(row).memo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString TxTableModel::getAddr(int row) {
|
||||||
|
return modeldata->at(row).address.trimmed();
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ public:
|
|||||||
|
|
||||||
QString getTxId(int row);
|
QString getTxId(int row);
|
||||||
QString getMemo(int row);
|
QString getMemo(int row);
|
||||||
|
QString getAddr(int row);
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent) const;
|
int rowCount(const QModelIndex &parent) const;
|
||||||
int columnCount(const QModelIndex &parent) const;
|
int columnCount(const QModelIndex &parent) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user