Browse Source

Merge branch 'duke' of https://github.com/MyHush/SilentDragon into duke

pull/140/head
Duke Leto 4 years ago
parent
commit
84ad9ab179
  1. 39
      src/mainwindow.cpp

39
src/mainwindow.cpp

@ -1,4 +1,5 @@
// Copyright 2019 The Hush Developers
// Copyright 2019-2020 The Hush Developers
// Released under the GPLv3
#include "mainwindow.h"
#include "addressbook.h"
#include "viewalladdresses.h"
@ -225,13 +226,22 @@ void MainWindow::setupStatusBar() {
menu.addAction("Copy txid", [=]() {
QGuiApplication::clipboard()->setText(txid);
});
menu.addAction("View tx on block explorer", [=]() {
menu.addAction("Copy block explorer link", [=]() {
QString url;
auto explorer = Settings::getInstance()->getExplorer();
if (Settings::getInstance()->isTestnet()) {
url = explorer.testnetTxExplorerUrl + txid;
} else {
url = explorer.txExplorerUrl + txid;
}
else {
QGuiApplication::clipboard()->setText(url);
});
menu.addAction("View tx on block explorer", [=]() {
QString url;
auto explorer = Settings::getInstance()->getExplorer();
if (Settings::getInstance()->isTestnet()) {
url = explorer.testnetTxExplorerUrl + txid;
} else {
url = explorer.txExplorerUrl + txid;
}
QDesktopServices::openUrl(QUrl(url));
@ -889,7 +899,6 @@ void MainWindow::setupBalancesTab() {
QString url;
auto explorer = Settings::getInstance()->getExplorer();
if (Settings::getInstance()->isTestnet()) {
//TODO
url = explorer.testnetAddressExplorerUrl + addr;
} else {
url = explorer.addressExplorerUrl + addr;
@ -897,6 +906,17 @@ void MainWindow::setupBalancesTab() {
QDesktopServices::openUrl(QUrl(url));
});
menu.addAction("Copy explorer link", [=]() {
QString url;
auto explorer = Settings::getInstance()->getExplorer();
if (Settings::getInstance()->isTestnet()) {
url = explorer.testnetAddressExplorerUrl + addr;
} else {
url = explorer.addressExplorerUrl + addr;
}
QGuiApplication::clipboard()->setText(url);
});
menu.addAction(tr("Address Asset Viewer"), [=] () {
QString url;
url = "https://dexstats.info/assetviewer.php?address=" + addr;
@ -971,6 +991,17 @@ void MainWindow::setupTransactionsTab() {
QDesktopServices::openUrl(QUrl(url));
});
menu.addAction(tr("Copy block explorer link"), [=] () {
QString url;
auto explorer = Settings::getInstance()->getExplorer();
if (Settings::getInstance()->isTestnet()) {
url = explorer.testnetTxExplorerUrl + txid;
} else {
url = explorer.txExplorerUrl + txid;
}
QGuiApplication::clipboard()->setText(url);
});
// Payment Request
if (!memo.isEmpty() && memo.startsWith("hush:")) {
menu.addAction(tr("View Payment Request"), [=] () {

Loading…
Cancel
Save