Fixed #13: configuration validator should require cq or callsign in cq message
This commit is contained in:
parent
29f759dafe
commit
5c1f890095
@ -2022,7 +2022,7 @@ QStringList splitGroups(QString groupsString, bool filter){
|
|||||||
|
|
||||||
bool Configuration::impl::validate ()
|
bool Configuration::impl::validate ()
|
||||||
{
|
{
|
||||||
auto callsign = ui_->callsign_line_edit->text().trimmed();
|
auto callsign = ui_->callsign_line_edit->text().toUpper().trimmed();
|
||||||
if(!Varicode::isValidCallsign(callsign, nullptr) || callsign.startsWith("@")){
|
if(!Varicode::isValidCallsign(callsign, nullptr) || callsign.startsWith("@")){
|
||||||
MessageBox::critical_message (this, tr ("The callsign format you provided is not supported"));
|
MessageBox::critical_message (this, tr ("The callsign format you provided is not supported"));
|
||||||
return false;
|
return false;
|
||||||
@ -2035,6 +2035,12 @@ bool Configuration::impl::validate ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto cq = ui_->cq_message_line_edit->text().toUpper().trimmed();
|
||||||
|
if(!cq.isEmpty() && !(cq.startsWith("CQ") || cq.contains(callsign))){
|
||||||
|
MessageBox::critical_message (this, QString("The CQ message format is invalid. It must either start with \"CQ\" or contain your callsign."));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (ui_->sound_input_combo_box->currentIndex () < 0
|
if (ui_->sound_input_combo_box->currentIndex () < 0
|
||||||
&& !QAudioDeviceInfo::availableDevices (QAudio::AudioInput).empty ())
|
&& !QAudioDeviceInfo::availableDevices (QAudio::AudioInput).empty ())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user