~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/utilities/cameragui/cameraui.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-ttj4and3ds1ldgn1
Tags: upstream-0.9.4
ImportĀ upstreamĀ versionĀ 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Description : Camera interface dialog
8
8
 * 
9
9
 * Copyright (C) 2004-2005 by Renchi Raju <renchi@pooh.tam.uiuc.edu>
10
 
 * Copyright (C) 2006-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2006-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
11
 *
12
12
 * This program is free software; you can redistribute it
13
13
 * and/or modify it under the terms of the GNU General
76
76
 
77
77
// LibKDcraw includes.
78
78
 
79
 
#include <libkdcraw/rawfiles.h>
 
79
#include <libkdcraw/dcrawbinary.h>
80
80
 
81
81
// Local includes.
82
82
 
279
279
    albumVlay->addStretch();
280
280
 
281
281
    QWhatsThis::add( albumBox, i18n("<p>Set how digiKam creates albums automatically when downloading."));
282
 
    QWhatsThis::add( d->autoAlbumExtCheck, i18n("<p>Toggle on this option if you want to download your "
 
282
    QWhatsThis::add( d->autoAlbumExtCheck, i18n("<p>Enable this option if you want to download your "
283
283
                     "pictures into automatically created file extension-based sub-albums of the destination "
284
284
                     "album. This way, you can separate JPEG and RAW files as they are downloaded from your camera."));
285
 
    QWhatsThis::add( d->autoAlbumDateCheck, i18n("<p>Toggle on this option if you want to "
 
285
    QWhatsThis::add( d->autoAlbumDateCheck, i18n("<p>Enable this option if you want to "
286
286
                     "download your pictures into automatically created file date-based sub-albums "
287
287
                     "of the destination album."));
288
 
    QWhatsThis::add( d->folderDateFormat, i18n("<p>Select here your preferred date format used to "
 
288
    QWhatsThis::add( d->folderDateFormat, i18n("<p>Select your preferred date format used to "
289
289
                     "create new albums. The options available are:<p>"
290
290
                     "<b>ISO</b>: the date format is in accordance with ISO 8601 "
291
291
                     "(YYYY-MM-DD). E.g.: <i>2006-08-24</i><p>"
321
321
 
322
322
    QWhatsThis::add( onFlyBox, i18n("<p>Set here all options to fix/transform JPEG files automatically "
323
323
                     "as they are downloaded."));
324
 
    QWhatsThis::add( d->autoRotateCheck, i18n("<p>Toggle on this option if you want images automatically "
 
324
    QWhatsThis::add( d->autoRotateCheck, i18n("<p>Enable this option if you want images automatically "
325
325
                     "rotated or flipped using EXIF information provided by the camera."));
326
 
    QWhatsThis::add( d->setPhotographerId, i18n("<p>Toggle on this option to store the default "
327
 
                     "photographer identity into IPTC tags using digiKam's metadata settings."));
328
 
    QWhatsThis::add( d->setCredits, i18n("<p>Toggle on this option to store the default credit "
329
 
                     "and copyright information into IPTC tags using digiKam's metadata settings."));
330
 
    QWhatsThis::add( d->fixDateTimeCheck, i18n("<p>Toggle on this option to set date and time metadata "
 
326
    QWhatsThis::add( d->setPhotographerId, i18n("<p>Enable this option to store the default "
 
327
                     "photographer identity in the IPTC tags using digiKam's metadata settings."));
 
328
    QWhatsThis::add( d->setCredits, i18n("<p>Enable this option to store the default credit "
 
329
                     "and copyright information in the IPTC tags using digiKam's metadata settings."));
 
330
    QWhatsThis::add( d->fixDateTimeCheck, i18n("<p>Enable this option to set date and time metadata "
331
331
                     "tags to the right values if your camera does not set "
332
332
                     "these tags correctly when pictures are taken. The values will "
333
333
                     "be saved in the DateTimeDigitized and DateTimeCreated EXIF/IPTC fields."));
334
 
    QWhatsThis::add( d->convertJpegCheck, i18n("<p>Toggle on this option to automatically convert "
 
334
    QWhatsThis::add( d->convertJpegCheck, i18n("<p>Enable this option to automatically convert "
335
335
                     "all JPEG files to a lossless image format. <b>Note:</b> Image conversion can take a "
336
336
                     "while on a slow computer."));
337
337
    QWhatsThis::add( d->losslessFormat, i18n("<p>Select your preferred lossless image file format to "
352
352
    
353
353
    d->status   = new KSqueezedTextLabel(plainPage());
354
354
    d->progress = new KProgress(plainPage());
355
 
    d->progress->setMaximumHeight( fontMetrics().height() );
 
355
    d->progress->setMaximumHeight( fontMetrics().height()+4 );
356
356
    d->progress->hide();
357
357
 
358
358
    QWidget *frame      = new QWidget(plainPage());
406
406
    d->imageMenu->insertSeparator();
407
407
    d->imageMenu->insertItem(i18n("Select &New Items"), d->view, SLOT(slotSelectNew()), 0, 3);
408
408
    d->imageMenu->insertSeparator();
409
 
    d->imageMenu->insertItem(i18n("Increase Thumbs"),   this,    SLOT(slotIncreaseThumbSize()), CTRL+Key_Plus, 4);
410
 
    d->imageMenu->insertItem(i18n("Decrease Thumbs"),   this,    SLOT(slotDecreaseThumbSize()), CTRL+Key_Minus, 5);
 
409
    d->imageMenu->insertItem(i18n("Increase thumbnail size"),   this,    SLOT(slotIncreaseThumbSize()), CTRL+Key_Plus, 4);
 
410
    d->imageMenu->insertItem(i18n("Decrease thumbnail size"),   this,    SLOT(slotDecreaseThumbSize()), CTRL+Key_Minus, 5);
411
411
    d->imageMenu->insertSeparator();
412
412
    d->imageMenu->insertItem(i18n("Toggle Lock"),       this,    SLOT(slotToggleLock()), 0, 6);
413
413
    actionButton(User3)->setPopup(d->imageMenu);    
811
811
 
812
812
void CameraUI::slotIncreaseThumbSize()
813
813
{
814
 
    ThumbnailSize thumbSize;
815
 
 
816
 
    switch(d->view->thumbnailSize().size())
817
 
    {
818
 
        case (ThumbnailSize::Small):
819
 
        {
820
 
            thumbSize = ThumbnailSize(ThumbnailSize::Medium);
821
 
            break;
822
 
        }
823
 
        case (ThumbnailSize::Medium):
824
 
        {
825
 
            thumbSize = ThumbnailSize(ThumbnailSize::Large);
826
 
            break;
827
 
        }
828
 
        case (ThumbnailSize::Large):
829
 
        {
830
 
            thumbSize = ThumbnailSize(ThumbnailSize::Huge);
831
 
            break;
832
 
        }
833
 
        case (ThumbnailSize::Huge):
834
 
        {
835
 
            thumbSize = ThumbnailSize(ThumbnailSize::Huge);
836
 
            break;
837
 
        }
838
 
        default:
839
 
            return;
840
 
    }
841
 
 
842
 
    if (thumbSize.size() == ThumbnailSize::Huge)
 
814
    int thumbSize = d->view->thumbnailSize().size();
 
815
    if (thumbSize >= ThumbnailSize::Huge) return;
 
816
 
 
817
    thumbSize += ThumbnailSize::Step;
 
818
 
 
819
    if (thumbSize >= ThumbnailSize::Huge)
843
820
    {
844
821
        d->imageMenu->setItemEnabled(4, false);
845
822
    }
850
827
 
851
828
void CameraUI::slotDecreaseThumbSize()
852
829
{
853
 
    ThumbnailSize thumbSize;
854
 
 
855
 
    switch(d->view->thumbnailSize().size())
856
 
    {
857
 
        case (ThumbnailSize::Small):
858
 
        {
859
 
            thumbSize = ThumbnailSize(ThumbnailSize::Small);
860
 
            break;
861
 
        }
862
 
        case (ThumbnailSize::Medium):
863
 
        {
864
 
            thumbSize = ThumbnailSize(ThumbnailSize::Small);
865
 
            break;
866
 
        }
867
 
        case (ThumbnailSize::Large):
868
 
        {
869
 
            thumbSize = ThumbnailSize(ThumbnailSize::Medium);
870
 
            break;
871
 
        }
872
 
        case (ThumbnailSize::Huge):
873
 
        {
874
 
            thumbSize = ThumbnailSize(ThumbnailSize::Large);
875
 
            break;
876
 
        }
877
 
        default:
878
 
            return;
879
 
    }
880
 
 
881
 
    if (thumbSize.size() == ThumbnailSize::Small)
 
830
    int thumbSize = d->view->thumbnailSize().size();
 
831
    if (thumbSize <= ThumbnailSize::Small) return;
 
832
 
 
833
    thumbSize -= ThumbnailSize::Step;
 
834
 
 
835
    if (thumbSize <= ThumbnailSize::Small)
882
836
    {
883
837
        d->imageMenu->setItemEnabled(5, false);
884
838
    }
885
 
    d->imageMenu->setItemEnabled(4, true);    
886
 
    
 
839
    d->imageMenu->setItemEnabled(4, true);
 
840
 
887
841
    d->view->setThumbnailSize(thumbSize);
888
842
}
889
843
 
990
944
    QString allPictures = patternList[0];
991
945
    
992
946
    // Add RAW file format to All Images" type mime and remplace current.
993
 
    allPictures.insert(allPictures.find("|"), QString(raw_file_extentions));
 
947
    allPictures.insert(allPictures.find("|"), QString(KDcrawIface::DcrawBinary::instance()->rawFiles()));
994
948
    patternList.remove(patternList[0]);
995
949
    patternList.prepend(allPictures);
996
950
    
997
951
    // Added RAW file formats supported by dcraw program like a type mime. 
998
952
    // Nota: we cannot use here "image/x-raw" type mime from KDE because it uncomplete 
999
953
    // or unavailable(dcraw_0)(see file #121242 in B.K.O).
1000
 
    patternList.append(QString("\n%1|Camera RAW files").arg(QString(raw_file_extentions)));
 
954
    patternList.append(QString("\n%1|Camera RAW files").arg(QString(KDcrawIface::DcrawBinary::instance()->rawFiles())));
1001
955
    
1002
956
    fileformats = patternList.join("\n");
1003
957
 
1299
1253
{
1300
1254
    CameraIconViewItem* iconItem = d->view->findItem(folder, file);
1301
1255
    if (iconItem)
1302
 
    {
1303
1256
        iconItem->setDownloaded(status);
1304
 
        d->view->ensureItemVisible(iconItem);
1305
 
    }
1306
1257
    
1307
1258
    if (status == GPItemInfo::DownloadedYes || status == GPItemInfo::DownloadFailed)
1308
1259
    {
1315
1266
{
1316
1267
    CameraIconViewItem* iconItem = d->view->findItem(folder, file);
1317
1268
    if (iconItem)
1318
 
    {
1319
1269
        iconItem->setDownloaded(GPItemInfo::DownloadedNo);
1320
 
        d->view->ensureItemVisible(iconItem);
1321
 
    }
1322
1270
 
1323
1271
    int curr = d->progress->progress();
1324
1272
    d->progress->setProgress(curr+1);
1403
1351
    // If we want to delete some locked files, just give a feedback to user.
1404
1352
    if (!lockedList.isEmpty())
1405
1353
    {
1406
 
        QString infoMsg(i18n("The items listed below are locked by the camera (read-only). "
 
1354
        QString infoMsg(i18n("The items listed below are locked by camera (read-only). "
1407
1355
                             "These items will not be deleted. If you really want to delete these items, "
1408
1356
                             "please unlock them and try again."));
1409
1357
        KMessageBox::informationList(this, infoMsg, lockedList, i18n("Information"));