Make OK button the default on the LogQSO dialog window.

This commit is contained in:
Joe Taylor 2022-07-01 11:56:22 -04:00
parent 3caaf785bd
commit bc635f0cd7

View File

@ -5,6 +5,7 @@
#include <QSettings> #include <QSettings>
#include <QStandardPaths> #include <QStandardPaths>
#include <QDir> #include <QDir>
#include <QPushButton>
#include "logbook/logbook.h" #include "logbook/logbook.h"
#include "MessageBox.hpp" #include "MessageBox.hpp"
@ -109,6 +110,15 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString
Radio::Frequency dialFreq, bool noSuffix, QString xSent, QString xRcvd) Radio::Frequency dialFreq, bool noSuffix, QString xSent, QString xRcvd)
{ {
if(!isHidden()) return; if(!isHidden()) return;
QPushButton* okBtn = ui->buttonBox->button(QDialogButtonBox::Ok);
okBtn->setAutoDefault(true);
okBtn->setDefault(true);
okBtn->setFocus();
QPushButton* caBtn = ui->buttonBox->button(QDialogButtonBox::Cancel);
caBtn->setAutoDefault(false);
caBtn->setDefault(false);
ui->call->setText (hisCall); ui->call->setText (hisCall);
ui->grid->setText (hisGrid); ui->grid->setText (hisGrid);
ui->name->clear (); ui->name->clear ();