1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Make the cancel button the default button

This commit is contained in:
Impyy 2015-09-23 20:04:13 +02:00
parent 91e51f8a10
commit 25ff57ad23

View File

@ -10,7 +10,9 @@ RemoveFriendDialog::RemoveFriendDialog(QWidget *parent, const Friend *f)
ui.setupUi(this); ui.setupUi(this);
ui.label->setText(ui.label->text().replace("<name>", f->getDisplayedName())); ui.label->setText(ui.label->text().replace("<name>", f->getDisplayedName()));
auto removeButton = ui.buttonBox->button(QDialogButtonBox::Ok); auto removeButton = ui.buttonBox->button(QDialogButtonBox::Ok);
auto cancelButton = ui.buttonBox->button(QDialogButtonBox::Cancel);
removeButton->setText(tr("Remove")); removeButton->setText(tr("Remove"));
cancelButton->setDefault(true);
adjustSize(); adjustSize();
connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &RemoveFriendDialog::onAccepted); connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &RemoveFriendDialog::onAccepted);
connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &RemoveFriendDialog::close); connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &RemoveFriendDialog::close);