Subversion Repositories svn1-original

Rev

Rev 363 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 363 Rev 365
Line 16... Line 16...
16
    ui->setupUi(this);
16
    ui->setupUi(this);
17
    connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(save()) );
17
    connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(save()) );
18
    connect(ui->pushButtonRestore, SIGNAL(clicked()), this, SLOT(cancel()) );
18
    connect(ui->pushButtonRestore, SIGNAL(clicked()), this, SLOT(cancel()) );
19
    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()));
20
    connect(ui->editAwardsFileName, SIGNAL(clicked()), this, SLOT(editAwards()));
-
 
21
    connect(ui->pushButtonExit, SIGNAL(clicked()), this, SLOT(quitApplication()));
21
 
22
 
22
 
23
 
23
    ui->spinBox_NeLeg->setMaximum(5);
24
    ui->spinBox_NeLeg->setMaximum(5);
24
    ui->spinBox_NeLeg->setMinimum(0);
25
    ui->spinBox_NeLeg->setMinimum(0);
25
    connect(ui->spinBox_NeLeg, SIGNAL(valueChanged(int)), this,SLOT(updateNe()));
26
    connect(ui->spinBox_NeLeg, SIGNAL(valueChanged(int)), this,SLOT(updateNe()));
Line 62... Line 63...
62
    connect(ui->tn7, SIGNAL(changed()), this, SLOT(changed()));
63
    connect(ui->tn7, SIGNAL(changed()), this, SLOT(changed()));
63
    connect(ui->tn8, SIGNAL(changed()), this, SLOT(changed()));
64
    connect(ui->tn8, SIGNAL(changed()), this, SLOT(changed()));
64
 
65
 
65
    populating = false;
66
    populating = false;
66
    dirty = true;
67
    dirty = true;
-
 
68
    mustRestart = false;
-
 
69
    ui->pushButtonExit->hide();
67
    populate();
70
    populate();
68
 
71
 
69
 
72
 
70
}
73
}
71
void QmConfTeams::populate(void)
74
void QmConfTeams::populate(void)
Line 290... Line 293...
290
            newcfg.nonequestrian_class = newcfg.lookup_class( newcfg.nonequestrian_class_abr );
293
            newcfg.nonequestrian_class = newcfg.lookup_class( newcfg.nonequestrian_class_abr );
291
            if( newcfg.nonequestrian_class == 0 )
294
            if( newcfg.nonequestrian_class == 0 )
292
                MainWindow::showMessage( "WARNING: Non-equestrian class not found" );
295
                MainWindow::showMessage( "WARNING: Non-equestrian class not found" );
293
        }
296
        }
294
 
297
 
-
 
298
        //  Detect change in the number of legs configured
-
 
299
        //  Need to force application restart
-
 
300
        if ( config.num_legs != newcfg.num_legs || mustRestart ) {
-
 
301
            mustRestart = true;
-
 
302
        }
-
 
303
 
295
        config = newcfg;
304
        config = newcfg;
296
        config.write_config();
305
        config.write_config();
297
        updateChanged(false);
306
        updateChanged(false);
298
 
307
 
299
    }
308
    }
Line 340... Line 349...
340
            ui->Changed->setVisible(false);
349
            ui->Changed->setVisible(false);
341
            ui->pushButtonSave->setEnabled(false);
350
            ui->pushButtonSave->setEnabled(false);
342
            ui->pushButtonSave->setStyleSheet("");
351
            ui->pushButtonSave->setStyleSheet("");
343
        }
352
        }
344
    }
353
    }
-
 
354
 
-
 
355
    if (mustRestart) {
-
 
356
        MainWindow::disableAllTabs();
-
 
357
        ui->pushButtonExit->show();
-
 
358
        ui->pushButtonExit->setEnabled(true);
-
 
359
        ui->pushButtonExit->setStyleSheet("background-color: rgb(255, 0, 0);");
-
 
360
    }
345
}
361
}
346
 
362
 
347
void QmConfTeams::editAddendum(void)
363
void QmConfTeams::editAddendum(void)
348
{
364
{
349
    QString fname = ui->addendum->text();
365
    QString fname = ui->addendum->text();
Line 379... Line 395...
379
        break;
395
        break;
380
    default:
396
    default:
381
        break;
397
        break;
382
    }
398
    }
383
}
399
}
-
 
400
 
-
 
401
void QmConfTeams::quitApplication(void)
-
 
402
{
-
 
403
    QCoreApplication::quit();
-
 
404
}
-
 
405