|
@@ -16,13 +16,22 @@ Dialog::Dialog(Options const& option, QWidget *parent) :
|
|
QVBoxLayout *layoutDialog = new QVBoxLayout;
|
|
QVBoxLayout *layoutDialog = new QVBoxLayout;
|
|
QFormLayout *layoutForm = new QFormLayout;
|
|
QFormLayout *layoutForm = new QFormLayout;
|
|
QDialogButtonBox *boutonJouer = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
|
QDialogButtonBox *boutonJouer = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
|
- checkBoxSon = new QCheckBox();
|
|
|
|
|
|
+ checkBoxSon = new QCheckBox;
|
|
checkBoxSon->setChecked(option.son());
|
|
checkBoxSon->setChecked(option.son());
|
|
spinTempsDepart = new QTimeEdit;
|
|
spinTempsDepart = new QTimeEdit;
|
|
spinTempsDepart->setTimeRange(QTime(0,0,5,0), QTime(3,0,0,0));
|
|
spinTempsDepart->setTimeRange(QTime(0,0,5,0), QTime(3,0,0,0));
|
|
spinTempsDepart->setTime(option.tempsDepart());
|
|
spinTempsDepart->setTime(option.tempsDepart());
|
|
spinTempsDepart->setDisplayFormat("HH:mm:ss");
|
|
spinTempsDepart->setDisplayFormat("HH:mm:ss");
|
|
|
|
|
|
|
|
+ spinTempsSupplementaire = new QTimeEdit;
|
|
|
|
+ spinTempsSupplementaire->setTimeRange(QTime(0,0,1), QTime (0,0,59));
|
|
|
|
+ spinTempsSupplementaire->setTime(option.tempsSupplementaire());
|
|
|
|
+ spinTempsSupplementaire->setDisplayFormat("ss");
|
|
|
|
+ spinTempsSupplementaire->setEnabled(option.isTempsSupplementaire());
|
|
|
|
+
|
|
|
|
+ checkBoxTempsSupp = new QCheckBox;
|
|
|
|
+ checkBoxTempsSupp->setChecked(option.isTempsSupplementaire());
|
|
|
|
+
|
|
joueur1LineEdit = new QLineEdit(option.nomJoueur1() , this);
|
|
joueur1LineEdit = new QLineEdit(option.nomJoueur1() , this);
|
|
joueur2LineEdit = new QLineEdit(option.nomJoueur2() , this);
|
|
joueur2LineEdit = new QLineEdit(option.nomJoueur2() , this);
|
|
joueur1LineEdit->selectAll();
|
|
joueur1LineEdit->selectAll();
|
|
@@ -32,6 +41,8 @@ Dialog::Dialog(Options const& option, QWidget *parent) :
|
|
|
|
|
|
layoutForm->addRow("Son", checkBoxSon);
|
|
layoutForm->addRow("Son", checkBoxSon);
|
|
layoutForm->addRow("Temps de départ", spinTempsDepart);
|
|
layoutForm->addRow("Temps de départ", spinTempsDepart);
|
|
|
|
+ layoutForm->addRow("Temps supplémentaire", checkBoxTempsSupp);
|
|
|
|
+ layoutForm->addRow("Secondes supplémentaires", spinTempsSupplementaire);
|
|
|
|
|
|
layoutDialog->addLayout(layoutLineEdit);
|
|
layoutDialog->addLayout(layoutLineEdit);
|
|
layoutDialog->addLayout(layoutForm);
|
|
layoutDialog->addLayout(layoutForm);
|
|
@@ -40,6 +51,7 @@ Dialog::Dialog(Options const& option, QWidget *parent) :
|
|
|
|
|
|
QObject::connect(boutonJouer , &QDialogButtonBox::accepted , this, &Dialog::accept);
|
|
QObject::connect(boutonJouer , &QDialogButtonBox::accepted , this, &Dialog::accept);
|
|
QObject::connect(boutonJouer , &QDialogButtonBox::rejected , this, &Dialog::close);
|
|
QObject::connect(boutonJouer , &QDialogButtonBox::rejected , this, &Dialog::close);
|
|
|
|
+ QObject::connect(checkBoxTempsSupp, &QCheckBox::stateChanged, spinTempsSupplementaire, &QTimeEdit::setEnabled);
|
|
}
|
|
}
|
|
|
|
|
|
Dialog::~Dialog() {
|
|
Dialog::~Dialog() {
|
|
@@ -65,3 +77,13 @@ QTime Dialog::champs_temps() const
|
|
{
|
|
{
|
|
return spinTempsDepart->time();
|
|
return spinTempsDepart->time();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+QTime Dialog::champs_temps_Supplementaire() const
|
|
|
|
+{
|
|
|
|
+ return spinTempsSupplementaire->time();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool Dialog::champs_is_temps_supplementaire() const
|
|
|
|
+{
|
|
|
|
+ return checkBoxTempsSupp->isChecked();
|
|
|
|
+}
|