2015-02-16 17:31:09 +00:00
|
|
|
/***************************************************************************
|
|
|
|
setuppagelogsnew.h - description
|
|
|
|
-------------------
|
|
|
|
begin : feb 2015
|
|
|
|
copyright : (C) 2015 by Jaime Robles
|
|
|
|
email : jaime@robles.es
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* This file is part of KLog. *
|
|
|
|
* *
|
|
|
|
* KLog is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* KLog is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*****************************************************************************/
|
|
|
|
//
|
|
|
|
// This class implements the Dialog to add a new log
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "setuppagelogsnew.h"
|
|
|
|
|
|
|
|
|
|
|
|
SetupPageLogsNew::SetupPageLogsNew(QWidget *parent)
|
|
|
|
{
|
2015-02-17 19:44:44 +00:00
|
|
|
dataProxy = new DataProxy_SQLite();
|
2015-04-03 14:44:39 +00:00
|
|
|
editing = false;
|
|
|
|
checking = false;
|
|
|
|
bCass = false;
|
|
|
|
bCOp = false;
|
|
|
|
bCMo = false;
|
|
|
|
bCPo = false;
|
|
|
|
bCBa = false;
|
|
|
|
bCOv = false;
|
|
|
|
bCTy = false;
|
2015-02-17 19:44:44 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
logData.clear();
|
|
|
|
stationCallsignFilled = false;
|
|
|
|
operatorsFilled = true;
|
|
|
|
stationCallsign = QString();
|
|
|
|
operators = QString();
|
|
|
|
comment = QString();
|
|
|
|
dateString = QString();
|
2015-04-03 14:44:39 +00:00
|
|
|
typeContest = 0;
|
|
|
|
contestCatMode = 0;
|
|
|
|
contestCatOperators = 0;
|
|
|
|
contestCatAssisted = 0;
|
|
|
|
contestCatPower = 0;
|
|
|
|
contestCatBands = 0;
|
|
|
|
contestBands = 0;
|
|
|
|
contestCatOverlay = 0;
|
|
|
|
typeContestSelected = 0;
|
2015-03-01 11:17:47 +00:00
|
|
|
typeConteststr = QString();
|
2015-02-28 20:50:49 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
|
|
|
|
stationCallsignLineEdit = new QLineEdit;
|
|
|
|
operatorsLineEdit = new QLineEdit;
|
|
|
|
|
|
|
|
dateEdit = new QDateEdit;
|
|
|
|
dateEdit->setDate(QDate::currentDate ());
|
|
|
|
commentLineEdit = new QLineEdit;
|
|
|
|
|
|
|
|
typeComboBox = new QComboBox;
|
|
|
|
contestCatModeComboBox = new QComboBox;
|
|
|
|
contestCatOperatorsComboBox = new QComboBox;
|
|
|
|
contestCatAssistedComboBox = new QComboBox;
|
|
|
|
contestCatPowerComboBox = new QComboBox;
|
|
|
|
contestCatBandsComboBox = new QComboBox;
|
|
|
|
contestBandsComboBox = new QComboBox;
|
2015-02-28 20:50:49 +00:00
|
|
|
contestCatOverlayComboBox = new QComboBox;
|
|
|
|
contestCatModeComboBox = new QComboBox;
|
2015-02-16 17:31:09 +00:00
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
catAsLabel = new QLabel();
|
|
|
|
typeLabel = new QLabel();
|
|
|
|
catOpLabel = new QLabel();
|
|
|
|
catModeLabel = new QLabel();
|
|
|
|
catPowerLabel = new QLabel();
|
|
|
|
catBandsLabel = new QLabel();
|
|
|
|
overlayLabel = new QLabel();
|
2015-04-04 09:06:26 +00:00
|
|
|
validCats = new QLabel();
|
2015-04-03 14:44:39 +00:00
|
|
|
|
2015-05-02 19:00:48 +00:00
|
|
|
dateLabel = new QLabel(tr("&Date"));
|
|
|
|
stationCallsignLabel = new QLabel(tr("&Station Callsign"));
|
|
|
|
operatorsLabel = new QLabel(tr("&Operators"));
|
|
|
|
commentLabel = new QLabel(tr("Comm&ent"));
|
2015-04-03 14:44:39 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
okButton = new QPushButton(tr("&Ok"), this);
|
|
|
|
cancelButton = new QPushButton(tr("&Cancel"), this);
|
|
|
|
createWidget();
|
|
|
|
|
2015-03-18 18:42:16 +00:00
|
|
|
isThereAnyNotManagedLog();
|
2015-04-23 18:39:00 +00:00
|
|
|
okButton->setEnabled(false);
|
2015-03-18 18:42:16 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::createWidget()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::createWidget" << endl;
|
2015-04-04 09:06:26 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
stationCallsignLabel->setWordWrap(true);
|
|
|
|
operatorsLabel->setWordWrap(true);
|
|
|
|
commentLabel->setWordWrap(true);
|
2015-05-02 19:00:48 +00:00
|
|
|
dateLabel->setBuddy(dateEdit);
|
|
|
|
|
|
|
|
stationCallsignLabel->setBuddy(stationCallsignLineEdit);
|
|
|
|
operatorsLabel->setBuddy(operatorsLineEdit);
|
|
|
|
commentLabel->setBuddy(commentLineEdit);
|
|
|
|
catAsLabel->setBuddy(contestCatAssistedComboBox);
|
|
|
|
typeLabel->setBuddy(typeComboBox);
|
|
|
|
catOpLabel->setBuddy(contestCatOperatorsComboBox);
|
|
|
|
catModeLabel->setBuddy(contestCatModeComboBox);
|
|
|
|
catPowerLabel->setBuddy(contestCatPowerComboBox);
|
|
|
|
catBandsLabel->setBuddy(contestCatBandsComboBox);
|
|
|
|
overlayLabel->setBuddy(contestCatOverlayComboBox);
|
|
|
|
|
|
|
|
validCats->setText(tr("Select categories"));
|
|
|
|
validCats->setWordWrap(true);
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
|
|
|
|
stationCallsignLineEdit->setToolTip(tr("Callsign used for this log"));
|
|
|
|
operatorsLineEdit->setToolTip(tr("Comma separated list of operators: callsign1, callsign2"));
|
|
|
|
|
|
|
|
dateEdit->setToolTip(tr("Start date of this log"));
|
|
|
|
commentLineEdit->setToolTip(tr("Add a comment about this log"));
|
|
|
|
|
2015-05-02 19:00:48 +00:00
|
|
|
typeLabel->setText(tr("&Type of Operation"));
|
2015-02-16 17:31:09 +00:00
|
|
|
typeLabel->setWordWrap(true);
|
2015-05-02 19:00:48 +00:00
|
|
|
|
|
|
|
//nameLabel->setWordWrap(true);
|
2015-02-16 17:31:09 +00:00
|
|
|
dateLabel->setWordWrap(true);
|
|
|
|
|
2015-02-28 20:50:49 +00:00
|
|
|
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
typeComboBox->setToolTip(tr("Select the kind of operation for this log"));
|
|
|
|
QStringList _qs;
|
|
|
|
_qs.clear();
|
2015-02-28 20:50:49 +00:00
|
|
|
_qs.append(dataProxy->getContestNames());
|
2015-02-16 17:31:09 +00:00
|
|
|
typeComboBox->addItems(_qs);
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::createWidget - contestNames: " << _qs.at(0) << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
|
2015-05-02 19:00:48 +00:00
|
|
|
catModeLabel->setText(tr("&Mode Category"));
|
2015-02-16 17:31:09 +00:00
|
|
|
catModeLabel->setWordWrap(true);
|
|
|
|
contestCatModeComboBox->setToolTip(tr("Select the mode category"));
|
|
|
|
_qs.clear();
|
2015-02-28 20:50:49 +00:00
|
|
|
_qs.append(dataProxy->getContestCat(6));
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatModeComboBox->addItems(_qs);
|
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
//QLabel *catOpLabel = new QLabel(tr("Operators Category"));
|
2015-05-02 19:00:48 +00:00
|
|
|
catOpLabel->setText(tr("O&perators Category"));
|
2015-02-16 17:31:09 +00:00
|
|
|
catOpLabel->setWordWrap(true);
|
|
|
|
contestCatOperatorsComboBox->setToolTip(tr("Select the operators category"));
|
|
|
|
_qs.clear();
|
2015-02-28 20:50:49 +00:00
|
|
|
_qs.append(dataProxy->getContestCat(1));
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatOperatorsComboBox->addItems(_qs);
|
|
|
|
|
2015-05-02 19:00:48 +00:00
|
|
|
catAsLabel->setText(tr("&Assisted Category"));
|
2015-02-16 17:31:09 +00:00
|
|
|
catOpLabel->setWordWrap(true);
|
|
|
|
contestCatAssistedComboBox->setToolTip(tr("Select the assisted category"));
|
|
|
|
_qs.clear();
|
2015-02-28 20:50:49 +00:00
|
|
|
_qs.append(dataProxy->getContestCat(2));
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatAssistedComboBox->addItems(_qs);
|
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
//QLabel *catPowerLabel = new QLabel(tr("Power Category"));
|
2015-05-02 19:00:48 +00:00
|
|
|
catPowerLabel->setText(tr("Po&wer Category"));
|
2015-02-16 17:31:09 +00:00
|
|
|
catPowerLabel->setWordWrap(true);
|
|
|
|
contestCatPowerComboBox->setToolTip(tr("Select the power category"));
|
|
|
|
_qs.clear();
|
2015-02-28 20:50:49 +00:00
|
|
|
_qs.append(dataProxy->getContestCat(3));
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatPowerComboBox->addItems(_qs);
|
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
//QLabel *catBandsLabel = new QLabel(tr("Bands Category"));
|
2015-05-02 19:00:48 +00:00
|
|
|
catBandsLabel->setText(tr("&Bands Category"));
|
2015-02-16 17:31:09 +00:00
|
|
|
catBandsLabel->setWordWrap(true);
|
|
|
|
contestCatBandsComboBox->setToolTip(tr("Select the bands category"));
|
|
|
|
_qs.clear();
|
2015-02-28 20:50:49 +00:00
|
|
|
_qs.append(dataProxy->getContestCat(4));
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatBandsComboBox->addItems(_qs);
|
|
|
|
|
2015-05-02 19:00:48 +00:00
|
|
|
overlayLabel->setText(tr("O&verlay"));
|
2015-04-03 14:44:39 +00:00
|
|
|
overlayLabel->setWordWrap(true);
|
|
|
|
contestCatOverlayComboBox->setToolTip(tr("Select the Overlay category"));
|
2015-02-28 20:50:49 +00:00
|
|
|
_qs.clear();
|
2015-04-03 14:44:39 +00:00
|
|
|
_qs.append(dataProxy->getContestOverlays());
|
2015-02-28 20:50:49 +00:00
|
|
|
contestCatOverlayComboBox->addItems(_qs);
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
connect(stationCallsignLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotStationCallSignTextChanged() ) );
|
2015-02-28 20:50:49 +00:00
|
|
|
connect(operatorsLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotOperatorsTextChanged() ) );
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
connect(typeComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotTypeComboBoxChanged() ) ) ;
|
2015-02-16 17:31:09 +00:00
|
|
|
connect(contestCatModeComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatModeComboBoxChanged() ) ) ;
|
|
|
|
connect(contestCatAssistedComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatAssistedComboBoxChanged() ) ) ;
|
|
|
|
connect(contestCatOperatorsComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatOperatorsComboBoxChanged() ) ) ;
|
|
|
|
connect(contestCatPowerComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatPowerComboBoxChanged() ) ) ;
|
|
|
|
connect(contestCatBandsComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatBandsComboBoxChanged() ) ) ;
|
2015-02-28 20:50:49 +00:00
|
|
|
connect(contestCatOverlayComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatOverlayComboBoxChanged() ) ) ;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
//connect(typeComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotTypeComboBoxChanged() ) ) ;
|
|
|
|
//connect(contestCatModeComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatModeComboBoxChanged() ) ) ;
|
|
|
|
//connect(contestCatAssistedComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatAssistedComboBoxChanged() ) ) ;
|
|
|
|
//connect(contestCatOperatorsComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatOperatorsComboBoxChanged() ) ) ;
|
|
|
|
//connect(contestCatPowerComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatPowerComboBoxChanged() ) ) ;
|
|
|
|
//connect(contestCatBandsComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatBandsComboBoxChanged() ) ) ;
|
|
|
|
//connect(contestCatOverlayComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatOverlayComboBoxChanged() ) ) ;
|
|
|
|
|
|
|
|
connect(contestBandsComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotBandsComboBoxChanged() ) ) ;
|
2015-02-28 20:50:49 +00:00
|
|
|
//connect(contestCatModeComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatModeComboBoxChanged() ) ) ;
|
2015-02-16 17:31:09 +00:00
|
|
|
connect(okButton,SIGNAL(clicked()), this, SLOT(slotOKButtonClicked() ) );
|
|
|
|
connect(cancelButton, SIGNAL(clicked()), this, SLOT(slotCancelButtonClicked() ) );
|
|
|
|
|
|
|
|
QGridLayout *callsLayout = new QGridLayout; // Widget, row, column
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
callsLayout->addWidget(stationCallsignLabel, 0, 0);
|
|
|
|
callsLayout->addWidget(stationCallsignLineEdit, 0, 1);
|
|
|
|
callsLayout->addWidget(dateLabel, 1, 0);
|
|
|
|
callsLayout->addWidget(dateEdit, 1, 1);
|
|
|
|
|
|
|
|
callsLayout->addWidget(operatorsLabel, 2, 0);
|
|
|
|
callsLayout->addWidget(operatorsLineEdit, 2, 1);
|
|
|
|
callsLayout->addWidget(typeLabel, 3, 0);
|
|
|
|
callsLayout->addWidget(typeComboBox, 3, 1);
|
|
|
|
callsLayout->addWidget(catModeLabel, 4, 0);
|
|
|
|
callsLayout->addWidget(contestCatModeComboBox, 4, 1);
|
|
|
|
callsLayout->addWidget(catOpLabel, 5, 0);
|
|
|
|
callsLayout->addWidget(contestCatOperatorsComboBox, 5, 1);
|
|
|
|
callsLayout->addWidget(catAsLabel, 6, 0);
|
|
|
|
callsLayout->addWidget(contestCatAssistedComboBox, 6, 1);
|
|
|
|
|
|
|
|
callsLayout->addWidget(catPowerLabel, 7, 0);
|
|
|
|
callsLayout->addWidget(contestCatPowerComboBox, 7, 1);
|
|
|
|
|
|
|
|
callsLayout->addWidget(catBandsLabel, 8, 0);
|
|
|
|
callsLayout->addWidget(contestCatBandsComboBox, 8, 1);
|
|
|
|
callsLayout->addWidget(contestBandsComboBox, 8, 2);
|
|
|
|
callsLayout->addWidget(commentLabel, 9, 0);
|
|
|
|
callsLayout->addWidget(commentLineEdit, 9, 1);
|
|
|
|
|
|
|
|
callsLayout->addWidget(overlayLabel, 10, 0);
|
|
|
|
callsLayout->addWidget(contestCatOverlayComboBox, 10, 1);
|
2015-02-16 17:31:09 +00:00
|
|
|
|
|
|
|
QHBoxLayout *buttonsLayout = new QHBoxLayout;
|
2015-04-04 09:06:26 +00:00
|
|
|
buttonsLayout->addWidget(validCats);
|
2015-02-16 17:31:09 +00:00
|
|
|
buttonsLayout->addSpacerItem(new QSpacerItem(10,0,QSizePolicy::Expanding,QSizePolicy::Maximum));
|
|
|
|
buttonsLayout->addWidget(okButton);
|
|
|
|
buttonsLayout->addWidget(cancelButton);
|
|
|
|
|
|
|
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
|
|
|
mainLayout->addLayout(callsLayout);
|
|
|
|
mainLayout->addLayout(buttonsLayout);
|
|
|
|
|
|
|
|
setLayout(mainLayout);
|
|
|
|
//page->setLayout(callsLayout);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-02-28 20:50:49 +00:00
|
|
|
void SetupPageLogsNew::slotOperatorsTextChanged()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOperatorsTextChanged" << endl;
|
2015-02-28 20:50:49 +00:00
|
|
|
// connect(stationCallsignLineEdit, SIGNAL(textChanged(QString)), this, SLOT( ) );
|
2015-04-04 09:06:26 +00:00
|
|
|
if ((operatorsLineEdit->text()).length()<1)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-02-28 20:50:49 +00:00
|
|
|
int cursorP = operatorsLineEdit->cursorPosition();
|
|
|
|
|
|
|
|
QString currentQrz = operatorsLineEdit->text();
|
|
|
|
if ((currentQrz.at(cursorP-1)).isSpace())
|
|
|
|
{
|
|
|
|
currentQrz = currentQrz.remove(cursorP-1, 1);
|
|
|
|
cursorP--;
|
|
|
|
operatorsLineEdit->setText(currentQrz);
|
|
|
|
}
|
|
|
|
|
|
|
|
operatorsLineEdit->setText(((operatorsLineEdit->text())).simplified());
|
|
|
|
operatorsLineEdit->setText((operatorsLineEdit->text()).toUpper());
|
|
|
|
|
|
|
|
operatorsLineEdit->setCursorPosition(cursorP);
|
|
|
|
|
|
|
|
if (currentQrz.length()>=3)
|
|
|
|
{//TODO: Add a check of the format (comma separated)
|
|
|
|
operatorsFilled= true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
void SetupPageLogsNew::slotStationCallSignTextChanged()
|
|
|
|
{
|
|
|
|
//qDebug() << "SetupPageLogsNew::slotStationCallSignTextChanged" << endl;
|
|
|
|
// connect(stationCallsignLineEdit, SIGNAL(textChanged(QString)), this, SLOT( ) );
|
2015-04-04 09:06:26 +00:00
|
|
|
if ((stationCallsignLineEdit->text()).length()<1)
|
|
|
|
{
|
2015-04-23 18:39:00 +00:00
|
|
|
showNOK();
|
2015-04-04 09:06:26 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
int cursorP = stationCallsignLineEdit->cursorPosition();
|
|
|
|
|
|
|
|
QString currentQrz = stationCallsignLineEdit->text();
|
|
|
|
if ((currentQrz.at(cursorP-1)).isSpace())
|
|
|
|
{
|
|
|
|
currentQrz = currentQrz.remove(cursorP-1, 1);
|
|
|
|
cursorP--;
|
|
|
|
stationCallsignLineEdit->setText(currentQrz);
|
|
|
|
}
|
|
|
|
|
|
|
|
stationCallsignLineEdit->setText(((stationCallsignLineEdit->text())).simplified());
|
|
|
|
stationCallsignLineEdit->setText((stationCallsignLineEdit->text()).toUpper());
|
|
|
|
|
|
|
|
stationCallsignLineEdit->setCursorPosition(cursorP);
|
|
|
|
|
|
|
|
if (currentQrz.length()>=3)
|
|
|
|
{
|
|
|
|
stationCallsignFilled = true;
|
|
|
|
}
|
2015-04-23 18:39:00 +00:00
|
|
|
showOK();
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
void SetupPageLogsNew::slotTypeComboBoxChanged()
|
2015-02-16 17:31:09 +00:00
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotTypeComboBoxChanged" << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
// connect(typeComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotTypeComboBoxChanged() ) ) ;
|
|
|
|
|
2015-04-03 14:46:39 +00:00
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
|
|
|
contestCatOverlay= contestCatOverlayComboBox->currentIndex();
|
2015-02-16 17:31:09 +00:00
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
typeContest = getSelectedTypeContest();
|
2015-02-16 17:31:09 +00:00
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
if (typeContest < 0)
|
|
|
|
{
|
|
|
|
typeLabel->setStyleSheet("QLabel {color : red; }");
|
2015-04-04 09:06:26 +00:00
|
|
|
validCats->setText(tr("Categories not OK"));
|
|
|
|
validCats->setStyleSheet("QLabel {color : red; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
okButton->setEnabled(false);
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
typeLabel->setStyleSheet("QLabel {color : black; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetupPageLogsNew::slotCatAssistedComboBoxChanged()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogs:slotCatAssistedComboBoxChanged: " << QString::number(contestCatAssistedComboBox->currentIndex()) << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
//connect(contestCatAssistedComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatAssistedComboBoxChanged() ) ) ;
|
2015-02-28 20:50:49 +00:00
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
|
|
|
contestCatOverlay= contestCatOverlayComboBox->currentIndex();
|
|
|
|
|
|
|
|
typeContest = getSelectedTypeContest();
|
|
|
|
|
|
|
|
if (typeContest < 0)
|
|
|
|
{
|
|
|
|
catAsLabel->setStyleSheet("QLabel {color : red; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showNOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
catAsLabel->setStyleSheet("QLabel {color : black; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
2015-02-28 20:50:49 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
2015-04-03 14:44:39 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
void SetupPageLogsNew::slotCatOperatorsComboBoxChanged()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotCatOperatorsComboBoxChanged(): " << QString::number(contestCatOperatorsComboBox->currentIndex()) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
|
|
|
contestCatOverlay= contestCatOverlayComboBox->currentIndex();
|
|
|
|
|
|
|
|
typeContest = getSelectedTypeContest();
|
|
|
|
|
|
|
|
if (typeContest < 0)
|
|
|
|
{
|
|
|
|
catOpLabel->setStyleSheet("QLabel {color : red; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showNOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
catOpLabel->setStyleSheet("QLabel {color : black; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
2015-02-28 20:50:49 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
2015-04-03 14:44:39 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
void SetupPageLogsNew::slotCatPowerComboBoxChanged()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotCatPowerComboBoxChanged(): " << QString::number(contestCatPowerComboBox->currentIndex()) << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
//connect(contestCatPowerComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatPowerComboBoxChanged() ) ) ;
|
2015-02-28 20:50:49 +00:00
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
|
|
|
contestCatOverlay= contestCatOverlayComboBox->currentIndex();
|
|
|
|
|
|
|
|
typeContest = getSelectedTypeContest();
|
|
|
|
|
|
|
|
if (typeContest < 0)
|
|
|
|
{
|
|
|
|
catPowerLabel->setStyleSheet("QLabel {color : red; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showNOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
catPowerLabel->setStyleSheet("QLabel {color : black; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::slotCatBandsComboBoxChanged()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotCatBandsComboBoxChanged(): " << QString::number(contestCatBandsComboBox->currentIndex()) << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
//connect(contestCatBandsComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotCatBandsComboBoxChanged() ) ) ;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
|
|
|
contestCatOverlay= contestCatOverlayComboBox->currentIndex();
|
|
|
|
|
|
|
|
typeContest = getSelectedTypeContest();
|
|
|
|
|
|
|
|
if (typeContest < 0)
|
|
|
|
{
|
|
|
|
catBandsLabel->setStyleSheet("QLabel {color : red; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showNOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
catBandsLabel->setStyleSheet("QLabel {color : black; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
2015-02-28 20:50:49 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
void SetupPageLogsNew::slotBandsComboBoxChanged()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotBandsComboBoxChanged(): " << QString::number(contestBandsComboBox->currentIndex()) << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
//connect(contestBandsComboBox, SIGNAL(currentIndexChanged ( int)), this, SLOT(slotBandsComboBoxChanged() ) ) ;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
2015-02-28 20:50:49 +00:00
|
|
|
|
|
|
|
void SetupPageLogsNew::slotCatOverlayComboBoxChanged()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotCatOverlayComboBoxChanged(): " << QString::number(contestCatOverlayComboBox->currentIndex()) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
|
|
|
contestCatOverlay= contestCatOverlayComboBox->currentIndex();
|
|
|
|
|
|
|
|
typeContest = getSelectedTypeContest();
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotCatOverlayComboBoxChanged(): typeContest = " << QString::number(typeContest) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
if (typeContest < 0)
|
|
|
|
{
|
|
|
|
overlayLabel->setStyleSheet("QLabel {color : red; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showNOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
overlayLabel->setStyleSheet("QLabel {color : black; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
2015-02-28 20:50:49 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
void SetupPageLogsNew::slotCatModeComboBoxChanged()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotCatModeComboBoxChanged(): " << QString::number(contestCatModeComboBox->currentIndex()) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
|
|
|
contestCatOverlay= contestCatOverlayComboBox->currentIndex();
|
|
|
|
|
|
|
|
typeContest = getSelectedTypeContest();
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotCatModeComboBoxChanged(): " << QString::number(typeContest) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
if (typeContest < 0)
|
|
|
|
{
|
|
|
|
catModeLabel->setStyleSheet("QLabel {color : red; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showNOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
catModeLabel->setStyleSheet("QLabel {color : black; }");
|
2015-04-23 18:39:00 +00:00
|
|
|
showOK();
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
2015-02-16 17:31:09 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::slotOKButtonClicked()
|
|
|
|
{
|
2015-04-03 14:44:39 +00:00
|
|
|
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked" << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
stationCallsign = stationCallsignLineEdit->text();
|
2015-04-20 17:55:01 +00:00
|
|
|
if (stationCallsign.length()<3)
|
|
|
|
{
|
|
|
|
QMessageBox msgBox;
|
|
|
|
msgBox.setIcon(QMessageBox::Information);
|
2015-04-25 19:28:58 +00:00
|
|
|
msgBox.setText(tr("You need to enter a valid QRZ in the Station Callsign box.\nThe log will not be opened."));
|
2015-04-20 17:55:01 +00:00
|
|
|
msgBox.exec();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
operators = operatorsLineEdit->text();
|
2015-02-17 19:44:44 +00:00
|
|
|
comment = commentLineEdit->text();
|
|
|
|
dateString = dateEdit->date().toString("yyyy/MM/dd");
|
2015-02-16 17:31:09 +00:00
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
//typeContest, contestCatOperators, contestCatAssisted, contestCatPower,
|
|
|
|
//contestCatBands, contestCatOverlay, contestCatMode
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
if (typeComboBox->isEnabled())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: type" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
2015-03-01 11:17:47 +00:00
|
|
|
typeConteststr = typeComboBox->currentText();
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked NOT ENA: type" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
typeContestSelected = 0;
|
2015-03-01 11:17:47 +00:00
|
|
|
typeConteststr = QString();
|
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (contestCatModeComboBox->isEnabled())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: mode" << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked NOT ENA: mode" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatMode = 0;
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (contestCatOperatorsComboBox->isEnabled())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: oper" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked NOT ENA: oper" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatOperators = 0;
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (contestCatAssistedComboBox->isEnabled())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: ass" << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked NOT ENA: ass" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatAssisted = 0;
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (contestCatPowerComboBox->isEnabled())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: pwr" << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: pwr - " << contestCatPowerComboBox->currentText() << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked NOT ENA: pwr" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatPower = 0;
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (contestCatBandsComboBox->isEnabled())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: Cbands" << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked NOT ENA: Cbands" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatBands = 0;
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (contestBandsComboBox->isEnabled())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: bands" << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
contestBands = contestBandsComboBox->currentIndex();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked NOT ENA: bands" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
contestBands = 0;
|
2015-02-16 17:31:09 +00:00
|
|
|
}
|
|
|
|
|
2015-02-28 20:50:49 +00:00
|
|
|
if (contestCatOverlayComboBox->isEnabled())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked ENA: over" << endl;
|
2015-02-28 20:50:49 +00:00
|
|
|
contestCatOverlay = contestCatOverlayComboBox->currentIndex();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotOkButtonClicked NOT ENA: over" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
contestCatOverlay = 0;
|
2015-02-28 20:50:49 +00:00
|
|
|
}
|
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
//typeContest, contestCatOperators, contestCatAssisted, contestCatPower,
|
|
|
|
//contestCatBands, contestCatOverlay, contestCatMode
|
|
|
|
typeContest = getSelectedTypeContest();
|
|
|
|
if (typeContest < 0)
|
|
|
|
{
|
|
|
|
QMessageBox msgBox;
|
|
|
|
msgBox.setIcon(QMessageBox::Information);
|
2015-04-25 19:28:58 +00:00
|
|
|
msgBox.setText(tr("You selected an invalid combination.\nThe log will not be opened."));
|
2015-04-03 14:44:39 +00:00
|
|
|
msgBox.exec();
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gatherAndSend();
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
2015-02-16 17:31:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
void SetupPageLogsNew::gatherAndSend()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::gatherAndSend: " << typeConteststr << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
logData.clear();
|
2015-04-19 17:24:07 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
logData << stationCallsign << operators << comment << dateString
|
2015-03-01 11:17:47 +00:00
|
|
|
<< typeConteststr
|
2015-02-16 17:31:09 +00:00
|
|
|
<< QString::number(contestCatMode)
|
|
|
|
<< QString::number(contestCatOperators)
|
|
|
|
<< QString::number(contestCatAssisted)
|
|
|
|
<< QString::number(contestCatPower)
|
|
|
|
<< QString::number(contestCatBands)
|
2015-02-28 20:50:49 +00:00
|
|
|
<< QString::number(contestBands)
|
2015-04-03 14:44:39 +00:00
|
|
|
<< QString::number(contestCatOverlay)
|
|
|
|
<< QString::number(typeContest);
|
2015-04-19 17:24:07 +00:00
|
|
|
//logData << QString::number(typeContest)
|
2015-02-28 20:50:49 +00:00
|
|
|
// Update the SetupPageLogs::slotAnalyzeNewLogData if you add or remove any field (Today 12)
|
2015-02-16 17:31:09 +00:00
|
|
|
emit newLogData(logData);
|
|
|
|
|
|
|
|
}
|
2015-02-28 20:50:49 +00:00
|
|
|
|
2015-02-16 17:31:09 +00:00
|
|
|
void SetupPageLogsNew::slotCancelButtonClicked()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::slotCancelButtonClicked" << endl;
|
2015-02-16 17:31:09 +00:00
|
|
|
logData.clear();
|
|
|
|
close();
|
|
|
|
}
|
2015-02-28 20:50:49 +00:00
|
|
|
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
|
2015-02-28 20:50:49 +00:00
|
|
|
QStringList SetupPageLogsNew::getValidCatOptions(const int _currentCat, const int _higherCat)
|
|
|
|
{// currentCat is the current category and highercat is the category we want to know the information
|
|
|
|
// being:
|
|
|
|
// 1 - contestcatoperator
|
|
|
|
// 2 - contestcatassisted
|
|
|
|
// 3 - contestcatpower
|
|
|
|
// 4 - contestcatband
|
|
|
|
// 5 - contestcatoverlay
|
|
|
|
// 6 - contestcatmode
|
|
|
|
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::getValidCatOptions: " << QString::number(_currentCat) <<"/"<< QString::number(_higherCat) << endl;
|
2015-02-28 20:50:49 +00:00
|
|
|
//return dataProxy->getValidCatOptions(_currentCat, _higherCat);
|
2016-08-02 11:33:28 +00:00
|
|
|
return QStringList();
|
2015-02-28 20:50:49 +00:00
|
|
|
}
|
|
|
|
|
2015-03-18 18:42:16 +00:00
|
|
|
bool SetupPageLogsNew::isThereAnyNotManagedLog()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::isThereAnyNotManagedLog" << endl;
|
2015-03-18 18:42:16 +00:00
|
|
|
|
|
|
|
QSqlQuery query;
|
|
|
|
if (query.exec("SELECT DISTINCT lognumber FROM log WHERE lognumber!=1"))
|
|
|
|
{
|
|
|
|
while (query.next())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::isThereAnyNotManagedLog en el while" << endl;
|
2015-03-18 18:42:16 +00:00
|
|
|
if (query.isValid())
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::isThereAnyNotManagedLog - Log found!: " << QString::number((query.value(0)).toInt()) << endl;
|
2015-03-18 18:42:16 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::isThereAnyNotManagedLog Not valid!" << endl;
|
2015-03-18 18:42:16 +00:00
|
|
|
}
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::isThereAnyNotManagedLog en el while - FINAL" << endl;
|
2015-03-18 18:42:16 +00:00
|
|
|
}
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::isThereAnyNotManagedLog tras el while" << endl;
|
2015-03-18 18:42:16 +00:00
|
|
|
}
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::isThereAnyNotManagedLog END" << endl;
|
2016-08-02 11:33:28 +00:00
|
|
|
return false;
|
2015-03-18 18:42:16 +00:00
|
|
|
}
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
void SetupPageLogsNew::setStationCallSign(const QString _st)
|
|
|
|
{
|
|
|
|
stationCallsign = _st;
|
|
|
|
stationCallsignLineEdit->setText(stationCallsign.toUpper());
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setOperators(const QString _st)
|
|
|
|
{
|
|
|
|
operators = _st;
|
|
|
|
operatorsLineEdit->setText(operators.toUpper());
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setComment(const QString _st)
|
|
|
|
{
|
|
|
|
comment = _st;
|
|
|
|
commentLineEdit->setText(comment.toUpper());
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setDateString(const QString _st)
|
|
|
|
{
|
|
|
|
dateString = _st;
|
|
|
|
dateEdit->setDate(QDate::fromString(dateString, "yyyy/MM/dd"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setType(const QString _st)
|
|
|
|
{
|
|
|
|
typeConteststr = _st;
|
|
|
|
//typeConteststr = typeComboBox->currentText();
|
|
|
|
typeComboBox->setCurrentIndex(typeComboBox->findText(typeConteststr, Qt::MatchExactly));
|
|
|
|
|
|
|
|
//findText ( const QString & text, Qt::MatchFlags flags = static_cast<Qt::MatchFlags> ( Qt::MatchExactly | Qt::MatchCaseSensitive ) ) const
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setCMode(const int _n)
|
|
|
|
{
|
|
|
|
contestCatMode = _n;
|
|
|
|
contestCatModeComboBox->setCurrentIndex(contestCatMode);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setCOperators(const int _n)
|
|
|
|
{
|
|
|
|
contestCatOperators = _n;
|
|
|
|
contestCatOperatorsComboBox->setCurrentIndex(contestCatOperators);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setCAssisted(const int _n)
|
|
|
|
{
|
|
|
|
contestCatAssisted = _n;
|
|
|
|
contestCatAssistedComboBox->setCurrentIndex(contestCatAssisted);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setCPower(const int _n)
|
|
|
|
{
|
|
|
|
contestCatPower = _n;
|
|
|
|
contestCatPowerComboBox->setCurrentIndex(contestCatPower);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setCBands(const int _n)
|
|
|
|
{
|
|
|
|
contestCatBands = _n;
|
|
|
|
contestCatBandsComboBox->setCurrentIndex(contestCatBands);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setBands(const int _n)
|
|
|
|
{
|
|
|
|
contestBands = _n;
|
|
|
|
contestBandsComboBox->setCurrentIndex(contestBands);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setCOverlay(const int _n)
|
|
|
|
{
|
|
|
|
contestCatOverlay = _n;
|
|
|
|
contestCatOverlayComboBox->setCurrentIndex(contestCatOverlay);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setEditing(const bool b)
|
|
|
|
{
|
|
|
|
editing = b;
|
|
|
|
}
|
|
|
|
|
|
|
|
int SetupPageLogsNew::getSelectedTypeContest()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::getSelectedTypeContest: " << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
//is/contest/catoperator/catassisted/catpower/catband/catoverlay/catmode
|
|
|
|
int i = dataProxy->getContestTypeN(typeContestSelected, contestCatOperators, contestCatAssisted, contestCatPower, contestCatBands, contestCatOverlay, contestCatMode);
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::getSelectedTypeContest: " << QString::number(i) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
return i;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::setTypeN(const int _n)
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::setTypeN: " << QString::number(_n) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
typeContestSelected = _n;
|
|
|
|
fillWithType(typeContestSelected);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::fillWithType(const int _n)
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::fillWithType - n = " << QString::number(_n) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
typeContestSelected = _n;
|
|
|
|
QStringList contestData;
|
|
|
|
contestData << dataProxy->getDataFromContestType(_n);
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::fillWithType-1 (length = " << QString::number(contestData.length()) << ")" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
if (contestData.length()== 8)
|
|
|
|
{
|
|
|
|
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::fillWithType-2" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
setCOperators ((contestData.at(1)).toInt());
|
|
|
|
setCAssisted ((contestData.at(2)).toInt());
|
|
|
|
setCPower ((contestData.at(3)).toInt());
|
|
|
|
setCOverlay ((contestData.at(4)).toInt());
|
|
|
|
setCMode ((contestData.at(5)).toInt());
|
|
|
|
setType(contestData.at(6));
|
|
|
|
setCBands((contestData.at(7)).toInt());
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::fillWithType: " << contestData.at(6) << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::fillWithType-3" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::updateAllCats()
|
|
|
|
{
|
2015-04-20 17:55:01 +00:00
|
|
|
//qDebug() << "SetupPageLogsNew::updateAllCats" << endl;
|
2015-04-03 14:44:39 +00:00
|
|
|
|
|
|
|
contestCatMode = contestCatModeComboBox->currentIndex();
|
|
|
|
contestCatBands = contestCatBandsComboBox->currentIndex();
|
|
|
|
contestCatPower = contestCatPowerComboBox->currentIndex();
|
|
|
|
contestCatOperators = contestCatOperatorsComboBox->currentIndex();
|
|
|
|
contestCatAssisted = contestCatAssistedComboBox->currentIndex();
|
|
|
|
typeContestSelected = typeComboBox->currentIndex();
|
|
|
|
contestCatOverlay= contestCatOverlayComboBox->currentIndex();
|
|
|
|
|
|
|
|
typeContest = getSelectedTypeContest();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-04-23 18:39:00 +00:00
|
|
|
void SetupPageLogsNew::showOK()
|
|
|
|
{
|
|
|
|
validCats->setText(tr("Categories OK"));
|
|
|
|
validCats->setStyleSheet("QLabel {color : black; }");
|
|
|
|
okButton->setEnabled(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupPageLogsNew::showNOK()
|
|
|
|
{
|
|
|
|
validCats->setText(tr("Categories not OK"));
|
|
|
|
validCats->setStyleSheet("QLabel {color : red; }");
|
|
|
|
okButton->setEnabled(false);
|
|
|
|
}
|