From 8177578b296adb82fb8ab6c64cd76b832ebcc132 Mon Sep 17 00:00:00 2001 From: Jarol Rodriguez Date: Fri, 24 Sep 2021 02:55:00 -0400 Subject: [PATCH] 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. --- src/qt/transactionview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index d9e770e2d4..1973c9de9a 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -222,14 +222,17 @@ void TransactionView::setModel(WalletModel *_model) { // Add third party transaction URLs to context menu QStringList listUrls = GUIUtil::SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|"); + bool actions_created = false; for (int i = 0; i < listUrls.size(); ++i) { QString url = listUrls[i].trimmed(); QString host = QUrl(url, QUrl::StrictMode).host(); if (!host.isEmpty()) { - if (i == 0) + if (!actions_created) { contextMenu->addSeparator(); + actions_created = true; + } /*: Transactions table context menu action to show the selected transaction in a third-party block explorer. %1 is a stand-in argument for the URL of the explorer. */