Merge pull request 'Kryfi as default block explorer' (#95) from kryfi-block-explorer into master

Reviewed-on: #95
nodes-remove-double-click
dsc 2 years ago
commit 6cba5d0487

@ -1110,8 +1110,11 @@ void MainWindow::suchDonate(const QString address) {
}
void MainWindow::onViewOnBlockExplorer(const QString &txid) {
QString blockExplorerLink = Utils::blockExplorerLink(config()->get(Config::blockExplorer).toString(), m_ctx->networkType, txid);
Utils::externalLinkWarning(this, blockExplorerLink);
QString blockExplorerLink = Utils::blockExplorerLink(txid);
if(!blockExplorerLink.isEmpty())
Utils::externalLinkWarning(this, blockExplorerLink);
else
QMessageBox::warning(this, "Error", "Could not generate block explorer URL");
}
void MainWindow::onResendTransaction(const QString &txid) {

@ -146,7 +146,7 @@
</item>
<item>
<property name="text">
<string>blockchair.com</string>
<string>kryfi.com</string>
</property>
</item>
</widget>

@ -28,7 +28,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::openVRSkin,{QS("openVRSkin"), "default"}},
{Config::openVRStreamerMode,{QS("openVRStreamerMode"), false}},
{Config::preferredFiatCurrency,{QS("preferredFiatCurrency"), "USD"}},
{Config::blockExplorer,{QS("blockExplorer"), "explore.wownero.com"}},
{Config::blockExplorer,{QS("blockExplorer"), "kryfi.com"}},
{Config::walletDirectory,{QS("walletDirectory"), ""}},
{Config::autoOpenWalletPath,{QS("autoOpenWalletPath"), ""}},
{Config::walletPath,{QS("walletPath"), ""}},

@ -238,8 +238,13 @@ QString Utils::copyFromClipboard() {
return clipboard->text();
}
QString Utils::blockExplorerLink(const QString &blockExplorer, NetworkType::Type nettype, const QString &txid) {
return QString("https://explore.wownero.com/tx/%1").arg(txid);
QString Utils::blockExplorerLink(const QString &txid) {
auto explorer = config()->get(Config::blockExplorer).toString();
if(explorer.startsWith("kryfi.com")) {
return QString("https://kryfi.com/explorer/wownero/tx/%1").arg(txid);
} else {
return QString("https://explore.wownero.com/tx/%1").arg(txid);
}
}
QStandardItem *Utils::qStandardItem(const QString& text) {

@ -64,7 +64,7 @@ public:
static QStandardItem *qStandardItem(const QString &text, QFont &font);
static void copyToClipboard(const QString &string);
static QString copyFromClipboard();
static QString blockExplorerLink(const QString &blockExplorer, NetworkType::Type nettype, const QString &txid);
static QString blockExplorerLink(const QString &txid);
static QString getUnixAccountName();
static QString xdgDesktopEntry();
static bool xdgDesktopEntryWrite(const QString &path);

Loading…
Cancel
Save