~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to utilities/setup/setupmetadata.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
};
111
111
 
112
112
SetupMetadata::SetupMetadata(QWidget* parent)
113
 
             : QScrollArea(parent), d(new SetupMetadataPriv)
 
113
    : QScrollArea(parent), d(new SetupMetadataPriv)
114
114
{
115
115
    d->tab = new KTabWidget(viewport());
116
116
    setWidget(d->tab);
117
117
    setWidgetResizable(true);
118
118
 
119
 
    QWidget *panel          = new QWidget(d->tab);
120
 
    QVBoxLayout *mainLayout = new QVBoxLayout(panel);
 
119
    QWidget* panel          = new QWidget(d->tab);
 
120
    QVBoxLayout* mainLayout = new QVBoxLayout(panel);
121
121
 
122
122
    // --------------------------------------------------------
123
123
 
124
 
    QGroupBox *ExifGroup     = new QGroupBox(i18n("EXIF Actions"), panel);
125
 
    QVBoxLayout *gLayout1    = new QVBoxLayout(ExifGroup);
 
124
    QGroupBox* ExifGroup     = new QGroupBox(i18n("EXIF Actions"), panel);
 
125
    QVBoxLayout* gLayout1    = new QVBoxLayout(ExifGroup);
126
126
 
127
127
    d->exifRotateBox         = new QCheckBox(ExifGroup);
128
128
    d->exifRotateBox->setText(i18n("Show images/thumbnails &rotated according to orientation tag."));
137
137
 
138
138
    // --------------------------------------------------------
139
139
 
140
 
    QGroupBox *commonGroup = new QGroupBox(i18n("Common Metadata Actions"), panel);
141
 
    QVBoxLayout *gLayout2  = new QVBoxLayout(commonGroup);
 
140
    QGroupBox* commonGroup = new QGroupBox(i18n("Common Metadata Actions"), panel);
 
141
    QVBoxLayout* gLayout2  = new QVBoxLayout(commonGroup);
142
142
 
143
143
    d->saveTagsBox = new QCheckBox(commonGroup);
144
144
    d->saveTagsBox->setText(i18n("&Save image tags as \"Keywords\" tags in metadata embedded in files"));
196
196
 
197
197
    // --------------------------------------------------------
198
198
 
199
 
    QFrame      *box  = new QFrame(panel);
200
 
    QGridLayout *grid = new QGridLayout(box);
 
199
    QFrame*      box  = new QFrame(panel);
 
200
    QGridLayout* grid = new QGridLayout(box);
201
201
    box->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
202
202
 
203
 
    KUrlLabel *exiv2LogoLabel = new KUrlLabel(box);
 
203
    KUrlLabel* exiv2LogoLabel = new KUrlLabel(box);
204
204
    exiv2LogoLabel->setText(QString());
205
205
    exiv2LogoLabel->setUrl("http://www.exiv2.org");
206
206
    exiv2LogoLabel->setPixmap(QPixmap(KStandardDirs::locate("data", "digikam/data/logo-exiv2.png")));
249
249
 
250
250
#ifdef HAVE_NEPOMUK
251
251
 
252
 
    QWidget *nepoPanel      = new QWidget(d->tab);
253
 
    QVBoxLayout *nepoLayout = new QVBoxLayout(nepoPanel);
 
252
    QWidget* nepoPanel      = new QWidget(d->tab);
 
253
    QVBoxLayout* nepoLayout = new QVBoxLayout(nepoPanel);
254
254
 
255
 
    QGroupBox *nepoGroup    = new QGroupBox(i18n("Nepomuk Semantic Desktop"), nepoPanel);
256
 
    QVBoxLayout *gLayout3   = new QVBoxLayout(nepoGroup);
 
255
    QGroupBox* nepoGroup    = new QGroupBox(i18n("Nepomuk Semantic Desktop"), nepoPanel);
 
256
    QVBoxLayout* gLayout3   = new QVBoxLayout(nepoGroup);
257
257
 
258
258
    d->saveToNepomukBox     = new QCheckBox;
259
259
    d->saveToNepomukBox->setText(i18n("Store metadata from digiKam in Nepomuk"));
263
263
    d->readFromNepomukBox   = new QCheckBox;
264
264
    d->readFromNepomukBox->setText(i18n("Read metadata from Nepomuk"));
265
265
    d->readFromNepomukBox->setWhatsThis( i18n("Turn on this option if you want to apply changes to "
266
 
                                              "rating, comments and tags made in Nepomuk to digiKam's metadata storage. "
267
 
                                              "Please note that image metadata will not be edited automatically."));
 
266
                                         "rating, comments and tags made in Nepomuk to digiKam's metadata storage. "
 
267
                                         "Please note that image metadata will not be edited automatically."));
