[Digikam-devel] extragear/graphics/digikam

Gilles Caulier caulier.gilles at gmail.com
Tue May 29 15:14:50 BST 2007


SVN commit 669483 by cgilles:

digikam from trunk : ALbum GUI : new option to handle full size image in Preview Mode, instead a reduced size.
For performance reasons, this option is disable by default. Use it only if you have a fast computer...
CCMAIL: digikam-devel at kde.org



 M  +24 -6     digikam/albumsettings.cpp  
 M  +3 -0      digikam/albumsettings.h  
 M  +1 -0      digikam/digikamview.cpp  
 M  +12 -1     digikam/imagepreviewview.cpp  
 M  +2 -0      digikam/imagepreviewview.h  
 M  +14 -2     utilities/setup/setupgeneral.cpp  


--- trunk/extragear/graphics/digikam/digikam/albumsettings.cpp #669482:669483
@@ -94,6 +94,8 @@
     bool saveDateTime;
     bool saveRating;
 
+    bool previewLoadFullImageSize;
+
     int  thumbnailSize;
     int  treeThumbnailSize;
 
@@ -226,6 +228,8 @@
     d->saveComments           = false;
     d->saveDateTime           = false;
     d->saveRating             = false;
+
+    d->previewLoadFullImageSize = false;
 }
 
 void AlbumSettings::readSettings()
@@ -255,13 +259,13 @@
                                                                   "Item Right Click Action",
                                                                   (int)AlbumSettings::ShowPreview));
 
-    d->imageFilefilter = config->readEntry("File Filter", d->imageFilefilter);
-    d->movieFilefilter = config->readEntry("Movie File Filter", d->movieFilefilter);
-    d->audioFilefilter = config->readEntry("Audio File Filter", d->audioFilefilter);
-    d->rawFilefilter   = config->readEntry("Raw File Filter", d->rawFilefilter);
-    d->thumbnailSize   = config->readNumEntry("Default Icon Size", ThumbnailSize::Medium);
+    d->imageFilefilter   = config->readEntry("File Filter", d->imageFilefilter);
+    d->movieFilefilter   = config->readEntry("Movie File Filter", d->movieFilefilter);
+    d->audioFilefilter   = config->readEntry("Audio File Filter", d->audioFilefilter);
+    d->rawFilefilter     = config->readEntry("Raw File Filter", d->rawFilefilter);
+    d->thumbnailSize     = config->readNumEntry("Default Icon Size", ThumbnailSize::Medium);
     d->treeThumbnailSize = config->readNumEntry("Default Tree Icon Size", ThumbnailSize::Tiny);
-    d->currentTheme    = config->readEntry("Theme", i18n("Default"));
+    d->currentTheme      = config->readEntry("Theme", i18n("Default"));
 
     d->iconShowName       = config->readBoolEntry("Icon Show Name", false); 
     d->iconShowResolution = config->readBoolEntry("Icon Show Resolution", false);
@@ -290,6 +294,8 @@
     d->tooltipShowTags       = config->readBoolEntry("ToolTips Show Tags", true);
     d->tooltipShowRating     = config->readBoolEntry("ToolTips Show Rating", true);
 
+    d->previewLoadFullImageSize = config->readBoolEntry("Preview Load Full Image Size", false);
+    
     // ---------------------------------------------------------------------
 
     config->setGroup("EXIF Settings");
@@ -374,6 +380,8 @@
     config->writeEntry("ToolTips Show Tags", d->tooltipShowTags);
     config->writeEntry("ToolTips Show Rating", d->tooltipShowRating);
 
+    config->writeEntry("Preview Load Full Image Size", d->previewLoadFullImageSize);
+
     // ---------------------------------------------------------------------
 
     config->setGroup("EXIF Settings");
@@ -1043,4 +1051,14 @@
     return d->defaultRawFilefilter;
 }
 
+void AlbumSettings::setPreviewLoadFullImageSize(bool val)
+{
+    d->previewLoadFullImageSize = val;
+}
+
+bool AlbumSettings::getPreviewLoadFullImageSize() const
+{
+    return d->previewLoadFullImageSize;
+}
+
 }  // namespace Digikam
--- trunk/extragear/graphics/digikam/digikam/albumsettings.h #669482:669483
@@ -245,6 +245,9 @@
     QString getDefaultAudioFileFilter() const;
     QString getDefaultRawFileFilter() const;
 
+    void setPreviewLoadFullImageSize(bool val);
+    bool getPreviewLoadFullImageSize() const;
+
     static AlbumSettings *instance();
 
 private:
--- trunk/extragear/graphics/digikam/digikam/digikamview.cpp #669482:669483
@@ -198,6 +198,7 @@
 void DigikamView::applySettings(const AlbumSettings* settings)
 {
     d->iconView->applySettings(settings);
+    d->albumWidgetStack->imagePreviewView()->setLoadFullImageSize(settings->getPreviewLoadFullImageSize());
 }
 
 void DigikamView::setupConnections()
