Move desktopservices to settings
This commit is contained in:
@@ -160,6 +160,27 @@ void Settings::saveRestore(QDialog* d) {
|
||||
});
|
||||
}
|
||||
|
||||
void Settings::openAddressInExplorer(QString address) {
|
||||
QString url;
|
||||
if (Settings::getInstance()->isTestnet()) {
|
||||
url = "https://explorer.testnet.z.cash/address/" + address;
|
||||
} else {
|
||||
url = "https://explorer.zcha.in/accounts/" + address;
|
||||
}
|
||||
QDesktopServices::openUrl(QUrl(url));
|
||||
}
|
||||
|
||||
void Settings::openTxInExplorer(QString txid) {
|
||||
QString url;
|
||||
if (Settings::getInstance()->isTestnet()) {
|
||||
url = "https://explorer.testnet.z.cash/tx/" + txid;
|
||||
}
|
||||
else {
|
||||
url = "https://explorer.zcha.in/transactions/" + txid;
|
||||
}
|
||||
QDesktopServices::openUrl(QUrl(url));
|
||||
}
|
||||
|
||||
QString Settings::getUSDFormat(double bal) {
|
||||
return "$" + QLocale(QLocale::English).toString(bal, 'f', 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user