Subversion Repositories svn1

Rev

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

Rev 278 Rev 279
Line 47... Line 47...
47
    horizontalLayout1 = new QHBoxLayout();
47
    horizontalLayout1 = new QHBoxLayout();
48
    horizontalLayout1->setContentsMargins(5, 5, 5, 5);
48
    horizontalLayout1->setContentsMargins(5, 5, 5, 5);
49
    groupBox2->setLayout(horizontalLayout1);
49
    groupBox2->setLayout(horizontalLayout1);
50
    groupBox2->setToolTip("Enable Tests to be performed");
50
    groupBox2->setToolTip("Enable Tests to be performed");
51
 
51
 
52
    cb1 = new QCheckBox("Disq");
52
    cb_all = new QCheckBox("All");
53
    cb1->setChecked(true);
53
    cb_all->setChecked(true);
-
 
54
    cb_all->setToolTip("Enable all tests");
54
    horizontalLayout1->addWidget(cb1);
55
    horizontalLayout1->addWidget(cb_all);
-
 
56
 
-
 
57
    QFrame *line = new QFrame();
-
 
58
    line->setObjectName(QString::fromUtf8("line"));
-
 
59
    line->setGeometry(QRect(320, 150, 118, 3));
-
 
60
    line->setFrameShape(QFrame::VLine);
-
 
61
    line->setFrameShadow(QFrame::Sunken);
-
 
62
    horizontalLayout1->addWidget(line);
55
 
63
 
56
//    cb_ne = new QCheckBox("Non Equest");
64
    cb_teamName = new QCheckBox("Team Names");
-
 
65
    cb_teamName->setChecked(true);
-
 
66
    cb_teamName->setToolTip("Check that teams have a name");
-
 
67
    horizontalLayout1->addWidget(cb_teamName);
-
 
68
 
-
 
69
    cb_class = new QCheckBox("Class");
57
//    cb_ne->setTristate(true);
70
    cb_class->setChecked(true);
-
 
71
    cb_class->setToolTip("Check that teams have a valid class");
58
//    horizontalLayout1->addWidget(cb_ne);
72
    horizontalLayout1->addWidget(cb_class);
59
 
73
 
60
//    cb_enable = new QCheckBox("Enable");
74
    cb_neNames = new QCheckBox("NE/Names");
61
//    cb_enable->setTristate(true);
75
    cb_neNames->setChecked(true);
-
 
76
    cb_neNames->setToolTip("Check that NE teams do not have a\nteam member for the equestrian leg");
62
//    horizontalLayout1->addWidget(cb_enable);
77
    horizontalLayout1->addWidget(cb_neNames);
63
 
78
 
64
//    cb_vetcheck = new QCheckBox("Vet Check");
79
    cb_checkLegs = new QCheckBox("Leg Times");
65
//    cb_vetcheck->setTristate(true);
80
    cb_checkLegs->setChecked(true);
-
 
81
    cb_checkLegs->setToolTip("Check Leg Start and End times");
66
//    horizontalLayout1->addWidget(cb_vetcheck);
82
    horizontalLayout1->addWidget(cb_checkLegs);
67
        
83
 
68
    horizontalLayout1->addWidget(new QLabel("Leg"));
84
    horizontalLayout1->addWidget(new QLabel("Leg"));
69
    leg = new QmTeamSelector();
85
    leg = new QmTeamSelector();
70
    horizontalLayout1->addWidget(leg);
86
    horizontalLayout1->addWidget(leg);
71
 
87
 
72
    horizontalSpacer1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
88
    horizontalSpacer1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
73
    horizontalLayout1->addItem(horizontalSpacer1);
89
    horizontalLayout->addItem(horizontalSpacer1);
74
 
90
 
75
    buttonBox = new QDialogButtonBox();
91
    buttonBox = new QDialogButtonBox();
76
    pb_check = buttonBox->addButton("Check",QDialogButtonBox::ActionRole );
92
    pb_check = buttonBox->addButton("Check",QDialogButtonBox::ActionRole );
77
    pb_cancel = buttonBox->addButton("Clear",QDialogButtonBox::ActionRole );
93
    pb_cancel = buttonBox->addButton("Clear",QDialogButtonBox::ActionRole );
78
    horizontalLayout->addWidget(buttonBox);
94
    horizontalLayout->addWidget(buttonBox);
Line 82... Line 98...
82
    leg->setValue(config.num_legs);
98
    leg->setValue(config.num_legs);
83
 
99
 
