Commit 1a0fb7cd authored by Allen Winter's avatar Allen Winter
Browse files

korgac/alarmdialog.cpp

prevent accidental button presses when the dialog pops-up
by putting the focus on the first selected reminder rather
than on the buttons (like dismiss).

BUG: 188848

Differential Revision: https://phabricator.kde.org/D28226
parent fdcb81eb
...@@ -181,10 +181,13 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par ...@@ -181,10 +181,13 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
mOkButton = new QToolButton; mOkButton = new QToolButton;
mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return); mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
mUser1Button = new QPushButton; mUser1Button = new QPushButton;
mUser1Button->setDefault(false);
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole); buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
mUser2Button = new QPushButton; mUser2Button = new QPushButton;
mUser2Button->setDefault(false);
buttonBox->addButton(mUser2Button, QDialogButtonBox::ActionRole); buttonBox->addButton(mUser2Button, QDialogButtonBox::ActionRole);
mUser3Button = new QPushButton; mUser3Button = new QPushButton;
mUser3Button->setDefault(false);
buttonBox->addButton(mUser3Button, QDialogButtonBox::ActionRole); buttonBox->addButton(mUser3Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::accepted, this, &AlarmDialog::accept); connect(buttonBox, &QDialogButtonBox::accepted, this, &AlarmDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &AlarmDialog::reject); connect(buttonBox, &QDialogButtonBox::rejected, this, &AlarmDialog::reject);
...@@ -958,6 +961,10 @@ void AlarmDialog::updateButtons() ...@@ -958,6 +961,10 @@ void AlarmDialog::updateButtons()
} else { } else {
mUser1Button->setEnabled(false); mUser1Button->setEnabled(false);
} }
if (enabled) {
mIncidenceTree->setFocus();
mIncidenceTree->setCurrentItem(selection.first());
}
} }
void AlarmDialog::toggleDetails(QTreeWidgetItem *item) void AlarmDialog::toggleDetails(QTreeWidgetItem *item)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment