Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Grid Award Stats #566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added Grid Awards
Added options for 2,4 and 6 digit grids in Awards window.
aa5sh committed Jan 7, 2025
commit 4eef46293c840a214e9cbf9eff8a57c5f32c0037
44 changes: 44 additions & 0 deletions ui/AwardsDialog.cpp
Original file line number Diff line number Diff line change
@@ -41,6 +41,9 @@ AwardsDialog::AwardsDialog(QWidget *parent) :
ui->awardComboBox->addItem(tr("POTA Activator"), QVariant("potaa"));
ui->awardComboBox->addItem(tr("SOTA"), QVariant("sota"));
ui->awardComboBox->addItem(tr("WWFF"), QVariant("wwff"));
ui->awardComboBox->addItem(tr("Gridsquare 2-Digit"), QVariant("grid2"));
ui->awardComboBox->addItem(tr("Gridsquare 4-Digit"), QVariant("grid4"));
ui->awardComboBox->addItem(tr("Gridsquare 6-Digit"), QVariant("grid6"));

ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Done"));
ui->awardTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
@@ -247,6 +250,47 @@ void AwardsDialog::refreshTable(int)
addWherePart = " AND c.iota is not NULL"
" AND c.my_dxcc = '" + entitySelected + "' ";
}
else if ( awardSelected == "grid2" )
{
setEntityInputEnabled(true);
setNotWorkedEnabled(false);
const QString &entitySelected = getSelectedEntity();
headersColumns = "substr(c.gridsquare,1,2) col1, NULL col2 ";
uniqColumns = "substr(c.gridsquare,1,2)";
sqlPartDetailTable = " FROM source_contacts c"
" INNER JOIN modes m ON c.mode = m.name"
" WHERE c.my_dxcc = '" + entitySelected + "' ";
addWherePart = " AND c.gridsquare is not NULL"
" AND c.my_dxcc = '" + entitySelected + "' ";
}
else if ( awardSelected == "grid4" )
{
setEntityInputEnabled(true);
setNotWorkedEnabled(false);
const QString &entitySelected = getSelectedEntity();
headersColumns = "substr(c.gridsquare,1,4) col1, NULL col2 ";
uniqColumns = "substr(c.gridsquare,1,4)";
sqlPartDetailTable = " FROM source_contacts c"
" INNER JOIN modes m ON c.mode = m.name"
" WHERE c.my_dxcc = '" + entitySelected + "' ";
addWherePart = " AND c.gridsquare is not NULL"
" AND length(c.gridsquare) >= 4 "
" AND c.my_dxcc = '" + entitySelected + "' ";
}
else if ( awardSelected == "grid6" )
{
setEntityInputEnabled(true);
setNotWorkedEnabled(false);
const QString &entitySelected = getSelectedEntity();
headersColumns = "substr(c.gridsquare,1,6) col1, NULL col2 ";
uniqColumns = "substr(c.gridsquare,1,6)";
sqlPartDetailTable = " FROM source_contacts c"
" INNER JOIN modes m ON c.mode = m.name"
" WHERE c.my_dxcc = '" + entitySelected + "' ";
addWherePart = " AND c.gridsquare is not NULL"
" AND length(c.gridsquare) >= 6 "
" AND c.my_dxcc = '" + entitySelected + "' ";
}
else if ( awardSelected == "potah" )
{
setEntityInputEnabled(false);