Summary: | Add an option to show image titles [patch] | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Michael G. Hansen <mike> |
Component: | Plugin-Generic-SlideShow | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | anantapalani, caulier.gilles, wazery |
Priority: | NOR | Keywords: | junior-jobs |
Version: | 2.3.0 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.5.0 | |
Sentry Crash Report: | |||
Attachments: |
Add an option to show image titles
Final Patch Sorry for the Comment #14 |
Description
Michael G. Hansen
2011-10-05 20:16:21 UTC
Thinking about legacy: I guess people who used to add captions will add titles and captions to new images, while their old images have only captions. Therefore, an option "Show captions if no title exists" might be helpful to them. I think this task will be simple enough to make it a junior-job. I will take this job *** Bug 284652 has been marked as a duplicate of this bug. *** Created attachment 66750 [details]
Add an option to show image titles
I don't no if it is true to remove the "Show image captions" option or not, in this patch I removed it and instead I added an option to show the captions if no title exists.
Personally I think both 'show captions' and 'show title' should be available checkboxes. People will use the fields differently. Some people might have very detailed titles, but some people might have 'Skyrise I', 'Skyrise II' and then write some notes in the captions field. If it's possible, you could have a sub-option under the 'show title' labeled 'show captions if title not available'. This should cover all use cases. To clarify, I mean that there would be three check-boxes.. - Show captions - Show title - Show captions if title not visible If 'Show captions' is checked, captions are always shown regardless of any other settings. If 'Show captions' is unchecked, but 'Show title' and 'Show captions if title not visible' is checked, then captions are visible if there is no title. If only 'Show title' is checked, then the title is the only thing displayed if it is available. Hopefully that makes more sense. ok, I will edit the patch. I agree with Ananta, both options must be available... I will review your future patch before 2.5.0 release, planed on 1th January 2012 Gilles Caulier Menopia, What's new about your patch ? Gilles Caulier I will work on it now, sorry I slept more than 24 hours :( Created attachment 66818 [details]
Final Patch
Here is the edited patch, but I am think that there is one thing left; what about making the "Show captions" option disable the "Show captions if no title" when it is checked?
(In reply to comment #12) > Created an attachment (id=66818) [details] > Edited Patch > > Here is the edited patch, but I am think that there is one thing left; what > about making the "Show captions" option disable the "Show captions if no title" > when it is checked? Yes, that would be good. Sorry, I thought that was implicit in my description in comment #7. Comment on attachment 66818 [details] Final Patch >From da24d9f5741ea5f2aae34e4bec23d1775b4daa30 Mon Sep 17 00:00:00 2001 >From: Islam Wazery <wazery@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 > Created attachment 66837 [details] Sorry for the Comment #14 Sorry for the Comment #14, I posted it by mistake and it was incorrect :(, here is the final one. Menopia, Your patch is malformed : [gilles@localhost core]$ pwd /mnt/data/Devel/GIT/2.x/core [gilles@localhost core]$ patch -p1 < 0001-Added-an-option-to-show-image-title.patch patching file digikam/views/digikamview.cpp Hunk #1 succeeded at 1835 (offset 8 lines). patching file utilities/setup/setupslideshow.cpp patch: **** malformed patch at line 80: Please, generate your patch in a standard way, using a git diff against git/master, like this : http://www.digikam.org/drupal/contrib Best Gilles Caulier Sorry about the malformed patch, you can download it from here http://bit.ly/rNUlcf let me know if there is something missing. Git commit 2ee41c206239764b0bc866234bfbd1b1ad8d9405 by Gilles Caulier. Committed on 18/12/2011 at 10:35. Pushed by cgilles into branch 'master'. apply patch to show image title on digiKam SlideShow BUGS: 283417 M +1 -0 digikam/views/digikamview.cpp M +34 -5 utilities/setup/setupslideshow.cpp M +4 -0 utilities/setup/setupslideshow.h M +28 -2 utilities/slideshow/slideshow.cpp M +8 -0 utilities/slideshow/slideshowsettings.cpp M +11 -0 utilities/slideshow/slideshowsettings.h http://commits.kde.org/digikam/2ee41c206239764b0bc866234bfbd1b1ad8d9405 I think we need to add the same options for showfoto, if I am true I will make a patch for that. No. Look on code commited to git/master, option are disabled with showfoto. Imagetitle (as Tags) is digiKam Database info, not available from showfoto Gilles Caulier |