Commit 2ee41c20 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

apply patch to show image title on digiKam SlideShow

BUGS: 283417
parent 0d21f50d
......@@ -1835,6 +1835,7 @@ void DigikamView::slideShow(const ImageInfoList& infoList)
settings.fileList.append(info.fileUrl());
SlidePictureInfo pictInfo;
pictInfo.comment = info.comment();
pictInfo.title = info.title();
pictInfo.rating = info.rating();
pictInfo.colorLabel = info.colorLabel();
pictInfo.pickLabel = info.pickLabel();
......
......@@ -26,6 +26,7 @@
// Qt includes
#include <QCheckBox>
#include <QGroupBox>
#include <QLabel>
#include <QVBoxLayout>
......@@ -57,8 +58,10 @@ public:
showApertureFocal(0),
showExpoSensitivity(0),
showMakeModel(0),
showComment(0),
showLabels(0),
showComment(0),
showTitle(0),
showCapIfNoTitle(0),
delayInput(0)
{}
......@@ -69,8 +72,10 @@ public:
QCheckBox* showApertureFocal;
QCheckBox* showExpoSensitivity;
QCheckBox* showMakeModel;
QCheckBox* showComment;
QCheckBox* showLabels;
QCheckBox* showComment;
QCheckBox* showTitle;
QCheckBox* showCapIfNoTitle;
KIntNumInput* delayInput;
};
......@@ -114,11 +119,24 @@ SetupSlideShow::SetupSlideShow(QWidget* parent)
d->showMakeModel = new QCheckBox(i18n("Show camera make and model"), panel);
d->showMakeModel->setWhatsThis( i18n("Show the camera make and model at the bottom of the screen."));
d->showLabels = new QCheckBox(i18n("Show image labels"), panel);
d->showLabels->setWhatsThis( i18n("Show the digiKam image color label, pick label, and rating at the bottom of the screen."));
d->showComment = new QCheckBox(i18n("Show image caption"), panel);
d->showComment->setWhatsThis( i18n("Show the image caption at the bottom of the screen."));
d->showLabels = new QCheckBox(i18n("Show image labels"), panel);
d->showLabels->setWhatsThis( i18n("Show the digiKam image color label, pick label, and rating at the bottom of the screen."));
d->showTitle = new QCheckBox(i18n("Show image title"), panel);
d->showTitle->setWhatsThis(i18n("Show the image title at the bottom of the screen."));
d->showCapIfNoTitle = new QCheckBox(i18n("Show image caption if it hasn't title"), panel);
d->showCapIfNoTitle->setWhatsThis( i18n("Show the image caption at the bottom of the screen if no titles existed."));
// Disable and uncheck the "Show captions if no title" checkbox if the "Show comment" checkbox enabled
connect(d->showComment, SIGNAL(stateChanged(int)),
this, SLOT(slotSetUnchecked(int)));
connect(d->showComment, SIGNAL(toggled(bool)),
d->showCapIfNoTitle, SLOT(setDisabled(bool)));
// Only digiKam support this feature, showFoto do not support digiKam database information.
if (kapp->applicationName() == "showfoto")
......@@ -134,8 +152,10 @@ SetupSlideShow::SetupSlideShow(QWidget* parent)
layout->addWidget(d->showApertureFocal);
layout->addWidget(d->showExpoSensitivity);
layout->addWidget(d->showMakeModel);
layout->addWidget(d->showComment);
layout->addWidget(d->showLabels);
layout->addWidget(d->showComment);
layout->addWidget(d->showTitle);
layout->addWidget(d->showCapIfNoTitle);
layout->addStretch();
layout->setMargin(KDialog::spacingHint());
layout->setSpacing(KDialog::spacingHint());
......@@ -154,6 +174,11 @@ SetupSlideShow::~SetupSlideShow()
delete d;
}
void SetupSlideShow::slotSetUnchecked(int)
{
d->showCapIfNoTitle->setCheckState(Qt::Unchecked);
}
void SetupSlideShow::applySettings()
{
SlideShowSettings settings;
......@@ -166,6 +191,8 @@ void SetupSlideShow::applySettings()
settings.printExpoSensitivity = d->showExpoSensitivity->isChecked();
settings.printMakeModel = d->showMakeModel->isChecked();
settings.printComment = d->showComment->isChecked();
settings.printTitle = d->showTitle->isChecked();
settings.printCapIfNoTitle = d->showCapIfNoTitle->isChecked();
settings.printLabels = d->showLabels->isChecked();
settings.writeToConfig();
}
......@@ -183,6 +210,8 @@ void SetupSlideShow::readSettings()
d->showExpoSensitivity->setChecked(settings.printExpoSensitivity);
d->showMakeModel->setChecked(settings.printMakeModel);
d->showComment->setChecked(settings.printComment);
d->showTitle->setChecked(settings.printTitle);
d->showCapIfNoTitle->setChecked(settings.printCapIfNoTitle);
d->showLabels->setChecked(settings.printLabels);
}
......
......@@ -46,6 +46,10 @@ public:
void applySettings();
public slots:
void slotSetUnchecked(int);
private:
void readSettings();
......
......@@ -396,6 +396,8 @@ void SlideShow::updatePixmap()
QString str;
PhotoInfoContainer photoInfo = d->settings.pictInfoMap[d->currentImage].photoInfo;
QString comment = d->settings.pictInfoMap[d->currentImage].comment;
QString title = d->settings.pictInfoMap[d->currentImage].title;
int offset = d->toolBar->height()+30;
// Display Labels.
......@@ -413,12 +415,36 @@ void SlideShow::updatePixmap()
d->labelsBox->move(10, height() - offset - d->clWidget->minimumHeight());
offset += d->clWidget->minimumHeight();
}
// Display Titles.
if (d->settings.printTitle)
{
str.clear();
if (!title.isEmpty())
{
str += title;
printInfoText(p, offset, str);
}
}
// Display Comments.
// Display Captions if no Titles.
if (d->settings.printCapIfNoTitle)
{
str.clear();
if (title.isEmpty())
{
str += comment;
printComments(p, offset, str);
}
}
// Display Comments.
if (d->settings.printComment)
{
str = d->settings.pictInfoMap[d->currentImage].comment;
str = comment;
printComments(p, offset, str);
}
......
......@@ -43,6 +43,8 @@ const QString SlideShowSettings::configSlideShowDelayEntry("SlideShowDelay");
const QString SlideShowSettings::configSlideShowLoopEntry("SlideShowLoop");
const QString SlideShowSettings::configSlideShowPrintApertureFocalEntry("SlideShowPrintApertureFocal");
const QString SlideShowSettings::configSlideShowPrintCommentEntry("SlideShowPrintComment");
const QString SlideShowSettings::configSlideShowPrintTitleEntry("SlideShowPrintTitle");
const QString SlideShowSettings::configSlideShowPrintCapIfNoTitleEntry("SlideShowPrintCapIfNoTitle");
const QString SlideShowSettings::configSlideShowPrintDateEntry("SlideShowPrintDate");
const QString SlideShowSettings::configSlideShowPrintExpoSensitivityEntry("SlideShowPrintExpoSensitivity");
const QString SlideShowSettings::configSlideShowPrintMakeModelEntry("SlideShowPrintMakeModel");
......@@ -58,6 +60,8 @@ SlideShowSettings::SlideShowSettings()
printName = true;
printDate = false;
printComment = false;
printTitle = false;
printCapIfNoTitle = false;
printLabels = false;
printApertureFocal = false;
printMakeModel = false;
......@@ -81,6 +85,8 @@ void SlideShowSettings::readFromConfig()
printExpoSensitivity = group.readEntry(configSlideShowPrintExpoSensitivityEntry, false);
printMakeModel = group.readEntry(configSlideShowPrintMakeModelEntry, false);
printComment = group.readEntry(configSlideShowPrintCommentEntry, false);
printTitle = group.readEntry(configSlideShowPrintTitleEntry, false);
printCapIfNoTitle = group.readEntry(configSlideShowPrintCapIfNoTitleEntry, false);
printLabels = group.readEntry(configSlideShowPrintLabelsEntry, false);
exifRotate = MetadataSettings::instance()->settings().exifRotate;
......@@ -99,6 +105,8 @@ void SlideShowSettings::writeToConfig()
group.writeEntry(configSlideShowPrintExpoSensitivityEntry, printExpoSensitivity);
group.writeEntry(configSlideShowPrintMakeModelEntry, printMakeModel);
group.writeEntry(configSlideShowPrintCommentEntry, printComment);
group.writeEntry(configSlideShowPrintTitleEntry, printTitle);
group.writeEntry(configSlideShowPrintCapIfNoTitleEntry, printCapIfNoTitle);
group.writeEntry(configSlideShowPrintLabelsEntry, printLabels);
group.sync();
}
......
......@@ -66,6 +66,9 @@ public:
/** Picture Comment */
QString comment;
/** Picture Title */
QString title;
/** Exif photo info of picture */
PhotoInfoContainer photoInfo;
};
......@@ -112,6 +115,12 @@ public:
/** Print picture comment during slide */
bool printComment;
/** Print image title during slide */
bool printTitle;
/** Print image captions if no title available during slide */
bool printCapIfNoTitle;
/** Print color label, pick label, and rating during slide */
bool printLabels;
......@@ -138,6 +147,8 @@ private:
static const QString configSlideShowLoopEntry;
static const QString configSlideShowPrintApertureFocalEntry;
static const QString configSlideShowPrintCommentEntry;
static const QString configSlideShowPrintTitleEntry;
static const QString configSlideShowPrintCapIfNoTitleEntry;
static const QString configSlideShowPrintDateEntry;
static const QString configSlideShowPrintExpoSensitivityEntry;
static const QString configSlideShowPrintMakeModelEntry;
......
Supports Markdown
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