mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 05:20:00 -08:00
[Client] Move the turn order dialog strings into retranslateUi
Follows the DlgInviteToGame convention so the dialog can be retranslated instead of freezing its strings at construction time.
This commit is contained in:
parent
17a1f8cf78
commit
cc9847c33b
2 changed files with 15 additions and 4 deletions
|
|
@ -16,11 +16,11 @@ DlgTurnOrder::DlgTurnOrder(const QStringList &_playerNames, QWidget *parent)
|
|||
listWidget->setCurrentRow(0);
|
||||
connect(listWidget, &QListWidget::currentRowChanged, this, &DlgTurnOrder::selectionChanged);
|
||||
|
||||
moveUpButton = new QPushButton(tr("Move up"), this);
|
||||
moveUpButton = new QPushButton(this);
|
||||
connect(moveUpButton, &QPushButton::clicked, this, &DlgTurnOrder::actMoveUp);
|
||||
moveDownButton = new QPushButton(tr("Move down"), this);
|
||||
moveDownButton = new QPushButton(this);
|
||||
connect(moveDownButton, &QPushButton::clicked, this, &DlgTurnOrder::actMoveDown);
|
||||
randomizeButton = new QPushButton(tr("Randomize"), this);
|
||||
randomizeButton = new QPushButton(this);
|
||||
connect(randomizeButton, &QPushButton::clicked, this, &DlgTurnOrder::actRandomize);
|
||||
|
||||
auto *buttonColumn = new QVBoxLayout;
|
||||
|
|
@ -43,10 +43,19 @@ DlgTurnOrder::DlgTurnOrder(const QStringList &_playerNames, QWidget *parent)
|
|||
setLayout(mainLayout);
|
||||
|
||||
updateButtons();
|
||||
setWindowTitle(tr("Set turn order"));
|
||||
|
||||
retranslateUi();
|
||||
setMinimumWidth(300);
|
||||
}
|
||||
|
||||
void DlgTurnOrder::retranslateUi()
|
||||
{
|
||||
setWindowTitle(tr("Set turn order"));
|
||||
moveUpButton->setText(tr("Move up"));
|
||||
moveDownButton->setText(tr("Move down"));
|
||||
randomizeButton->setText(tr("Randomize"));
|
||||
}
|
||||
|
||||
QStringList DlgTurnOrder::order() const
|
||||
{
|
||||
QStringList playerNames;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ private slots:
|
|||
public:
|
||||
explicit DlgTurnOrder(const QStringList &_playerNames, QWidget *parent = nullptr);
|
||||
|
||||
void retranslateUi();
|
||||
|
||||
[[nodiscard]] bool randomize() const
|
||||
{
|
||||
return randomizeRequested;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue