Added app defined log fields and editable comboboxes
This commit is contained in:
parent
6cd22b48a9
commit
87eff6070d
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
const QStringList ADIF_FIELDS = {
|
const QStringList ADIF_FIELDS = {
|
||||||
// ADIF 3.1.0 - pulled from http://www.adif.org/310/adx310.xsd on 2019-06-04
|
// ADIF 3.1.0 - pulled from http://www.adif.org/310/adx310.xsd on 2019-06-04
|
||||||
"USERDEF",
|
|
||||||
"APP",
|
"APP",
|
||||||
"ADDRESS",
|
"ADDRESS",
|
||||||
"ADDRESS_INTL",
|
"ADDRESS_INTL",
|
||||||
@ -365,8 +364,14 @@ QByteArray ADIF::QSOToADIF(QString const& hisCall, QString const& hisGrid, QStri
|
|||||||
">" + operator_call;
|
">" + operator_call;
|
||||||
|
|
||||||
foreach(auto key, additionalFields.keys()){
|
foreach(auto key, additionalFields.keys()){
|
||||||
auto value = additionalFields[key].toString();
|
auto k = key.toUpper();
|
||||||
t += QString(" <%1:%2>%3").arg(key).arg(value.length()).arg(value);
|
auto value = additionalFields[k].toString();
|
||||||
|
|
||||||
|
if(ADIF_FIELDS.contains(k)){
|
||||||
|
t += QString(" <%1:%2>%3").arg(k).arg(value.length()).arg(value);
|
||||||
|
} else {
|
||||||
|
t += QString(" <APP_JS8CALL_%1:%2>%3").arg(k).arg(value.length()).arg(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return t.toLatin1 ();
|
return t.toLatin1 ();
|
||||||
|
@ -81,7 +81,10 @@ void LogQSO::createAdditionalField(QString key, QString value){
|
|||||||
QComboBox * c = new QComboBox(this);
|
QComboBox * c = new QComboBox(this);
|
||||||
c->insertItems(0, ADIF_FIELDS);
|
c->insertItems(0, ADIF_FIELDS);
|
||||||
c->insertItem(0, "");
|
c->insertItem(0, "");
|
||||||
c->setEditable(false);
|
c->setEditable(true);
|
||||||
|
c->setAutoCompletion(true);
|
||||||
|
c->setAutoCompletionCaseSensitivity(Qt::CaseInsensitive);
|
||||||
|
c->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||||
connect(c, &QComboBox::currentTextChanged, this, [this, l](const QString &text){
|
connect(c, &QComboBox::currentTextChanged, this, [this, l](const QString &text){
|
||||||
l->setProperty("fieldKey", QVariant(text));
|
l->setProperty("fieldKey", QVariant(text));
|
||||||
});
|
});
|
||||||
@ -102,6 +105,7 @@ void LogQSO::createAdditionalField(QString key, QString value){
|
|||||||
|
|
||||||
m_additionalFieldsControls.append(l);
|
m_additionalFieldsControls.append(l);
|
||||||
ui->additionalFields->setVisible(true);
|
ui->additionalFields->setVisible(true);
|
||||||
|
ui->additionalFields->adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QString, QVariant> LogQSO::collectAdditionalFields(){
|
QMap<QString, QVariant> LogQSO::collectAdditionalFields(){
|
||||||
|
Loading…
Reference in New Issue
Block a user