Skip to content

Commit

Permalink
qt: ensure seperator when adding third-party transaction links
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jarolrod committed Sep 24, 2021
1 parent a70a980 commit 8177578
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 8177578

Please sign in to comment.