qt: ensure seperator when adding third-party transaction links

This ensures that if we're going to add an action to open up
a transaction in a third-party link (block explorer) that it
is seperated into it's own section.
This commit is contained in:
Jarol Rodriguez 2021-09-24 02:55:00 -04:00
parent a70a98075a
commit 8177578b29

View File

@ -222,14 +222,17 @@ void TransactionView::setModel(WalletModel *_model)
{ {
// Add third party transaction URLs to context menu // Add third party transaction URLs to context menu
QStringList listUrls = GUIUtil::SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|"); QStringList listUrls = GUIUtil::SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|");
bool actions_created = false;
for (int i = 0; i < listUrls.size(); ++i) for (int i = 0; i < listUrls.size(); ++i)
{ {
QString url = listUrls[i].trimmed(); QString url = listUrls[i].trimmed();
QString host = QUrl(url, QUrl::StrictMode).host(); QString host = QUrl(url, QUrl::StrictMode).host();
if (!host.isEmpty()) if (!host.isEmpty())
{ {
if (i == 0) if (!actions_created) {
contextMenu->addSeparator(); contextMenu->addSeparator();
actions_created = true;
}
/*: Transactions table context menu action to show the /*: Transactions table context menu action to show the
selected transaction in a third-party block explorer. selected transaction in a third-party block explorer.
%1 is a stand-in argument for the URL of the explorer. */ %1 is a stand-in argument for the URL of the explorer. */