[Digikam-devel] [Bug 283417] Add an option to show image titles [patch]
Menopia
wazery at ubuntu.com
Sat Dec 17 19:21:04 GMT 2011
https://bugs.kde.org/show_bug.cgi?id=283417
Menopia <wazery at ubuntu.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #66818|Edited Patch |Final Patch
description| |
--- Comment #14 from Menopia <wazery ubuntu com> 2011-12-17 19:21:03 ---
(From update of attachment 66818)
>From da24d9f5741ea5f2aae34e4bec23d1775b4daa30 Mon Sep 17 00:00:00 2001
>From: Islam Wazery <wazery at ubuntu.com>
>Date: Fri, 16 Dec 2011 22:47:54 +0200
>Subject: [PATCH] Added an option to show image title
>
>---
> digikam/views/digikamview.cpp | 1 +
> utilities/setup/setupslideshow.cpp | 26 +++++++++++++++++++++++---
> utilities/slideshow/slideshow.cpp | 27 ++++++++++++++++++++++++++-
> utilities/slideshow/slideshowsettings.cpp | 8 ++++++++
> utilities/slideshow/slideshowsettings.h | 11 +++++++++++
> 5 files changed, 69 insertions(+), 4 deletions(-)
>
>diff --git a/digikam/views/digikamview.cpp b/digikam/views/digikamview.cpp
>index bdf808f..a7b62e7 100644
>--- a/digikam/views/digikamview.cpp
>+++ b/digikam/views/digikamview.cpp
>@@ -1827,6 +1827,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();
>diff --git a/utilities/setup/setupslideshow.cpp b/utilities/setup/setupslideshow.cpp
>index 9cb32da..b807eb2 100644
>--- a/utilities/setup/setupslideshow.cpp
>+++ b/utilities/setup/setupslideshow.cpp
>@@ -26,6 +26,7 @@
> // Qt includes
>
> #include <QCheckBox>
>+#include <QGroupBox>
> #include <QLabel>
> #include <QVBoxLayout>
>
>@@ -58,6 +59,8 @@ public:
> showExpoSensitivity(0),
> showMakeModel(0),
> showComment(0),
>+ showTitle(0),
>+ showCapIfNoTitle(0),
> showLabels(0),
> delayInput(0)
> {}
>@@ -70,6 +73,8 @@ public:
> QCheckBox* showExpoSensitivity;
> QCheckBox* showMakeModel;
> QCheckBox* showComment;
>+ QGroupBox* showTitle;
>+ QCheckBox* showCapIfNoTitle;
> QCheckBox* showLabels;
>
> KIntNumInput* delayInput;
>@@ -114,11 +119,21 @@ 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 QGroupBox(i18n("Show image title"), panel);
>+ d->showTitle->setWhatsThis( i18n("Show the image title at the bottom of the screen."));
>+ d->showTitle->setCheckable(true);
>+
>+ 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."));
>+ QVBoxLayout *vbox = new QVBoxLayout;
>+ vbox->addWidget(d->showCapIfNoTitle);
>+ d->showTitle->setLayout(vbox);
>+
>+ // Disable the "Show captions if no title" checkbox if the "Show comment" checkbox enabled
>+ 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 +149,9 @@ SetupSlideShow::SetupSlideShow(QWidget* parent)
> layout->addWidget(d->showApertureFocal);
> layout->addWidget(d->showExpoSensitivity);
> layout->addWidget(d->showMakeModel);
>+ layout->addWidget(d->showLabels);
> layout->addWidget(d->showComment);
>- layout->addWidget(d->showLabels);
>+ layout->addWidget(d->showTitle);
> layout->addStretch();
> layout->setMargin(KDialog::spacingHint());
> layout->setSpacing(KDialog::spacingHint());
>@@ -166,6 +182,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 +201,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);
> }
>
>diff --git a/utilities/slideshow/slideshow.cpp b/utilities/slideshow/slideshow.cpp
>index 4cdfe43..e279b69 100644
>--- a/utilities/slideshow/slideshow.cpp
>+++ b/utilities/slideshow/slideshow.cpp
>@@ -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.
>@@ -414,11 +416,34 @@ void SlideShow::updatePixmap()
> offset += d->clWidget->minimumHeight();
> }
>
>+ // Display Titles.
>+ if (d->settings.printTitle)
>+ {
>+ str.clear();
>+ if (!title.isEmpty())
>+ {
>+ str += title;
>+ printInfoText(p, offset, str);
>+ }
>+ }
>+
>+ // 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);
> }
>
>diff --git a/utilities/slideshow/slideshowsettings.cpp b/utilities/slideshow/slideshowsettings.cpp
>index 593c32f..d6e4ff6 100644
>--- a/utilities/slideshow/slideshowsettings.cpp
>+++ b/utilities/slideshow/slideshowsettings.cpp
>@@ -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();
> }
>diff --git a/utilities/slideshow/slideshowsettings.h b/utilities/slideshow/slideshowsettings.h
>index 17bea5f..15599a3 100644
>--- a/utilities/slideshow/slideshowsettings.h
>+++ b/utilities/slideshow/slideshowsettings.h
>@@ -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;
>--
>1.7.5.4
>
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Digikam-devel
mailing list