| Line 5... |
Line 5... |
| 5 |
#include "structs.h"
|
5 |
#include "structs.h"
|
| 6 |
#include "proto.h"
|
6 |
#include "proto.h"
|
| 7 |
#include "mainwindow.h"
|
7 |
#include "mainwindow.h"
|
| 8 |
#include "twinspinbox.h"
|
8 |
#include "twinspinbox.h"
|
| 9 |
#include "qmeditaddendum.h"
|
9 |
#include "qmeditaddendum.h"
|
| - |
|
10 |
#include "qmeditawards.h"
|
| 10 |
|
11 |
|
| 11 |
QmConfTeams::QmConfTeams(QWidget *parent) :
|
12 |
QmConfTeams::QmConfTeams(QWidget *parent) :
|
| 12 |
QWidget(parent),
|
13 |
QWidget(parent),
|
| 13 |
ui(new Ui::QmConfigure)
|
14 |
ui(new Ui::QmConfigure)
|
| 14 |
{
|
15 |
{
|
| 15 |
ui->setupUi(this);
|
16 |
ui->setupUi(this);
|
| 16 |
connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(save()) );
|
17 |
connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(save()) );
|
| 17 |
connect(ui->pushButtonRestore, SIGNAL(clicked()), this, SLOT(cancel()) );
|
18 |
connect(ui->pushButtonRestore, SIGNAL(clicked()), this, SLOT(cancel()) );
|
| 18 |
connect(ui->editAddendum, SIGNAL(clicked()), this, SLOT(editAddendum()));
|
19 |
connect(ui->editAddendum, SIGNAL(clicked()), this, SLOT(editAddendum()));
|
| - |
|
20 |
connect(ui->editAwardsFileName, SIGNAL(clicked()), this, SLOT(editAwards()));
|
| - |
|
21 |
|
| 19 |
|
22 |
|
| 20 |
ui->spinBox_NeLeg->setMaximum(5);
|
23 |
ui->spinBox_NeLeg->setMaximum(5);
|
| 21 |
ui->spinBox_NeLeg->setMinimum(0);
|
24 |
ui->spinBox_NeLeg->setMinimum(0);
|
| 22 |
connect(ui->spinBox_NeLeg, SIGNAL(valueChanged(int)), this,SLOT(updateNe()));
|
25 |
connect(ui->spinBox_NeLeg, SIGNAL(valueChanged(int)), this,SLOT(updateNe()));
|
| 23 |
connect(ui->legNe1,SIGNAL(clicked()), this,SLOT(calcNe1()));
|
26 |
connect(ui->legNe1,SIGNAL(clicked()), this,SLOT(calcNe1()));
|
| Line 33... |
Line 36... |
| 33 |
connect(ui->legName4, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
36 |
connect(ui->legName4, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
| 34 |
connect(ui->legName5, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
37 |
connect(ui->legName5, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
| 35 |
|
38 |
|
| 36 |
connect(ui->ne_leg_abr, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
39 |
connect(ui->ne_leg_abr, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
| 37 |
connect(ui->addendum, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
40 |
connect(ui->addendum, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
| - |
|
41 |
connect(ui->awardsFileName, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
| 38 |
connect(ui->datafilename, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
42 |
connect(ui->datafilename, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
| 39 |
connect(ui->spinBox_LinesPerPage, SIGNAL(valueChanged(int)), this, SLOT(changed()));
|
43 |
connect(ui->spinBox_LinesPerPage, SIGNAL(valueChanged(int)), this, SLOT(changed()));
|
| 40 |
connect(ui->perfSkip, SIGNAL(stateChanged(int)), this, SLOT(changed()));
|
44 |
connect(ui->perfSkip, SIGNAL(stateChanged(int)), this, SLOT(changed()));
|
| 41 |
|
45 |
|
| 42 |
|
46 |
|
| Line 74... |
Line 78... |
| 74 |
ui->addendum->setMaxLength(sizeof(config.addendum)-1);
|
78 |
ui->addendum->setMaxLength(sizeof(config.addendum)-1);
|
| 75 |
|
79 |
|
| 76 |
ui->datafilename->setText(config.datafilename);
|
80 |
ui->datafilename->setText(config.datafilename);
|
| 77 |
ui->datafilename->setMaxLength(sizeof(config.datafilename) - 1);
|
81 |
ui->datafilename->setMaxLength(sizeof(config.datafilename) - 1);
|
| 78 |
|
82 |
|
| - |
|
83 |
ui->awardsFileName->setText(config.awardsfilename);
|
| - |
|
84 |
ui->awardsFileName->setMaxLength(sizeof(config.awardsfilename) - 1);
|
| - |
|
85 |
|
| 79 |
ui->legName1->setText(config.leg_name[0]);
|
86 |
ui->legName1->setText(config.leg_name[0]);
|
| 80 |
ui->legName1->setMaxLength(MAX_LEG_NAME);
|
87 |
ui->legName1->setMaxLength(MAX_LEG_NAME);
|
| 81 |
ui->legName2->setText(config.leg_name[1]);
|
88 |
ui->legName2->setText(config.leg_name[1]);
|
| 82 |
ui->legName2->setMaxLength(MAX_LEG_NAME);
|
89 |
ui->legName2->setMaxLength(MAX_LEG_NAME);
|
| 83 |
ui->legName3->setText(config.leg_name[2]);
|
90 |
ui->legName3->setText(config.leg_name[2]);
|
| Line 137... |
Line 144... |
| 137 |
** Extract data from Widgets
|
144 |
** Extract data from Widgets
|
| 138 |
*/
|
145 |
*/
|
| 139 |
strncpy(newcfg.event_name, qPrintable(ui->eventName->text()), sizeof(newcfg.event_name)) ;
|
146 |
strncpy(newcfg.event_name, qPrintable(ui->eventName->text()), sizeof(newcfg.event_name)) ;
|
| 140 |
strncpy(newcfg.datafilename, qPrintable(ui->datafilename->text()), sizeof(newcfg.datafilename)) ;
|
147 |
strncpy(newcfg.datafilename, qPrintable(ui->datafilename->text()), sizeof(newcfg.datafilename)) ;
|
| 141 |
strncpy(newcfg.addendum, qPrintable(ui->addendum->text()), sizeof(newcfg.addendum)) ;
|
148 |
strncpy(newcfg.addendum, qPrintable(ui->addendum->text()), sizeof(newcfg.addendum)) ;
|
| - |
|
149 |
strncpy(newcfg.awardsfilename, qPrintable(ui->awardsFileName->text()), sizeof(newcfg.awardsfilename)) ;
|
| 142 |
|
150 |
|
| 143 |
strncpy(newcfg.leg_name[0], qPrintable(ui->legName1->text()), sizeof(newcfg.leg_name[0])) ;
|
151 |
strncpy(newcfg.leg_name[0], qPrintable(ui->legName1->text()), sizeof(newcfg.leg_name[0])) ;
|
| 144 |
strncpy(newcfg.leg_name[1], qPrintable(ui->legName2->text()), sizeof(newcfg.leg_name[1])) ;
|
152 |
strncpy(newcfg.leg_name[1], qPrintable(ui->legName2->text()), sizeof(newcfg.leg_name[1])) ;
|
| 145 |
strncpy(newcfg.leg_name[2], qPrintable(ui->legName3->text()), sizeof(newcfg.leg_name[2])) ;
|
153 |
strncpy(newcfg.leg_name[2], qPrintable(ui->legName3->text()), sizeof(newcfg.leg_name[2])) ;
|
| 146 |
strncpy(newcfg.leg_name[3], qPrintable(ui->legName4->text()), sizeof(newcfg.leg_name[3])) ;
|
154 |
strncpy(newcfg.leg_name[3], qPrintable(ui->legName4->text()), sizeof(newcfg.leg_name[3])) ;
|
| Line 171... |
Line 179... |
| 171 |
compact( newcfg.event_name ); /* Rip of leading white_space */
|
179 |
compact( newcfg.event_name ); /* Rip of leading white_space */
|
| 172 |
for( int i = 0; i < MAX_LEGS; i++ )
|
180 |
for( int i = 0; i < MAX_LEGS; i++ )
|
| 173 |
compact( newcfg.leg_name[i] );
|
181 |
compact( newcfg.leg_name[i] );
|
| 174 |
compact( newcfg.addendum );
|
182 |
compact( newcfg.addendum );
|
| 175 |
compact( newcfg.datafilename );
|
183 |
compact( newcfg.datafilename );
|
| - |
|
184 |
compact( newcfg.awardsfilename );
|
| 176 |
|
185 |
|
| 177 |
/*
|
186 |
/*
|
| 178 |
* Do all sorts of consistency tests on the data
|
187 |
* Do all sorts of consistency tests on the data
|
| 179 |
* Firstly - calculate the number of legs. Justify the data in the array
|
188 |
* Firstly - calculate the number of legs. Justify the data in the array
|
| 180 |
*/
|
189 |
*/
|
| Line 343... |
Line 352... |
| 343 |
QmEditAddendum dialog(QmConfig::getAddendemFile(fname, true));
|
352 |
QmEditAddendum dialog(QmConfig::getAddendemFile(fname, true));
|
| 344 |
dialog.exec();
|
353 |
dialog.exec();
|
| 345 |
}
|
354 |
}
|
| 346 |
}
|
355 |
}
|
| 347 |
|
356 |
|
| - |
|
357 |
void QmConfTeams::editAwards(void)
|
| - |
|
358 |
{
|
| - |
|
359 |
QString fname = ui->awardsFileName->text();
|
| - |
|
360 |
if ( !fname.isEmpty() )
|
| - |
|
361 |
{
|
| - |
|
362 |
QmEditAwards dialog(QmConfig::getAddendemFile(fname, true));
|
| - |
|
363 |
dialog.exec();
|
| - |
|
364 |
}
|
| - |
|
365 |
}
|
| - |
|
366 |
|
| 348 |
QmConfTeams::~QmConfTeams()
|
367 |
QmConfTeams::~QmConfTeams()
|
| 349 |
{
|
368 |
{
|
| 350 |
delete ui;
|
369 |
delete ui;
|
| 351 |
}
|
370 |
}
|
| 352 |
|
371 |
|