The images tab now looks complete. Made the left side (thumbnails) a bit smaller. The right side of the screen now shows the current image and all data that belongs to that. After a new image is added, reload the images. Implemented delete image.

Sat, 21 Jan 2023 14:27:10 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 21 Jan 2023 14:27:10 +0100
changeset 468
b21da6f583be
parent 467
c5f6f3f1b714
child 469
a022701d47f5

The images tab now looks complete. Made the left side (thumbnails) a bit smaller. The right side of the screen now shows the current image and all data that belongs to that. After a new image is added, reload the images. Implemented delete image.

src/EditProduct.cpp file | annotate | diff | comparison | revisions
src/EditProduct.h file | annotate | diff | comparison | revisions
src/EditProductTab13.cpp file | annotate | diff | comparison | revisions
src/global.h file | annotate | diff | comparison | revisions
translations/bmsapp_en.ts file | annotate | diff | comparison | revisions
translations/bmsapp_nl.ts file | annotate | diff | comparison | revisions
ui/EditProduct.ui file | annotate | diff | comparison | revisions
--- a/src/EditProduct.cpp	Fri Jan 20 16:44:08 2023 +0100
+++ b/src/EditProduct.cpp	Sat Jan 21 14:27:10 2023 +0100
@@ -102,10 +102,15 @@
 	ui->keg_sugarEdit->addItem(query.value(0).toString());
     }
 
+    for (int i = 0; i < 7; i++)
+        ui->image_typeEdit->addItem(QCoreApplication::translate("PicType", g_prod_pic_types[i]));
+
     ui->spargeGroup->setId(ui->w1_spButton, 0);
     ui->spargeGroup->setId(ui->w2_spButton, 1);
     ui->spargeGroup->setId(ui->wg_spButton, 2);
 
+
+
     if (id >= 0) {
 	if (! DB_product::load(product, this, id))
 	    return;
@@ -764,6 +769,7 @@
     connect(ui->prevImage, SIGNAL(clicked()), this, SLOT(prevImage_clicked()));
     connect(ui->downloadImage, SIGNAL(clicked()), this, SLOT(downloadImage_clicked()));
     connect(ui->printImage, SIGNAL(clicked()), this, SLOT(printImage_clicked()));
+    connect(ui->filmStrip, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectImage_clicked(QListWidgetItem *)));
 
     setStage();
 
--- a/src/EditProduct.h	Fri Jan 20 16:44:08 2023 +0100
+++ b/src/EditProduct.h	Sat Jan 21 14:27:10 2023 +0100
@@ -18,6 +18,7 @@
 #include <QCalendarWidget>
 #include <QClipboard>
 #include <QTableWidget>
+#include <QListWidget>
 
 #include "global.h"
 
@@ -264,7 +265,7 @@
     void prevImage_clicked();
     void downloadImage_clicked();
     void printImage_clicked();
-    void selectImage_clicked(int val);
+    void selectImage_clicked(QListWidgetItem *);
 
     /* Modified progress bars */
     void ferment_perc_mash_valueChanged(int value);
--- a/src/EditProductTab13.cpp	Fri Jan 20 16:44:08 2023 +0100
+++ b/src/EditProductTab13.cpp	Sat Jan 21 14:27:10 2023 +0100
@@ -26,6 +26,13 @@
     /*
      * Clean old picture areas.
      */