84
    connect(pb_check, SIGNAL(clicked()), this, SLOT(populate()));
100
    connect(pb_check, SIGNAL(clicked()), this, SLOT(populate()));
85
    connect(pb_cancel, SIGNAL(clicked()), this, SLOT(cancel()) );
101
    connect(pb_cancel, SIGNAL(clicked()), this, SLOT(cancel()) );
86
    connect(listWidget,SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(selected(QListWidgetItem *)));
102
    connect(listWidget,SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(selected(QListWidgetItem *)));
-
 
103
    connect(cb_all, SIGNAL(clicked()), this, SLOT(checkAllTests()));
87
}
104
}
88
 
105
 
89
qmDataCheck::~qmDataCheck()
106
qmDataCheck::~qmDataCheck()
90
{
107
{
91
 
108
 
Line 135... Line 152...
135
        {
152
        {
136
            g_record( tm, &team_buf );
153
            g_record( tm, &team_buf );
137
            if ( !team_buf.flags.disqualified && team_buf.flags.valid)
154
            if ( !team_buf.flags.disqualified && team_buf.flags.valid)
138
            {
155
            {
139
                // Test for class not defined
156
                // Test for class not defined
140
                if ( team_buf.teamclass <= 0)
157
                if ( cb_class->isChecked() && (team_buf.teamclass <= 0))
141
                {
158
                {
142
                    addItem(tm, 0, QString("Team %1, No Class specified").arg(QString::number(tm) ) );
159
                    addItem(tm, 0, QString("Team %1, No Class specified").arg(QString::number(tm) ) );
143
                    badData = 1;
160
                    badData = 1;
144
                }
161
                }
145
 
162
 
146
                if ( strlen (team_buf.name) <= 0)
163
                if ( cb_teamName->isChecked() && (strlen (team_buf.name) <= 0))
147
                {
164
                {
148
                    addItem(tm, 0, QString("Team %1, No Team Name specified").arg(QString::number(tm) ) );
165
                    addItem(tm, 0, QString("Team %1, No Team Name specified").arg(QString::number(tm) ) );
149
                    badData = 1;
166
                    badData = 1;
150
                }
167
                }
151
 
168
 
152
                // Test for NE Team with a team name
169
                // Test for NE Team with a team name
153
                if ( team_buf.flags.non_equestrian && config.equestrian_leg )
170
                if (cb_neNames->isChecked() && team_buf.flags.non_equestrian && config.equestrian_leg )
154
                {
171
                {
155
                    int neindex = config.equestrian_leg - 1;
172
                    int neindex = config.equestrian_leg - 1;
156
                    char *nptr = team_buf.members[neindex].name;
173
                    char *nptr = team_buf.members[neindex].name;
157
 
174
 
158
                    // Ignore allowed NE names
175
                    // Ignore allowed NE names
Line 164... Line 181...
164
                        badData = 1;
181
                        badData = 1;
165
                    }
182
                    }
166
                }
183
                }
167
 
184
 
168
                // Test Leg Data if required
185
                // Test Leg Data if required
169
                if (leg_end)
186
                if (cb_checkLegs->isChecked() && leg_end)
170
                {
187
                {
171
                    test_times( &team_buf, leg_end );
188
                    test_times( &team_buf, leg_end );
172
                    if( check_error.type > 0 )
189
                    if( check_error.type > 0 )
173
                    {
190
                    {
174
                        addItem(tm, check_error.leg, QString("Team %1, Leg %2: %3").arg(QString::number(tm)).arg(QString::number(check_error.leg)).arg(qck_err_mess[check_error.type]));
191
                        addItem(tm, check_error.leg, QString("Team %1, Leg %2: %3").arg(QString::number(tm)).arg(QString::number(check_error.leg)).arg(qck_err_mess[check_error.type]));
Line 224... Line 241...
224
        qmDialogTeamEditor dialog(myitem->team, this);
241
        qmDialogTeamEditor dialog(myitem->team, this);
225
        dialog.exec();
242
        dialog.exec();
226
    }
243
    }
227
}
244
}
228
 
245
 
-
 
246
void qmDataCheck::checkAllTests(void)
-
 
247
{
-
 
248
    bool all_state = cb_all->isChecked();
-
 
249
 
-
 
250
    cb_checkLegs->setChecked(all_state);
-
 
251
    cb_class->setChecked(all_state);
-
 
252
    cb_neNames->setChecked(all_state);
-
 
253
    cb_teamName->setChecked(all_state);
-
 
254
}
-
 
255