mirror of
https://github.com/ea4k/klog.git
synced 2024-09-21 18:38:19 +00:00
533 lines
15 KiB
C++
Executable File
533 lines
15 KiB
C++
Executable File
#include "mainwindowinputeqsl.h"
|
|
|
|
MainWindowInputEQSL::MainWindowInputEQSL(QWidget *parent) :
|
|
QWidget(parent)
|
|
{
|
|
qslSentStatusList.clear();
|
|
qslRcvdStatusList.clear();
|
|
clubLogStatusList.clear();
|
|
|
|
dataProxy = new DataProxy_SQLite();
|
|
|
|
qslSentStatusList = dataProxy->getQSLSentList();
|
|
qslRcvdStatusList = dataProxy->getQSLRcvdList();
|
|
clubLogStatusList = dataProxy->getClubLogStatusList();
|
|
|
|
eqslSentComboBox = new QComboBox;
|
|
eqslRecComboBox = new QComboBox;
|
|
lotwSentComboBox = new QComboBox;
|
|
lotwRecComboBox = new QComboBox;
|
|
clublogComboBox = new QComboBox;
|
|
|
|
eqslSentQDateEdit = new QDateEdit;
|
|
eqslRecQDateEdit = new QDateEdit;
|
|
lotwSentQDateEdit = new QDateEdit;
|
|
lotwRecQDateEdit = new QDateEdit;
|
|
clublogQDateEdit = new QDateEdit;
|
|
|
|
eqslSentQDateEdit->setDisplayFormat("dd/MM/yyyy");
|
|
eqslRecQDateEdit->setDisplayFormat("dd/MM/yyyy");
|
|
lotwSentQDateEdit->setDisplayFormat("dd/MM/yyyy");
|
|
lotwRecQDateEdit->setDisplayFormat("dd/MM/yyyy");
|
|
clublogQDateEdit->setDisplayFormat("dd/MM/yyyy");
|
|
|
|
createUI();
|
|
setDefaultData();
|
|
clear();
|
|
}
|
|
|
|
void MainWindowInputEQSL::createUI()
|
|
{
|
|
clublogQDateEdit->setToolTip(tr("Date of the ClubLog upload"));
|
|
eqslSentQDateEdit->setToolTip(tr("Date of the eQSL sending"));
|
|
eqslRecQDateEdit->setToolTip(tr("Date of the eQSL reception"));
|
|
lotwSentQDateEdit->setToolTip(tr("Date of the LotW sending"));
|
|
lotwRecQDateEdit->setToolTip(tr("Date of the LotW reception"));
|
|
|
|
clublogComboBox->setToolTip(tr("Status on ClubLog"));
|
|
eqslSentComboBox->setToolTip(tr("Status of the eQSL sending"));
|
|
eqslRecComboBox->setToolTip(tr("Status of the eQSL reception"));
|
|
lotwSentComboBox->setToolTip(tr("Status of the LotW sending"));
|
|
lotwRecComboBox->setToolTip(tr("Status of the LotW reception"));
|
|
|
|
// eQSL Tab definition starts here
|
|
|
|
QLabel *clublogLabelN = new QLabel(tr("ClubLog"));
|
|
clublogLabelN->setAlignment(Qt::AlignVCenter| Qt::AlignRight);
|
|
|
|
QLabel *eQSLSentLabelN = new QLabel(tr("eQSL Sent"));
|
|
eQSLSentLabelN->setAlignment(Qt::AlignVCenter| Qt::AlignRight);
|
|
|
|
QLabel *eQSLRecLabelN = new QLabel(tr("eQSL Rec"));
|
|
eQSLRecLabelN->setAlignment(Qt::AlignVCenter| Qt::AlignRight);
|
|
|
|
QLabel *lotWSentLabelN = new QLabel(tr("LotW Sent"));
|
|
lotWSentLabelN->setAlignment(Qt::AlignVCenter| Qt::AlignRight);
|
|
|
|
QLabel *lotWRecLabelN = new QLabel(tr("LotW Rec"));
|
|
lotWRecLabelN->setAlignment(Qt::AlignVCenter| Qt::AlignRight);
|
|
|
|
/*
|
|
QHBoxLayout *eqslSentLayout = new QHBoxLayout;
|
|
eqslSentLayout->addWidget(eqslSentComboBox);
|
|
eqslSentLayout->addWidget(eqslSentQDateEdit);
|
|
QHBoxLayout *eqslRecLayout = new QHBoxLayout;
|
|
eqslRecLayout->addWidget(eqslRecComboBox);
|
|
eqslRecLayout->addWidget(eqslRecQDateEdit);
|
|
QHBoxLayout *lotwSentLayout = new QHBoxLayout;
|
|
lotwSentLayout->addWidget(lotwSentComboBox);
|
|
lotwSentLayout->addWidget(lotwSentQDateEdit);
|
|
QHBoxLayout *lotwRecLayout = new QHBoxLayout;
|
|
lotwRecLayout->addWidget(lotwRecComboBox);
|
|
lotwRecLayout->addWidget(lotwRecQDateEdit);
|
|
|
|
QFormLayout *eqslInputTabWidgetLayout = new QFormLayout;
|
|
|
|
eqslInputTabWidgetLayout->addRow(eQSLSentLabelN, eqslSentLayout);
|
|
eqslInputTabWidgetLayout->addRow(eQSLRecLabelN, eqslRecLayout);
|
|
eqslInputTabWidgetLayout->addRow(lotWSentLabelN, lotwSentLayout);
|
|
eqslInputTabWidgetLayout->addRow(lotWRecLabelN, lotwRecLayout);
|
|
*/
|
|
QGridLayout *eqslInputTabWidgetLayout = new QGridLayout;
|
|
|
|
eqslInputTabWidgetLayout->addWidget(clublogLabelN, 0, 0);
|
|
eqslInputTabWidgetLayout->addWidget(eQSLSentLabelN, 1, 0);
|
|
eqslInputTabWidgetLayout->addWidget(eQSLRecLabelN, 2, 0);
|
|
eqslInputTabWidgetLayout->addWidget(lotWSentLabelN, 3, 0);
|
|
eqslInputTabWidgetLayout->addWidget(lotWRecLabelN, 4, 0);
|
|
|
|
eqslInputTabWidgetLayout->addWidget(clublogComboBox, 0, 1);
|
|
eqslInputTabWidgetLayout->addWidget(eqslSentComboBox, 1, 1);
|
|
eqslInputTabWidgetLayout->addWidget(eqslRecComboBox, 2, 1);
|
|
eqslInputTabWidgetLayout->addWidget(lotwSentComboBox, 3, 1);
|
|
eqslInputTabWidgetLayout->addWidget(lotwRecComboBox, 4, 1);
|
|
|
|
eqslInputTabWidgetLayout->addWidget(clublogQDateEdit, 0, 2);
|
|
eqslInputTabWidgetLayout->addWidget(eqslSentQDateEdit, 1, 2);
|
|
eqslInputTabWidgetLayout->addWidget(eqslRecQDateEdit, 2, 2);
|
|
eqslInputTabWidgetLayout->addWidget(lotwSentQDateEdit, 3, 2);
|
|
eqslInputTabWidgetLayout->addWidget(lotwRecQDateEdit, 4, 2);
|
|
|
|
setLayout(eqslInputTabWidgetLayout);
|
|
|
|
connect(eqslSentComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(sloteQSLSentComboBoxChanged() ) ) ;
|
|
connect(eqslRecComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(sloteQSLRecvComboBoxChanged() ) ) ;
|
|
connect(lotwSentComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotLotwSentComboBoxChanged() ) ) ;
|
|
connect(lotwRecComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotLotwRecvComboBoxChanged() ) ) ;
|
|
|
|
//dxUpLeftTab->addTab(eqslInputTabWidget, tr("eQSL"));
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindowInputEQSL::setDefaultData()
|
|
{
|
|
|
|
|
|
//qsAux << tr("Y-Yes") << tr("N-No") << tr("R-Requested") << tr("I-Ignore") << tr("V-Validated");
|
|
|
|
//eqslRecComboBox->addItems(qsAux);
|
|
//lotwRecComboBox->addItems(qsAux);
|
|
eqslRecComboBox->addItems(qslRcvdStatusList);
|
|
lotwRecComboBox->addItems(qslRcvdStatusList);
|
|
|
|
//qsAux.clear();
|
|
//qsAux << tr("Y-Yes") << tr("N-No") << tr("R-Requested") << tr("Q-Queued") << tr("I-Ignore");
|
|
//eqslSentComboBox->addItems(qsAux);
|
|
//lotwSentComboBox->addItems(qsAux);
|
|
eqslSentComboBox->addItems(qslSentStatusList);
|
|
lotwSentComboBox->addItems(qslSentStatusList);
|
|
|
|
//QStringList qsAux;
|
|
//qsAux.clear();
|
|
//qsAux << tr("Y-Uploaded") << tr("N-Do not upload") << tr("M-Modified");
|
|
clublogComboBox->addItems(clubLogStatusList);
|
|
|
|
}
|
|
void MainWindowInputEQSL::clear()
|
|
{
|
|
//qDebug() << "MainWindowInputEQSL::clear" << endl;
|
|
clublogComboBox->setCurrentIndex(1); // Do not upload
|
|
eqslSentComboBox->setCurrentIndex(1);
|
|
eqslRecComboBox->setCurrentIndex(1);
|
|
lotwSentComboBox->setCurrentIndex(1);
|
|
lotwRecComboBox->setCurrentIndex(1);
|
|
|
|
//dateEdit->setDate(QDate::fromString(aux1, "yyyy/MM/dd"));
|
|
QString date;
|
|
date = "18000101";
|
|
eqslSentQDateEdit->setDate(QDate::fromString(date, "yyyyMMdd"));
|
|
eqslRecQDateEdit->setDate(QDate::fromString(date, "yyyyMMdd"));
|
|
lotwSentQDateEdit->setDate(QDate::fromString(date, "yyyyMMdd"));
|
|
lotwRecQDateEdit->setDate(QDate::fromString(date, "yyyyMMdd"));
|
|
clublogQDateEdit->setDate(QDate::fromString(date, "yyyyMMdd"));
|
|
|
|
}
|
|
|
|
|
|
QString MainWindowInputEQSL::getClubLogStatus()
|
|
{
|
|
QString _pm = QString();
|
|
//qDebug() << "MainWindowInputEQSL::getClubLogStatus:" << clublogComboBox->currentText() << endl;
|
|
_pm = (((clublogComboBox->currentText()).split('-')).at(0)).simplified();
|
|
//qDebug() << "MainWindowInputEQSL::getClubLogStatus: " << _pm << endl;
|
|
//if (_pm == "Not")
|
|
//{
|
|
// return QString();
|
|
//}
|
|
return _pm;
|
|
}
|
|
|
|
QString MainWindowInputEQSL::getEQSLRecStatus()
|
|
{
|
|
QString _pm = QString();
|
|
//qDebug() << "MainWindowInputEQSL::getEQSLRecStatus:" << eqslRecComboBox->currentText() << endl;
|
|
_pm = (((eqslRecComboBox->currentText()).split('-')).at(0)).simplified();
|
|
//qDebug() << "MainWindowInputEQSL::getEQSLRecStatus: " << _pm << endl;
|
|
//if (_pm == "Not")
|
|
//{
|
|
// return QString();
|
|
//}
|
|
return _pm;
|
|
|
|
}
|
|
|
|
QString MainWindowInputEQSL::getEQSLSenStatus()
|
|
{
|
|
QString _pm = QString();
|
|
//qDebug() << "MainWindowInputEQSL::getEQSLSenStatus:" << eqslSentComboBox->currentText() << endl;
|
|
_pm = (((eqslSentComboBox->currentText()).split('-')).at(0)).simplified();
|
|
//qDebug() << "MainWindowInputEQSL::getEQSLSenStatus: " << _pm << endl;
|
|
//if (_pm == "Not")
|
|
//{
|
|
// return QString();
|
|
//}
|
|
return _pm;
|
|
}
|
|
|
|
QString MainWindowInputEQSL::getLOTWRecStatus()
|
|
{
|
|
QString _pm = QString();
|
|
//qDebug() << "MainWindowInputEQSL::getLOTWRecStatus:" << lotwRecComboBox->currentText() << endl;
|
|
_pm = (((lotwRecComboBox->currentText()).split('-')).at(0)).simplified();
|
|
//qDebug() << "MainWindowInputEQSL::getLOTWRecStatus: " << _pm << endl;
|
|
//if (_pm == "Not")
|
|
//{
|
|
// return QString();
|
|
//}
|
|
return _pm;
|
|
}
|
|
|
|
QString MainWindowInputEQSL::getLOTWSenStatus()
|
|
{
|
|
QString _pm = QString();
|
|
//qDebug() << "MainWindowInputEQSL::getLOTWSenStatus:" << lotwSentComboBox->currentText() << endl;
|
|
_pm = (((lotwSentComboBox->currentText()).split('-')).at(0)).simplified();
|
|
//qDebug() << "MainWindowInputEQSL::getLOTWSenStatus: " << _pm << endl;
|
|
//if (_pm == "Not")
|
|
//{
|
|
// return QString();
|
|
//}
|
|
return _pm;
|
|
}
|
|
|
|
|
|
void MainWindowInputEQSL::setClubLogStatus(const QString _qs)
|
|
{
|
|
//qDebug() << "MainWindowInputEQSL::setClubLogStatus: " << _qs << endl;
|
|
if(( clublogComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
|
|
{
|
|
clublogComboBox->setCurrentIndex( clublogComboBox->findText(_qs+" -", Qt::MatchStartsWith));
|
|
}
|
|
else
|
|
{
|
|
clublogComboBox->setCurrentIndex(1);
|
|
}
|
|
|
|
}
|
|
|
|
void MainWindowInputEQSL::setEQSLRecStatus(const QString _qs)
|
|
{
|
|
//qDebug() << "MainWindowInputEQSL::setEQSLRecStatus: " << _qs << endl;
|
|
if(( eqslRecComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
|
|
{
|
|
eqslRecComboBox->setCurrentIndex( eqslRecComboBox->findText(_qs+" -", Qt::MatchStartsWith));
|
|
}
|
|
else
|
|
{
|
|
eqslRecComboBox->setCurrentIndex(1);
|
|
}
|
|
}
|
|
|
|
void MainWindowInputEQSL::setEQSLSenStatus(const QString _qs)
|
|
{
|
|
//qDebug() << "MainWindowInputEQSL::setEQSLSenStatus: #" << _qs+" -" << endl;
|
|
|
|
if(( eqslSentComboBox->findText(_qs, Qt::MatchStartsWith))>=0)
|
|
{
|
|
eqslSentComboBox->setCurrentIndex( eqslSentComboBox->findText(_qs, Qt::MatchStartsWith));
|
|
}
|
|
else
|
|
{
|
|
//qDebug() << "MainWindowInputEQSL::setEQSLSenStatus: NOT found" << endl;
|
|
eqslSentComboBox->setCurrentIndex(1);
|
|
}
|
|
}
|
|
|
|
void MainWindowInputEQSL::setLOTWRecStatus(const QString _qs)
|
|
{
|
|
//qDebug() << "MainWindowInputEQSL::setLOTWRecStatus: " << _qs << endl;
|
|
if(( lotwRecComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
|
|
{
|
|
lotwRecComboBox->setCurrentIndex( lotwRecComboBox->findText(_qs+" -", Qt::MatchStartsWith));
|
|
}
|
|
else
|
|
{
|
|
lotwRecComboBox->setCurrentIndex(1);
|
|
}
|
|
}
|
|
|
|
|
|
void MainWindowInputEQSL::setLOTWSenStatus(const QString _qs)
|
|
{
|
|
//qDebug() << "MainWindowInputEQSL::setLOTWSenStatus: " << _qs << endl;
|
|
if(( lotwSentComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
|
|
{
|
|
lotwSentComboBox->setCurrentIndex( lotwSentComboBox->findText(_qs+" -", Qt::MatchStartsWith));
|
|
}
|
|
else
|
|
{
|
|
lotwSentComboBox->setCurrentIndex(1);
|
|
}
|
|
}
|
|
|
|
|
|
void MainWindowInputEQSL::slotLotwRecvComboBoxChanged(){
|
|
//qDebug() << "MainWindowInputEQSL::slotLotwRecvComboBoxChanged" << endl;
|
|
|
|
//QSLRDATE (only valid if QSL_RCVD is Y-0, I-3, or V-4)
|
|
//Y-Yes-0
|
|
//N-No-1
|
|
//R-Requested-2
|
|
//I-Ignore-3
|
|
//V-Verified-4
|
|
|
|
int i = lotwRecComboBox->currentIndex();
|
|
|
|
switch (i)
|
|
{
|
|
case 0:
|
|
lotwRecQDateEdit->setEnabled(true);
|
|
lotwRecQDateEdit->setDate((QDateTime::currentDateTime()).date());
|
|
|
|
break;
|
|
case 2:
|
|
break;
|
|
case 3:
|
|
lotwRecQDateEdit->setEnabled(true);
|
|
break;
|
|
case 4:
|
|
lotwRecQDateEdit->setEnabled(true);
|
|
break;
|
|
default: //NO
|
|
lotwRecQDateEdit->setEnabled(false);
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
void MainWindowInputEQSL::slotLotwSentComboBoxChanged(){
|
|
//qDebug() << "MainWindowInputEQSL::slotLotwSentComboBoxChanged" << endl;
|
|
|
|
int i = lotwSentComboBox->currentIndex();
|
|
//{Y, N, R, I, V}
|
|
//(QSLSDATE is only valid if QSL_SENT is Y-0, Q-3, or I-4)
|
|
// Y-Yes = 0
|
|
// N-No = 1
|
|
// R-Requested = 2
|
|
// Q-Queued = 3
|
|
// I-Ignore = 4
|
|
switch (i)
|
|
{
|
|
case 0:
|
|
lotwSentQDateEdit->setEnabled(true);
|
|
lotwSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
|
|
|
|
break;
|
|
case 2:
|
|
break;
|
|
case 3:
|
|
lotwSentQDateEdit->setEnabled(true);
|
|
break;
|
|
case 4:
|
|
lotwSentQDateEdit->setEnabled(true);
|
|
break;
|
|
|
|
default: //NO
|
|
lotwSentQDateEdit->setEnabled(false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
void MainWindowInputEQSL::sloteQSLRecvComboBoxChanged(){
|
|
//qDebug() << "MainWindowInputEQSL::sloteQSLRecvComboBoxChanged" << endl;
|
|
|
|
//QSLRDATE (only valid if QSL_RCVD is Y-0, I-3, or V-4)
|
|
//Y-Yes-0
|
|
//N-No-1
|
|
//R-Requested-2
|
|
//I-Ignore-3
|
|
//V-Verified-4
|
|
|
|
int i = eqslRecComboBox->currentIndex();
|
|
|
|
switch (i)
|
|
{
|
|
case 0:
|
|
eqslRecQDateEdit->setEnabled(true);
|
|
eqslRecQDateEdit->setDate((QDateTime::currentDateTime()).date());
|
|
|
|
break;
|
|
case 2:
|
|
break;
|
|
case 3:
|
|
eqslRecQDateEdit->setEnabled(true);
|
|
break;
|
|
case 4:
|
|
eqslRecQDateEdit->setEnabled(true);
|
|
break;
|
|
default: //NO
|
|
eqslRecQDateEdit->setEnabled(false);
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
void MainWindowInputEQSL::sloteQSLSentComboBoxChanged(){
|
|
//qDebug() << "MainWindowInputEQSL::sloteQSLSentComboBoxChanged" << endl;
|
|
|
|
int i = eqslSentComboBox->currentIndex();
|
|
//{Y, N, R, I, V}
|
|
//(QSLSDATE is only valid if QSL_SENT is Y-0, Q-3, or I-4)
|
|
// Y-Yes = 0
|
|
// N-No = 1
|
|
// R-Requested = 2
|
|
// Q-Queued = 3
|
|
// I-Ignore = 4
|
|
switch (i)
|
|
{
|
|
case 0:
|
|
eqslSentQDateEdit->setEnabled(true);
|
|
eqslSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
|
|
|
|
break;
|
|
case 2:
|
|
break;
|
|
case 3:
|
|
eqslSentQDateEdit->setEnabled(true);
|
|
break;
|
|
case 4:
|
|
eqslSentQDateEdit->setEnabled(true);
|
|
break;
|
|
|
|
default: //NO
|
|
eqslSentQDateEdit->setEnabled(false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
void MainWindowInputEQSL::setClubLogDate(const QDate _qs)
|
|
{
|
|
if (_qs.isValid())
|
|
{
|
|
clublogQDateEdit->setDate(_qs);
|
|
}
|
|
else
|
|
{
|
|
clublogQDateEdit->clear();
|
|
}
|
|
}
|
|
|
|
void MainWindowInputEQSL::setEQSLRecDate(const QDate _qs)
|
|
{
|
|
if (_qs.isValid())
|
|
{
|
|
eqslRecQDateEdit->setDate(_qs);
|
|
}
|
|
else
|
|
{
|
|
eqslRecQDateEdit->clear();
|
|
}
|
|
}
|
|
|
|
void MainWindowInputEQSL::setEQSLSenDate(const QDate _qs)
|
|
{
|
|
if (_qs.isValid())
|
|
{
|
|
eqslSentQDateEdit->setDate(_qs);
|
|
}
|
|
else
|
|
{
|
|
eqslSentQDateEdit->clear();
|
|
}
|
|
}
|
|
|
|
void MainWindowInputEQSL::setLOTWRecDate(const QDate _qs)
|
|
{
|
|
if (_qs.isValid())
|
|
{
|
|
|
|
lotwRecQDateEdit->setDate(_qs);
|
|
}
|
|
else
|
|
{
|
|
lotwRecQDateEdit->clear();
|
|
}
|
|
}
|
|
|
|
void MainWindowInputEQSL::setLOTWSenDate(const QDate _qs)
|
|
{
|
|
if (_qs.isValid())
|
|
{
|
|
lotwSentQDateEdit->setDate(_qs);
|
|
}
|
|
else
|
|
{
|
|
lotwSentQDateEdit->clear();
|
|
}
|
|
}
|
|
|
|
QDate MainWindowInputEQSL::getClubLogDate()
|
|
{
|
|
return clublogQDateEdit->date();
|
|
}
|
|
|
|
QDate MainWindowInputEQSL::getEQSLRecDate()
|
|
{
|
|
return eqslRecQDateEdit->date();
|
|
}
|
|
|
|
QDate MainWindowInputEQSL::getEQSLSenDate()
|
|
{
|
|
return eqslSentQDateEdit->date();
|
|
}
|
|
|
|
QDate MainWindowInputEQSL::getLOTWRecDate()
|
|
{
|
|
return lotwRecQDateEdit->date();
|
|
}
|
|
|
|
QDate MainWindowInputEQSL::getLOTWSenDate()
|
|
{
|
|
return lotwSentQDateEdit->date();
|
|
}
|
|
|