mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-06 01:12:33 +02:00
Bugfix: GUI/ReceiveCoinsDialog: Use correct Qt plural forms for context menu
This commit is contained in:
parent
b1a93c83b0
commit
8ae1cbb315
@ -23,18 +23,6 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
|
|
||||||
static const char* const COPY_URI_SINGLE_TEXT = "Copy &URI";
|
|
||||||
static const char* const COPY_ADDRESS_SINGLE_TEXT = "&Copy address";
|
|
||||||
static const char* const COPY_LABEL_SINGLE_TEXT = "Copy &label";
|
|
||||||
static const char* const COPY_MESSAGE_SINGLE_TEXT = "Copy &message";
|
|
||||||
static const char* const COPY_AMOUNT_SINGLE_TEXT = "Copy &amount";
|
|
||||||
|
|
||||||
static const char* const COPY_URI_MULTIPLE_TEXT = "Copy &URIs";
|
|
||||||
static const char* const COPY_ADDRESS_MULTIPLE_TEXT = "&Copy addresses";
|
|
||||||
static const char* const COPY_LABEL_MULTIPLE_TEXT = "Copy &labels";
|
|
||||||
static const char* const COPY_MESSAGE_MULTIPLE_TEXT = "Copy &messages";
|
|
||||||
static const char* const COPY_AMOUNT_MULTIPLE_TEXT = "Copy &amounts";
|
|
||||||
|
|
||||||
ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
|
ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
|
||||||
QDialog(parent, GUIUtil::dialog_flags),
|
QDialog(parent, GUIUtil::dialog_flags),
|
||||||
ui(new Ui::ReceiveCoinsDialog),
|
ui(new Ui::ReceiveCoinsDialog),
|
||||||
@ -59,11 +47,11 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
|
|||||||
|
|
||||||
// context menu
|
// context menu
|
||||||
contextMenu = new QMenu(this);
|
contextMenu = new QMenu(this);
|
||||||
copyURIAction = contextMenu->addAction(tr(COPY_URI_SINGLE_TEXT), this, &ReceiveCoinsDialog::copyURI);
|
copyURIAction = contextMenu->addAction("", this, &ReceiveCoinsDialog::copyURI);
|
||||||
copyAddressAction = contextMenu->addAction(tr(COPY_ADDRESS_SINGLE_TEXT), this, &ReceiveCoinsDialog::copyAddress);
|
copyAddressAction = contextMenu->addAction("", this, &ReceiveCoinsDialog::copyAddress);
|
||||||
copyLabelAction = contextMenu->addAction(tr(COPY_LABEL_SINGLE_TEXT), this, &ReceiveCoinsDialog::copyLabel);
|
copyLabelAction = contextMenu->addAction("", this, &ReceiveCoinsDialog::copyLabel);
|
||||||
copyMessageAction = contextMenu->addAction(tr(COPY_MESSAGE_SINGLE_TEXT), this, &ReceiveCoinsDialog::copyMessage);
|
copyMessageAction = contextMenu->addAction("", this, &ReceiveCoinsDialog::copyMessage);
|
||||||
copyAmountAction = contextMenu->addAction(tr(COPY_AMOUNT_SINGLE_TEXT), this, &ReceiveCoinsDialog::copyAmount);
|
copyAmountAction = contextMenu->addAction("", this, &ReceiveCoinsDialog::copyAmount);
|
||||||
connect(ui->recentRequestsView, &QWidget::customContextMenuRequested, this, &ReceiveCoinsDialog::showMenu);
|
connect(ui->recentRequestsView, &QWidget::customContextMenuRequested, this, &ReceiveCoinsDialog::showMenu);
|
||||||
|
|
||||||
connect(ui->clearButton, &QPushButton::clicked, this, &ReceiveCoinsDialog::clear);
|
connect(ui->clearButton, &QPushButton::clicked, this, &ReceiveCoinsDialog::clear);
|
||||||
@ -313,14 +301,13 @@ void ReceiveCoinsDialog::showMenu(const QPoint &point)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sel.size() == 1 && sel.at(0).isValid()) {
|
copyAddressAction->setText(tr("&Copy address(es)", nullptr, sel.size()));
|
||||||
// Make sure we have single labels
|
copyURIAction->setText(tr("Copy &URI(s)", nullptr, sel.size()));
|
||||||
copyAddressAction->setText(tr(COPY_ADDRESS_SINGLE_TEXT));
|
copyLabelAction->setText(tr("Copy &label(s)", nullptr, sel.size()));
|
||||||
copyURIAction->setText(tr(COPY_URI_SINGLE_TEXT));
|
copyMessageAction->setText(tr("Copy &message(s)", nullptr, sel.size()));
|
||||||
copyLabelAction->setText(tr(COPY_LABEL_SINGLE_TEXT));
|
copyAmountAction->setText(tr("Copy &amount(s)", nullptr, sel.size()));
|
||||||
copyMessageAction->setText(tr(COPY_MESSAGE_SINGLE_TEXT));
|
|
||||||
copyAmountAction->setText(tr(COPY_AMOUNT_SINGLE_TEXT));
|
|
||||||
|
|
||||||
|
if (sel.size() == 1 && sel.at(0).isValid()) {
|
||||||
// disable context menu actions when appropriate
|
// disable context menu actions when appropriate
|
||||||
const RecentRequestsTableModel* const submodel = model->getRecentRequestsTableModel();
|
const RecentRequestsTableModel* const submodel = model->getRecentRequestsTableModel();
|
||||||
const RecentRequestEntry& req = submodel->entry(sel.at(0).row());
|
const RecentRequestEntry& req = submodel->entry(sel.at(0).row());
|
||||||
@ -332,13 +319,6 @@ void ReceiveCoinsDialog::showMenu(const QPoint &point)
|
|||||||
} else if (sel.size() > 1) {
|
} else if (sel.size() > 1) {
|
||||||
// multiple selection
|
// multiple selection
|
||||||
|
|
||||||
// Make sure we have multiple labels
|
|
||||||
copyAddressAction->setText(tr(COPY_ADDRESS_MULTIPLE_TEXT));
|
|
||||||
copyURIAction->setText(tr(COPY_URI_MULTIPLE_TEXT));
|
|
||||||
copyLabelAction->setText(tr(COPY_LABEL_MULTIPLE_TEXT));
|
|
||||||
copyMessageAction->setText(tr(COPY_MESSAGE_MULTIPLE_TEXT));
|
|
||||||
copyAmountAction->setText(tr(COPY_AMOUNT_MULTIPLE_TEXT));
|
|
||||||
|
|
||||||
copyLabelAction->setDisabled(false);
|
copyLabelAction->setDisabled(false);
|
||||||
copyMessageAction->setDisabled(false);
|
copyMessageAction->setDisabled(false);
|
||||||
copyAmountAction->setDisabled(false);
|
copyAmountAction->setDisabled(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user