diff -r 1fed3ff9a64e -r 8fc909360552 src/EditProduct.cpp --- a/src/EditProduct.cpp Mon Jan 16 16:55:41 2023 +0100 +++ b/src/EditProduct.cpp Wed Jan 18 16:17:31 2023 +0100 @@ -575,6 +575,9 @@ qDebug() << "== Start connecting =="; + // Global signals + connect(ui->tabWidget, &QTabWidget::currentChanged, this, &EditProduct::tab_changed); + // All signals from tab "Generic" connect(ui->lockedEdit, &QCheckBox::stateChanged, this, &EditProduct::is_changed); connect(ui->codeEdit, &QLineEdit::textChanged, this, &EditProduct::code_changed); @@ -750,6 +753,9 @@ connect(ui->taste_aftertasteEdit, &QLineEdit::textChanged, this, &EditProduct::taste_aftertaste_changed); connect(ui->taste_notesEdit, SIGNAL(textChanged()), this, SLOT(taste_notes_changed())); + /* All signals from tab Images */ + connect(ui->addImage, SIGNAL(clicked()), this, SLOT(addImage_clicked())); + setStage(); ui->saveButton->setEnabled(false); @@ -768,6 +774,18 @@ } +void EditProduct::tab_changed() +{ + if (ui->tabWidget->currentWidget()->objectName() != "images") + return; + + /* + * Entered the images tab. Load the images for this product. + */ + images_Init(); +} + + void EditProduct::calcSupplies() { if (product->inventory_reduced > PROD_STAGE_PACKAGE) {