• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

digikam

albumsettings.cpp

Go to the documentation of this file.
00001 /* ============================================================
00002  *
00003  * This file is a part of digiKam project
00004  * http://www.digikam.org
00005  *
00006  * Date        : 2003-16-10
00007  * Description : albums settings interface
00008  *
00009  * Copyright (C) 2003-2004 by Renchi Raju <renchi@pooh.tam.uiuc.edu> 
00010  * Copyright (C) 2003-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
00011  * Copyright (C) 2007 by Arnd Baecker <arnd dot baecker at web dot de>
00012  *
00013  * This program is free software; you can redistribute it
00014  * and/or modify it under the terms of the GNU General
00015  * Public License as published by the Free Software Foundation;
00016  * either version 2, or (at your option)
00017  * any later version.
00018  *
00019  * This program is distributed in the hope that it will be useful,
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  * GNU General Public License for more details.
00023  *
00024  * ============================================================ */
00025 
00026 // KDE includes.
00027 
00028 #include <kconfig.h>
00029 #include <klocale.h>
00030 #include <kapplication.h>
00031 #include <kdebug.h>
00032 #include <kglobal.h>
00033 #include <kconfiggroup.h>
00034 
00035 // LibKDcraw includes.
00036 
00037 #include <libkdcraw/dcrawbinary.h>
00038 
00039 // Local includes.
00040 
00041 #include "thumbnailsize.h"
00042 #include "mimefilter.h"
00043 #include "databaseaccess.h"
00044 #include "albumdb.h"
00045 #include "albumlister.h"
00046 #include "albumsettings.h"
00047 
00048 namespace Digikam
00049 {
00050 
00051 class AlbumSettingsPrivate 
00052 {
00053 
00054 public:
00055 
00056     // start up setting
00057     bool                                showSplash;
00058     // file ops settings
00059     bool                                useTrash;
00060     bool                                showTrashDeleteDialog;
00061     // metadata setting
00062     bool                                sidebarApplyDirectly;
00063     // database setting
00064     bool                                scanAtStart;
00065 
00066     // icon view settings
00067     bool                                iconShowName;
00068     bool                                iconShowSize;
00069     bool                                iconShowDate;
00070     bool                                iconShowModDate;
00071     bool                                iconShowComments;
00072     bool                                iconShowResolution;
00073     bool                                iconShowTags;
00074     bool                                iconShowRating;
00075 
00076     // tooltip settings
00077     bool                                showToolTips;
00078     bool                                tooltipShowFileName;
00079     bool                                tooltipShowFileDate;
00080     bool                                tooltipShowFileSize;
00081     bool                                tooltipShowImageType;
00082     bool                                tooltipShowImageDim;
00083     bool                                tooltipShowPhotoMake;
00084     bool                                tooltipShowPhotoDate;
00085     bool                                tooltipShowPhotoFocal;
00086     bool                                tooltipShowPhotoExpo;
00087     bool                                tooltipShowPhotoMode;
00088     bool                                tooltipShowPhotoFlash;
00089     bool                                tooltipShowPhotoWb;
00090     bool                                tooltipShowAlbumName;
00091     bool                                tooltipShowComments;
00092     bool                                tooltipShowTags;
00093     bool                                tooltipShowRating;
00094 
00095     // metadata settings
00096     bool                                exifRotate;
00097     bool                                exifSetOrientation;
00098 
00099     bool                                saveTags;
00100     bool                                savePhotographerId;
00101     bool                                saveCredits;
00102 
00103     bool                                saveComments;
00104     bool                                saveDateTime;
00105     bool                                saveRating;
00106 
00107     // preview settings
00108     bool                                previewLoadFullImageSize;      
00109     bool                                showThumbbar;
00110 
00111     bool                                showFolderTreeViewItemsCount;
00112 
00113     QString                             author;
00114     QString                             authorTitle;
00115     QString                             credit;
00116     QString                             source;
00117     QString                             copyright;
00118 
00119     // album view settings
00120     int                                 treeThumbnailSize;
00121 
00122     // icon view settings
00123     int                                 thumbnailSize;
00124     int                                 ratingFilterCond;
00125     bool                                recursiveAlbums;
00126     bool                                recursiveTags;
00127 
00128     // theme settings
00129     QString                             currentTheme;
00130 
00131     // database settings
00132     QString                             albumLibraryPath;
00133     QString                             databaseFilePath;
00134 
00135     // album settings
00136     QStringList                         albumCollectionNames;
00137 
00138     KSharedConfigPtr                    config;
00139 
00140     // album view settings
00141     AlbumSettings::AlbumSortOrder       albumSortOrder;
00142 
00143     // icon view settings
00144     AlbumSettings::ImageSortOrder       imageSortOrder;
00145     AlbumSettings::ItemRightClickAction itemRightClickAction;
00146 };
00147 
00148 class AlbumSettingsCreator { public: AlbumSettings object; };
00149 K_GLOBAL_STATIC(AlbumSettingsCreator, creator)
00150 
00151 AlbumSettings* AlbumSettings::instance()
00152 {
00153     return &creator->object;
00154 }
00155 
00156 AlbumSettings::AlbumSettings()
00157 {
00158     d = new AlbumSettingsPrivate;
00159     d->config  = KGlobal::config();
00160     init();
00161     readSettings();
00162 }
00163 
00164 AlbumSettings::~AlbumSettings()
00165 {
00166     delete d;
00167 }
00168 
00169 void AlbumSettings::init()
00170 {
00171     d->albumCollectionNames.clear();
00172     d->albumCollectionNames.append(i18n("Family"));
00173     d->albumCollectionNames.append(i18n("Travel"));
00174     d->albumCollectionNames.append(i18n("Holidays"));
00175     d->albumCollectionNames.append(i18n("Friends"));
00176     d->albumCollectionNames.append(i18n("Nature"));
00177     d->albumCollectionNames.append(i18n("Party"));
00178     d->albumCollectionNames.append(i18n("Todo"));
00179     d->albumCollectionNames.append(i18n("Miscellaneous"));
00180     d->albumCollectionNames.sort();
00181 
00182     d->albumSortOrder               = AlbumSettings::ByFolder;
00183     d->imageSortOrder               = AlbumSettings::ByIName;
00184     d->itemRightClickAction         = AlbumSettings::ShowPreview;
00185 
00186     d->thumbnailSize                = ThumbnailSize::Medium;
00187     d->treeThumbnailSize            = 32;
00188 
00189     d->ratingFilterCond             = AlbumLister::GreaterEqualCondition;
00190 
00191     d->showToolTips                 = true;
00192     d->showSplash                   = true;
00193     d->useTrash                     = true;
00194     d->showTrashDeleteDialog        = true;
00195     d->sidebarApplyDirectly         = false;
00196 
00197     d->iconShowName                 = false;
00198     d->iconShowSize                 = false;
00199     d->iconShowDate                 = true;
00200     d->iconShowModDate              = true;
00201     d->iconShowComments             = true;
00202     d->iconShowResolution           = false;
00203     d->iconShowTags                 = true;
00204     d->iconShowRating               = true;
00205 
00206     d->tooltipShowFileName          = true;
00207     d->tooltipShowFileDate          = false;
00208     d->tooltipShowFileSize          = false;
00209     d->tooltipShowImageType         = false;
00210     d->tooltipShowImageDim          = true;
00211     d->tooltipShowPhotoMake         = true;
00212     d->tooltipShowPhotoDate         = true;
00213     d->tooltipShowPhotoFocal        = true;
00214     d->tooltipShowPhotoExpo         = true;
00215     d->tooltipShowPhotoMode         = true;
00216     d->tooltipShowPhotoFlash        = false;
00217     d->tooltipShowPhotoWb           = false;
00218     d->tooltipShowAlbumName         = false;
00219     d->tooltipShowComments          = true;
00220     d->tooltipShowTags              = true;
00221     d->tooltipShowRating            = true;
00222 
00223     d->exifRotate                   = true;
00224     d->exifSetOrientation           = true;
00225 
00226     d->saveTags                     = false;
00227     d->savePhotographerId           = false;
00228     d->saveCredits                  = false;
00229 
00230     d->saveComments                 = false;
00231     d->saveDateTime                 = false;
00232     d->saveRating                   = false;
00233 
00234     d->previewLoadFullImageSize     = false;
00235     d->showThumbbar                 = true;
00236 
00237     d->recursiveAlbums              = false;
00238     d->recursiveTags                = true;
00239 
00240     d->showFolderTreeViewItemsCount = false;
00241 
00242 }
00243 
00244 void AlbumSettings::readSettings()
00245 {
00246     KSharedConfigPtr config = d->config;
00247 
00248     // ---------------------------------------------------------------------
00249 
00250     KConfigGroup group  = config->group("Album Settings");
00251 
00252     d->albumLibraryPath = group.readEntry("Album Path", QString());
00253     // NOTE: default database file path is root album library path, like 0.7.x-0.9.x series work.
00254     d->databaseFilePath = group.readEntry("Database File Path", d->albumLibraryPath);
00255 
00256     QStringList collectionList = group.readEntry("Album Collections",QStringList());
00257     if (!collectionList.isEmpty())
00258     {
00259         collectionList.sort();
00260         d->albumCollectionNames = collectionList;
00261     }
00262 
00263     d->albumSortOrder = AlbumSettings::AlbumSortOrder(group.readEntry("Album Sort Order",
00264                                                       (int)AlbumSettings::ByFolder));
00265 
00266     d->imageSortOrder               = AlbumSettings::ImageSortOrder(group.readEntry("Image Sort Order",
00267                                                                     (int)AlbumSettings::ByIName));
00268 
00269     d->itemRightClickAction         = AlbumSettings::ItemRightClickAction(group.readEntry(
00270                                                                          "Item Right Click Action",
00271                                                                           (int)AlbumSettings::ShowPreview));
00272 
00273     d->thumbnailSize                = group.readEntry("Default Icon Size", (int)ThumbnailSize::Medium);
00274     d->treeThumbnailSize            = group.readEntry("Default Tree Icon Size", (int)ThumbnailSize::Tiny);
00275     d->currentTheme                 = group.readEntry("Theme", i18n("Default"));
00276 
00277     d->ratingFilterCond             = group.readEntry("Rating Filter Condition",
00278                                                   (int)AlbumLister::GreaterEqualCondition);
00279     d->recursiveAlbums              = group.readEntry("Recursive Albums", false);
00280     d->recursiveTags                = group.readEntry("Recursive Tags", true);
00281 
00282 
00283     d->iconShowName                 = group.readEntry("Icon Show Name", false); 
00284     d->iconShowResolution           = group.readEntry("Icon Show Resolution", false);
00285     d->iconShowSize                 = group.readEntry("Icon Show Size", false);
00286     d->iconShowDate                 = group.readEntry("Icon Show Date", true);
00287     d->iconShowModDate              = group.readEntry("Icon Show Modification Date", true);
00288     d->iconShowComments             = group.readEntry("Icon Show Comments", true);
00289     d->iconShowTags                 = group.readEntry("Icon Show Tags", true);
00290     d->iconShowRating               = group.readEntry("Icon Show Rating", true);
00291 
00292     d->showToolTips                 = group.readEntry("Show ToolTips", false);
00293     d->tooltipShowFileName          = group.readEntry("ToolTips Show File Name", true);
00294     d->tooltipShowFileDate          = group.readEntry("ToolTips Show File Date", false);
00295     d->tooltipShowFileSize          = group.readEntry("ToolTips Show File Size", false);
00296     d->tooltipShowImageType         = group.readEntry("ToolTips Show Image Type", false);
00297     d->tooltipShowImageDim          = group.readEntry("ToolTips Show Image Dim", true);
00298     d->tooltipShowPhotoMake         = group.readEntry("ToolTips Show Photo Make", true);
00299     d->tooltipShowPhotoDate         = group.readEntry("ToolTips Show Photo Date", true);
00300     d->tooltipShowPhotoFocal        = group.readEntry("ToolTips Show Photo Focal", true);
00301     d->tooltipShowPhotoExpo         = group.readEntry("ToolTips Show Photo Expo", true);
00302     d->tooltipShowPhotoMode         = group.readEntry("ToolTips Show Photo Mode", true);
00303     d->tooltipShowPhotoFlash        = group.readEntry("ToolTips Show Photo Flash", false);
00304     d->tooltipShowPhotoWb           = group.readEntry("ToolTips Show Photo WB", false);
00305     d->tooltipShowAlbumName         = group.readEntry("ToolTips Show Album Name", false);
00306     d->tooltipShowComments          = group.readEntry("ToolTips Show Comments", true);
00307     d->tooltipShowTags              = group.readEntry("ToolTips Show Tags", true);
00308     d->tooltipShowRating            = group.readEntry("ToolTips Show Rating", true);
00309 
00310     d->previewLoadFullImageSize     = group.readEntry("Preview Load Full Image Size", false);
00311     d->showThumbbar                 = group.readEntry("Show Thumbbar", true);
00312 
00313     d->showFolderTreeViewItemsCount = group.readEntry("Show Folder Tree View Items Count", false);
00314 
00315     // ---------------------------------------------------------------------
00316 
00317     group = config->group("EXIF Settings");
00318 
00319     d->exifRotate         = group.readEntry("EXIF Rotate", true);
00320     d->exifSetOrientation = group.readEntry("EXIF Set Orientation", true);
00321 
00322     // ---------------------------------------------------------------------
00323 
00324     group = config->group("Metadata Settings");
00325 
00326     d->saveTags               = group.readEntry("Save Tags", false);
00327     d->savePhotographerId     = group.readEntry("Save Photographer ID", false);
00328     d->saveCredits            = group.readEntry("Save Credits", false);
00329 
00330     d->saveComments           = group.readEntry("Save EXIF Comments", false);
00331     d->saveDateTime           = group.readEntry("Save Date Time", false);
00332     d->saveRating             = group.readEntry("Save Rating", false);
00333 
00334     d->author                 = group.readEntry("Author", QString());
00335     d->authorTitle            = group.readEntry("Author Title", QString());
00336     d->credit                 = group.readEntry("Credit", QString());
00337     d->source                 = group.readEntry("Source", QString());
00338     d->copyright              = group.readEntry("Copyright", QString());
00339 
00340     // ---------------------------------------------------------------------
00341 
00342     group = config->group("General Settings");
00343 
00344     d->showSplash            = group.readEntry("Show Splash", true);
00345     d->useTrash              = group.readEntry("Use Trash", true);
00346     d->showTrashDeleteDialog = group.readEntry("Show Trash Delete Dialog", true);
00347     d->sidebarApplyDirectly  = group.readEntry("Apply Sidebar Changes Directly", false);
00348     d->scanAtStart           = group.readEntry("Scan At Start", true);
00349 }
00350 
00351 void AlbumSettings::saveSettings()
00352 {
00353     KSharedConfigPtr config = d->config;
00354 
00355     // ---------------------------------------------------------------------
00356 
00357     KConfigGroup group = config->group("Album Settings");
00358 
00359     group.writeEntry("Album Path", d->albumLibraryPath);
00360     group.writeEntry("Database File Path", d->databaseFilePath);
00361     group.writeEntry("Album Collections", d->albumCollectionNames);
00362     group.writeEntry("Album Sort Order", (int)d->albumSortOrder);
00363     group.writeEntry("Image Sort Order", (int)d->imageSortOrder);
00364     group.writeEntry("Item Right Click Action", (int)d->itemRightClickAction);
00365     group.writeEntry("Default Icon Size", QString::number(d->thumbnailSize));
00366     group.writeEntry("Default Tree Icon Size", QString::number(d->treeThumbnailSize));
00367     group.writeEntry("Rating Filter Condition", d->ratingFilterCond);
00368     group.writeEntry("Recursive Albums", d->recursiveAlbums);
00369     group.writeEntry("Recursive Tags", d->recursiveTags);
00370     group.writeEntry("Theme", d->currentTheme);
00371 
00372     group.writeEntry("Icon Show Name", d->iconShowName);
00373     group.writeEntry("Icon Show Resolution", d->iconShowResolution);
00374     group.writeEntry("Icon Show Size", d->iconShowSize);
00375     group.writeEntry("Icon Show Date", d->iconShowDate);
00376     group.writeEntry("Icon Show Modification Date", d->iconShowModDate);
00377     group.writeEntry("Icon Show Comments", d->iconShowComments);
00378     group.writeEntry("Icon Show Tags", d->iconShowTags);
00379     group.writeEntry("Icon Show Rating", d->iconShowRating);
00380 
00381     group.writeEntry("Show ToolTips", d->showToolTips);
00382     group.writeEntry("ToolTips Show File Name", d->tooltipShowFileName);
00383     group.writeEntry("ToolTips Show File Date", d->tooltipShowFileDate);
00384     group.writeEntry("ToolTips Show File Size", d->tooltipShowFileSize);
00385     group.writeEntry("ToolTips Show Image Type", d->tooltipShowImageType);
00386     group.writeEntry("ToolTips Show Image Dim", d->tooltipShowImageDim);
00387     group.writeEntry("ToolTips Show Photo Make", d->tooltipShowPhotoMake);
00388     group.writeEntry("ToolTips Show Photo Date", d->tooltipShowPhotoDate);
00389     group.writeEntry("ToolTips Show Photo Focal", d->tooltipShowPhotoFocal);
00390     group.writeEntry("ToolTips Show Photo Expo", d->tooltipShowPhotoExpo);
00391     group.writeEntry("ToolTips Show Photo Mode", d->tooltipShowPhotoMode);
00392     group.writeEntry("ToolTips Show Photo Flash", d->tooltipShowPhotoFlash);
00393     group.writeEntry("ToolTips Show Photo WB", d->tooltipShowPhotoWb);
00394     group.writeEntry("ToolTips Show Album Name", d->tooltipShowAlbumName);
00395     group.writeEntry("ToolTips Show Comments", d->tooltipShowComments);
00396     group.writeEntry("ToolTips Show Tags", d->tooltipShowTags);
00397     group.writeEntry("ToolTips Show Rating", d->tooltipShowRating);
00398 
00399     group.writeEntry("Preview Load Full Image Size", d->previewLoadFullImageSize);
00400     group.writeEntry("Show Thumbbar", d->showThumbbar);
00401 
00402     group.writeEntry("Show Folder Tree View Items Count", d->showFolderTreeViewItemsCount);
00403 
00404     // ---------------------------------------------------------------------
00405 
00406     group = config->group("EXIF Settings");
00407 
00408     group.writeEntry("EXIF Rotate", d->exifRotate);
00409     group.writeEntry("EXIF Set Orientation", d->exifSetOrientation);
00410 
00411     // ---------------------------------------------------------------------
00412 
00413     group = config->group("Metadata Settings");
00414 
00415     group.writeEntry("Save Tags", d->saveTags);
00416     group.writeEntry("Save Photographer ID", d->savePhotographerId);
00417     group.writeEntry("Save Credits", d->saveCredits);
00418 
00419     group.writeEntry("Save EXIF Comments", d->saveComments);
00420     group.writeEntry("Save Date Time", d->saveDateTime);
00421     group.writeEntry("Save Rating", d->saveRating);
00422 
00423     group.writeEntry("Author", d->author);
00424     group.writeEntry("Author Title", d->authorTitle);
00425     group.writeEntry("Credit", d->credit);
00426     group.writeEntry("Source", d->source);
00427     group.writeEntry("Copyright", d->copyright);
00428 
00429     // ---------------------------------------------------------------------
00430 
00431     group = config->group("General Settings");
00432 
00433     group.writeEntry("Show Splash", d->showSplash);
00434     group.writeEntry("Use Trash", d->useTrash);
00435     group.writeEntry("Show Trash Delete Dialog", d->showTrashDeleteDialog);
00436     group.writeEntry("Apply Sidebar Changes Directly", d->sidebarApplyDirectly);
00437     group.writeEntry("Scan At Start", d->scanAtStart);
00438 
00439     config->sync();
00440 }
00441 
00442 void AlbumSettings::setAlbumLibraryPath(const QString& path)
00443 {
00444     d->albumLibraryPath = path;
00445 }
00446 
00447 QString AlbumSettings::getDatabaseFilePath() const
00448 {
00449     return d->databaseFilePath;
00450 }
00451 
00452 void AlbumSettings::setDatabaseFilePath(const QString& path)
00453 {
00454     d->databaseFilePath = path;
00455 }
00456 
00457 QString AlbumSettings::getAlbumLibraryPath() const
00458 {
00459     return d->albumLibraryPath;
00460 }
00461 
00462 void AlbumSettings::setShowSplashScreen(bool val)
00463 {
00464     d->showSplash = val;
00465 }
00466 
00467 bool AlbumSettings::getShowSplashScreen() const
00468 {
00469     return d->showSplash;
00470 }
00471 
00472 void AlbumSettings::setScanAtStart(bool val)
00473 {
00474     d->scanAtStart = val;
00475 }
00476 
00477 bool AlbumSettings::getScanAtStart() const
00478 {
00479     return d->scanAtStart;
00480 }
00481 
00482 void AlbumSettings::setAlbumCollectionNames(const QStringList& list)
00483 {
00484     d->albumCollectionNames = list;
00485 }
00486 
00487 QStringList AlbumSettings::getAlbumCollectionNames()
00488 {
00489     return d->albumCollectionNames;
00490 }
00491 
00492 bool AlbumSettings::addAlbumCollectionName(const QString& name)
00493 {
00494     if (d->albumCollectionNames.contains(name))
00495         return false;
00496 
00497     d->albumCollectionNames.append(name);
00498     return true;
00499 }
00500 
00501 bool AlbumSettings::delAlbumCollectionName(const QString& name)
00502 {
00503     uint count = d->albumCollectionNames.removeAll(name);
00504     return (count > 0) ? true : false;
00505 }
00506 
00507 void AlbumSettings::setAlbumSortOrder(const AlbumSettings::AlbumSortOrder order)
00508 {
00509     d->albumSortOrder = order;
00510 }
00511 
00512 AlbumSettings::AlbumSortOrder AlbumSettings::getAlbumSortOrder() const
00513 {
00514     return d->albumSortOrder;
00515 }
00516 
00517 void AlbumSettings::setImageSortOrder(const ImageSortOrder order)
00518 {
00519     d->imageSortOrder = order;
00520 }
00521 
00522 AlbumSettings::ImageSortOrder AlbumSettings::getImageSortOrder() const
00523 {
00524     return d->imageSortOrder;
00525 }
00526 
00527 void AlbumSettings::setItemRightClickAction(const ItemRightClickAction action)
00528 {
00529     d->itemRightClickAction = action;
00530 }
00531 
00532 AlbumSettings::ItemRightClickAction AlbumSettings::getItemRightClickAction() const
00533 {
00534     return d->itemRightClickAction;
00535 }
00536 
00537 QString AlbumSettings::getImageFileFilter() const
00538 {
00539     QStringList imageSettings;
00540     DatabaseAccess().db()->getFilterSettings(&imageSettings, 0, 0);
00541     QStringList wildcards;
00542     foreach (const QString &suffix, imageSettings)
00543         wildcards << "*." + suffix;
00544     return wildcards.join(" ");
00545 }
00546 
00547 QString AlbumSettings::getMovieFileFilter() const
00548 {
00549     QStringList movieSettings;
00550     DatabaseAccess().db()->getFilterSettings(0, &movieSettings, 0);
00551     QStringList wildcards;
00552     foreach (const QString &suffix, movieSettings)
00553         wildcards << "*." + suffix;
00554     return wildcards.join(" ");
00555 }
00556 
00557 QString AlbumSettings::getAudioFileFilter() const
00558 {
00559     QStringList audioSettings;
00560     DatabaseAccess().db()->getFilterSettings(0, 0, &audioSettings);
00561     QStringList wildcards;
00562     foreach (const QString &suffix, audioSettings)
00563         wildcards << "*." + suffix;
00564     return wildcards.join(" ");
00565 }
00566 
00567 QString AlbumSettings::getRawFileFilter() const
00568 {
00569     QStringList supportedRaws = KDcrawIface::DcrawBinary::rawFilesList();
00570     QStringList imageSettings;
00571     DatabaseAccess().db()->getFilterSettings(&imageSettings, 0, 0);
00572 
00573     // form intersection: those extensions that are supported as RAW as well in the list of allowed extensions
00574     for (QStringList::iterator it = supportedRaws.begin(); it != supportedRaws.end(); )
00575     {
00576         if (imageSettings.contains(*it))
00577             ++it;
00578         else
00579             it = supportedRaws.erase(it);
00580     }
00581 
00582     QStringList wildcards;
00583     foreach (const QString &suffix, supportedRaws)
00584         wildcards << "*." + suffix;
00585     return wildcards.join(" ");
00586 }
00587 
00588 QString AlbumSettings::getAllFileFilter() const
00589 {
00590     QStringList imageFilter, audioFilter, videoFilter;
00591     DatabaseAccess().db()->getFilterSettings(&imageFilter, &audioFilter, &videoFilter);
00592     QStringList wildcards;
00593     foreach (const QString &suffix, imageFilter)
00594         wildcards << "*." + suffix;
00595     foreach (const QString &suffix, audioFilter)
00596         wildcards << "*." + suffix;
00597     foreach (const QString &suffix, videoFilter)
00598         wildcards << "*." + suffix;
00599     return wildcards.join(" ");
00600 }
00601 
00602 void AlbumSettings::addToImageFileFilter(const QString &extensions)
00603 {
00604     DatabaseAccess().db()->addToUserImageFilterSettings(extensions);
00605 }
00606 
00607 void AlbumSettings::setDefaultIconSize(int val)
00608 {
00609     d->thumbnailSize = val;
00610 }
00611 
00612 int AlbumSettings::getDefaultIconSize() const
00613 {
00614     return d->thumbnailSize;
00615 }
00616 
00617 void AlbumSettings::setDefaultTreeIconSize(int val)
00618 {
00619     d->treeThumbnailSize = val;
00620 }
00621 
00622 int AlbumSettings::getDefaultTreeIconSize() const
00623 {
00624     return ((d->treeThumbnailSize < 8) || (d->treeThumbnailSize > 48)) ? 48 : d->treeThumbnailSize;
00625 }
00626 
00627 void AlbumSettings::setRatingFilterCond(int val)
00628 {
00629     d->ratingFilterCond = val;
00630 }
00631 
00632 int AlbumSettings::getRatingFilterCond() const
00633 {
00634     return d->ratingFilterCond;
00635 }
00636 
00637 void AlbumSettings::setIconShowName(bool val)
00638 {
00639     d->iconShowName = val;
00640 }
00641 
00642 bool AlbumSettings::getIconShowName() const
00643 {
00644     return d->iconShowName;
00645 }
00646 
00647 void AlbumSettings::setIconShowSize(bool val)
00648 {
00649     d->iconShowSize = val;
00650 }
00651 
00652 bool AlbumSettings::getIconShowSize() const
00653 {
00654     return d->iconShowSize;
00655 }
00656 
00657 void AlbumSettings::setIconShowComments(bool val)
00658 {
00659     d->iconShowComments = val;
00660 }
00661 
00662 bool AlbumSettings::getIconShowComments() const
00663 {
00664     return d->iconShowComments;
00665 }
00666 
00667 void AlbumSettings::setIconShowResolution(bool val)
00668 {
00669     d->iconShowResolution = val;
00670 }
00671 
00672 bool AlbumSettings::getIconShowResolution() const
00673 {
00674     return d->iconShowResolution;
00675 }
00676 
00677 void AlbumSettings::setIconShowTags(bool val)
00678 {
00679     d->iconShowTags = val;
00680 }
00681 
00682 bool AlbumSettings::getIconShowTags() const
00683 {
00684     return d->iconShowTags;
00685 }
00686 
00687 void AlbumSettings::setIconShowDate(bool val)
00688 {
00689     d->iconShowDate = val;
00690 }
00691 
00692 bool AlbumSettings::getIconShowDate() const
00693 {
00694     return d->iconShowDate;
00695 }
00696 
00697 void AlbumSettings::setIconShowModDate(bool val)
00698 {
00699     d->iconShowModDate = val;
00700 }
00701 
00702 bool AlbumSettings::getIconShowModDate() const
00703 {
00704     return d->iconShowModDate;
00705 }
00706 
00707 void AlbumSettings::setIconShowRating(bool val)
00708 {
00709     d->iconShowRating = val;
00710 }
00711 
00712 bool AlbumSettings::getIconShowRating() const
00713 {
00714     return d->iconShowRating;
00715 }
00716 
00717 void AlbumSettings::setExifRotate(bool val)
00718 {
00719     d->exifRotate = val;
00720 }
00721 
00722 bool AlbumSettings::getExifRotate() const
00723 {
00724     return d->exifRotate;
00725 }
00726 
00727 void AlbumSettings::setExifSetOrientation(bool val)
00728 {
00729     d->exifSetOrientation = val;
00730 }
00731 
00732 bool AlbumSettings::getExifSetOrientation() const
00733 {
00734     return d->exifSetOrientation;
00735 }
00736 
00737 void AlbumSettings::setSaveTags(bool val)
00738 {
00739     d->saveTags = val;
00740 }
00741 
00742 bool AlbumSettings::getSaveTags() const
00743 {
00744     return d->saveTags;
00745 }
00746 
00747 void AlbumSettings::setSavePhotographerId(bool val)
00748 {
00749     d->savePhotographerId = val;
00750 }
00751 
00752 bool AlbumSettings::getSavePhotographerId() const
00753 {
00754     return d->savePhotographerId;
00755 }
00756 
00757 void AlbumSettings::setSaveCredits(bool val)
00758 {
00759     d->saveCredits = val;
00760 }
00761 
00762 bool AlbumSettings::getSaveCredits() const
00763 {
00764     return d->saveCredits;
00765 }
00766 
00767 void AlbumSettings::setAuthor(const QString& author)
00768 {
00769     d->author = author;
00770 }
00771 
00772 QString AlbumSettings::getAuthor() const
00773 {
00774     return d->author;
00775 }
00776 
00777 void AlbumSettings::setAuthorTitle(const QString& authorTitle)
00778 {
00779     d->authorTitle = authorTitle;
00780 }
00781 
00782 QString AlbumSettings::getAuthorTitle() const
00783 {
00784     return d->authorTitle;
00785 }
00786 
00787 void AlbumSettings::setCredit(const QString& credit)
00788 {
00789     d->credit = credit;
00790 }
00791 
00792 QString AlbumSettings::getCredit() const
00793 {
00794     return d->credit;
00795 }
00796 
00797 void AlbumSettings::setSource(const QString& source)
00798 {
00799     d->source = source;
00800 }
00801 
00802 QString AlbumSettings::getSource() const
00803 {
00804     return d->source;
00805 }
00806 
00807 void AlbumSettings::setCopyright(const QString& copyright)
00808 {
00809     d->copyright = copyright;
00810 }
00811 
00812 QString AlbumSettings::getCopyright() const
00813 {
00814     return d->copyright;
00815 }
00816 
00817 void AlbumSettings::setSaveComments(bool val)
00818 {
00819     d->saveComments = val;
00820 }
00821 
00822 bool AlbumSettings::getSaveComments() const
00823 {
00824     return d->saveComments;
00825 }
00826 
00827 void AlbumSettings::setSaveDateTime(bool val)
00828 {
00829     d->saveDateTime = val;
00830 }
00831 
00832 bool AlbumSettings::getSaveDateTime() const
00833 {
00834     return d->saveDateTime;
00835 }
00836 
00837 bool AlbumSettings::getSaveRating() const
00838 {
00839     return d->saveRating;
00840 }
00841 
00842 void AlbumSettings::setSaveRating(bool val)
00843 {
00844     d->saveRating = val;
00845 }
00846 
00847 void AlbumSettings::setShowToolTips(bool val)
00848 {
00849     d->showToolTips = val;
00850 }
00851 
00852 bool AlbumSettings::getShowToolTips() const
00853 {
00854     return d->showToolTips;
00855 }
00856 
00857 void AlbumSettings::setToolTipsShowFileName(bool val)
00858 {
00859     d->tooltipShowFileName = val;
00860 }
00861 
00862 bool AlbumSettings::getToolTipsShowFileName() const
00863 {
00864     return d->tooltipShowFileName;
00865 }
00866 
00867 void AlbumSettings::setToolTipsShowFileDate(bool val)
00868 {
00869     d->tooltipShowFileDate = val;
00870 }
00871 
00872 bool AlbumSettings::getToolTipsShowFileDate() const
00873 {
00874     return d->tooltipShowFileDate;
00875 }
00876 
00877 void AlbumSettings::setToolTipsShowFileSize(bool val)
00878 {
00879     d->tooltipShowFileSize = val;
00880 }
00881 
00882 bool AlbumSettings::getToolTipsShowFileSize() const
00883 {
00884     return d->tooltipShowFileSize;
00885 }
00886 
00887 void AlbumSettings::setToolTipsShowImageType(bool val)
00888 {
00889     d->tooltipShowImageType = val;
00890 }
00891 
00892 bool AlbumSettings::getToolTipsShowImageType() const
00893 {
00894     return d->tooltipShowImageType;
00895 }
00896 
00897 void AlbumSettings::setToolTipsShowImageDim(bool val)
00898 {
00899     d->tooltipShowImageDim = val;
00900 }
00901 
00902 bool AlbumSettings::getToolTipsShowImageDim() const
00903 {
00904     return d->tooltipShowImageDim;
00905 }
00906 
00907 void AlbumSettings::setToolTipsShowPhotoMake(bool val)
00908 {
00909     d->tooltipShowPhotoMake = val;
00910 }
00911 
00912 bool AlbumSettings::getToolTipsShowPhotoMake() const
00913 {
00914     return d->tooltipShowPhotoMake;
00915 }
00916 
00917 void AlbumSettings::setToolTipsShowPhotoDate(bool val)
00918 {
00919     d->tooltipShowPhotoDate = val;
00920 }
00921 
00922 bool AlbumSettings::getToolTipsShowPhotoDate() const
00923 {
00924     return d->tooltipShowPhotoDate;
00925 }
00926 
00927 void AlbumSettings::setToolTipsShowPhotoFocal(bool val)
00928 {
00929     d->tooltipShowPhotoFocal = val;
00930 }
00931 
00932 bool AlbumSettings::getToolTipsShowPhotoFocal() const
00933 {
00934     return d->tooltipShowPhotoFocal;
00935 }
00936 
00937 void AlbumSettings::setToolTipsShowPhotoExpo(bool val)
00938 {
00939     d->tooltipShowPhotoExpo = val;
00940 }
00941 
00942 bool AlbumSettings::getToolTipsShowPhotoExpo() const
00943 {
00944     return d->tooltipShowPhotoExpo;
00945 }
00946 
00947 void AlbumSettings::setToolTipsShowPhotoMode(bool val)
00948 {
00949     d->tooltipShowPhotoMode = val;
00950 }
00951 
00952 bool AlbumSettings::getToolTipsShowPhotoMode() const
00953 {
00954     return d->tooltipShowPhotoMode;
00955 }
00956 
00957 void AlbumSettings::setToolTipsShowPhotoFlash(bool val)
00958 {
00959     d->tooltipShowPhotoFlash = val;
00960 }
00961 
00962 bool AlbumSettings::getToolTipsShowPhotoFlash() const
00963 {
00964     return d->tooltipShowPhotoFlash;
00965 }
00966 
00967 void AlbumSettings::setToolTipsShowPhotoWB(bool val)
00968 {
00969     d->tooltipShowPhotoWb = val;
00970 }
00971 
00972 bool AlbumSettings::getToolTipsShowPhotoWB() const
00973 {
00974     return d->tooltipShowPhotoWb;
00975 }
00976 
00977 void AlbumSettings::setToolTipsShowAlbumName(bool val)
00978 {
00979     d->tooltipShowAlbumName = val;
00980 }
00981 
00982 bool AlbumSettings::getToolTipsShowAlbumName() const
00983 {
00984     return d->tooltipShowAlbumName;
00985 }
00986 
00987 void AlbumSettings::setToolTipsShowComments(bool val)
00988 {
00989     d->tooltipShowComments = val;
00990 }
00991 
00992 bool AlbumSettings::getToolTipsShowComments() const
00993 {
00994     return d->tooltipShowComments;
00995 }
00996 
00997 void AlbumSettings::setToolTipsShowTags(bool val)
00998 {
00999     d->tooltipShowTags = val;
01000 }
01001 
01002 bool AlbumSettings::getToolTipsShowTags() const
01003 {
01004     return d->tooltipShowTags;
01005 }
01006 
01007 void AlbumSettings::setToolTipsShowRating(bool val)
01008 {
01009     d->tooltipShowRating = val;
01010 }
01011 
01012 bool AlbumSettings::getToolTipsShowRating() const
01013 {
01014     return d->tooltipShowRating;
01015 }
01016 
01017 void AlbumSettings::setCurrentTheme(const QString& theme)
01018 {
01019     d->currentTheme = theme;
01020 }
01021 
01022 QString AlbumSettings::getCurrentTheme() const
01023 {
01024     return d->currentTheme;
01025 }
01026 
01027 void AlbumSettings::setUseTrash(bool val)
01028 {
01029     d->useTrash = val;
01030 }
01031 
01032 bool AlbumSettings::getUseTrash() const
01033 {
01034     return d->useTrash;
01035 }
01036 
01037 void AlbumSettings::setShowTrashDeleteDialog(bool val)
01038 {
01039     d->showTrashDeleteDialog = val;
01040 }
01041 
01042 bool AlbumSettings::getShowTrashDeleteDialog() const
01043 {
01044     return d->showTrashDeleteDialog;
01045 }
01046 
01047 void AlbumSettings::setApplySidebarChangesDirectly(bool val)
01048 {
01049     d->sidebarApplyDirectly= val;
01050 }
01051 
01052 bool AlbumSettings::getApplySidebarChangesDirectly() const
01053 {
01054     return d->sidebarApplyDirectly;
01055 }
01056 
01057 bool AlbumSettings::showToolTipsIsValid() const
01058 {
01059     if (d->showToolTips)
01060     {
01061         if (d->tooltipShowFileName   ||
01062             d->tooltipShowFileDate   ||
01063             d->tooltipShowFileSize   ||
01064             d->tooltipShowImageType  ||
01065             d->tooltipShowImageDim   ||
01066             d->tooltipShowPhotoMake  ||
01067             d->tooltipShowPhotoDate  ||
01068             d->tooltipShowPhotoFocal ||
01069             d->tooltipShowPhotoExpo  ||
01070             d->tooltipShowPhotoMode  ||
01071             d->tooltipShowPhotoFlash ||
01072             d->tooltipShowPhotoWb    ||
01073             d->tooltipShowAlbumName  ||
01074             d->tooltipShowComments   ||
01075             d->tooltipShowTags       ||
01076             d->tooltipShowRating)
01077            return true;
01078     }
01079 
01080     return false;
01081 }
01082 
01083 void AlbumSettings::setPreviewLoadFullImageSize(bool val)
01084 {
01085     d->previewLoadFullImageSize = val;
01086 }
01087 
01088 bool AlbumSettings::getPreviewLoadFullImageSize() const
01089 {
01090     return d->previewLoadFullImageSize;
01091 }
01092 
01093 void AlbumSettings::setRecurseAlbums(bool val)
01094 {
01095     d->recursiveAlbums = val;
01096 }
01097 
01098 bool AlbumSettings::getRecurseAlbums() const
01099 {
01100     return d->recursiveAlbums;
01101 }
01102 
01103 void AlbumSettings::setRecurseTags(bool val)
01104 {
01105     d->recursiveTags = val;
01106 }
01107 
01108 bool AlbumSettings::getRecurseTags() const
01109 {
01110     return d->recursiveTags;
01111 }
01112 
01113 void AlbumSettings::setShowFolderTreeViewItemsCount(bool val)
01114 {
01115     d->showFolderTreeViewItemsCount = val;
01116 }
01117 
01118 bool AlbumSettings::getShowFolderTreeViewItemsCount() const
01119 {
01120     return d->showFolderTreeViewItemsCount;
01121 }
01122 
01123 void AlbumSettings::setShowThumbbar(bool val)
01124 {
01125     d->showThumbbar = val;
01126 }
01127 
01128 bool AlbumSettings::getShowThumbbar() const
01129 {
01130     return d->showThumbbar;
01131 }
01132 
01133 }  // namespace Digikam

digikam

Skip menu "digikam"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members