forked from qt-creator/qt-creator
Core: Make Terms And Conditions more explicit
Renames the Buttons to "Accept" and "Decline" to make it more clear that the user is agreeing to the Terms and Conditions. Also make "Decline" the default button. Change-Id: I1d51f8fd80b9d1e0884fe6901d26f7dead78c236 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -54,6 +54,7 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -174,8 +175,15 @@ static void initTAndCAcceptDialog()
|
|||||||
QDialog dialog(ICore::dialogParent());
|
QDialog dialog(ICore::dialogParent());
|
||||||
dialog.setWindowTitle(Tr::tr("Terms and Conditions"));
|
dialog.setWindowTitle(Tr::tr("Terms and Conditions"));
|
||||||
|
|
||||||
QDialogButtonBox buttonBox(
|
QDialogButtonBox buttonBox;
|
||||||
QDialogButtonBox::StandardButton::Yes | QDialogButtonBox::StandardButton::No);
|
QPushButton *acceptButton
|
||||||
|
= buttonBox.addButton(Tr::tr("Accept"), QDialogButtonBox::ButtonRole::YesRole);
|
||||||
|
QPushButton *decline
|
||||||
|
= buttonBox.addButton(Tr::tr("Decline"), QDialogButtonBox::ButtonRole::NoRole);
|
||||||
|
acceptButton->setAutoDefault(false);
|
||||||
|
acceptButton->setDefault(false);
|
||||||
|
decline->setAutoDefault(true);
|
||||||
|
decline->setDefault(true);
|
||||||
QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
||||||
QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user