1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : A tab to display general image information
9
* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
* This program is free software; you can redistribute it
12
* and/or modify it under the terms of the GNU General
13
* Public License as published by the Free Software Foundation;
14
* either version 2, or (at your option)
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* ============================================================ */
24
#include "imagepropertiestab.moc"
28
#include <QGridLayout>
41
#include "imagepropertiestxtlabel.h"
46
class ImagePropertiesTabPriv
50
ImagePropertiesTabPriv() :
75
labelFileModifiedDate(0),
78
labelFilePermissions(0),
80
labelImageDimensions(0),
81
labelImageCompression(0),
82
labelImageBitDepth(0),
83
labelImageColorMode(0),
86
labelPhotoDateTime(0),
88
labelPhotoAperture(0),
89
labelPhotoFocalLength(0),
90
labelPhotoExposureTime(0),
91
labelPhotoSensitivity(0),
92
labelPhotoExposureMode(0),
94
labelPhotoWhiteBalance(0)
99
DTextLabelName* folder;
100
DTextLabelName* modifiedDate;
101
DTextLabelName* size;
102
DTextLabelName* owner;
103
DTextLabelName* permissions;
105
DTextLabelName* mime;
106
DTextLabelName* dimensions;
107
DTextLabelName* compression;
108
DTextLabelName* bitDepth;
109
DTextLabelName* colorMode;
111
DTextLabelName* make;
112
DTextLabelName* model;
113
DTextLabelName* photoDate;
114
DTextLabelName* lens;
115
DTextLabelName* aperture;
116
DTextLabelName* focalLength;
117
DTextLabelName* exposureTime;
118
DTextLabelName* sensitivity;
119
DTextLabelName* exposureMode;
120
DTextLabelName* flash;
121
DTextLabelName* whiteBalance;
123
DTextLabelValue* labelFile;
124
DTextLabelValue* labelFolder;
125
DTextLabelValue* labelFileModifiedDate;
126
DTextLabelValue* labelFileSize;
127
DTextLabelValue* labelFileOwner;
128
DTextLabelValue* labelFilePermissions;
130
DTextLabelValue* labelImageMime;
131
DTextLabelValue* labelImageDimensions;
132
DTextLabelValue* labelImageCompression;
133
DTextLabelValue* labelImageBitDepth;
134
DTextLabelValue* labelImageColorMode;
136
DTextLabelValue* labelPhotoMake;
137
DTextLabelValue* labelPhotoModel;
138
DTextLabelValue* labelPhotoDateTime;
139
DTextLabelValue* labelPhotoLens;
140
DTextLabelValue* labelPhotoAperture;
141
DTextLabelValue* labelPhotoFocalLength;
142
DTextLabelValue* labelPhotoExposureTime;
143
DTextLabelValue* labelPhotoSensitivity;
144
DTextLabelValue* labelPhotoExposureMode;
145
DTextLabelValue* labelPhotoFlash;
146
DTextLabelValue* labelPhotoWhiteBalance;
149
ImagePropertiesTab::ImagePropertiesTab(QWidget* parent)
150
: RExpanderBox(parent), d(new ImagePropertiesTabPriv)
152
setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
153
setLineWidth( style()->pixelMetric(QStyle::PM_DefaultFrameWidth) );
155
// --------------------------------------------------
157
QWidget* w1 = new QWidget(this);
158
QGridLayout* glay1 = new QGridLayout(w1);
160
d->file = new DTextLabelName(i18n("File: "), w1);
161
d->folder = new DTextLabelName(i18n("Folder: "), w1);
162
d->modifiedDate = new DTextLabelName(i18n("Date: "), w1);
163
d->size = new DTextLabelName(i18n("Size: "), w1);
164
d->owner = new DTextLabelName(i18n("Owner: "), w1);
165
d->permissions = new DTextLabelName(i18n("Permissions: "), w1);
167
d->labelFile = new DTextLabelValue(0, w1);
168
d->labelFolder = new DTextLabelValue(0, w1);
169
d->labelFileModifiedDate = new DTextLabelValue(0, w1);
170
d->labelFileSize = new DTextLabelValue(0, w1);
171
d->labelFileOwner = new DTextLabelValue(0, w1);
172
d->labelFilePermissions = new DTextLabelValue(0, w1);
174
glay1->addWidget(d->file, 0, 0, 1, 1);
175
glay1->addWidget(d->labelFile, 0, 1, 1, 1);
176
glay1->addWidget(d->folder, 1, 0, 1, 1);
177
glay1->addWidget(d->labelFolder, 1, 1, 1, 1);
178
glay1->addWidget(d->modifiedDate, 2, 0, 1, 1);
179
glay1->addWidget(d->labelFileModifiedDate, 2, 1, 1, 1);
180
glay1->addWidget(d->size, 3, 0, 1, 1);
181
glay1->addWidget(d->labelFileSize, 3, 1, 1, 1);
182
glay1->addWidget(d->owner, 4, 0, 1, 1);
183
glay1->addWidget(d->labelFileOwner, 4, 1, 1, 1);
184
glay1->addWidget(d->permissions, 5, 0, 1, 1);
185
glay1->addWidget(d->labelFilePermissions, 5, 1, 1, 1);
186
glay1->setMargin(KDialog::spacingHint());
187
glay1->setSpacing(0);
188
glay1->setColumnStretch(1, 10);
190
addItem(w1, SmallIcon("dialog-information"),
191
i18n("File Properties"), QString("FileProperties"), true);
193
// --------------------------------------------------
195
QWidget* w2 = new QWidget(this);
196
QGridLayout* glay2 = new QGridLayout(w2);
198
d->mime = new DTextLabelName(i18n("Type: "), w2);
199
d->dimensions = new DTextLabelName(i18n("Dimensions: "), w2);
200
d->compression = new DTextLabelName(i18n("Compression: "), w2);
201
d->bitDepth = new DTextLabelName(i18n("Bit depth: "), w2);
202
d->colorMode = new DTextLabelName(i18n("Color mode: "), w2);
204
d->labelImageMime = new DTextLabelValue(0, w2);
205
d->labelImageDimensions = new DTextLabelValue(0, w2);
206
d->labelImageCompression = new DTextLabelValue(0, w2);
207
d->labelImageBitDepth = new DTextLabelValue(0, w2);
208
d->labelImageColorMode = new DTextLabelValue(0, w2);
210
glay2->addWidget(d->mime, 0, 0, 1, 1);
211
glay2->addWidget(d->labelImageMime, 0, 1, 1, 1);
212
glay2->addWidget(d->dimensions, 1, 0, 1, 1);
213
glay2->addWidget(d->labelImageDimensions, 1, 1, 1, 1);
214
glay2->addWidget(d->compression, 2, 0, 1, 1);
215
glay2->addWidget(d->labelImageCompression, 2, 1, 1, 1);
216
glay2->addWidget(d->bitDepth, 3, 0, 1, 1);
217
glay2->addWidget(d->labelImageBitDepth, 3, 1, 1, 1);
218
glay2->addWidget(d->colorMode, 4, 0, 1, 1);
219
glay2->addWidget(d->labelImageColorMode, 4, 1, 1, 1);
220
glay2->setMargin(KDialog::spacingHint());
221
glay2->setSpacing(0);
222
glay2->setColumnStretch(1, 10);
224
addItem(w2, SmallIcon("image-x-generic"),
225
i18n("Image Properties"), QString("ImageProperties"), true);
227
// --------------------------------------------------
229
QWidget* w3 = new QWidget(this);
230
QGridLayout* glay3 = new QGridLayout(w3);
232
d->make = new DTextLabelName(i18n("Make: "), w3);
233
d->model = new DTextLabelName(i18n("Model: "), w3);
234
d->photoDate = new DTextLabelName(i18n("Created: "), w3);
235
d->lens = new DTextLabelName(i18n("Lens: "), w3);
236
d->aperture = new DTextLabelName(i18n("Aperture: "), w3);
237
d->focalLength = new DTextLabelName(i18n("Focal: "), w3);
238
d->exposureTime = new DTextLabelName(i18n("Exposure: "), w3);
239
d->sensitivity = new DTextLabelName(i18n("Sensitivity: "), w3);
240
d->exposureMode = new DTextLabelName(i18n("Mode/Program: "), w3);
241
d->flash = new DTextLabelName(i18n("Flash: "), w3);
242
d->whiteBalance = new DTextLabelName(i18n("White balance: "), w3);
244
d->labelPhotoMake = new DTextLabelValue(0, w3);
245
d->labelPhotoModel = new DTextLabelValue(0, w3);
246
d->labelPhotoDateTime = new DTextLabelValue(0, w3);
247
d->labelPhotoLens = new DTextLabelValue(0, w3);
248
d->labelPhotoAperture = new DTextLabelValue(0, w3);
249
d->labelPhotoFocalLength = new DTextLabelValue(0, w3);
250
d->labelPhotoExposureTime = new DTextLabelValue(0, w3);
251
d->labelPhotoSensitivity = new DTextLabelValue(0, w3);
252
d->labelPhotoExposureMode = new DTextLabelValue(0, w3);
253
d->labelPhotoFlash = new DTextLabelValue(0, w3);
254
d->labelPhotoWhiteBalance = new DTextLabelValue(0, w3);
256
glay3->addWidget(d->make, 23, 0, 1, 1);
257
glay3->addWidget(d->labelPhotoMake, 23, 1, 1, 1);
258
glay3->addWidget(d->model, 24, 0, 1, 1);
259
glay3->addWidget(d->labelPhotoModel, 24, 1, 1, 1);
260
glay3->addWidget(d->photoDate, 25, 0, 1, 1);
261
glay3->addWidget(d->labelPhotoDateTime, 25, 1, 1, 1);
262
glay3->addWidget(d->lens, 26, 0, 1, 1);
263
glay3->addWidget(d->labelPhotoLens, 26, 1, 1, 1);
264
glay3->addWidget(d->aperture, 27, 0, 1, 1);
265
glay3->addWidget(d->labelPhotoAperture, 27, 1, 1, 1);
266
glay3->addWidget(d->focalLength, 28, 0, 1, 1);
267
glay3->addWidget(d->labelPhotoFocalLength, 28, 1, 1, 1);
268
glay3->addWidget(d->exposureTime, 29, 0, 1, 1);
269
glay3->addWidget(d->labelPhotoExposureTime, 29, 1, 1, 1);
270
glay3->addWidget(d->sensitivity, 30, 0, 1, 1);
271
glay3->addWidget(d->labelPhotoSensitivity, 30, 1, 1, 1);
272
glay3->addWidget(d->exposureMode, 31, 0, 1, 1);
273
glay3->addWidget(d->labelPhotoExposureMode, 31, 1, 1, 1);
274
glay3->addWidget(d->flash, 32, 0, 1, 1);
275
glay3->addWidget(d->labelPhotoFlash, 32, 1, 1, 1);
276
glay3->addWidget(d->whiteBalance, 33, 0, 1, 1);
277
glay3->addWidget(d->labelPhotoWhiteBalance, 33, 1, 1, 1);
278
glay3->setColumnStretch(1, 10);
279
glay3->setMargin(KDialog::spacingHint());
280
glay3->setSpacing(0);
282
addItem(w3, SmallIcon("camera-photo"),
283
i18n("Photograph Properties"), QString("PhotographProperties"), true);
288
ImagePropertiesTab::~ImagePropertiesTab()
293
void ImagePropertiesTab::setCurrentURL(const KUrl& url)
297
d->labelFile->setText(QString());
298
d->labelFolder->setText(QString());
299
d->labelFileModifiedDate->setText(QString());
300
d->labelFileSize->setText(QString());
301
d->labelFileOwner->setText(QString());
302
d->labelFilePermissions->setText(QString());
304
d->labelImageMime->setText(QString());
305
d->labelImageDimensions->setText(QString());
306
d->labelImageCompression->setText(QString());
307
d->labelImageBitDepth->setText(QString());
308
d->labelImageColorMode->setText(QString());
310
d->labelPhotoMake->setText(QString());
311
d->labelPhotoModel->setText(QString());
312
d->labelPhotoDateTime->setText(QString());
313
d->labelPhotoLens->setText(QString());
314
d->labelPhotoAperture->setText(QString());
315
d->labelPhotoFocalLength->setText(QString());
316
d->labelPhotoExposureTime->setText(QString());
317
d->labelPhotoSensitivity->setText(QString());
318
d->labelPhotoExposureMode->setText(QString());
319
d->labelPhotoFlash->setText(QString());
320
d->labelPhotoWhiteBalance->setText(QString());
328
d->labelFile->setText(url.fileName());
329
d->labelFolder->setText(url.directory());
332
void ImagePropertiesTab::setPhotoInfoDisable(bool b)
344
void ImagePropertiesTab::setFileModifiedDate(const QString& str)
346
d->labelFileModifiedDate->setText(str);
349
void ImagePropertiesTab::setFileSize(const QString& str)
351
d->labelFileSize->setText(str);
354
void ImagePropertiesTab::setFileOwner(const QString& str)
356
d->labelFileOwner->setText(str);
359
void ImagePropertiesTab::setFilePermissions(const QString& str)
361
d->labelFilePermissions->setText(str);
364
void ImagePropertiesTab::setImageMime(const QString& str)
366
d->labelImageMime->setText(str);
369
void ImagePropertiesTab::setImageDimensions(const QString& str)
371
d->labelImageDimensions->setText(str);
374
void ImagePropertiesTab::setImageCompression(const QString& str)
376
d->compression->show();
377
d->labelImageCompression->show();
379
d->labelImageCompression->setText(str);
382
void ImagePropertiesTab::hideImageCompression()
384
d->compression->hide();
385
d->labelImageCompression->hide();
388
void ImagePropertiesTab::setImageBitDepth(const QString& str)
390
d->labelImageBitDepth->setText(str);
393
void ImagePropertiesTab::setImageColorMode(const QString& str)
395
d->labelImageColorMode->setText(str);
398
void ImagePropertiesTab::setPhotoMake(const QString& str)
400
d->labelPhotoMake->setText(str);
403
void ImagePropertiesTab::setPhotoModel(const QString& str)
405
d->labelPhotoModel->setText(str);
408
void ImagePropertiesTab::setPhotoDateTime(const QString& str)
410
d->labelPhotoDateTime->setText(str);
413
void ImagePropertiesTab::setPhotoLens(const QString& str)
415
d->labelPhotoLens->setText(str);
418
void ImagePropertiesTab::setPhotoAperture(const QString& str)
420
d->labelPhotoAperture->setText(str);
423
void ImagePropertiesTab::setPhotoFocalLength(const QString& str)
425
d->labelPhotoFocalLength->setText(str);
428
void ImagePropertiesTab::setPhotoExposureTime(const QString& str)
430
d->labelPhotoExposureTime->setText(str);
433
void ImagePropertiesTab::setPhotoSensitivity(const QString& str)
435
d->labelPhotoSensitivity->setText(str);
438
void ImagePropertiesTab::setPhotoExposureMode(const QString& str)
440
d->labelPhotoExposureMode->setText(str);
443
void ImagePropertiesTab::setPhotoFlash(const QString& str)
445
d->labelPhotoFlash->setText(str);
448
void ImagePropertiesTab::setPhotoWhiteBalance(const QString& str)
450
d->labelPhotoWhiteBalance->setText(str);
453
} // namespace Digikam