Qt: Give discard button focus (but not as default)
Set focus to the discard button in the "Unsaved packet" and "Unsaved comments" dialogs to enable spacebar for discard and enter for save. Bug: 13363 Change-Id: I576b02c4e3f0964aef56a0f1c06ed57c6ba683bf Reviewed-on: https://code.wireshark.org/review/20485 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
parent
f8abec1f37
commit
b0335359e5
|
@ -167,6 +167,9 @@ check_savability_t CaptureFileDialog::checkSaveAsWithComments(QWidget *
|
|||
msg_dialog.setDefaultButton(QMessageBox::Cancel);
|
||||
}
|
||||
|
||||
discard_button->setAutoDefault(false);
|
||||
discard_button->setFocus();
|
||||
|
||||
msg_dialog.exec();
|
||||
/* According to the Qt doc:
|
||||
* when using QMessageBox with custom buttons, exec() function returns an opaque value.
|
||||
|
|
|
@ -1741,6 +1741,9 @@ bool MainWindow::testCaptureFileClose(QString before_what, FileCloseContext cont
|
|||
}
|
||||
discard_button = msg_dialog.addButton(discard_button_text, QMessageBox::DestructiveRole);
|
||||
|
||||
discard_button->setAutoDefault(false);
|
||||
discard_button->setFocus();
|
||||
|
||||
msg_dialog.exec();
|
||||
/* According to the Qt doc:
|
||||
* when using QMessageBox with custom buttons, exec() function returns an opaque value.
|
||||
|
|
Loading…
Reference in New Issue