--- trunk/extragear/graphics/digikam/digikam/imagepreviewview.cpp #669482:669483
@@ -92,12 +92,14 @@
         parent               = 0;
         hasPrev              = false;
         hasNext              = false;
+        loadFullImageSize    = false;
         currentFitWindowZoom = 0;
         previewSize          = 1024;
     }
 
     bool               hasPrev;
     bool               hasNext;
+    bool               loadFullImageSize;
 
     int                previewSize;
 
@@ -177,6 +179,12 @@
     delete d;
 }
 
+void ImagePreviewView::setLoadFullImageSize(bool b)
+{
+    d->loadFullImageSize = b;
+    reload();
+}
+
 void ImagePreviewView::setImage(const DImg& image)
 {
     d->preview = image;
@@ -232,7 +240,10 @@
                 this, SLOT(slotNextPreload()));
     }
 
-    d->previewThread->load(LoadingDescription(path, d->previewSize, AlbumSettings::instance()->getExifRotate()));
+    if (d->loadFullImageSize)
+        d->previewThread->loadHighQuality(LoadingDescription(path, 0, AlbumSettings::instance()->getExifRotate()));
+    else
+        d->previewThread->load(LoadingDescription(path, d->previewSize, AlbumSettings::instance()->getExifRotate()));
 }
 
 void ImagePreviewView::slotGotImagePreview(const LoadingDescription &description, const DImg& preview)
--- trunk/extragear/graphics/digikam/digikam/imagepreviewview.h #669482:669483
@@ -55,6 +55,8 @@
     ImagePreviewView(AlbumWidgetStack *parent=0);
     ~ImagePreviewView();
 
+    void setLoadFullImageSize(bool b);
+
     void setImage(const DImg& image);
     DImg& getImage() const;
 
--- trunk/extragear/graphics/digikam/utilities/setup/setupgeneral.cpp #669482:669483
@@ -77,10 +77,11 @@
         iconShowTagsBox          = 0;
         iconShowRatingBox        = 0;
         rightClickActionComboBox = 0;
+        previewLoadFullImageSize = 0;
     }
 
-    QComboBox     *iconTreeThumbSize;
     QLabel        *iconTreeThumbLabel;
+
     QCheckBox     *iconShowNameBox;
     QCheckBox     *iconShowSizeBox;
     QCheckBox     *iconShowDateBox;
@@ -89,7 +90,9 @@
     QCheckBox     *iconShowCommentsBox;
     QCheckBox     *iconShowTagsBox;
     QCheckBox     *iconShowRatingBox;
+    QCheckBox     *previewLoadFullImageSize;
 
+    QComboBox     *iconTreeThumbSize;
     QComboBox     *rightClickActionComboBox;
 
     KURLRequester *albumPathEdit;
@@ -129,7 +132,7 @@
     QVGroupBox *iconTextGroup = new QVGroupBox(i18n("Thumbnails"), parent);
     iconTextGroup->setColumnLayout(0, Qt::Vertical );
     iconTextGroup->layout()->setMargin(KDialog::marginHint());
-    QGridLayout* tagSettingsLayout = new QGridLayout(iconTextGroup->layout(), 5, 10,
+    QGridLayout* tagSettingsLayout = new QGridLayout(iconTextGroup->layout(), 10, 4,
                                                      KDialog::spacingHint());
       
     d->iconTreeThumbLabel = new QLabel(i18n("Sidebar thumbnail size:"), iconTextGroup);
@@ -200,6 +203,12 @@
     tagSettingsLayout->addMultiCellWidget(rightClickLabel, 9 ,9, 0, 0);
     tagSettingsLayout->addMultiCellWidget(d->rightClickActionComboBox, 9, 9, 1, 4);
 
+    d->previewLoadFullImageSize = new QCheckBox(i18n("Embedded preview load full image size"), iconTextGroup);
+    QWhatsThis::add( d->previewLoadFullImageSize, i18n("<p>Set this option to load full image size "
+                     "with embedded preview instead a reduced one. Because this option will take more time "
+                     "to load image, use it only if you have a fast computer."));
+    tagSettingsLayout->addMultiCellWidget(d->previewLoadFullImageSize, 10, 10, 0, 4);
+
     layout->addWidget(iconTextGroup);
 
     // --------------------------------------------------------
@@ -235,6 +244,7 @@
     settings->setItemRightClickAction((AlbumSettings::ItemRightClickAction)
                                       d->rightClickActionComboBox->currentItem());
 
+    settings->setPreviewLoadFullImageSize(d->previewLoadFullImageSize->isChecked());
     settings->saveSettings();
 }
 
@@ -265,6 +275,8 @@
     d->iconShowRatingBox->setChecked(settings->getIconShowRating());
 
     d->rightClickActionComboBox->setCurrentItem((int)settings->getItemRightClickAction());
+
+    d->previewLoadFullImageSize->setChecked(settings->getPreviewLoadFullImageSize());
 }
 
 void SetupGeneral::slotChangeAlbumPath(const QString &result)



More information about the Digikam-devel mailing list