+    if (product->images_count < 0 && product->images_list.size()) {
+	qDebug() << "  clean images_list";
+	ui->filmStrip->clear();
+	product->images_list.clear();
+	product->images_count = -1;
+	product->images_current = -1;
+    }
 
     /*
      * Load images data for this product uuid.
@@ -47,7 +54,8 @@
 
 	while (query.next()) {
 	    Images i;
-	    qDebug() << product->images_count << query.value("pic_data").toByteArray().size();
+	    i.record = query.value("record").toInt();
+	    i.uuid = query.value("uuid").toString();
 	    i.pic_type = query.value("pic_type").toInt();
 	    i.pic_data = query.value("pic_data").toByteArray();
 	    i.pic_comment = query.value("pic_comment").toString();
@@ -79,27 +87,20 @@
  */
 void EditProduct::images_Thumbnails()
 {
-    QList<QListWidgetItem*> items = ui->filmStrip->selectedItems();
-    foreach(QListWidgetItem * item, items) {
-	delete ui->filmStrip->takeItem(ui->filmStrip->row(item));
-    }
+    ui->filmStrip->clear();
 
     for (int i = 0; i < product->images_list.size(); i++) {
 	QListWidgetItem* newItem = new QListWidgetItem();
 	QString text = QCoreApplication::translate("PicType", g_prod_pic_types[product->images_list.at(i).pic_type]);
-	if (product->images_list.at(i).filename != "")
-	    text.append("\n" + product->images_list.at(i).filename);
-	if (product->images_list.at(i).pic_comment != "")
-	    text.append("\n" + product->images_list.at(i).pic_comment);
-	// product->images_list.at(i).timestamp
 	newItem->setText(text);
 	newItem->setBackground(QColor(0x45,0x53,0x64));
 
 	QPixmap outPixmap = QPixmap();
 	outPixmap.loadFromData(product->images_list.at(i).pic_data);
 	qDebug() << "  " << outPixmap.width() << "x" << outPixmap.height() << "size" << outPixmap.size() << product->images_list.at(i).filename;
-	if (outPixmap.width() > 320 || outPixmap.height() > 240)
-	    newItem->setIcon(QIcon(outPixmap.scaled(320, 240, Qt::KeepAspectRatio, Qt::SmoothTransformation)));
+	qDebug() << "  " << ui->filmStrip->iconSize();
+	if (outPixmap.width() > 240 || outPixmap.height() > 180)
+	    newItem->setIcon(QIcon(outPixmap.scaled(240, 180, Qt::KeepAspectRatio, Qt::SmoothTransformation)));
 	else
 	    newItem->setIcon(QIcon(outPixmap));
 
@@ -117,6 +118,28 @@
     ui->downloadImage->setEnabled((product->images_count > 0) ? true:false);
     ui->printImage->setEnabled((product->images_count > 0) ? true:false);
     ui->delImage->setEnabled((product->images_count > 0) ? true:false);
+
+    if (product->images_count < 1) {
+	ui->image_filenameEdit->setText("");
+	ui->image_timestampEdit->setText("");
+	ui->image_commentEdit->setText("");
+	ui->image_typeEdit->setCurrentIndex(0);
+	//ui->currentImage->setPixmap();
+	return;
+    }
+
+    QPixmap outPixmap = QPixmap();
+    outPixmap.loadFromData(product->images_list.at(id).pic_data);
+    qDebug() << "  " << outPixmap.width() << "x" << outPixmap.height() << "size" << outPixmap.size() << product->images_list.at(id).filename;
+    if (outPixmap.width() > ui->currentImage->width() || outPixmap.height() > ui->currentImage->height())
+	ui->currentImage->setPixmap(outPixmap.scaled(ui->currentImage->width(), ui->currentImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
+    else
+	ui->currentImage->setPixmap(outPixmap);
+
+    ui->image_filenameEdit->setText(product->images_list.at(id).filename);
+    ui->image_timestampEdit->setText(product->images_list.at(id).timestamp.toString(Qt::RFC2822Date));
+    ui->image_commentEdit->setText(product->images_list.at(id).pic_comment);
+    ui->image_typeEdit->setCurrentIndex(product->images_list.at(id).pic_type);
 }
 
 
@@ -194,7 +217,7 @@
     typeEdit->setObjectName(QString::fromUtf8("typeEdit"));
     typeEdit->setGeometry(QRect(160, 360, 161, 23));
     for (int i = 0; i < 7; i++)
-	typeEdit->addItem(g_prod_pic_types[i]);
+	typeEdit->addItem(QCoreApplication::translate("PicType", g_prod_pic_types[i]));
     typeEdit->setCurrentIndex(0);
 
     QLabel *commentLabel = new QLabel(dialog);
@@ -235,15 +258,36 @@
 		.arg(query.lastError().nativeErrorCode()).arg(query.lastError().driverText()).arg(query.lastError().databaseText()));
     } else {
 	qDebug() << "new image Saved";
+	product->images_count = -1;         // Force reload data
+	images_Init();
     }
-
-    //emit refreshAll();
 }
 
 
 void EditProduct::delImage_clicked()
 {
-    qDebug() << "delImage_clicked()" << product->images_current << ui->filmStrip->currentRow();
+    qDebug() << "delImage_clicked()" << ui->filmStrip->currentRow();
+
+    int rc = QMessageBox::warning(this, tr("Delete image"), tr("Delete %1").arg(product->images_list.at(ui->filmStrip->currentRow()).filename),
+                    QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
+    if (rc == QMessageBox::No)
+        return;
+
+    qDebug() << "  delete record" << product->images_list.at(ui->filmStrip->currentRow()).record;
+
+    QSqlQuery query;
+    query.prepare("DELETE FROM products_pics WHERE record=:record");
+    query.bindValue(":record", product->images_list.at(ui->filmStrip->currentRow()).record);
+    query.exec();
+
+    if (query.lastError().isValid()) {
+	qWarning() << "delImage_clicked()" << query.lastError();
+	QMessageBox::warning(this, tr("Database error"), tr("MySQL error: %1\n%2\n%3")
+                .arg(query.lastError().nativeErrorCode()).arg(query.lastError().driverText()).arg(query.lastError().databaseText()));
+    }
+
+    product->images_count = -1;		// Force reload data
+    images_Init();
 }
 
 
@@ -287,8 +331,13 @@
 }
 
 
