Subversion Repositories svn1

Rev

Rev 182 | Rev 197 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 182 Rev 183
Line 1... Line 1...
1
#include "qmconfteams.h"
1
#include "qmconfteams.h"
2
#include "qmconfig.h"
2
#include "qmconfig.h"
3
#include "ui_qmconfteams.h"
3
#include "ui_qmconfteams.h"
4
#include    "consts.h"
4
#include "consts.h"
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
 
9
 
9
QmConfTeams::QmConfTeams(QWidget *parent) :
10
QmConfTeams::QmConfTeams(QWidget *parent) :
10
    QWidget(parent),
11
    QWidget(parent),
11
    ui(new Ui::QmConfigure)
12
    ui(new Ui::QmConfigure)
12
{
13
{
Line 34... Line 35...
34
    connect(ui->addendum, SIGNAL(textChanged(QString)), this, SLOT(changed()));
35
    connect(ui->addendum, SIGNAL(textChanged(QString)), this, SLOT(changed()));
35
    connect(ui->datafilename, SIGNAL(textChanged(QString)), this, SLOT(changed()));
36
    connect(ui->datafilename, SIGNAL(textChanged(QString)), this, SLOT(changed()));
36
    connect(ui->spinBox_LinesPerPage, SIGNAL(valueChanged(int)), this, SLOT(changed()));
37
    connect(ui->spinBox_LinesPerPage, SIGNAL(valueChanged(int)), this, SLOT(changed()));
37
    connect(ui->perfSkip, SIGNAL(stateChanged(int)), this, SLOT(changed()));
38
    connect(ui->perfSkip, SIGNAL(stateChanged(int)), this, SLOT(changed()));
38
 
39
 
39
    connect(ui->spinBox_1l, SIGNAL(valueChanged(int)), this, SLOT(changed()));
-
 
40
    connect(ui->spinBox_1u, SIGNAL(valueChanged(int)), this, SLOT(changed()));
-
 
41
 
40
 
42
    connect(ui->spinBox_2l, SIGNAL(valueChanged(int)), this, SLOT(changed()));
41
    ui->tn1->setLimits( 0, 999);
43
    connect(ui->spinBox_2u, SIGNAL(valueChanged(int)), this, SLOT(changed()));
42
    ui->tn2->setLimits( 0, 999);
44
    connect(ui->spinBox_3l, SIGNAL(valueChanged(int)), this, SLOT(changed()));
43
    ui->tn3->setLimits( 0, 999);
-
 
44
    ui->tn4->setLimits( 0, 999);
-
 
45
    ui->tn5->setLimits( 0, 999);
45
    connect(ui->spinBox_3u, SIGNAL(valueChanged(int)), this, SLOT(changed()));
46
    ui->tn6->setLimits( 0, 999);
46
    connect(ui->spinBox_4l, SIGNAL(valueChanged(int)), this, SLOT(changed()));
47
    ui->tn7->setLimits( 0, 999);
47
    connect(ui->spinBox_4u, SIGNAL(valueChanged(int)), this, SLOT(changed()));
48
    ui->tn8->setLimits( 0, 999);
-
 
49
 
48
    connect(ui->spinBox_5l, SIGNAL(valueChanged(int)), this, SLOT(changed()));
50
    connect(ui->tn1, SIGNAL(changed()), this, SLOT(changed()));
49
    connect(ui->spinBox_5u, SIGNAL(valueChanged(int)), this, SLOT(changed()));
51
    connect(ui->tn2, SIGNAL(changed()), this, SLOT(changed()));
50
    connect(ui->spinBox_6l, SIGNAL(valueChanged(int)), this, SLOT(changed()));
52
    connect(ui->tn3, SIGNAL(changed()), this, SLOT(changed()));
51
    connect(ui->spinBox_6u, SIGNAL(valueChanged(int)), this, SLOT(changed()));
53
    connect(ui->tn4, SIGNAL(changed()), this, SLOT(changed()));
52
    connect(ui->spinBox_7l, SIGNAL(valueChanged(int)), this, SLOT(changed()));
54
    connect(ui->tn5, SIGNAL(changed()), this, SLOT(changed()));
53
    connect(ui->spinBox_7u, SIGNAL(valueChanged(int)), this, SLOT(changed()));
55
    connect(ui->tn6, SIGNAL(changed()), this, SLOT(changed()));
54
    connect(ui->spinBox_8l, SIGNAL(valueChanged(int)), this, SLOT(changed()));
56
    connect(ui->tn7, SIGNAL(changed()), this, SLOT(changed()));
55
    connect(ui->spinBox_8u, SIGNAL(valueChanged(int)), this, SLOT(changed()));
57
    connect(ui->tn8, SIGNAL(changed()), this, SLOT(changed()));
56
 
58
 
57
    populating = false;
59
    populating = false;
58
    dirty = true;
60
    dirty = true;
59
    populate();
61
    populate();
60
 
62
 
Line 81... Line 83...
81
    ui->legName4->setText(config.leg_name[3]);
83
    ui->legName4->setText(config.leg_name[3]);
82
    ui->legName4->setMaxLength(MAX_LEG_NAME);
84
    ui->legName4->setMaxLength(MAX_LEG_NAME);
83
    ui->legName5->setText(config.leg_name[4]);
85
    ui->legName5->setText(config.leg_name[4]);
84
    ui->legName5->setMaxLength(MAX_LEG_NAME);
86
    ui->legName5->setMaxLength(MAX_LEG_NAME);
85
 
87
 
86
    ui->spinBox_1l->setValue( config.t_def[0].start);
88
    ui->tn1->setData( config.t_def[0].start, config.t_def[0].end);
87
    ui->spinBox_1u->setValue( config.t_def[0].end);
-
 
88
    ui->spinBox_2l->setValue( config.t_def[1].start);
89
    ui->tn2->setData( config.t_def[1].start, config.t_def[1].end);
89
    ui->spinBox_2u->setValue( config.t_def[1].end);
-
 
90
    ui->spinBox_3l->setValue( config.t_def[2].start);
90
    ui->tn3->setData( config.t_def[2].start, config.t_def[2].end);
91
    ui->spinBox_3u->setValue( config.t_def[2].end);
-
 
92
    ui->spinBox_4l->setValue( config.t_def[3].start);
91
    ui->tn4->setData( config.t_def[3].start, config.t_def[3].end);
93
    ui->spinBox_4u->setValue( config.t_def[3].end);
-
 
94
    ui->spinBox_5l->setValue( config.t_def[4].start);
92
    ui->tn5->setData( config.t_def[4].start, config.t_def[4].end);
95
    ui->spinBox_5u->setValue( config.t_def[4].end);
-
 
96
    ui->spinBox_6l->setValue( config.t_def[5].start);
93
    ui->tn6->setData( config.t_def[5].start, config.t_def[5].end);
97
    ui->spinBox_6u->setValue( config.t_def[5].end);
-
 
98
    ui->spinBox_7l->setValue( config.t_def[6].start);
94
    ui->tn7->setData( config.t_def[6].start, config.t_def[6].end);
99
    ui->spinBox_7u->setValue( config.t_def[6].end);
-
 
100
    ui->spinBox_8l->setValue( config.t_def[7].start);
95
    ui->tn8->setData( config.t_def[7].start, config.t_def[7].end);
101
    ui->spinBox_8u->setValue( config.t_def[7].end);
-
 
102
 
96
 
103
    ui->spinBox_NeLeg->setValue(config.equestrian_leg);
97
    ui->spinBox_NeLeg->setValue(config.equestrian_leg);
104
    updateNe();
98
    updateNe();
105
    ui->ne_leg_abr->setText(config.nonequestrian_class_abr);
99
    ui->ne_leg_abr->setText(config.nonequestrian_class_abr);
106
    ui->ne_leg_abr->setMaxLength(sizeof(config.nonequestrian_class_abr)-1);
100
    ui->ne_leg_abr->setMaxLength(sizeof(config.nonequestrian_class_abr)-1);
Line 148... Line 142...
148
    strncpy(newcfg.leg_name[1], qPrintable(ui->legName2->text()), sizeof(newcfg.leg_name[1])) ;
142
    strncpy(newcfg.leg_name[1], qPrintable(ui->legName2->text()), sizeof(newcfg.leg_name[1])) ;
149
    strncpy(newcfg.leg_name[2], qPrintable(ui->legName3->text()), sizeof(newcfg.leg_name[2])) ;
143
    strncpy(newcfg.leg_name[2], qPrintable(ui->legName3->text()), sizeof(newcfg.leg_name[2])) ;
150
    strncpy(newcfg.leg_name[3], qPrintable(ui->legName4->text()), sizeof(newcfg.leg_name[3])) ;
144
    strncpy(newcfg.leg_name[3], qPrintable(ui->legName4->text()), sizeof(newcfg.leg_name[3])) ;
151
    strncpy(newcfg.leg_name[4], qPrintable(ui->legName5->text()), sizeof(newcfg.leg_name[4])) ;
145
    strncpy(newcfg.leg_name[4], qPrintable(ui->legName5->text()), sizeof(newcfg.leg_name[4])) ;
152
 
146
 
153
    newcfg.t_def[0].start = ui->spinBox_1l->value();
147
    ui->tn1->getData(&newcfg.t_def[0].start, &newcfg.t_def[0].end);
154
    newcfg.t_def[0].end = ui->spinBox_1u->value();
-
 
155
 
-
 
156
    newcfg.t_def[1].start = ui->spinBox_2l->value();
148
    ui->tn2->getData(&newcfg.t_def[1].start, &newcfg.t_def[1].end);
157
    newcfg.t_def[1].end   = ui->spinBox_2u->value();
-
 
158
 
-
 
159
    newcfg.t_def[2].start = ui->spinBox_3l->value();
149
    ui->tn3->getData(&newcfg.t_def[2].start, &newcfg.t_def[2].end);
160
    newcfg.t_def[2].end   = ui->spinBox_3u->value();
-
 
161
 
-
 
162
    newcfg.t_def[3].start = ui->spinBox_4l->value();
150
    ui->tn4->getData(&newcfg.t_def[3].start, &newcfg.t_def[3].end);
163
    newcfg.t_def[3].end   = ui->spinBox_4u->value();
-
 
164
 
-
 
165
    newcfg.t_def[4].start = ui->spinBox_5l->value();
151
    ui->tn5->getData(&newcfg.t_def[4].start, &newcfg.t_def[4].end);
166
    newcfg.t_def[4].end   = ui->spinBox_5u->value();
-
 
167
 
-
 
168
    newcfg.t_def[5].start = ui->spinBox_6l->value();
152
    ui->tn6->getData(&newcfg.t_def[5].start, &newcfg.t_def[5].end);
169
    newcfg.t_def[5].end   = ui->spinBox_6u->value();
-
 
170
 
-
 
171
    newcfg.t_def[6].start = ui->spinBox_7l->value();
153
    ui->tn7->getData(&newcfg.t_def[6].start, &newcfg.t_def[6].end);
172
    newcfg.t_def[6].end   = ui->spinBox_7u->value();
-
 
173
 
-
 
174
    newcfg.t_def[7].start = ui->spinBox_8l->value();
154
    ui->tn8->getData(&newcfg.t_def[7].start, &newcfg.t_def[7].end);
175
    newcfg.t_def[7].end   = ui->spinBox_8u->value();
-
 
176
 
155
 
177
    newcfg.equestrian_leg = ui->spinBox_NeLeg->value();
156
    newcfg.equestrian_leg = ui->spinBox_NeLeg->value();
178
    strncpy(newcfg.nonequestrian_class_abr, qPrintable(ui->ne_leg_abr->text()), sizeof(newcfg.nonequestrian_class_abr)-1) ;
157
    strncpy(newcfg.nonequestrian_class_abr, qPrintable(ui->ne_leg_abr->text()), sizeof(newcfg.nonequestrian_class_abr)-1) ;
179
 
158
 
180
    newcfg.lines_per_page = ui->spinBox_LinesPerPage->value();
159
    newcfg.lines_per_page = ui->spinBox_LinesPerPage->value();