Commit 9ddedf90 authored by Marcel Wiesweg's avatar Marcel Wiesweg
Browse files

Apply settings UI for previews:

() Fast preview
() High quality preview
	RAW: - Automatic
	     - Always embedded preview
	     - Always half-size demosaic

CCBUG: 205776
parent b56fc72c
......@@ -196,7 +196,26 @@ void ApplicationSettings::readSettings()
d->tooltipShowAlbumCaption = group.readEntry(d->configToolTipsShowAlbumCaptionEntry, true);
d->tooltipShowAlbumPreview = group.readEntry(d->configToolTipsShowAlbumPreviewEntry, false);
d->previewLoadFullImageSize = group.readEntry(d->configPreviewLoadFullImageSizeEntry, false);
if (group.readEntry(d->configPreviewLoadFullImageSizeEntry, true))
{
d->previewSettings.quality = PreviewSettings::HighQualityPreview;
if (group.readEntry(d->configPreviewRawUseEmbeddedPreview, false))
{
d->previewSettings.rawLoading = PreviewSettings::RawPreviewFromEmbeddedPreview;
}
else if (group.readEntry(d->configPreviewRawUseHalfSizeData, false))
{
d->previewSettings.rawLoading = PreviewSettings::RawPreviewFromRawHalfSize;
}
else
{
d->previewSettings.rawLoading = PreviewSettings::RawPreviewAutomatic;
}
}
else
{
d->previewSettings.quality = PreviewSettings::FastPreview;
}
d->previewShowIcons = group.readEntry(d->configPreviewShowIconsEntry, true);
d->showThumbbar = group.readEntry(d->configShowThumbbarEntry, true);
......@@ -320,7 +339,29 @@ void ApplicationSettings::saveSettings()
group.writeEntry(d->configToolTipsShowAlbumCaptionEntry, d->tooltipShowAlbumCaption);
group.writeEntry(d->configToolTipsShowAlbumPreviewEntry, d->tooltipShowAlbumPreview);
group.writeEntry(d->configPreviewLoadFullImageSizeEntry, d->previewLoadFullImageSize);
if (d->previewSettings.quality == PreviewSettings::HighQualityPreview)
{
group.writeEntry(d->configPreviewLoadFullImageSizeEntry, true);
switch (d->previewSettings.rawLoading)
{
case PreviewSettings::RawPreviewAutomatic:
group.writeEntry(d->configPreviewRawUseEmbeddedPreview, false);
group.writeEntry(d->configPreviewRawUseHalfSizeData, false);
break;
case PreviewSettings::RawPreviewFromEmbeddedPreview:
group.writeEntry(d->configPreviewRawUseEmbeddedPreview, true);
group.writeEntry(d->configPreviewRawUseHalfSizeData, false);
break;
case PreviewSettings::RawPreviewFromRawHalfSize:
group.writeEntry(d->configPreviewRawUseEmbeddedPreview, false);
group.writeEntry(d->configPreviewRawUseHalfSizeData, true);
break;
}
}
else
{
group.writeEntry(d->configPreviewLoadFullImageSizeEntry, false);
}
group.writeEntry(d->configPreviewShowIconsEntry, d->previewShowIcons);
group.writeEntry(d->configShowThumbbarEntry, d->showThumbbar);
......
......@@ -49,6 +49,7 @@ namespace Digikam
class DatabaseParameters;
class VersionManagerSettings;
class PreviewSettings;
class ApplicationSettings : public QObject
{
......@@ -241,8 +242,8 @@ public:
*/
bool getIconShowOverlays() const;
void setPreviewLoadFullImageSize(bool val);
bool getPreviewLoadFullImageSize() const;
void setPreviewSettings(const PreviewSettings& settings);
PreviewSettings getPreviewSettings() const;
void setPreviewShowIcons(bool val);
bool getPreviewShowIcons() const;
......
......@@ -233,14 +233,14 @@ bool ApplicationSettings::getIconShowOverlays() const
return d->iconShowOverlays;
}
void ApplicationSettings::setPreviewLoadFullImageSize(bool val)
void ApplicationSettings::setPreviewSettings(const PreviewSettings& settings)
{
d->previewLoadFullImageSize = val;
d->previewSettings = settings;
}
bool ApplicationSettings::getPreviewLoadFullImageSize() const
PreviewSettings ApplicationSettings::getPreviewSettings() const
{
return d->previewLoadFullImageSize;
return d->previewSettings;
}
void ApplicationSettings::setPreviewShowIcons(bool val)
......
......@@ -117,6 +117,8 @@ const QString ApplicationSettings::Private::configToolTipsShowAlbumCategoryEntry
const QString ApplicationSettings::Private::configToolTipsShowAlbumCaptionEntry("ToolTips Show Album Caption");
const QString ApplicationSettings::Private::configToolTipsShowAlbumPreviewEntry("ToolTips Show Album Preview");
const QString ApplicationSettings::Private::configPreviewLoadFullImageSizeEntry("Preview Load Full Image Size");
const QString ApplicationSettings::Private::configPreviewRawUseEmbeddedPreview("Preview Raw Use Embedded Preview");
const QString ApplicationSettings::Private::configPreviewRawUseHalfSizeData("Preview Raw Use Half Size Data");
const QString ApplicationSettings::Private::configPreviewShowIconsEntry("Preview Show Icons");
const QString ApplicationSettings::Private::configShowThumbbarEntry("Show Thumbbar");
const QString ApplicationSettings::Private::configShowFolderTreeViewItemsCountEntry("Show Folder Tree View Items Count");
......@@ -183,7 +185,6 @@ ApplicationSettings::Private::Private(ApplicationSettings* const q)
tooltipShowAlbumCategory(false),
tooltipShowAlbumCaption(false),
tooltipShowAlbumPreview(false),
previewLoadFullImageSize(false),
previewShowIcons(true),
showThumbbar(false),
showFolderTreeViewItemsCount(false),
......@@ -297,7 +298,6 @@ void ApplicationSettings::Private::init()
tooltipShowAlbumCaption = true;
tooltipShowAlbumPreview = false;
previewLoadFullImageSize = false;
previewShowIcons = true;
showThumbbar = true;
......
......@@ -24,6 +24,8 @@
#ifndef APPLICATIONSETTINGS_P_H
#define APPLICATIONSETTINGS_P_H
#include "previewsettings.h"
namespace Digikam
{
......@@ -111,6 +113,8 @@ public:
static const QString configToolTipsShowAlbumCaptionEntry;
static const QString configToolTipsShowAlbumPreviewEntry;
static const QString configPreviewLoadFullImageSizeEntry;
static const QString configPreviewRawUseEmbeddedPreview;
static const QString configPreviewRawUseHalfSizeData;
static const QString configPreviewShowIconsEntry;
static const QString configShowThumbbarEntry;
static const QString configShowFolderTreeViewItemsCountEntry;
......@@ -191,7 +195,7 @@ public:
bool tooltipShowAlbumPreview;
// preview settings
bool previewLoadFullImageSize;
PreviewSettings previewSettings;
bool previewShowIcons;
bool showThumbbar;
......
......@@ -125,7 +125,7 @@ void SlideShowBuilder::slotParseImageInfoList(const ImageInfoList& list)
int i = 0;
SlideShowSettings settings;
settings.readFromConfig();
settings.useFullSizePreviews = ApplicationSettings::instance()->getPreviewLoadFullImageSize();
settings.previewSettings = ApplicationSettings::instance()->getPreviewSettings();
for (ImageInfoList::const_iterator it = list.constBegin();
!d->cancel && (it != list.constEnd()) ; ++it)
......
......@@ -70,6 +70,7 @@
#include "tagspopupmenu.h"
#include "thememanager.h"
#include "previewlayout.h"
#include "previewsettings.h"
#include "tagscache.h"
#include "imagetagpair.h"
#include "albummanager.h"
......@@ -489,7 +490,7 @@ void ImagePreviewView::slotThemeChanged()
void ImagePreviewView::slotSetupChanged()
{
previewItem()->setLoadFullImageSize(ApplicationSettings::instance()->getPreviewLoadFullImageSize());
previewItem()->setPreviewSettings(ApplicationSettings::instance()->getPreviewSettings());
d->toolBar->setVisible(ApplicationSettings::instance()->getPreviewShowIcons());
setShowText(ApplicationSettings::instance()->getPreviewShowIcons());
......
......@@ -38,6 +38,7 @@
#include <kapplication.h>
#include <kcombobox.h>
#include <kdebug.h>
#include <kdialog.h>
#include <klocale.h>
#include <kmessagebox.h>
......@@ -49,6 +50,7 @@
#include "dfontselect.h"
#include "fullscreensettings.h"
#include "dxmlguiwindow.h"
#include "previewsettings.h"
namespace Digikam
{
......@@ -74,7 +76,9 @@ public:
iconShowRatingBox(0),
iconShowFormatBox(0),
iconShowCoordinatesBox(0),
previewLoadFullImageSize(0),
previewFastPreview(0),
previewFullView(0),
previewRawMode(0),
previewShowIcons(0),
showFolderTreeViewItemsCount(0),
largeThumbsBox(0),
......@@ -104,7 +108,9 @@ public:
QCheckBox* iconShowRatingBox;
QCheckBox* iconShowFormatBox;
QCheckBox* iconShowCoordinatesBox;
QCheckBox* previewLoadFullImageSize;
QRadioButton* previewFastPreview;
QRadioButton* previewFullView;
QComboBox* previewRawMode;
QCheckBox* previewShowIcons;
QCheckBox* showFolderTreeViewItemsCount;
QCheckBox* largeThumbsBox;
......@@ -183,7 +189,7 @@ SetupAlbumView::SetupAlbumView(QWidget* const parent)
QLabel* leftClickLabel = new QLabel(i18n("Thumbnail click action:"), iconViewGroup);
d->leftClickActionComboBox = new KComboBox(iconViewGroup);
d->leftClickActionComboBox->addItem(i18n("Show embedded preview"), ApplicationSettings::ShowPreview);
d->leftClickActionComboBox->addItem(i18n("Show embedded view"), ApplicationSettings::ShowPreview);
d->leftClickActionComboBox->addItem(i18n("Start image editor"), ApplicationSettings::StartEditor);
d->leftClickActionComboBox->setToolTip(i18n("Choose what should happen when you click on a thumbnail."));
......@@ -251,21 +257,35 @@ SetupAlbumView::SetupAlbumView(QWidget* const parent)
QGroupBox* const interfaceOptionsGroup = new QGroupBox(i18n("Preview Options"), panel);
QGridLayout* const grid3 = new QGridLayout(interfaceOptionsGroup);
d->previewLoadFullImageSize = new QCheckBox(i18n("Embedded preview loads full-sized images"), interfaceOptionsGroup);
d->previewLoadFullImageSize->setWhatsThis(i18n("<p>Set this option to load images at their full size "
"for preview, rather than at a reduced size. As this option "
"will make it take longer to load images, only use it if you have "
"a fast computer.</p>"
"<p><b>Note:</b> for Raw images, a half size version of the Raw data "
"is used instead of the embedded JPEG preview.</p>"));
d->previewFastPreview = new QRadioButton(i18nc("@option:radio",
"Embedded view shows a small, quick preview"));
d->previewFullView = new QRadioButton(i18nc("@option:radio",
"Embedded view shows shows the full image"));
QLabel* rawPreviewLabel = new QLabel(i18nc("@label:listbox Mode of RAW preview decoding:",
"Raw images:"));
d->previewRawMode = new QComboBox;
d->previewRawMode->addItem(i18nc("@option:inlistbox Automatic choice of RAW image preview source",
"Automatic"), PreviewSettings::RawPreviewAutomatic);
d->previewRawMode->addItem(i18nc("@option:inlistbox Embedded preview as RAW image preview source",
"Embedded preview"), PreviewSettings::RawPreviewFromEmbeddedPreview);
d->previewRawMode->addItem(i18nc("@option:inlistbox Original, half-size data as RAW image preview source",
"Raw data in half size"), PreviewSettings::RawPreviewFromRawHalfSize);
d->previewShowIcons = new QCheckBox(i18n("Show icons and text over preview"), interfaceOptionsGroup);
d->previewShowIcons->setWhatsThis(i18n("Uncheck this if you do not want to see icons and text in the image preview."));
grid3->setMargin(KDialog::spacingHint());
grid3->setSpacing(KDialog::spacingHint());
grid3->addWidget(d->previewLoadFullImageSize, 0, 0, 1, 2);
grid3->addWidget(d->previewShowIcons, 1, 0, 1, 2);
grid3->addWidget(d->previewFastPreview, 0, 0, 1, 2);
grid3->addWidget(d->previewFullView, 1, 0, 1, 2);
grid3->addWidget(rawPreviewLabel, 2, 0, 1, 1);
grid3->addWidget(d->previewRawMode, 2, 1, 1, 1);
grid3->addWidget(d->previewShowIcons, 3, 0, 1, 2);
d->previewFastPreview->setChecked(true);
d->previewRawMode->setCurrentIndex(0);
d->previewRawMode->setEnabled(false);
connect(d->previewFullView, SIGNAL(toggled(bool)), d->previewRawMode, SLOT(setEnabled(bool)));
// --------------------------------------------------------
......@@ -328,7 +348,11 @@ void SetupAlbumView::applySettings()
settings->setItemLeftClickAction((ApplicationSettings::ItemLeftClickAction)
d->leftClickActionComboBox->currentIndex());
settings->setPreviewLoadFullImageSize(d->previewLoadFullImageSize->isChecked());
PreviewSettings previewSettings;
previewSettings.quality = d->previewFastPreview->isChecked() ? PreviewSettings::FastPreview : PreviewSettings::HighQualityPreview;
previewSettings.rawLoading = (PreviewSettings::RawLoading)d->previewRawMode->itemData(d->previewRawMode->currentIndex()).toInt();
settings->setPreviewSettings(previewSettings);
settings->setPreviewShowIcons(d->previewShowIcons->isChecked());
settings->setShowFolderTreeViewItemsCount(d->showFolderTreeViewItemsCount->isChecked());
settings->saveSettings();
......@@ -385,7 +409,17 @@ void SetupAlbumView::readSettings()
d->leftClickActionComboBox->setCurrentIndex((int)settings->getItemLeftClickAction());
d->previewLoadFullImageSize->setChecked(settings->getPreviewLoadFullImageSize());
PreviewSettings previewSettings = settings->getPreviewSettings();
if (previewSettings.quality == PreviewSettings::FastPreview)
{
d->previewFastPreview->setChecked(true);
}
else
{
d->previewFullView->setChecked(true);
}
d->previewRawMode->setCurrentIndex(d->previewRawMode->findData(previewSettings.rawLoading));
d->previewShowIcons->setChecked(settings->getPreviewShowIcons());
d->showFolderTreeViewItemsCount->setChecked(settings->getShowFolderTreeViewItemsCount());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment