src/EditRecipe.cpp

changeset 171
6cd2d808d863
parent 169
541ddf3edb10
child 249
3c28dc8dd51d
equal deleted inserted replaced
170:d25e41da6be2 171:6cd2d808d863
681 connect(ui->efficiencyEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::efficiency_changed); 681 connect(ui->efficiencyEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::efficiency_changed);
682 connect(ui->beerstyleEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::style_changed); 682 connect(ui->beerstyleEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::style_changed);
683 connect(ui->est_ogEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::est_og_changed); 683 connect(ui->est_ogEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::est_og_changed);
684 connect(ui->color_methodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::colormethod_changed); 684 connect(ui->color_methodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::colormethod_changed);
685 connect(ui->ibu_methodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::ibumethod_changed); 685 connect(ui->ibu_methodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::ibumethod_changed);
686 connect(ui->lockedEdit, &QCheckBox::stateChanged, this, &EditRecipe::locked_changed);
686 687
687 // All signals from tab "Fermentables" 688 // All signals from tab "Fermentables"
688 ui->fermentablesTable->setEditTriggers(QAbstractItemView::NoEditTriggers); 689 ui->fermentablesTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
689 connect(ui->est_og2Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::est_og_changed); 690 connect(ui->est_og2Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::est_og_changed);
690 connect(ui->perc_mashShow, &QProgressBar::valueChanged, this, &EditRecipe::ferment_perc_mash_valueChanged); 691 connect(ui->perc_mashShow, &QProgressBar::valueChanged, this, &EditRecipe::ferment_perc_mash_valueChanged);
731 connect(ui->w2_volEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::w2_volume_changed); 732 connect(ui->w2_volEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::w2_volume_changed);
732 connect(ui->sp_sourceEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::sp_source_changed); 733 connect(ui->sp_sourceEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::sp_source_changed);
733 connect(ui->sp_acidtypeEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::sp_type_changed); 734 connect(ui->sp_acidtypeEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::sp_type_changed);
734 connect(ui->sp_phEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_ph_changed); 735 connect(ui->sp_phEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::sp_ph_changed);
735 736
737 setLocked(recipe->locked);
738
736 ui->saveButton->setEnabled(false); 739 ui->saveButton->setEnabled(false);
737 ui->deleteButton->setEnabled((id >= 0) ? true:false); 740 ui->deleteButton->setEnabled((id >= 0 && ! recipe->locked) ? true:false);
738 741
739 emit refreshAll(); 742 emit refreshAll();
740 } 743 }
741 744
742 745
1169 1172
1170 1173
1171 void EditRecipe::is_changed() 1174 void EditRecipe::is_changed()
1172 { 1175 {
1173 ui->saveButton->setEnabled(true); 1176 ui->saveButton->setEnabled(true);
1174 ui->deleteButton->setEnabled((this->recno >= 0) ? true:false); 1177 ui->deleteButton->setEnabled(((this->recno >= 0) ? true:false) && ! recipe->locked);
1175 this->textIsChanged = true; 1178 this->textIsChanged = true;
1176 WindowTitle(); 1179 WindowTitle();
1177 } 1180 }
1178 1181
1179 1182

mercurial