-void EditProduct::selectImage_clicked(int val)
+void EditProduct::selectImage_clicked(QListWidgetItem *val)
 {
-    qDebug() << "selectImage_clicked()" << val << product->images_current << ui->filmStrip->currentRow();
+    qDebug() << "selectImage_clicked()" << ui->filmStrip->currentRow();
+
+    if (product->images_count > 0) {
+	product->images_current = ui->filmStrip->currentRow();
+        images_Main(product->images_current);
+    }
 }
 
--- a/src/global.h	Fri Jan 20 16:44:08 2023 +0100
+++ b/src/global.h	Sat Jan 21 14:27:10 2023 +0100
@@ -239,6 +239,8 @@
 
 struct Images
 {
+    int		record;
+    QString	uuid;
     int		pic_type;
     QByteArray	pic_data;
     QString	pic_comment;
--- a/translations/bmsapp_en.ts	Fri Jan 20 16:44:08 2023 +0100
+++ b/translations/bmsapp_en.ts	Sat Jan 21 14:27:10 2023 +0100
@@ -2336,14 +2336,14 @@
     </message>
     <message>
         <location filename="../ui/EditProduct.ui" line="55"/>
-        <location filename="../ui/EditProduct.ui" line="12246"/>
+        <location filename="../ui/EditProduct.ui" line="12255"/>
         <location filename="../src/EditProductTab9.cpp" line="552"/>
         <source>Save</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../ui/EditProduct.ui" line="75"/>
-        <location filename="../ui/EditProduct.ui" line="12195"/>
+        <location filename="../ui/EditProduct.ui" line="12204"/>
         <location filename="../src/EditProductTab3.cpp" line="74"/>
         <location filename="../src/EditProductTab3.cpp" line="162"/>
         <location filename="../src/EditProductTab4.cpp" line="56"/>
@@ -4100,23 +4100,38 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../ui/EditProduct.ui" line="12212"/>
+        <location filename="../ui/EditProduct.ui" line="12221"/>
         <source>Previous</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../ui/EditProduct.ui" line="12229"/>
+        <location filename="../ui/EditProduct.ui" line="12238"/>
         <source>Next</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../ui/EditProduct.ui" line="12282"/>
+        <location filename="../ui/EditProduct.ui" line="12311"/>
+        <source>Filename:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/EditProduct.ui" line="12327"/>
+        <source>Comment:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/EditProduct.ui" line="12372"/>
+        <source>Type:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/EditProduct.ui" line="12416"/>
         <source>Export</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../ui/EditProduct.ui" line="12263"/>
-        <location filename="../ui/EditProduct.ui" line="12299"/>
+        <location filename="../ui/EditProduct.ui" line="12272"/>
+        <location filename="../ui/EditProduct.ui" line="12433"/>
         <source>Print</source>
         <translation type="unfinished"></translation>
     </message>
@@ -4151,48 +4166,48 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="307"/>
+        <location filename="../src/EditProduct.cpp" line="312"/>
         <source>%1, part %2 of %3</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="841"/>
+        <location filename="../src/EditProduct.cpp" line="847"/>
         <source>BMSapp - Add new product</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="843"/>
+        <location filename="../src/EditProduct.cpp" line="849"/>
         <source>BMSapp - Edit %1 - %2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="859"/>
-        <location filename="../src/EditProduct.cpp" line="863"/>
+        <location filename="../src/EditProduct.cpp" line="865"/>
+        <location filename="../src/EditProduct.cpp" line="869"/>
         <source>Edit Product</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="859"/>
+        <location filename="../src/EditProduct.cpp" line="865"/>
         <source>Name empty or too short.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="863"/>
+        <location filename="../src/EditProduct.cpp" line="869"/>
         <source>No beerstyle selected.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="902"/>
+        <location filename="../src/EditProduct.cpp" line="908"/>
         <source>Delete product</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="926"/>
+        <location filename="../src/EditProduct.cpp" line="932"/>
         <source>Product changed</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="926"/>
+        <location filename="../src/EditProduct.cpp" line="932"/>
         <source>The product has been modified. Save changes?</source>
         <translation type="unfinished"></translation>
     </message>
@@ -4317,7 +4332,8 @@
         <location filename="../src/EditProductTab5.cpp" line="399"/>
         <location filename="../src/EditProductTab6.cpp" line="896"/>
         <location filename="../src/EditProductTab7.cpp" line="306"/>
-        <location filename="../src/EditProduct.cpp" line="902"/>
+        <location filename="../src/EditProductTab13.cpp" line="271"/>
+        <location filename="../src/EditProduct.cpp" line="908"/>
         <source>Delete %1</source>
         <translation type="unfinished"></translation>
     </message>
@@ -5238,44 +5254,52 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="121"/>
+        <location filename="../src/EditProductTab13.cpp" line="153"/>
         <source>Open File</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="142"/>
+        <location filename="../src/EditProductTab13.cpp" line="174"/>
         <source>Cannot load %1: %2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="170"/>
+        <location filename="../ui/EditProduct.ui" line="12295"/>
+        <location filename="../src/EditProductTab13.cpp" line="202"/>
         <source>Image here</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="180"/>
+        <location filename="../src/EditProductTab13.cpp" line="212"/>
         <source>Image type:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="193"/>
+        <location filename="../src/EditProductTab13.cpp" line="225"/>
         <source>Image comment:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="200"/>
+        <location filename="../src/EditProductTab13.cpp" line="232"/>
         <source>The comment for this image.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="43"/>
-        <location filename="../src/EditProductTab13.cpp" line="225"/>
+        <location filename="../src/EditProductTab13.cpp" line="271"/>
+        <source>Delete image</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../src/EditProductTab13.cpp" line="50"/>
+        <location filename="../src/EditProductTab13.cpp" line="257"/>
+        <location filename="../src/EditProductTab13.cpp" line="285"/>
         <source>Database error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="43"/>
-        <location filename="../src/EditProductTab13.cpp" line="225"/>
+        <location filename="../src/EditProductTab13.cpp" line="50"/>
+        <location filename="../src/EditProductTab13.cpp" line="257"/>
+        <location filename="../src/EditProductTab13.cpp" line="285"/>
         <source>MySQL error: %1
 %2
 %3</source>
--- a/translations/bmsapp_nl.ts	Fri Jan 20 16:44:08 2023 +0100
+++ b/translations/bmsapp_nl.ts	Sat Jan 21 14:27:10 2023 +0100
@@ -2636,14 +2636,14 @@
     </message>
     <message>
         <location filename="../ui/EditProduct.ui" line="55"/>
-        <location filename="../ui/EditProduct.ui" line="12246"/>
+        <location filename="../ui/EditProduct.ui" line="12255"/>
         <location filename="../src/EditProductTab9.cpp" line="552"/>
         <source>Save</source>
         <translation>Bewaar</translation>
     </message>
     <message>
         <location filename="../ui/EditProduct.ui" line="75"/>
-        <location filename="../ui/EditProduct.ui" line="12195"/>
+        <location filename="../ui/EditProduct.ui" line="12204"/>
         <location filename="../src/EditProductTab3.cpp" line="74"/>
         <location filename="../src/EditProductTab3.cpp" line="162"/>
         <location filename="../src/EditProductTab4.cpp" line="56"/>
@@ -4540,23 +4540,38 @@
         <translation>Plaatjes</translation>
     </message>
     <message>
-        <location filename="../ui/EditProduct.ui" line="12212"/>
+        <location filename="../ui/EditProduct.ui" line="12221"/>
         <source>Previous</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../ui/EditProduct.ui" line="12229"/>
+        <location filename="../ui/EditProduct.ui" line="12238"/>
         <source>Next</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../ui/EditProduct.ui" line="12282"/>
+        <location filename="../ui/EditProduct.ui" line="12311"/>
+        <source>Filename:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/EditProduct.ui" line="12327"/>
+        <source>Comment:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/EditProduct.ui" line="12372"/>
+        <source>Type:</source>
+        <translation type="unfinished">Soort:</translation>
+    </message>
+    <message>
+        <location filename="../ui/EditProduct.ui" line="12416"/>
         <source>Export</source>
         <translation>Exporteer</translation>
     </message>
     <message>
-        <location filename="../ui/EditProduct.ui" line="12263"/>
-        <location filename="../ui/EditProduct.ui" line="12299"/>
+        <location filename="../ui/EditProduct.ui" line="12272"/>
+        <location filename="../ui/EditProduct.ui" line="12433"/>
         <source>Print</source>
         <translation>Print</translation>
     </message>
@@ -4576,7 +4591,7 @@
         <translation>Mout</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="843"/>
+        <location filename="../src/EditProduct.cpp" line="849"/>
         <source>BMSapp - Edit %1 - %2</source>
         <translation>BMSapp - Wijzig %1 - %2</translation>
     </message>
@@ -4624,8 +4639,9 @@
         <translation>Zuurstof</translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="43"/>
-        <location filename="../src/EditProductTab13.cpp" line="225"/>
+        <location filename="../src/EditProductTab13.cpp" line="50"/>
+        <location filename="../src/EditProductTab13.cpp" line="257"/>
+        <location filename="../src/EditProductTab13.cpp" line="285"/>
         <source>Database error</source>
         <translation>Database fout</translation>
     </message>
@@ -4634,7 +4650,7 @@
         <translation type="vanished">MySQL fout: record %1 niet gevonden</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="307"/>
+        <location filename="../src/EditProduct.cpp" line="312"/>
         <source>%1, part %2 of %3</source>
         <translation>%1, deel %2 van %3</translation>
     </message>
@@ -4643,7 +4659,7 @@
         <translation type="vanished">Koken %1 minuten</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="841"/>
+        <location filename="../src/EditProduct.cpp" line="847"/>
         <source>BMSapp - Add new product</source>
         <translation>BMSapp - Nieuw product</translation>
     </message>
@@ -4652,24 +4668,25 @@
         <translation type="vanished">BMSapp - Wijzig product %1</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="859"/>
-        <location filename="../src/EditProduct.cpp" line="863"/>
+        <location filename="../src/EditProduct.cpp" line="865"/>
+        <location filename="../src/EditProduct.cpp" line="869"/>
         <source>Edit Product</source>
         <translation>Wijzig Product</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="859"/>
+        <location filename="../src/EditProduct.cpp" line="865"/>
         <source>Name empty or too short.</source>
         <translation>De naam is leeg of te kort.</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="863"/>
+        <location filename="../src/EditProduct.cpp" line="869"/>
         <source>No beerstyle selected.</source>
         <translation>Geen bierstijl gekozen.</translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="43"/>
-        <location filename="../src/EditProductTab13.cpp" line="225"/>
+        <location filename="../src/EditProductTab13.cpp" line="50"/>
+        <location filename="../src/EditProductTab13.cpp" line="257"/>
+        <location filename="../src/EditProductTab13.cpp" line="285"/>
         <source>MySQL error: %1
 %2
 %3</source>
@@ -4678,17 +4695,17 @@
 %3</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="902"/>
+        <location filename="../src/EditProduct.cpp" line="908"/>
         <source>Delete product</source>
         <translation>Verwijder product</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="926"/>
+        <location filename="../src/EditProduct.cpp" line="932"/>
         <source>Product changed</source>
         <translation>Product gewijzigd</translation>
     </message>
     <message>
-        <location filename="../src/EditProduct.cpp" line="926"/>
+        <location filename="../src/EditProduct.cpp" line="932"/>
         <source>The product has been modified. Save changes?</source>
         <translation>Het product is gewijzigd. Wijzigingen opslaan?</translation>
     </message>
@@ -4825,7 +4842,8 @@
         <location filename="../src/EditProductTab5.cpp" line="399"/>
         <location filename="../src/EditProductTab6.cpp" line="896"/>
         <location filename="../src/EditProductTab7.cpp" line="306"/>
-        <location filename="../src/EditProduct.cpp" line="902"/>
+        <location filename="../src/EditProductTab13.cpp" line="271"/>
+        <location filename="../src/EditProduct.cpp" line="908"/>
         <source>Delete %1</source>
         <translation>Verwijder %1</translation>
     </message>
@@ -5842,35 +5860,41 @@
         <translation>Bevestig dat het proeven gedaan is en opmerkingen ingevuld zijn.</translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="121"/>
+        <location filename="../src/EditProductTab13.cpp" line="153"/>
         <source>Open File</source>
         <translation>Open bestand</translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="142"/>
+        <location filename="../src/EditProductTab13.cpp" line="174"/>
         <source>Cannot load %1: %2</source>
         <translation>Kan niet laden %1: %2</translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="170"/>
+        <location filename="../ui/EditProduct.ui" line="12295"/>
+        <location filename="../src/EditProductTab13.cpp" line="202"/>
         <source>Image here</source>
         <translation>Plaatje hier</translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="180"/>
+        <location filename="../src/EditProductTab13.cpp" line="212"/>
         <source>Image type:</source>
         <translation>Soort plaatje:</translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="193"/>
+        <location filename="../src/EditProductTab13.cpp" line="225"/>
         <source>Image comment:</source>
         <translation>Bijschrift:</translation>
     </message>
     <message>
-        <location filename="../src/EditProductTab13.cpp" line="200"/>
+        <location filename="../src/EditProductTab13.cpp" line="232"/>
         <source>The comment for this image.</source>
         <translation>Het bijschrift of commentaar bij dit plaatje.</translation>
     </message>
+    <message>
+        <location filename="../src/EditProductTab13.cpp" line="271"/>
+        <source>Delete image</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>EditProfileFerment</name>
--- a/ui/EditProduct.ui	Fri Jan 20 16:44:08 2023 +0100
+++ b/ui/EditProduct.ui	Sat Jan 21 14:27:10 2023 +0100
@@ -12122,8 +12122,8 @@
        <widget class="QPushButton" name="addImage">
         <property name="geometry">
          <rect>
-          <x>950</x>
-          <y>470</y>
+          <x>300</x>
+          <y>10</y>
           <width>80</width>
           <height>23</height>
          </rect>
@@ -12141,7 +12141,7 @@
          <rect>
           <x>10</x>
           <y>10</y>
-          <width>346</width>
+          <width>267</width>
           <height>491</height>
          </rect>
         </property>
@@ -12151,6 +12151,9 @@
         <property name="horizontalScrollBarPolicy">
          <enum>Qt::ScrollBarAlwaysOff</enum>
         </property>
+        <property name="editTriggers">
+         <set>QAbstractItemView::NoEditTriggers</set>
+        </property>
         <property name="tabKeyNavigation">
          <bool>true</bool>
         </property>
@@ -12159,8 +12162,8 @@
         </property>
         <property name="iconSize">
          <size>
-          <width>330</width>
-          <height>330</height>
+          <width>250</width>
+          <height>200</height>
          </size>
         </property>
         <property name="textElideMode">
@@ -12181,12 +12184,18 @@
         <property name="viewMode">
          <enum>QListView::IconMode</enum>
         </property>
+        <property name="selectionRectVisible">
+         <bool>true</bool>
+        </property>
+        <property name="itemAlignment">
+         <set>Qt::AlignHCenter</set>
+        </property>
        </widget>
        <widget class="QPushButton" name="delImage">
         <property name="geometry">
          <rect>
-          <x>1060</x>
-          <y>470</y>
+          <x>300</x>
+          <y>50</y>
           <width>80</width>
           <height>23</height>
          </rect>
@@ -12202,8 +12211,8 @@
        <widget class="QPushButton" name="prevImage">
         <property name="geometry">
          <rect>
-          <x>390</x>
-          <y>470</y>
+          <x>300</x>
+          <y>330</y>
           <width>80</width>
           <height>23</height>
          </rect>
@@ -12219,8 +12228,8 @@
        <widget class="QPushButton" name="nextImage">
         <property name="geometry">
          <rect>
-          <x>500</x>
-          <y>470</y>
+          <x>300</x>
+          <y>370</y>
           <width>80</width>
           <height>23</height>
          </rect>
@@ -12236,8 +12245,8 @@
        <widget class="QPushButton" name="downloadImage">
         <property name="geometry">
          <rect>
-          <x>670</x>
-          <y>470</y>
+          <x>300</x>
+          <y>130</y>
           <width>80</width>
           <height>23</height>
          </rect>
@@ -12253,8 +12262,8 @@
        <widget class="QPushButton" name="printImage">
         <property name="geometry">
          <rect>
-          <x>780</x>
-          <y>470</y>
+          <x>300</x>
+          <y>170</y>
           <width>80</width>
           <height>23</height>
          </rect>
@@ -12267,6 +12276,131 @@
           <normaloff>:/icons/silk/printer.png</normaloff>:/icons/silk/printer.png</iconset>
         </property>
        </widget>
+       <widget class="QLabel" name="currentImage">
+        <property name="geometry">
+         <rect>
+          <x>400</x>
+          <y>10</y>
+          <width>741</width>
+          <height>381</height>
+         </rect>
+        </property>
+        <property name="autoFillBackground">
+         <bool>false</bool>
+        </property>
+        <property name="frameShape">
+         <enum>QFrame::StyledPanel</enum>
+        </property>
+        <property name="text">
+         <string>Image here</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+       <widget class="QLabel" name="image_filenameLabel">
+        <property name="geometry">
+         <rect>
+          <x>300</x>
+          <y>410</y>
+          <width>131</width>
+          <height>20</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>Filename:</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+       <widget class="QLabel" name="image_commentLabel">
+        <property name="geometry">
+         <rect>
+          <x>300</x>
+          <y>470</y>
+          <width>131</width>
+          <height>20</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>Comment:</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+       <widget class="QLineEdit" name="image_commentEdit">
+        <property name="geometry">
+         <rect>
+          <x>440</x>
+          <y>470</y>
+          <width>661</width>
+          <height>23</height>
+         </rect>
+        </property>
+        <property name="maxLength">
+         <number>256</number>
+        </property>
+       </widget>
+       <widget class="QLineEdit" name="image_filenameEdit">
+        <property name="geometry">
+         <rect>
+          <x>440</x>
+          <y>410</y>
+          <width>381</width>
+          <height>23</height>
+         </rect>
+        </property>
+        <property name="maxLength">
+         <number>256</number>
+        </property>
+        <property name="readOnly">
+         <bool>true</bool>
+        </property>
+       </widget>
+       <widget class="QLabel" name="image_pictypeLabel">
+        <property name="geometry">
+         <rect>
+          <x>300</x>
+          <y>440</y>
+          <width>131</width>
+          <height>20</height>
+         </rect>
+        </property>
+        <property name="text">
+         <string>Type:</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+       <widget class="QComboBox" name="image_typeEdit">
+        <property name="geometry">
+         <rect>
+          <x>440</x>
+          <y>440</y>
+          <width>161</width>
+          <height>23</height>
+         </rect>
+        </property>
+       </widget>
+       <widget class="QLineEdit" name="image_timestampEdit">
+        <property name="geometry">
+         <rect>
+          <x>900</x>
+          <y>410</y>
+          <width>201</width>
+          <height>23</height>
+         </rect>
+        </property>
+        <property name="maxLength">
+         <number>256</number>
+        </property>
+        <property name="readOnly">
+         <bool>true</bool>
+        </property>
+       </widget>
       </widget>
      </widget>
      <widget class="QPushButton" name="exportButton">

mercurial