| Line 17... |
Line 17... |
| 17 |
#define COL_TIME 2
|
17 |
#define COL_TIME 2
|
| 18 |
#define COL_WINNERS 3
|
18 |
#define COL_WINNERS 3
|
| 19 |
#define COL_NE 4
|
19 |
#define COL_NE 4
|
| 20 |
#define COL_NE_WINNERS 5
|
20 |
#define COL_NE_WINNERS 5
|
| 21 |
#define COL_ST_TOTAL 6
|
21 |
#define COL_ST_TOTAL 6
|
| - |
|
22 |
#define COL_ST_VALID 7
|
| 22 |
#define COL_ST_DISQ 7
|
23 |
#define COL_ST_DISQ 8
|
| 23 |
#define COL_ST_NONEQ 8
|
24 |
#define COL_ST_NONEQ 9
|
| 24 |
#define COL_ST_VET 9
|
25 |
#define COL_ST_VET 10
|
| 25 |
#define COL_COUNT 10
|
26 |
#define COL_COUNT 11
|
| 26 |
|
27 |
|
| 27 |
|
28 |
|
| 28 |
QmConfClass::QmConfClass(QWidget *parent) :
|
29 |
QmConfClass::QmConfClass(QWidget *parent) :
|
| 29 |
QWidget(parent),
|
30 |
QWidget(parent),
|
| 30 |
ui(new Ui::QmConfClass)
|
31 |
ui(new Ui::QmConfClass)
|
| Line 33... |
Line 34... |
| 33 |
populating = false;
|
34 |
populating = false;
|
| 34 |
connect(ui->pushButtonSave, SIGNAL(clicked(bool)), this, SLOT(save()) );
|
35 |
connect(ui->pushButtonSave, SIGNAL(clicked(bool)), this, SLOT(save()) );
|
| 35 |
connect(ui->pushButtonRestore, SIGNAL(clicked(bool)), this, SLOT(cancel()) );
|
36 |
connect(ui->pushButtonRestore, SIGNAL(clicked(bool)), this, SLOT(cancel()) );
|
| 36 |
|
37 |
|
| 37 |
QStringList labels;
|
38 |
QStringList labels;
|
| 38 |
labels << "Abr" << "Full Name" << "Start Time" << "Winners" << "NE" << "NE Winners";
|
39 |
labels << "Abr" << "Full Name" << "Start Time" << "Winners" << "NE" << "NE Winners";
|
| 39 |
|
40 |
|
| 40 |
|
41 |
|
| 41 |
ui->tableWidget->setRowCount(config.num_class + 1);
|
42 |
ui->tableWidget->setRowCount(config.num_class + 1);
|
| 42 |
ui->tableWidget->setColumnCount(COL_COUNT);
|
43 |
ui->tableWidget->setColumnCount(COL_COUNT);
|
| 43 |
ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
44 |
ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
| Line 59... |
Line 60... |
| 59 |
|
60 |
|
| 60 |
// Wire in the status button
|
61 |
// Wire in the status button
|
| 61 |
connect(ui->statusButton, SIGNAL(clicked()), this, SLOT(updateStatus()));
|
62 |
connect(ui->statusButton, SIGNAL(clicked()), this, SLOT(updateStatus()));
|
| 62 |
statusShown = false;
|
63 |
statusShown = false;
|
| 63 |
ui->tableWidget->setColumnHidden(COL_ST_TOTAL, true);
|
64 |
ui->tableWidget->setColumnHidden(COL_ST_TOTAL, true);
|
| - |
|
65 |
ui->tableWidget->setColumnHidden(COL_ST_VALID, true);
|
| 64 |
ui->tableWidget->setColumnHidden(COL_ST_DISQ, true);
|
66 |
ui->tableWidget->setColumnHidden(COL_ST_DISQ, true);
|
| 65 |
ui->tableWidget->setColumnHidden(COL_ST_NONEQ, true);
|
67 |
ui->tableWidget->setColumnHidden(COL_ST_NONEQ, true);
|
| 66 |
ui->tableWidget->setColumnHidden(COL_ST_VET, true);
|
68 |
ui->tableWidget->setColumnHidden(COL_ST_VET, true);
|
| 67 |
|
69 |
|
| 68 |
labels << "Total" <<"Disqual" << "NonEq" << "VetCheck";
|
70 |
labels << "Total" << "Valid" <<"Disqual" << "NonEq" << "VetCheck";
|
| 69 |
|
71 |
|
| 70 |
ui->tableWidget->setHorizontalHeaderLabels(labels);
|
72 |
ui->tableWidget->setHorizontalHeaderLabels(labels);
|
| 71 |
ui->tableWidget->resizeColumnsToContents();
|
73 |
ui->tableWidget->resizeColumnsToContents();
|
| 72 |
|
74 |
|
| 73 |
}
|
75 |
}
|
| Line 255... |
Line 257... |
| 255 |
if (newcfg.nonequestrian_class)
|
257 |
if (newcfg.nonequestrian_class)
|
| 256 |
{
|
258 |
{
|
| 257 |
newcfg.class_ne_winners_by_class = false;
|
259 |
newcfg.class_ne_winners_by_class = false;
|
| 258 |
for( int i = 0; i < MAX_CLASS; i++ )
|
260 |
for( int i = 0; i < MAX_CLASS; i++ )
|
| 259 |
{
|
261 |
{
|
| - |
|
262 |
if ( newcfg.class_ne_winners[i])
|
| - |
|
263 |
{
|
| 260 |
newcfg.class_ne_winners_by_class = true;
|
264 |
newcfg.class_ne_winners_by_class = true;
|
| 261 |
break;
|
265 |
break;
|
| - |
|
266 |
}
|
| 262 |
}
|
267 |
}
|
| 263 |
if (newcfg.class_winners[newcfg.nonequestrian_class - 1] && newcfg.class_ne_winners_by_class )
|
268 |
if (newcfg.class_winners[newcfg.nonequestrian_class - 1] && newcfg.class_ne_winners_by_class )
|
| 264 |
{
|
269 |
{
|
| 265 |
MainWindow::showMessage( QString("Should not mix NE winners by each class and by NE Class"));
|
270 |
MainWindow::showMessage( QString("Should not mix NE winners by each class and by NE Class"));
|
| 266 |
//throw( "Error: Cannot mix NE winners by each class and by NE Class" );
|
271 |
//throw( "Error: Cannot mix NE winners by each class and by NE Class" );
|
| Line 320... |
Line 325... |
| 320 |
{
|
325 |
{
|
| 321 |
populating = true;
|
326 |
populating = true;
|
| 322 |
if (!statusShown)
|
327 |
if (!statusShown)
|
| 323 |
{
|
328 |
{
|
| 324 |
ui->tableWidget->setColumnHidden(COL_ST_TOTAL, false);
|
329 |
ui->tableWidget->setColumnHidden(COL_ST_TOTAL, false);
|
| - |
|
330 |
ui->tableWidget->setColumnHidden(COL_ST_VALID, false);
|
| 325 |
ui->tableWidget->setColumnHidden(COL_ST_DISQ, false);
|
331 |
ui->tableWidget->setColumnHidden(COL_ST_DISQ, false);
|
| 326 |
ui->tableWidget->setColumnHidden(COL_ST_NONEQ, false);
|
332 |
ui->tableWidget->setColumnHidden(COL_ST_NONEQ, false);
|
| 327 |
ui->tableWidget->setColumnHidden(COL_ST_VET, false);
|
333 |
ui->tableWidget->setColumnHidden(COL_ST_VET, false);
|
| 328 |
statusShown = true;
|
334 |
statusShown = true;
|
| 329 |
}
|
335 |
}
|
| Line 340... |
Line 346... |
| 340 |
QTableWidgetItem *item;
|
346 |
QTableWidgetItem *item;
|
| 341 |
item = new QTableWidgetItem(QString::number(data.teamclass[ii+1].total));
|
347 |
item = new QTableWidgetItem(QString::number(data.teamclass[ii+1].total));
|
| 342 |
item->setFlags(Qt::NoItemFlags);
|
348 |
item->setFlags(Qt::NoItemFlags);
|
| 343 |
ui->tableWidget->setItem(ii,COL_ST_TOTAL, item );
|
349 |
ui->tableWidget->setItem(ii,COL_ST_TOTAL, item );
|
| 344 |
|
350 |
|
| - |
|
351 |
item = new QTableWidgetItem(QString::number(data.teamclass[ii+1].valid));
|
| - |
|
352 |
item->setFlags(Qt::NoItemFlags);
|
| - |
|
353 |
ui->tableWidget->setItem(ii,COL_ST_VALID, item );
|
| - |
|
354 |
|
| 345 |
item = new QTableWidgetItem(QString::number(data.teamclass[ii+1].disqualified)) ;
|
355 |
item = new QTableWidgetItem(QString::number(data.teamclass[ii+1].disqualified)) ;
|
| 346 |
item->setFlags(Qt::NoItemFlags);
|
356 |
item->setFlags(Qt::NoItemFlags);
|
| 347 |
ui->tableWidget->setItem(ii,COL_ST_DISQ, item);
|
357 |
ui->tableWidget->setItem(ii,COL_ST_DISQ, item);
|
| 348 |
|
358 |
|
| 349 |
item = new QTableWidgetItem(QString::number(data.teamclass[ii+1].non_equestrian));
|
359 |
item = new QTableWidgetItem(QString::number(data.teamclass[ii+1].non_equestrian));
|