Fixed #13: configuration validator should require cq or callsign in cq message

This commit is contained in:
Jordan Sherer 2018-12-14 20:16:33 -05:00
parent 29f759dafe
commit 5c1f890095

View File

@ -2022,7 +2022,7 @@ QStringList splitGroups(QString groupsString, bool filter){
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("@")){
MessageBox::critical_message (this, tr ("The callsign format you provided is not supported"));
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
&& !QAudioDeviceInfo::availableDevices (QAudio::AudioInput).empty ())
{