src/EditProduct.cpp

changeset 198
904591820c3d
parent 196
f7954f2d4451
child 202
49ec4fdee5a6
equal deleted inserted replaced
197:6a5e5b3d0fcd 198:904591820c3d
329 329
330 product->starter_enable = query.value("starter_enable").toInt() ? true:false; 330 product->starter_enable = query.value("starter_enable").toInt() ? true:false;
331 product->starter_type = query.value("starter_type").toInt(); 331 product->starter_type = query.value("starter_type").toInt();
332 product->starter_sg = query.value("starter_sg").toDouble(); 332 product->starter_sg = query.value("starter_sg").toDouble();
333 product->starter_viability = query.value("starter_viability").toInt(); 333 product->starter_viability = query.value("starter_viability").toInt();
334 product->yeast_prod_date = query.value("yeast_prod_date").toDate(); 334 if (query.value("yeast_prod_date").toString().length() == 10)
335 product->yeast_prod_date = query.value("yeast_prod_date").toDate();
336 else
337 product->yeast_prod_date = QDate();
335 product->yeast_pitchrate = query.value("yeast_pitchrate").toDouble(); 338 product->yeast_pitchrate = query.value("yeast_pitchrate").toDouble();
336 product->prop_type[0] = query.value("prop1_type").toInt(); 339 product->prop_type[0] = query.value("prop1_type").toInt();
337 product->prop_volume[0] = query.value("prop1_volume").toDouble(); 340 product->prop_volume[0] = query.value("prop1_volume").toDouble();
338 product->prop_type[1] = query.value("prop2_type").toInt(); 341 product->prop_type[1] = query.value("prop2_type").toInt();
339 product->prop_volume[1] = query.value("prop2_volume").toDouble(); 342 product->prop_volume[1] = query.value("prop2_volume").toDouble();
1044 1047
1045 // All signals from tab "Yeasts" 1048 // All signals from tab "Yeasts"
1046 connect(ui->addYeast, SIGNAL(clicked()), this, SLOT(addYeastRow_clicked())); 1049 connect(ui->addYeast, SIGNAL(clicked()), this, SLOT(addYeastRow_clicked()));
1047 connect(ui->stmethodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::yeast_method_changed); 1050 connect(ui->stmethodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::yeast_method_changed);
1048 connect(ui->startersgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::yeast_starter_sg_changed); 1051 connect(ui->startersgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::yeast_starter_sg_changed);
1052 connect(ui->productionButton1, SIGNAL(clicked()), this, SLOT(yeast_prod_date_today()));
1053 connect(ui->productionButton2, SIGNAL(clicked()), this, SLOT(yeast_prod_date_clear()));
1054 connect(ui->productionEdit, &QDateEdit::dateChanged, this, &EditProduct::yeast_prod_date_changed);
1049 1055
1050 // All signals from tab "Mash" 1056 // All signals from tab "Mash"
1051 ui->mashsTable->setEditTriggers(QAbstractItemView::NoEditTriggers); 1057 ui->mashsTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
1052 connect(ui->addMash, SIGNAL(clicked()), this, SLOT(addMashRow_clicked())); 1058 connect(ui->addMash, SIGNAL(clicked()), this, SLOT(addMashRow_clicked()));
1053 connect(ui->mash_pickEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::mash_select_changed); 1059 connect(ui->mash_pickEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::mash_select_changed);

mercurial