diff options
author | Mark Stiebel <mark@aretha.stiebel.me> | 2021-05-30 11:21:20 +1000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-06-04 09:35:16 -0700 |
commit | e42fc1a1e9a13c77d3474dbcb26b68b8772b8c6d (patch) | |
tree | c88fc12cbabdfbe0aedc9c48c651cb82084afd11 /desktop-widgets | |
parent | 891805763e5370a0bf8c9cc6776ce8c96573e008 (diff) | |
download | subsurface-e42fc1a1e9a13c77d3474dbcb26b68b8772b8c6d.tar.gz |
desktop: add numerus translation for dive context menu
Add numerus translation lookup for the right-click context menu in the dive
list to show proper singular/plural text.
Fixes #3256
Signed-off-by: Mark Stiebel <mark@aretha.stiebel.me>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/divelistview.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 94acfc8d2..a50c81756 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -779,12 +779,14 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) popup.addAction(tr("Collapse all"), this, &QTreeView::collapseAll); // verify if there`s a need for collapse others - if (expanded_nodes > 1) + if (expanded_nodes > 1 && d->divetrip) collapseAction = popup.addAction(tr("Collapse others"), this, &QTreeView::collapseAll); if (d) { - popup.addAction(tr("Remove dive(s) from trip"), this, &DiveListView::removeFromTrip); + if (d->divetrip) { + popup.addAction(tr("Remove dive(s) from trip","",amount_selected), this, &DiveListView::removeFromTrip); + } popup.addAction(tr("Create new trip above"), this, &DiveListView::newTripAbove); if (!d->divetrip) { struct dive *top = d; @@ -800,9 +802,9 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) } } if (is_trip_before_after(top, (currentOrder == Qt::AscendingOrder))) - popup.addAction(tr("Add dive(s) to trip immediately above"), this, &DiveListView::addToTripAbove); + popup.addAction(tr("Add dive(s) to trip immediately above","",amount_selected), this, &DiveListView::addToTripAbove); if (is_trip_before_after(bottom, (currentOrder == Qt::DescendingOrder))) - popup.addAction(tr("Add dive(s) to trip immediately below"), this, &DiveListView::addToTripBelow); + popup.addAction(tr("Add dive(s) to trip immediately below","",amount_selected), this, &DiveListView::addToTripBelow); } } if (trip) { @@ -811,17 +813,17 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) } } if (d) { - popup.addAction(tr("Delete dive(s)"), this, &DiveListView::deleteDive); + popup.addAction(tr("Delete dive(s)","",amount_selected), this, &DiveListView::deleteDive); if (d->invalid) - popup.addAction(tr("Mark dive(s) valid"), this, &DiveListView::markDiveValid); + popup.addAction(tr("Mark dive(s) valid","",amount_selected), this, &DiveListView::markDiveValid); else - popup.addAction(tr("Mark dive(s) invalid"), this, &DiveListView::markDiveInvalid); + popup.addAction(tr("Mark dive(s) invalid","",amount_selected), this, &DiveListView::markDiveInvalid); } if (amount_selected > 1 && consecutive_selected()) popup.addAction(tr("Merge selected dives"), this, &DiveListView::mergeDives); if (amount_selected >= 1) { - popup.addAction(tr("Add dive(s) to arbitrary trip"), this, &DiveListView::addDivesToTrip); - popup.addAction(tr("Renumber dive(s)"), this, &DiveListView::renumberDives); + popup.addAction(tr("Add dive(s) to arbitrary trip","",amount_selected), this, &DiveListView::addDivesToTrip); + popup.addAction(tr("Renumber dive(s)","",amount_selected), this, &DiveListView::renumberDives); popup.addAction(tr("Shift dive times"), this, &DiveListView::shiftTimes); popup.addAction(tr("Split selected dives"), this, &DiveListView::splitDives); popup.addAction(tr("Load media from file(s)"), this, &DiveListView::loadImages); |