File indexing completed on 2025-01-19 03:59:22

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2012-07-15
0007  * Description : Settings for the import tool
0008  *
0009  * SPDX-FileCopyrightText: 2012      by Islam Wazery <wazery at ubuntu dot com>
0010  * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #include "importsettings.h"
0017 
0018 // Qt includes
0019 
0020 #include <QFontDatabase>
0021 
0022 // KDE includes
0023 
0024 #include <ksharedconfig.h>
0025 #include <kconfiggroup.h>
0026 
0027 // Local includes
0028 
0029 #include "camitemsortsettings.h"
0030 #include "thumbnailsize.h"
0031 
0032 namespace Digikam
0033 {
0034 
0035 class Q_DECL_HIDDEN ImportSettings::Private
0036 {
0037 public:
0038 
0039     explicit Private()
0040       : iconShowName                (true),
0041         iconShowSize                (false),
0042         iconShowDate                (true),
0043         iconShowTitle               (false),
0044         iconShowResolution          (false),
0045         iconShowTags                (false),
0046         iconShowOverlays            (false),
0047         iconShowRating              (false),
0048         iconShowImageFormat         (false),
0049         iconShowCoordinates         (false),
0050         thumbnailSize               (0),
0051         imageSortOrder              (0),
0052         imageSortBy                 (0),
0053         imageSeparationMode         (0),
0054         itemLeftClickAction         (ImportSettings::ShowPreview),
0055         showToolTips                (false),
0056         tooltipShowFileName         (false),
0057         tooltipShowFileDate         (false),
0058         tooltipShowFileSize         (false),
0059         tooltipShowImageType        (false),
0060         tooltipShowImageDim         (true),
0061         tooltipShowPhotoMake        (false),
0062         tooltipShowPhotoLens        (false),
0063         tooltipShowPhotoFocal       (false),
0064         tooltipShowPhotoExpo        (false),
0065         tooltipShowPhotoFlash       (false),
0066         tooltipShowPhotoWb          (false),
0067         tooltipShowFolderName       (false),
0068         tooltipShowTags             (false),
0069         tooltipShowLabelRating      (false),
0070         previewLoadFullImageSize    (false),
0071         previewItemsWhileDownload   (false),
0072         previewShowIcons            (true),
0073 /*
0074         ratingFilterCond            (0),
0075 */
0076         showThumbbar                (false)
0077     {
0078     }
0079 
0080     static const QString                configGroupDefault;
0081     static const QString                configImageSortOrderEntry;
0082     static const QString                configImageSortByEntry;
0083     static const QString                configImageSeparationModeEntry;
0084     static const QString                configItemLeftClickActionEntry;
0085     static const QString                configDefaultIconSizeEntry;
0086     static const QString                configIconShowNameEntry;
0087     static const QString                configIconShowResolutionEntry;
0088     static const QString                configIconShowSizeEntry;
0089     static const QString                configIconShowDateEntry;
0090     static const QString                configIconShowTitleEntry;
0091     static const QString                configIconShowTagsEntry;
0092     static const QString                configIconShowOverlaysEntry;
0093     static const QString                configIconShowRatingEntry;
0094     static const QString                configIconShowImageFormatEntry;
0095     static const QString                configIconShowCoordinatesEntry;
0096     static const QString                configIconViewFontEntry;
0097     static const QString                configToolTipsFontEntry;
0098     static const QString                configShowToolTipsEntry;
0099     static const QString                configToolTipsShowFileNameEntry;
0100     static const QString                configToolTipsShowFileDateEntry;
0101     static const QString                configToolTipsShowFileSizeEntry;
0102     static const QString                configToolTipsShowImageTypeEntry;
0103     static const QString                configToolTipsShowImageDimEntry;
0104     static const QString                configToolTipsShowPhotoMakeEntry;
0105     static const QString                configToolTipsShowPhotoLensEntry;
0106     static const QString                configToolTipsShowPhotoDateEntry;
0107     static const QString                configToolTipsShowPhotoFocalEntry;
0108     static const QString                configToolTipsShowPhotoExpoEntry;
0109     static const QString                configToolTipsShowPhotoFlashEntry;
0110     static const QString                configToolTipsShowPhotoWBEntry;
0111     static const QString                configToolTipsShowFolderNameEntry;
0112     static const QString                configToolTipsShowTagsEntry;
0113     static const QString                configToolTipsShowLabelRatingEntry;
0114     static const QString                configPreviewLoadFullImageSizeEntry;
0115     static const QString                configPreviewItemsWhileDownloadEntry;
0116     static const QString                configPreviewShowIconsEntry;
0117     static const QString                configShowThumbbarEntry;
0118 
0119     // Import icon-view settings
0120     bool                                iconShowName;
0121     bool                                iconShowSize;
0122     bool                                iconShowDate;
0123     bool                                iconShowTitle;
0124     bool                                iconShowResolution;
0125     bool                                iconShowTags;
0126     bool                                iconShowOverlays;
0127     bool                                iconShowRating;
0128     bool                                iconShowImageFormat;
0129     bool                                iconShowCoordinates;
0130 
0131     QFont                               iconviewFont;
0132 
0133     int                                 thumbnailSize;
0134     int                                 imageSortOrder;
0135     int                                 imageSortBy;
0136     int                                 imageSeparationMode;
0137     int                                 itemLeftClickAction;
0138 
0139     // Import icon-view tooltip settings
0140     bool                                showToolTips;
0141     bool                                tooltipShowFileName;
0142     bool                                tooltipShowFileDate;
0143     bool                                tooltipShowFileSize;
0144     bool                                tooltipShowImageType;
0145     bool                                tooltipShowImageDim;
0146     bool                                tooltipShowPhotoMake;
0147     bool                                tooltipShowPhotoLens;
0148     bool                                tooltipShowPhotoFocal;
0149     bool                                tooltipShowPhotoExpo;
0150     bool                                tooltipShowPhotoFlash;
0151     bool                                tooltipShowPhotoWb;
0152     bool                                tooltipShowFolderName;
0153     bool                                tooltipShowTags;
0154     bool                                tooltipShowLabelRating;
0155 
0156     QFont                               toolTipsFont;
0157 
0158     // preview settings
0159     bool                                previewLoadFullImageSize;
0160     bool                                previewItemsWhileDownload;
0161     bool                                previewShowIcons;
0162     bool                                showThumbbar;
0163 
0164     KSharedConfigPtr                    config;
0165  };
0166 
0167 const QString ImportSettings::Private::configGroupDefault(QLatin1String("Import Settings"));
0168 const QString ImportSettings::Private::configImageSortOrderEntry(QLatin1String("Image Sort Order"));
0169 const QString ImportSettings::Private::configImageSortByEntry(QLatin1String("Image Sorting")); // TODO not changed due to backwards compatibility
0170 const QString ImportSettings::Private::configImageSeparationModeEntry(QLatin1String("Image Separation Mode"));
0171 const QString ImportSettings::Private::configItemLeftClickActionEntry(QLatin1String("Item Left Click Action"));
0172 const QString ImportSettings::Private::configDefaultIconSizeEntry(QLatin1String("Default Icon Size"));
0173 //const QString ImportSettings::Private::configRatingFilterConditionEntry(QLatin1String("Rating Filter Condition"));
0174 const QString ImportSettings::Private::configIconShowNameEntry(QLatin1String("Icon Show Name"));
0175 //const QString ImportSettings::Private::configIconShowResolutionEntry(QLatin1String("Icon Show Resolution"));
0176 const QString ImportSettings::Private::configIconShowSizeEntry(QLatin1String("Icon Show Size"));
0177 const QString ImportSettings::Private::configIconShowDateEntry(QLatin1String("Icon Show Date"));
0178 const QString ImportSettings::Private::configIconShowTitleEntry(QLatin1String("Icon Show Title"));
0179 const QString ImportSettings::Private::configIconShowTagsEntry(QLatin1String("Icon Show Tags"));
0180 const QString ImportSettings::Private::configIconShowRatingEntry(QLatin1String("Icon Show Rating"));
0181 const QString ImportSettings::Private::configIconShowImageFormatEntry(QLatin1String("Icon Show Image Format"));
0182 const QString ImportSettings::Private::configIconShowCoordinatesEntry(QLatin1String("Icon Show Coordinates"));
0183 const QString ImportSettings::Private::configIconShowOverlaysEntry(QLatin1String("Icon Show Overlays"));
0184 const QString ImportSettings::Private::configIconViewFontEntry(QLatin1String("IconView Font"));
0185 const QString ImportSettings::Private::configToolTipsFontEntry(QLatin1String("ToolTips Font"));
0186 const QString ImportSettings::Private::configShowToolTipsEntry(QLatin1String("Show ToolTips"));
0187 const QString ImportSettings::Private::configToolTipsShowFileNameEntry(QLatin1String("ToolTips Show File Name"));
0188 const QString ImportSettings::Private::configToolTipsShowFileDateEntry(QLatin1String("ToolTips Show File Date"));
0189 const QString ImportSettings::Private::configToolTipsShowFileSizeEntry(QLatin1String("ToolTips Show File Size"));
0190 const QString ImportSettings::Private::configToolTipsShowImageTypeEntry(QLatin1String("ToolTips Show Image Type"));
0191 const QString ImportSettings::Private::configToolTipsShowImageDimEntry(QLatin1String("ToolTips Show Image Dim"));
0192 const QString ImportSettings::Private::configToolTipsShowPhotoMakeEntry(QLatin1String("ToolTips Show Photo Make"));
0193 const QString ImportSettings::Private::configToolTipsShowPhotoLensEntry(QLatin1String("ToolTips Show Photo Lens"));
0194 const QString ImportSettings::Private::configToolTipsShowPhotoDateEntry(QLatin1String("ToolTips Show Photo Date"));
0195 const QString ImportSettings::Private::configToolTipsShowPhotoFocalEntry(QLatin1String("ToolTips Show Photo Focal"));
0196 const QString ImportSettings::Private::configToolTipsShowPhotoExpoEntry(QLatin1String("ToolTips Show Photo Expo"));
0197 const QString ImportSettings::Private::configToolTipsShowPhotoFlashEntry(QLatin1String("ToolTips Show Photo Flash"));
0198 const QString ImportSettings::Private::configToolTipsShowPhotoWBEntry(QLatin1String("ToolTips Show Photo WB"));
0199 const QString ImportSettings::Private::configToolTipsShowFolderNameEntry(QLatin1String("ToolTips Show Folder Name"));
0200 const QString ImportSettings::Private::configToolTipsShowTagsEntry(QLatin1String("ToolTips Show Tags"));
0201 const QString ImportSettings::Private::configToolTipsShowLabelRatingEntry(QLatin1String("ToolTips Show Label Rating"));
0202 const QString ImportSettings::Private::configPreviewLoadFullImageSizeEntry(QLatin1String("Preview Load Full Image Size"));
0203 const QString ImportSettings::Private::configPreviewItemsWhileDownloadEntry(QLatin1String("Preview Each Item While Downloading it"));
0204 const QString ImportSettings::Private::configPreviewShowIconsEntry(QLatin1String("Preview Show Icons"));
0205 const QString ImportSettings::Private::configShowThumbbarEntry(QLatin1String("Show Thumbbar"));
0206 
0207 // -------------------------------------------------------------------------------------------------
0208 
0209 class Q_DECL_HIDDEN ImportSettingsCreator
0210 {
0211 public:
0212 
0213     ImportSettings object;
0214 };
0215 
0216 Q_GLOBAL_STATIC(ImportSettingsCreator, creator)
0217 
0218 // -------------------------------------------------------------------------------------------------
0219 
0220 ImportSettings* ImportSettings::instance()
0221 {
0222     return &creator->object;
0223 }
0224 
0225 ImportSettings::ImportSettings()
0226     : QObject(),
0227       d      (new Private)
0228 {
0229     d->config = KSharedConfig::openConfig();
0230     init();
0231     readSettings();
0232 }
0233 
0234 ImportSettings::~ImportSettings()
0235 {
0236     delete d;
0237 }
0238 
0239 void ImportSettings::init()
0240 {
0241     d->imageSortBy                  = CamItemSortSettings::SortByFileName;
0242     d->imageSortOrder               = CamItemSortSettings::AscendingOrder;
0243     d->imageSeparationMode          = CamItemSortSettings::CategoryByFolder;
0244     d->itemLeftClickAction          = ImportSettings::ShowPreview;
0245 
0246     d->thumbnailSize                = ThumbnailSize::Medium;
0247 
0248     d->iconShowName                 = true;
0249     d->iconShowSize                 = false;
0250     d->iconShowDate                 = true;
0251     d->iconShowTitle                = true;
0252     d->iconShowImageFormat          = false;
0253     d->iconShowOverlays             = true;
0254     d->iconShowRating               = true;
0255     d->iconShowTags                 = true;
0256     d->iconviewFont                 = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
0257 
0258     d->toolTipsFont                 = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
0259     d->showToolTips                 = false;
0260     d->tooltipShowFileName          = true;
0261     d->tooltipShowFileDate          = false;
0262     d->tooltipShowFileSize          = false;
0263     d->tooltipShowImageType         = false;
0264     d->tooltipShowImageDim          = true;
0265     d->tooltipShowPhotoMake         = true;
0266     d->tooltipShowPhotoLens         = true;
0267     d->tooltipShowPhotoFocal        = true;
0268     d->tooltipShowPhotoExpo         = true;
0269     d->tooltipShowPhotoFlash        = false;
0270     d->tooltipShowPhotoWb           = false;
0271     d->tooltipShowTags              = true;
0272     d->tooltipShowLabelRating       = true;
0273 
0274     d->previewLoadFullImageSize     = false;
0275     d->previewItemsWhileDownload    = false;
0276     d->previewShowIcons             = true;
0277     d->showThumbbar                 = true;
0278 }
0279 
0280 void ImportSettings::readSettings()
0281 {
0282     KSharedConfigPtr config         = d->config;
0283 
0284     KConfigGroup group              = config->group(d->configGroupDefault);
0285 
0286     d->imageSortOrder               = group.readEntry(d->configImageSortOrderEntry, (int)CamItemSortSettings::AscendingOrder);
0287     d->imageSortBy                  = group.readEntry(d->configImageSortByEntry,    (int)CamItemSortSettings::SortByFileName);
0288     d->imageSeparationMode          = group.readEntry(d->configImageSeparationModeEntry, (int)CamItemSortSettings::CategoryByFolder);
0289 
0290     d->itemLeftClickAction          = ImportSettings::ItemLeftClickAction(group.readEntry( d->configItemLeftClickActionEntry,
0291                                                                          (int)ImportSettings::ShowPreview));
0292 
0293     d->thumbnailSize                = group.readEntry(d->configDefaultIconSizeEntry,              (int)ThumbnailSize::Medium);
0294 
0295     d->iconShowName                 = group.readEntry(d->configIconShowNameEntry,                 true);
0296 //  d->iconShowResolution           = group.readEntry(d->configIconShowResolutionEntry,           false);
0297     d->iconShowSize                 = group.readEntry(d->configIconShowSizeEntry,                 false);
0298     d->iconShowDate                 = group.readEntry(d->configIconShowDateEntry,                 true);
0299     d->iconShowTitle                = group.readEntry(d->configIconShowTitleEntry,                true);
0300     d->iconShowTags                 = group.readEntry(d->configIconShowTagsEntry,                 true);
0301     d->iconShowOverlays             = group.readEntry(d->configIconShowOverlaysEntry,             true);
0302     d->iconShowRating               = group.readEntry(d->configIconShowRatingEntry,               true);
0303     d->iconShowImageFormat          = group.readEntry(d->configIconShowImageFormatEntry,          false);
0304     d->iconShowCoordinates          = group.readEntry(d->configIconShowCoordinatesEntry,          false);
0305     d->iconviewFont                 = group.readEntry(d->configIconViewFontEntry,                 QFontDatabase::systemFont(QFontDatabase::GeneralFont));
0306 
0307     d->toolTipsFont                 = group.readEntry(d->configToolTipsFontEntry,                 QFontDatabase::systemFont(QFontDatabase::GeneralFont));
0308     d->showToolTips                 = group.readEntry(d->configShowToolTipsEntry,                 false);
0309     d->tooltipShowFileName          = group.readEntry(d->configToolTipsShowFileNameEntry,         true);
0310     d->tooltipShowFileDate          = group.readEntry(d->configToolTipsShowFileDateEntry,         false);
0311     d->tooltipShowFileSize          = group.readEntry(d->configToolTipsShowFileSizeEntry,         false);
0312     d->tooltipShowImageType         = group.readEntry(d->configToolTipsShowImageTypeEntry,        false);
0313     d->tooltipShowImageDim          = group.readEntry(d->configToolTipsShowImageDimEntry,         true);
0314     d->tooltipShowPhotoMake         = group.readEntry(d->configToolTipsShowPhotoMakeEntry,        true);
0315     d->tooltipShowPhotoLens         = group.readEntry(d->configToolTipsShowPhotoLensEntry,        true);
0316     d->tooltipShowPhotoFocal        = group.readEntry(d->configToolTipsShowPhotoFocalEntry,       true);
0317     d->tooltipShowPhotoExpo         = group.readEntry(d->configToolTipsShowPhotoExpoEntry,        true);
0318 //  d->tooltipShowPhotoMode         = group.readEntry(d->configToolTipsShowPhotoModeEntry,        true);
0319     d->tooltipShowPhotoFlash        = group.readEntry(d->configToolTipsShowPhotoFlashEntry,       false);
0320     d->tooltipShowPhotoWb           = group.readEntry(d->configToolTipsShowPhotoWBEntry,          false);
0321     d->tooltipShowFolderName         = group.readEntry(d->configToolTipsShowFolderNameEntry,      false);
0322     d->tooltipShowTags              = group.readEntry(d->configToolTipsShowTagsEntry,             true);
0323     d->tooltipShowLabelRating       = group.readEntry(d->configToolTipsShowLabelRatingEntry,      true);
0324 
0325     d->previewLoadFullImageSize     = group.readEntry(d->configPreviewLoadFullImageSizeEntry,     false);
0326     d->previewItemsWhileDownload    = group.readEntry(d->configPreviewItemsWhileDownloadEntry,    false);
0327     d->previewShowIcons             = group.readEntry(d->configPreviewShowIconsEntry,             true);
0328     d->showThumbbar                 = group.readEntry(d->configShowThumbbarEntry,                 true);
0329 
0330     // ---------------------------------------------------------------------
0331 
0332     Q_EMIT setupChanged();
0333 }
0334 
0335 void ImportSettings::saveSettings()
0336 {
0337     KSharedConfigPtr config = d->config;
0338 
0339     // ---------------------------------------------------------------------
0340 
0341     KConfigGroup group = config->group(d->configGroupDefault);
0342 
0343     group.writeEntry(d->configImageSortOrderEntry,               (int)d->imageSortOrder);
0344     group.writeEntry(d->configImageSortByEntry,                  (int)d->imageSortBy);
0345     group.writeEntry(d->configImageSeparationModeEntry,          (int)d->imageSeparationMode);
0346     group.writeEntry(d->configItemLeftClickActionEntry,          (int)d->itemLeftClickAction);
0347     group.writeEntry(d->configDefaultIconSizeEntry,              QString::number(d->thumbnailSize));
0348 
0349     group.writeEntry(d->configIconShowNameEntry,                 d->iconShowName);
0350     group.writeEntry(d->configIconShowSizeEntry,                 d->iconShowSize);
0351     group.writeEntry(d->configIconShowDateEntry,                 d->iconShowDate);
0352     group.writeEntry(d->configIconShowTitleEntry,                d->iconShowTitle);
0353     group.writeEntry(d->configIconShowTagsEntry,                 d->iconShowTags);
0354     group.writeEntry(d->configIconShowOverlaysEntry,             d->iconShowOverlays);
0355     group.writeEntry(d->configIconShowRatingEntry,               d->iconShowRating);
0356     group.writeEntry(d->configIconShowImageFormatEntry,          d->iconShowImageFormat);
0357     group.writeEntry(d->configIconShowCoordinatesEntry,          d->iconShowCoordinates);
0358     group.writeEntry(d->configIconViewFontEntry,                 d->iconviewFont);
0359 
0360     group.writeEntry(d->configToolTipsFontEntry,                 d->toolTipsFont);
0361     group.writeEntry(d->configShowToolTipsEntry,                 d->showToolTips);
0362     group.writeEntry(d->configToolTipsShowFileNameEntry,         d->tooltipShowFileName);
0363     group.writeEntry(d->configToolTipsShowFileDateEntry,         d->tooltipShowFileDate);
0364     group.writeEntry(d->configToolTipsShowFileSizeEntry,         d->tooltipShowFileSize);
0365     group.writeEntry(d->configToolTipsShowImageTypeEntry,        d->tooltipShowImageType);
0366     group.writeEntry(d->configToolTipsShowImageDimEntry,         d->tooltipShowImageDim);
0367     group.writeEntry(d->configToolTipsShowPhotoMakeEntry,        d->tooltipShowPhotoMake);
0368     group.writeEntry(d->configToolTipsShowPhotoLensEntry,        d->tooltipShowPhotoLens);
0369     group.writeEntry(d->configToolTipsShowPhotoFocalEntry,       d->tooltipShowPhotoFocal);
0370     group.writeEntry(d->configToolTipsShowPhotoExpoEntry,        d->tooltipShowPhotoExpo);
0371     group.writeEntry(d->configToolTipsShowPhotoFlashEntry,       d->tooltipShowPhotoFlash);
0372     group.writeEntry(d->configToolTipsShowPhotoWBEntry,          d->tooltipShowPhotoWb);
0373     group.writeEntry(d->configToolTipsShowFolderNameEntry,       d->tooltipShowFolderName);
0374     group.writeEntry(d->configToolTipsShowTagsEntry,             d->tooltipShowTags);
0375     group.writeEntry(d->configToolTipsShowLabelRatingEntry,      d->tooltipShowLabelRating);
0376 
0377     group.writeEntry(d->configPreviewLoadFullImageSizeEntry,     d->previewLoadFullImageSize);
0378     group.writeEntry(d->configPreviewItemsWhileDownloadEntry,    d->previewItemsWhileDownload);
0379     group.writeEntry(d->configPreviewShowIconsEntry,             d->previewShowIcons);
0380     group.writeEntry(d->configShowThumbbarEntry,                 d->showThumbbar);
0381 
0382     config->sync();
0383 }
0384 
0385 void ImportSettings::emitSetupChanged()
0386 {
0387     Q_EMIT setupChanged();
0388 }
0389 
0390 void ImportSettings::setImageSortOrder(int order)
0391 {
0392     d->imageSortOrder = order;
0393 }
0394 
0395 int ImportSettings::getImageSortOrder() const
0396 {
0397     return d->imageSortOrder;
0398 }
0399 
0400 void ImportSettings::setImageSortBy(int sortBy)
0401 {
0402     d->imageSortBy = sortBy;
0403 }
0404 
0405 int ImportSettings::getImageSortBy() const
0406 {
0407     return d->imageSortBy;
0408 }
0409 
0410 void ImportSettings::setImageSeparationMode(int mode)
0411 {
0412     d->imageSeparationMode = mode;
0413 }
0414 
0415 int ImportSettings::getImageSeparationMode() const
0416 {
0417     return d->imageSeparationMode;
0418 }
0419 
0420 void ImportSettings::setItemLeftClickAction(int action)
0421 {
0422     d->itemLeftClickAction = action;
0423 }
0424 
0425 int ImportSettings::getItemLeftClickAction() const
0426 {
0427     return d->itemLeftClickAction;
0428 }
0429 
0430 void ImportSettings::setDefaultIconSize(int val)
0431 {
0432     d->thumbnailSize = val;
0433 }
0434 
0435 int ImportSettings::getDefaultIconSize() const
0436 {
0437     return d->thumbnailSize;
0438 }
0439 
0440 void ImportSettings::setIconViewFont(const QFont& font)
0441 {
0442     d->iconviewFont = font;
0443 }
0444 
0445 QFont ImportSettings::getIconViewFont() const
0446 {
0447     return d->iconviewFont;
0448 }
0449 
0450 void ImportSettings::setIconShowName(bool val)
0451 {
0452     d->iconShowName = val;
0453 }
0454 
0455 bool ImportSettings::getIconShowName() const
0456 {
0457     return d->iconShowName;
0458 }
0459 
0460 void ImportSettings::setIconShowSize(bool val)
0461 {
0462     d->iconShowSize = val;
0463 }
0464 
0465 bool ImportSettings::getIconShowSize() const
0466 {
0467     return d->iconShowSize;
0468 }
0469 
0470 void ImportSettings::setIconShowTitle(bool val)
0471 {
0472     d->iconShowTitle = val;
0473 }
0474 
0475 bool ImportSettings::getIconShowTitle() const
0476 {
0477     return d->iconShowTitle;
0478 }
0479 
0480 void ImportSettings::setIconShowTags(bool val)
0481 {
0482     d->iconShowTags = val;
0483 }
0484 
0485 bool ImportSettings::getIconShowTags() const
0486 {
0487     return d->iconShowTags;
0488 }
0489 
0490 void ImportSettings::setIconShowDate(bool val)
0491 {
0492     d->iconShowDate = val;
0493 }
0494 
0495 bool ImportSettings::getIconShowDate() const
0496 {
0497     return d->iconShowDate;
0498 }
0499 
0500 void ImportSettings::setIconShowRating(bool val)
0501 {
0502     d->iconShowRating = val;
0503 }
0504 
0505 bool ImportSettings::getIconShowRating() const
0506 {
0507     return d->iconShowRating;
0508 }
0509 
0510 void ImportSettings::setIconShowImageFormat(bool val)
0511 {
0512     d->iconShowImageFormat = val;
0513 }
0514 
0515 bool ImportSettings::getIconShowImageFormat() const
0516 {
0517     return d->iconShowImageFormat;
0518 }
0519 
0520 void ImportSettings::setIconShowOverlays(bool val)
0521 {
0522     d->iconShowOverlays = val;
0523 }
0524 
0525 bool ImportSettings::getIconShowOverlays() const
0526 {
0527     return d->iconShowOverlays;
0528 }
0529 
0530 void ImportSettings::setToolTipsFont(const QFont& font)
0531 {
0532     d->toolTipsFont = font;
0533 }
0534 
0535 QFont ImportSettings::getToolTipsFont() const
0536 {
0537     return d->toolTipsFont;
0538 }
0539 
0540 void ImportSettings::setShowToolTips(bool val)
0541 {
0542     d->showToolTips = val;
0543 }
0544 
0545 bool ImportSettings::getShowToolTips() const
0546 {
0547     return d->showToolTips;
0548 }
0549 
0550 void ImportSettings::setToolTipsShowFileName(bool val)
0551 {
0552     d->tooltipShowFileName = val;
0553 }
0554 
0555 bool ImportSettings::getToolTipsShowFileName() const
0556 {
0557     return d->tooltipShowFileName;
0558 }
0559 
0560 void ImportSettings::setToolTipsShowFileDate(bool val)
0561 {
0562     d->tooltipShowFileDate = val;
0563 }
0564 
0565 bool ImportSettings::getToolTipsShowFileDate() const
0566 {
0567     return d->tooltipShowFileDate;
0568 }
0569 
0570 void ImportSettings::setToolTipsShowFileSize(bool val)
0571 {
0572     d->tooltipShowFileSize = val;
0573 }
0574 
0575 bool ImportSettings::getToolTipsShowFileSize() const
0576 {
0577     return d->tooltipShowFileSize;
0578 }
0579 
0580 void ImportSettings::setToolTipsShowImageType(bool val)
0581 {
0582     d->tooltipShowImageType = val;
0583 }
0584 
0585 bool ImportSettings::getToolTipsShowImageType() const
0586 {
0587     return d->tooltipShowImageType;
0588 }
0589 
0590 void ImportSettings::setToolTipsShowImageDim(bool val)
0591 {
0592     d->tooltipShowImageDim = val;
0593 }
0594 
0595 bool ImportSettings::getToolTipsShowImageDim() const
0596 {
0597     return d->tooltipShowImageDim;
0598 }
0599 
0600 void ImportSettings::setToolTipsShowPhotoMake(bool val)
0601 {
0602     d->tooltipShowPhotoMake = val;
0603 }
0604 
0605 bool ImportSettings::getToolTipsShowPhotoMake() const
0606 {
0607     return d->tooltipShowPhotoMake;
0608 }
0609 
0610 void ImportSettings::setToolTipsShowPhotoLens(bool val)
0611 {
0612     d->tooltipShowPhotoLens = val;
0613 }
0614 
0615 bool ImportSettings::getToolTipsShowPhotoLens() const
0616 {
0617     return d->tooltipShowPhotoLens;
0618 }
0619 
0620 void ImportSettings::setToolTipsShowPhotoFocal(bool val)
0621 {
0622     d->tooltipShowPhotoFocal = val;
0623 }
0624 
0625 bool ImportSettings::getToolTipsShowPhotoFocal() const
0626 {
0627     return d->tooltipShowPhotoFocal;
0628 }
0629 
0630 void ImportSettings::setToolTipsShowPhotoExpo(bool val)
0631 {
0632     d->tooltipShowPhotoExpo = val;
0633 }
0634 
0635 bool ImportSettings::getToolTipsShowPhotoExpo() const
0636 {
0637     return d->tooltipShowPhotoExpo;
0638 }
0639 
0640 void ImportSettings::setToolTipsShowPhotoFlash(bool val)
0641 {
0642     d->tooltipShowPhotoFlash = val;
0643 }
0644 
0645 bool ImportSettings::getToolTipsShowPhotoFlash() const
0646 {
0647     return d->tooltipShowPhotoFlash;
0648 }
0649 
0650 void ImportSettings::setToolTipsShowPhotoWB(bool val)
0651 {
0652     d->tooltipShowPhotoWb = val;
0653 }
0654 
0655 bool ImportSettings::getToolTipsShowPhotoWB() const
0656 {
0657     return d->tooltipShowPhotoWb;
0658 }
0659 
0660 void ImportSettings::setToolTipsShowTags(bool val)
0661 {
0662     d->tooltipShowTags = val;
0663 }
0664 
0665 bool ImportSettings::getToolTipsShowTags() const
0666 {
0667     return d->tooltipShowTags;
0668 }
0669 
0670 void ImportSettings::setToolTipsShowLabelRating(bool val)
0671 {
0672     d->tooltipShowLabelRating = val;
0673 }
0674 
0675 bool ImportSettings::getToolTipsShowLabelRating() const
0676 {
0677     return d->tooltipShowLabelRating;
0678 }
0679 
0680 bool ImportSettings::showToolTipsIsValid() const
0681 {
0682     if (d->showToolTips)
0683     {
0684         if (d->tooltipShowFileName   ||
0685             d->tooltipShowFileDate   ||
0686             d->tooltipShowFileSize   ||
0687             d->tooltipShowImageType  ||
0688             d->tooltipShowImageDim   ||
0689             d->tooltipShowPhotoMake  ||
0690             d->tooltipShowPhotoLens  ||
0691             d->tooltipShowPhotoFocal ||
0692             d->tooltipShowPhotoExpo  ||
0693             d->tooltipShowPhotoFlash ||
0694             d->tooltipShowPhotoWb    ||
0695             d->tooltipShowFolderName ||
0696             d->tooltipShowLabelRating) /*||
0697             d->tooltipShowTags)*/
0698         {
0699             return true;
0700         }
0701     }
0702 
0703     return false;
0704 }
0705 
0706 void ImportSettings::setShowThumbbar(bool val)
0707 {
0708     d->showThumbbar = val;
0709 }
0710 
0711 bool ImportSettings::getShowThumbbar() const
0712 {
0713     return d->showThumbbar;
0714 }
0715 
0716 void ImportSettings::setPreviewLoadFullImageSize(bool val)
0717 {
0718     d->previewLoadFullImageSize = val;
0719 }
0720 
0721 bool ImportSettings::getPreviewLoadFullImageSize() const
0722 {
0723     return d->previewLoadFullImageSize;
0724 }
0725 
0726 void ImportSettings::setPreviewItemsWhileDownload(bool val)
0727 {
0728     d->previewItemsWhileDownload = val;
0729 }
0730 
0731 bool ImportSettings::getPreviewItemsWhileDownload() const
0732 {
0733     return d->previewItemsWhileDownload;
0734 }
0735 
0736 void ImportSettings::setPreviewShowIcons(bool val)
0737 {
0738     d->previewShowIcons = val;
0739 }
0740 
0741 bool ImportSettings::getPreviewShowIcons() const
0742 {
0743     return d->previewShowIcons;
0744 }
0745 
0746 void ImportSettings::setIconShowCoordinates(bool val)
0747 {
0748     d->iconShowCoordinates = val;
0749 }
0750 
0751 bool ImportSettings::getIconShowCoordinates() const
0752 {
0753     return d->iconShowCoordinates;
0754 }
0755 
0756 } // namespace Digikam
0757 
0758 #include "moc_importsettings.cpp"