Fri, 20 Jan 2023 16:44:08 +0100
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
464
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /** |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | * EditProduct.cpp is part of bmsapp. |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * Tab 13, images and pictures. |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * bmsapp is free software: you can redistribute it and/or modify |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * it under the terms of the GNU General Public License as published by |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * the Free Software Foundation, either version 3 of the License, or |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * (at your option) any later version. |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * bmsapp is distributed in the hope that it will be useful, |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * GNU General Public License for more details. |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * You should have received a copy of the GNU General Public License |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | */ |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
20 | void EditProduct::images_Init() |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
21 | { |
467
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
22 | qDebug() << "images_Init()"; |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
23 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
24 | // Start spinner |
467
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
25 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
26 | /* |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
27 | * Clean old picture areas. |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
28 | */ |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
29 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
30 | /* |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
31 | * Load images data for this product uuid. |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
32 | */ |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
33 | if (product->images_count < 0) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
34 | QSqlQuery query; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
35 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
36 | qDebug() << " loading data"; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
37 | query.prepare("SELECT * FROM products_pics WHERE uuid=:uuid"); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
38 | query.bindValue(":uuid", product->uuid); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
39 | query.exec(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
40 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
41 | if (query.lastError().isValid()) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
42 | qWarning() << "images_init()" << query.lastError(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
43 | QMessageBox::warning(this, tr("Database error"), tr("MySQL error: %1\n%2\n%3") |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
44 | .arg(query.lastError().nativeErrorCode()).arg(query.lastError().driverText()).arg(query.lastError().databaseText())); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
45 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
46 | product->images_count = 0; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
47 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
48 | while (query.next()) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
49 | Images i; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
50 | qDebug() << product->images_count << query.value("pic_data").toByteArray().size(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
51 | i.pic_type = query.value("pic_type").toInt(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
52 | i.pic_data = query.value("pic_data").toByteArray(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
53 | i.pic_comment = query.value("pic_comment").toString(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
54 | i.filename = query.value("filename").toString(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
55 | i.timestamp = query.value("timestamp").toDateTime(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
56 | product->images_list.append(i); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
57 | product->images_count++; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
58 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
59 | qDebug() << " loaded" << product->images_count << product->images_list.size(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
60 | if (product->images_count < 1) |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
61 | product->images_current = -1; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
62 | else |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
63 | product->images_current = 0; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
64 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
65 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
66 | images_Thumbnails(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
67 | if (product->images_current >= 0) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
68 | ui->filmStrip->setCurrentRow(product->images_current); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
69 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
70 | images_Main(product->images_current); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
71 | |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
72 | // If any, show picture 1 |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
73 | // Stop spinner |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
74 | } |
464
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | |
1fed3ff9a64e
Show 0 if afterboil volume is invalid instead of the chiller volume. Added product tab 13. Here the images (beerlabels, brew pictures) for a product will be shown. Resized all product tabs. Added STA1 tickmark in the yeasts table.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | |
467
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
77 | /* |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
78 | * Show thumbnails on the left. |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
79 | */ |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
80 | void EditProduct::images_Thumbnails() |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
81 | { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
82 | QList<QListWidgetItem*> items = ui->filmStrip->selectedItems(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
83 | foreach(QListWidgetItem * item, items) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
84 | delete ui->filmStrip->takeItem(ui->filmStrip->row(item)); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
85 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
86 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
87 | for (int i = 0; i < product->images_list.size(); i++) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
88 | QListWidgetItem* newItem = new QListWidgetItem(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
89 | QString text = QCoreApplication::translate("PicType", g_prod_pic_types[product->images_list.at(i).pic_type]); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
90 | if (product->images_list.at(i).filename != "") |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
91 | text.append("\n" + product->images_list.at(i).filename); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
92 | if (product->images_list.at(i).pic_comment != "") |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
93 | text.append("\n" + product->images_list.at(i).pic_comment); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
94 | // product->images_list.at(i).timestamp |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
95 | newItem->setText(text); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
96 | newItem->setBackground(QColor(0x45,0x53,0x64)); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
97 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
98 | QPixmap outPixmap = QPixmap(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
99 | outPixmap.loadFromData(product->images_list.at(i).pic_data); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
100 | qDebug() << " " << outPixmap.width() << "x" << outPixmap.height() << "size" << outPixmap.size() << product->images_list.at(i).filename; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
101 | if (outPixmap.width() > 320 || outPixmap.height() > 240) |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
102 | newItem->setIcon(QIcon(outPixmap.scaled(320, 240, Qt::KeepAspectRatio, Qt::SmoothTransformation))); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
103 | else |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
104 | newItem->setIcon(QIcon(outPixmap)); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
105 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
106 | ui->filmStrip->addItem(newItem); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
107 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
108 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
109 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
110 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
111 | void EditProduct::images_Main(int id) |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
112 | { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
113 | qDebug() << " Main(" << id << ")"; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
114 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
115 | ui->prevImage->setEnabled((product->images_count > 0 && product->images_current > 0) ? true:false); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
116 | ui->nextImage->setEnabled((product->images_count > 0 && (product->images_current + 1) < product->images_count) ? true:false); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
117 | ui->downloadImage->setEnabled((product->images_count > 0) ? true:false); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
118 | ui->printImage->setEnabled((product->images_count > 0) ? true:false); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
119 | ui->delImage->setEnabled((product->images_count > 0) ? true:false); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
120 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
121 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
122 | |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
123 | void EditProduct::addImage_clicked() |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
124 | { |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
125 | QString fileName; |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
126 | QByteArray imageByteArray; |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
127 | QSqlQuery query; |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
128 | QSettings settings(QSettings::IniFormat, QSettings::UserScope, "mbse", "bmsapp"); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
129 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
130 | QFileDialog dialog1(this, tr("Open File")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
131 | dialog1.setDirectory(settings.value("paths/images").toString()); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
132 | /* Only a few image formats are valid */ |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
133 | QStringList mimeTypeFilters ({ "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg+xml" }); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
134 | dialog1.setMimeTypeFilters(mimeTypeFilters); |
467
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
135 | dialog1.setNameFilter("Images (*.bmp *.BMP *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.svg *.SVG)"); |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
136 | dialog1.setAcceptMode(QFileDialog::AcceptOpen); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
137 | // dialog1.setOption(QFileDialog::DontUseNativeDialog); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
138 | if (dialog1.exec() != QDialog::Accepted) |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
139 | return; |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
140 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
141 | /* |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
142 | * Save our current path |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
143 | */ |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
144 | settings.setValue("paths/images", dialog1.directory().absolutePath()); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
145 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
146 | fileName = dialog1.selectedFiles().constFirst(); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
147 | QImageReader reader(fileName); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
148 | reader.setAutoTransform(true); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
149 | const QImage newImage = reader.read(); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
150 | if (newImage.isNull()) { |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
151 | QMessageBox::information(this, QGuiApplication::applicationDisplayName(), tr("Cannot load %1: %2") |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
152 | .arg(QDir::toNativeSeparators(fileName), reader.errorString())); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
153 | return; |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
154 | } |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
155 | qDebug() << "Image" << fileName << newImage.width() << newImage.height() << "size" << newImage.sizeInBytes(); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
156 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
157 | QBuffer buffer(&imageByteArray); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
158 | buffer.open(QIODevice::WriteOnly); |
467
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
159 | newImage.save(&buffer, "PNG"); /* Convert to lossless .png format. */ |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
160 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
161 | /* |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
162 | * Now that we have selected a valid image, create a new dialog so |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
163 | * we can add extra information for this image and a Save button. |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
164 | */ |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
165 | QDialog* dialog = new QDialog(this); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
166 | dialog->resize(500, 490); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
167 | QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
168 | buttonBox->setObjectName(QString::fromUtf8("buttonBox")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
169 | buttonBox->setGeometry(QRect(10, 440, 480, 32)); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
170 | buttonBox->setLayoutDirection(Qt::LeftToRight); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
171 | buttonBox->setOrientation(Qt::Horizontal); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
172 | buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Save); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
173 | buttonBox->setCenterButtons(true); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
174 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
175 | QLabel *imageLabel = new QLabel(dialog); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
176 | imageLabel->setObjectName(QString::fromUtf8("imageLabel")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
177 | imageLabel->setGeometry(QRect(10, 10, 480, 320)); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
178 | imageLabel->setAlignment(Qt::AlignCenter); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
179 | imageLabel->setText(tr("Image here")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
180 | QPixmap outPixmap = QPixmap(); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
181 | outPixmap.loadFromData(imageByteArray); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
182 | if (outPixmap.width() > 480 || outPixmap.height() > 320) |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
183 | imageLabel->setPixmap(outPixmap.scaled(480, 320, Qt::KeepAspectRatio, Qt::SmoothTransformation)); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
184 | else |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
185 | imageLabel->setPixmap(outPixmap); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
186 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
187 | QLabel *typeLabel = new QLabel(dialog); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
188 | typeLabel->setObjectName(QString::fromUtf8("typeLabel")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
189 | typeLabel->setText(tr("Image type:")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
190 | typeLabel->setGeometry(QRect(10, 360, 141, 20)); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
191 | typeLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
192 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
193 | QComboBox *typeEdit = new QComboBox(dialog); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
194 | typeEdit->setObjectName(QString::fromUtf8("typeEdit")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
195 | typeEdit->setGeometry(QRect(160, 360, 161, 23)); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
196 | for (int i = 0; i < 7; i++) |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
197 | typeEdit->addItem(g_prod_pic_types[i]); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
198 | typeEdit->setCurrentIndex(0); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
199 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
200 | QLabel *commentLabel = new QLabel(dialog); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
201 | commentLabel->setObjectName(QString::fromUtf8("commentLabel")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
202 | commentLabel->setText(tr("Image comment:")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
203 | commentLabel->setGeometry(QRect(10, 390, 141, 20)); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
204 | commentLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
205 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
206 | QLineEdit *commentEdit = new QLineEdit(dialog); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
207 | commentEdit->setObjectName(QString::fromUtf8("commentEdit")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
208 | commentEdit->setGeometry(QRect(160, 390, 320, 23)); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
209 | commentEdit->setToolTip(tr("The comment for this image.")); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
210 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
211 | connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject())); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
212 | connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept())); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
213 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
214 | dialog->setModal(true); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
215 | dialog->exec(); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
216 | if (dialog->result() == QDialog::Rejected) { |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
217 | return; |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
218 | } |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
219 | disconnect(buttonBox, nullptr, nullptr, nullptr); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
220 | |
466
68ef2cc3e8d2
Added fields for filename and timestamp.
Michiel Broek <mbroek@mbse.eu>
parents:
465
diff
changeset
|
221 | QFileInfo fi(fileName); |
68ef2cc3e8d2
Added fields for filename and timestamp.
Michiel Broek <mbroek@mbse.eu>
parents:
465
diff
changeset
|
222 | query.prepare("INSERT INTO products_pics SET uuid=:uuid, pic_type=:pic_type, pic_data=:pic_data, " |
68ef2cc3e8d2
Added fields for filename and timestamp.
Michiel Broek <mbroek@mbse.eu>
parents:
465
diff
changeset
|
223 | "pic_comment=:pic_comment, filename=:filename, timestamp=:timestamp"); |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
224 | query.bindValue(":uuid", product->uuid); |
467
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
225 | query.bindValue(":pic_type", typeEdit->currentIndex()); |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
226 | query.bindValue(":pic_data", imageByteArray); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
227 | query.bindValue(":pic_comment", commentEdit->text()); |
467
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
228 | query.bindValue(":filename", fi.completeBaseName() + ".png"); /* The image is converted to .png */ |
466
68ef2cc3e8d2
Added fields for filename and timestamp.
Michiel Broek <mbroek@mbse.eu>
parents:
465
diff
changeset
|
229 | query.bindValue(":timestamp", fi.lastModified()); |
465
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
230 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
231 | query.exec(); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
232 | if (query.lastError().isValid()) { |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
233 | qWarning() << "addImage_clicked()" << query.lastError(); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
234 | QMessageBox::warning(this, tr("Database error"), tr("MySQL error: %1\n%2\n%3") |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
235 | .arg(query.lastError().nativeErrorCode()).arg(query.lastError().driverText()).arg(query.lastError().databaseText())); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
236 | } else { |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
237 | qDebug() << "new image Saved"; |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
238 | } |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
239 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
240 | //emit refreshAll(); |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
241 | } |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
242 | |
8fc909360552
In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents:
464
diff
changeset
|
243 | |
467
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
244 | void EditProduct::delImage_clicked() |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
245 | { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
246 | qDebug() << "delImage_clicked()" << product->images_current << ui->filmStrip->currentRow(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
247 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
248 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
249 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
250 | void EditProduct::nextImage_clicked() |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
251 | { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
252 | qDebug() << "nextImage_clicked()" << product->images_current << ui->filmStrip->currentRow(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
253 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
254 | if (product->images_count >= 0) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
255 | if ((product->images_current + 1) < product->images_count) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
256 | product->images_current++; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
257 | ui->filmStrip->setCurrentRow(product->images_current); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
258 | images_Main(product->images_current); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
259 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
260 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
261 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
262 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
263 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
264 | void EditProduct::prevImage_clicked() |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
265 | { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
266 | qDebug() << "prevImage_clicked()" << product->images_current << ui->filmStrip->currentRow(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
267 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
268 | if (product->images_count >= 0) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
269 | if (product->images_current > 0) { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
270 | product->images_current--; |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
271 | ui->filmStrip->setCurrentRow(product->images_current); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
272 | images_Main(product->images_current); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
273 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
274 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
275 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
276 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
277 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
278 | void EditProduct::downloadImage_clicked() |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
279 | { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
280 | qDebug() << "downloadImage_clicked()" << product->images_current << ui->filmStrip->currentRow(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
281 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
282 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
283 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
284 | void EditProduct::printImage_clicked() |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
285 | { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
286 | qDebug() << "printImage_clicked()" << product->images_current << ui->filmStrip->currentRow(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
287 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
288 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
289 | |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
290 | void EditProduct::selectImage_clicked(int val) |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
291 | { |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
292 | qDebug() << "selectImage_clicked()" << val << product->images_current << ui->filmStrip->currentRow(); |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
293 | } |
c5f6f3f1b714
Added more buttons to the images tab. Load images from the database and display thumbnails added. Added support for jpeg files. Rename pictures in the database to .png. Added temporary images_list, images_count and images_current variables to the product record.
Michiel Broek <mbroek@mbse.eu>
parents:
466
diff
changeset
|
294 |