src/EditHop.cpp

changeset 292
b6ec2e275736
parent 90
2396457a8167
child 300
2a97905cb637
equal deleted inserted replaced
291:daa667c1ad6d 292:b6ec2e275736
95 connect(ui->substitutesEdit, &QLineEdit::textChanged, this, &EditHop::is_changed); 95 connect(ui->substitutesEdit, &QLineEdit::textChanged, this, &EditHop::is_changed);
96 connect(ui->alwaysEdit, &QCheckBox::stateChanged, this, &EditHop::is_changed); 96 connect(ui->alwaysEdit, &QCheckBox::stateChanged, this, &EditHop::is_changed);
97 connect(ui->inventoryEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); 97 connect(ui->inventoryEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
98 connect(ui->costEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); 98 connect(ui->costEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
99 connect(ui->prodEdit, &QDateEdit::dateChanged, this, &EditHop::is_changed); 99 connect(ui->prodEdit, &QDateEdit::dateChanged, this, &EditHop::is_changed);
100 connect(ui->prodButton1, SIGNAL(clicked()), this, SLOT(prod_date_today()));
101 connect(ui->prodButton2, SIGNAL(clicked()), this, SLOT(prod_date_clear()));
100 connect(ui->thtEdit, &QDateEdit::dateChanged, this, &EditHop::is_changed); 102 connect(ui->thtEdit, &QDateEdit::dateChanged, this, &EditHop::is_changed);
103 connect(ui->thtButton1, SIGNAL(clicked()), this, SLOT(tht_date_today()));
104 connect(ui->thtButton2, SIGNAL(clicked()), this, SLOT(tht_date_clear()));
101 connect(ui->oilEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); 105 connect(ui->oilEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
102 106
103 ui->saveButton->setEnabled(false); 107 ui->saveButton->setEnabled(false);
104 ui->deleteButton->setEnabled((ui->inventoryEdit->value() == 0 && id >= 0) ? true:false); 108 ui->deleteButton->setEnabled((ui->inventoryEdit->value() == 0 && id >= 0) ? true:false);
105 } 109 }
255 } 259 }
256 260
257 this->close(); 261 this->close();
258 this->setResult(1); 262 this->setResult(1);
259 } 263 }
264
265
266 void EditHop::prod_date_clear()
267 {
268 ui->prodEdit->setDate(QDate());
269 is_changed();
270 }
271
272
273 void EditHop::prod_date_today()
274 {
275 ui->prodEdit->setDate(QDate::currentDate());
276 is_changed();
277 }
278
279
280 void EditHop::tht_date_clear()
281 {
282 ui->thtEdit->setDate(QDate());
283 is_changed();
284 }
285
286
287 void EditHop::tht_date_today()
288 {
289 ui->thtEdit->setDate(QDate::currentDate());
290 is_changed();
291 }
292

mercurial