diff --git a/src/gui/confirmshutdowndlg.ui b/src/gui/confirmshutdowndlg.ui index 8c1562ac1..e2a62b620 100644 --- a/src/gui/confirmshutdowndlg.ui +++ b/src/gui/confirmshutdowndlg.ui @@ -6,105 +6,86 @@ 0 0 - 463 - 128 + 407 + 103 - - - 0 - 0 - - + + 15 + - - - 20 - - - - - 6 + + + + + warning icon + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 0 + + + + + + + + + 0 + 0 + + + + shutdown message goes here - - - - - 0 - 0 - - - - warning icon goes here - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - + + true + + - - - - 6 + + + + Don't show again - - - - - 0 - 0 - - - - shutdown message goes here - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - Don't show again - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - + - + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + diff --git a/src/gui/shutdownconfirm.cpp b/src/gui/shutdownconfirm.cpp index cc5b58e7a..61984b7e3 100644 --- a/src/gui/shutdownconfirm.cpp +++ b/src/gui/shutdownconfirm.cpp @@ -52,30 +52,30 @@ ShutdownConfirmDlg::ShutdownConfirmDlg(const ShutdownAction &action) { ui->setupUi(this); - QIcon warningIcon(style()->standardIcon(QStyle::SP_MessageBoxWarning, 0, this)); - ui->warningLabel->setPixmap(warningIcon.pixmap(warningIcon.actualSize(QSize(32, 32)))); + QIcon warningIcon(style()->standardIcon(QStyle::SP_MessageBoxWarning)); + ui->warningLabel->setPixmap(warningIcon.pixmap(32)); updateText(); // Never show again checkbox, Title, and button + QPushButton *okButton = ui->buttonBox->button(QDialogButtonBox::Ok); if (m_action == ShutdownAction::None) { setWindowTitle(tr("Exit confirmation")); - ui->buttonBox->addButton(new QPushButton(tr("Exit Now"), this), QDialogButtonBox::AcceptRole); + okButton->setText(tr("E&xit Now")); } else { setWindowTitle(tr("Shutdown confirmation")); - ui->buttonBox->addButton(new QPushButton(tr("Shutdown Now"), this), QDialogButtonBox::AcceptRole); + okButton->setText(tr("&Shutdown Now")); ui->neverShowAgainCheckbox->setVisible(false); } // Cancel Button - QPushButton *cancelButton = ui->buttonBox->addButton(QDialogButtonBox::Cancel); + QPushButton *cancelButton = ui->buttonBox->button(QDialogButtonBox::Cancel); + cancelButton->setFocus(); cancelButton->setDefault(true); // Always on top setWindowFlags(windowFlags()|Qt::WindowStaysOnTopHint); - // Set 'Cancel' as default button. m_timer.setInterval(1000); // 1sec connect(&m_timer, SIGNAL(timeout()), this, SLOT(updateSeconds())); // Move to center move(Utils::Misc::screenCenter(this)); - cancelButton->setFocus(); } void ShutdownConfirmDlg::showEvent(QShowEvent *event)