268
268
 
269
269
    gLayout3->addWidget(d->saveToNepomukBox);
270
270
    gLayout3->addWidget(d->readFromNepomukBox);
285
285
 
286
286
    // --------------------------------------------------------
287
287
 
288
 
    QFrame      *nepoBox  = new QFrame(nepoPanel);
289
 
    QGridLayout *nepoGrid = new QGridLayout(nepoBox);
 
288
    QFrame*      nepoBox  = new QFrame(nepoPanel);
 
289
    QGridLayout* nepoGrid = new QGridLayout(nepoBox);
290
290
    nepoBox->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
291
291
 
292
 
    QLabel *nepoLogoLabel = new QLabel;
 
292
    QLabel* nepoLogoLabel = new QLabel;
293
293
    nepoLogoLabel->setPixmap(KIconLoader::global()->loadIcon("nepomuk", KIconLoader::NoGroup, KIconLoader::SizeLarge));
294
294
 
295
295
    QLabel* nepoExplanation = new QLabel(nepoBox);
298
298
    QString nepotxt;
299
299
 
300
300
    nepotxt.append(i18n("<p><a href='http://nepomuk.kde.org'>Nepomuk</a> "
301
 
                    "provides the basis to handle all kinds of metadata on the KDE desktop in a generic fashion. "
302
 
                    "It allows you to tag, rate and comment your files in KDE applications like Dolphin.</p> "
303
 
                    "<p>Please set here if you want to synchronize the metadata stored by digiKam desktop-wide with the "
304
 
                    "Nepomuk Semantic Desktop.</p> "
305
 
                    "<p>If you have enabled writing of metadata to files, please note that changes done through Nepomuk "
306
 
                    "are not automatically applied to the image's metadata when read into digiKam's database.</p> "));
 
301
                        "provides the basis to handle all kinds of metadata on the KDE desktop in a generic fashion. "
 
302
                        "It allows you to tag, rate and comment your files in KDE applications like Dolphin.</p> "
 
303
                        "<p>Please set here if you want to synchronize the metadata stored by digiKam desktop-wide with the "
 
304
                        "Nepomuk Semantic Desktop.</p> "
 
305
                        "<p>If you have enabled writing of metadata to files, please note that changes done through Nepomuk "
 
306
                        "are not automatically applied to the image's metadata when read into digiKam's database.</p> "));
307
307
 
308
308
    nepoExplanation->setText(nepotxt);
309
309
    nepoExplanation->setFont(KGlobalSettings::smallestReadableFont());
361
361
void SetupMetadata::applySettings()
362
362
{
363
363
    AlbumSettings* settings = AlbumSettings::instance();
364
 
    if (!settings) return;
 
364
 
 
365
    if (!settings)
 
366
    {
 
367
        return;
 
368
    }
365
369
 
366
370
    settings->setExifRotate(d->exifRotateBox->isChecked());
367
371
    settings->setExifSetOrientation(d->exifSetOrientationBox->isChecked());
375
379
#ifdef HAVE_NEPOMUK
376
380
    settings->setSyncDigikamToNepomuk(d->saveToNepomukBox->isChecked());
377
381
    settings->setSyncNepomukToDigikam(d->readFromNepomukBox->isChecked());
 
382
 
378
383
    if (d->resyncButton->isEnabled() && d->resyncButton->isChecked())
 
384
    {
379
385
        settings->triggerResyncWithNepomuk();
 
386
    }
 
387
 
380
388
#endif
381
389
    settings->saveSettings();
382
390
 
386
394
void SetupMetadata::readSettings()
387
395
{
388
396
    AlbumSettings* settings = AlbumSettings::instance();
389
 
    if (!settings) return;
 
397
 
 
398
    if (!settings)
 
399
    {
 
400
        return;
 
401
    }
390
402
 
391
403
    d->exifAutoRotateOrg = settings->getExifRotate();
392
404
    d->exifRotateBox->setChecked(d->exifAutoRotateOrg);
413
425
void SetupMetadata::slotExifAutoRotateToggled(bool b)
414
426
{
415
427
    if ( b != d->exifAutoRotateOrg)
 
428
    {
416
429
        d->exifAutoRotateAsChanged = true;
 
430
    }
417
431
    else
 
432
    {
418
433
        d->exifAutoRotateAsChanged = false;
 
434
    }
419
435
}
420
436
 
421
437
void SetupMetadata::slotNepomukToggled()