Bug 133276 - make changing exif date of multiple files easier
Summary: make changing exif date of multiple files easier
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-TimeAdjust (show other bugs)
Version: 0.8.0
Platform: Slackware Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-30 16:32 UTC by Michał Kosmulski
Modified: 2018-09-22 08:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0
Sentry Crash Report:


Attachments
camera interface from digikam 0.9.0-beta2 (302.82 KB, image/png)
2006-08-30 18:25 UTC, caulier.gilles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Kosmulski 2006-08-30 16:32:57 UTC
Version:           0.8.0 (using KDE KDE 3.5.3)
Installed from:    Slackware Packages
OS:                Linux

It would be a usefult feature to be able to change the EXIF dates of multiple files easily, i.e. offset them by a specified amount. I recntly took a long series of pictures with a camera whose clock was off by a considerable time span and in order to get the dates right, I had to use exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/). That is a very nice program but having the same functionality in the Digikam GUI would be even better. I think this option would fit well into the 'Adjust Time and Date' dialog.
Comment 1 caulier.gilles 2006-08-30 18:13:57 UTC
> I think this option would fit well into the 'Adjust Time and Date' dialog.

Yes, it's planned to improve this kipi-plugin in this way.

But there is also another way that we want to do in digiKam : to be capable to perform in batch all changes performed by the "Comments & tags" right sidebar tab from digiKam album gui. 

Gilles
Comment 2 caulier.gilles 2006-08-30 18:21:05 UTC
Nota : with next release 0.9.0, a batch date corrector have been added to camera gui. The internal date of picture is corrected during download.

Gilles
Comment 3 caulier.gilles 2006-08-30 18:25:41 UTC
Created attachment 17568 [details]
camera interface from digikam 0.9.0-beta2
Comment 4 caulier.gilles 2006-10-12 21:23:48 UTC
SVN commit 594899 by cgilles:

kipiplugins from trunk : new plugin to edit EXIF photograph tags and IPTC tags of pictures
This tool can be used on single or batch mode.

Note: this plugin is under developement. It's not yet suitable. 

CCMAIL: digikam-devel@kde.org, kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 A             metadataedit (directory)  
 A             metadataedit/Makefile.am  
 A             metadataedit/iptccaption.cpp   [License: GPL]
 A             metadataedit/iptccaption.h   [License: GPL]
 A             metadataedit/iptccredits.cpp   [License: GPL]
 A             metadataedit/iptccredits.h   [License: GPL]
 A             metadataedit/iptceditdialog.cpp   [License: GPL]
 A             metadataedit/iptceditdialog.h   [License: GPL]
 A             metadataedit/kipiplugin_metadataedit.desktop  
 A             metadataedit/metadataeditdialog.cpp   [License: GPL]
 A             metadataedit/metadataeditdialog.h   [License: GPL]
 A             metadataedit/metadataitem.cpp   [License: GPL]
 A             metadataedit/metadataitem.h   [License: GPL]
 A             metadataedit/plugin_metadataedit.cpp   [License: GPL]
 A             metadataedit/plugin_metadataedit.h   [License: GPL]
Comment 5 caulier.gilles 2006-10-13 09:20:13 UTC
SVN commit 595026 by cgilles:

kipiplugins from trunk : MetadataEdit plugin:

"Et Voila"... The IPTC metadata can be changed/set from pictures. The IPTC data set to edit is not yet complete, but a more complete edit dialog coming soon...

CCMAIL: digikam-devel@kde.org, kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 M  +17 -4     iptccaption.cpp  
 M  +18 -2     iptccredits.cpp  
 M  +1 -1      iptceditdialog.cpp  
 M  +5 -5      metadataeditdialog.cpp  
 M  +16 -7     metadataitem.cpp  


--- trunk/extragear/libs/kipi-plugins/metadataedit/iptccaption.cpp #595025:595026
@@ -36,6 +36,7 @@
 
 // Local includes.
 
+#include "exiv2iface.h"
 #include "iptccaption.h"
 #include "iptccaption.moc"
 
@@ -127,8 +128,7 @@
     vlay->addStretch();
                                          
     // --------------------------------------------------------
-    
-    
+        
     readMetadata(iptcData);
 }
 
@@ -137,12 +137,25 @@
     delete d;
 }
 
-void IPTCCaption::applyMetadata(QByteArray& iptcData)
+void IPTCCaption::readMetadata(QByteArray& iptcData)
 {
+    KIPIPlugins::Exiv2Iface exiv2Iface;
+    exiv2Iface.setIptc(iptcData);
+    d->captionEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Caption", false));
+    d->writerEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Writer", false));
+    d->headlineEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Headline", false));
+    d->specialInstructionEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.SpecialInstructions", false));
 }
 
-void IPTCCaption::readMetadata(QByteArray& iptcData)
+void IPTCCaption::applyMetadata(QByteArray& iptcData)
 {
+    KIPIPlugins::Exiv2Iface exiv2Iface;
+    exiv2Iface.setIptc(iptcData);
+    exiv2Iface.setIptcTagString("Iptc.Application2.Caption", d->captionEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.Writer", d->writerEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.Headline", d->headlineEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.SpecialInstructions", d->specialInstructionEdit->text());
+    iptcData = exiv2Iface.getIptc();
 }
 
 }  // namespace KIPIMetadataEditPlugin
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptccredits.cpp #595025:595026
@@ -35,6 +35,7 @@
 
 // Local includes.
 
+#include "exiv2iface.h"
 #include "iptccredits.h"
 #include "iptccredits.moc"
 
@@ -148,12 +149,27 @@
     delete d;
 }
 
-void IPTCCredits::applyMetadata(QByteArray& iptcData)
+void IPTCCredits::readMetadata(QByteArray& iptcData)
 {
+    KIPIPlugins::Exiv2Iface exiv2Iface;
+    exiv2Iface.setIptc(iptcData);
+    d->copyrightEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Copyright", false));
+    d->bylineEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Byline", false));
+    d->bylineTitleEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.BylineTitle", false));
+    d->creditEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Credit", false));
+    d->sourceEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Source", false));
 }
 
-void IPTCCredits::readMetadata(QByteArray& iptcData)
+void IPTCCredits::applyMetadata(QByteArray& iptcData)
 {
+    KIPIPlugins::Exiv2Iface exiv2Iface;
+    exiv2Iface.setIptc(iptcData);
+    exiv2Iface.setIptcTagString("Iptc.Application2.Copyright", d->copyrightEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.Byline", d->bylineEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.BylineTitle", d->bylineTitleEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.Credit", d->creditEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.Source", d->sourceEdit->text());
+    iptcData = exiv2Iface.getIptc();
 }
 
 }  // namespace KIPIMetadataEditPlugin
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptceditdialog.cpp #595025:595026
@@ -128,7 +128,7 @@
 
 QByteArray IPTCEditDialog::getIPTCInfo()
 {
-    return QByteArray();
+    return d->iptcData;
 }
 
 void IPTCEditDialog::slotOk()
--- trunk/extragear/libs/kipi-plugins/metadataedit/metadataeditdialog.cpp #595025:595026
@@ -382,24 +382,24 @@
 
 void MetadataEditDialog::slotApply()
 {
-/*    KURL::List images;
+    KURL::List images;
 
     QListViewItemIterator it( d->listView );
     while ( it.current() ) 
     {
-        GPSListViewItem *item = (GPSListViewItem*) it.current();
+        MetadataItem *item = (MetadataItem*)it.current();
         d->listView->setSelected(item, true);
         d->listView->ensureItemVisible(item);
-        item->writeGPSInfoToFile();
+        item->writeMetadataToFile();
         images.append(item->getUrl());
 
-        // TODO : new libkipi method to store GPS info in host database.
+        // TODO : add libkipi method call to please the host to re-read metadata from pictures.
 
         ++it;
         kapp->processEvents();
     }
     
-    d->interface->refreshImages(images);*/
+    d->interface->refreshImages(images);
 }
 
 }  // NameSpace KIPIMetadataEditPlugin
--- trunk/extragear/libs/kipi-plugins/metadataedit/metadataitem.cpp #595025:595026
@@ -173,25 +173,34 @@
 {
     if (isEnabled() && isDirty())
     {
-/*        setPixmap(1, SmallIcon("run"));
+        setPixmap(1, SmallIcon("run"));
         KIPIPlugins::Exiv2Iface exiv2Iface;
         bool ret = exiv2Iface.load(d->url.path());
 
-        if (d->erase)
-            ret &= exiv2Iface.removeGPSInfo();
+        if (d->eraseExif)
+        {
+        //    ret &= exiv2Iface.removeExif();
+        }
         else
         {
-            ret &= exiv2Iface.setGPSInfo(d->gpsData.altitude(), 
-                                         d->gpsData.latitude(), 
-                                         d->gpsData.longitude());
+            ret &= exiv2Iface.setExif(d->exifData);
         }
 
+        if (d->eraseIptc)
+        {
+        //    ret &= exiv2Iface.removeIptc();
+        }
+        else
+        {
+            ret &= exiv2Iface.setIptc(d->iptcData);
+        }
+
         ret &= exiv2Iface.save(d->url.path());
         
         if (ret)
             setPixmap(1, SmallIcon("ok"));
         else
-            setPixmap(1, SmallIcon("cancel"));*/
+            setPixmap(1, SmallIcon("cancel"));
 	
 	    d->dirty = false;
     }
Comment 6 caulier.gilles 2006-10-13 11:16:42 UTC
SVN commit 595071 by cgilles:

kipiplugins from trunk : MetadataEdit plugin:

Added IPTC Status informations in IPTC Edit dialog

CCMAIL: kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 M  +1 -1      Makefile.am  
 M  +1 -1      iptccredits.cpp  
 M  +10 -1     iptceditdialog.cpp  
 A             iptcstatus.cpp   [License: GPL]
 A             iptcstatus.h   [License: GPL]


--- trunk/extragear/libs/kipi-plugins/metadataedit/Makefile.am #595070:595071
@@ -11,7 +11,7 @@
 # Srcs for the plugin
 kipiplugin_metadataedit_la_SOURCES = plugin_metadataedit.cpp metadataeditdialog.cpp \
 	                                 metadataitem.cpp iptceditdialog.cpp iptccaption.cpp \
-	                                 iptccredits.cpp 
+	                                 iptccredits.cpp iptcstatus.cpp 
 
 # Libs needed by the plugin
 kipiplugin_metadataedit_la_LIBADD = $(top_builddir)/kipi-plugins/common/exiv2iface/libexiv2iface.la \
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptccredits.cpp #595070:595071
@@ -126,7 +126,7 @@
     d->sourceEdit  = new KLineEdit(parent);
     d->sourceEdit->setValidator(asciiValidator);
     d->sourceEdit->setMaxLength(32);
-    label4->setBuddy(d->sourceEdit);
+    label5->setBuddy(d->sourceEdit);
     vlay->addWidget(label5);
     vlay->addWidget(d->sourceEdit);
     QWhatsThis::add(d->sourceEdit, i18n("<p>Set here the original owner of content. "
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptceditdialog.cpp #595070:595071
@@ -40,6 +40,7 @@
 
 #include "iptccaption.h"
 #include "iptccredits.h"
+#include "iptcstatus.h"
 #include "iptceditdialog.h"
 #include "iptceditdialog.moc"
 
@@ -55,19 +56,22 @@
     {
         page_caption = 0;
         page_credits = 0;
+        page_status  = 0;
 
         captionPage  = 0;
         creditsPage  = 0;
+        statusPage   = 0;
     }
 
     QByteArray   iptcData;
 
     QFrame      *page_caption;
     QFrame      *page_credits;
+    QFrame      *page_status;
 
     IPTCCaption *captionPage;
     IPTCCredits *creditsPage;
-
+    IPTCStatus  *statusPage;
 };
 
 IPTCEditDialog::IPTCEditDialog(QWidget* parent, QByteArray iptcData, const QString& fileName)
@@ -87,6 +91,10 @@
                               BarIcon("identity", KIcon::SizeMedium));
     d->creditsPage  = new IPTCCredits(d->page_credits, d->iptcData);
 
+    d->page_status  = addPage(i18n("Status"), i18n("IPTC Status Informations"),
+                              BarIcon("messagebox_info", KIcon::SizeMedium));
+    d->statusPage   = new IPTCStatus(d->page_status, d->iptcData);
+
     readSettings();
     show();
 }
@@ -135,6 +143,7 @@
 {
     d->captionPage->applyMetadata(d->iptcData);
     d->creditsPage->applyMetadata(d->iptcData);
+    d->statusPage->applyMetadata(d->iptcData);
 
     saveSettings();
     accept();
Comment 7 caulier.gilles 2006-10-13 14:10:47 UTC
SVN commit 595152 by cgilles:

kipiplugins from trunk : MetadataEdit plugin:

Added IPTC Origin informations in IPTC Edit dialog

CCMAIL: kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 M  +1 -1      Makefile.am  
 M  +11 -2     iptceditdialog.cpp  
 M  +0 -13     iptceditdialog.h  
 A             iptcorigin.cpp   [License: GPL]
 A             iptcorigin.h   [License: GPL]


--- trunk/extragear/libs/kipi-plugins/metadataedit/Makefile.am #595151:595152
@@ -11,7 +11,7 @@
 # Srcs for the plugin
 kipiplugin_metadataedit_la_SOURCES = plugin_metadataedit.cpp metadataeditdialog.cpp \
 	                                 metadataitem.cpp iptceditdialog.cpp iptccaption.cpp \
-	                                 iptccredits.cpp iptcstatus.cpp 
+	                                 iptccredits.cpp iptcstatus.cpp iptcorigin.cpp 
 
 # Libs needed by the plugin
 kipiplugin_metadataedit_la_LIBADD = $(top_builddir)/kipi-plugins/common/exiv2iface/libexiv2iface.la \
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptceditdialog.cpp #595151:595152
@@ -41,6 +41,7 @@
 #include "iptccaption.h"
 #include "iptccredits.h"
 #include "iptcstatus.h"
+#include "iptcorigin.h"
 #include "iptceditdialog.h"
 #include "iptceditdialog.moc"
 
@@ -57,10 +58,12 @@
         page_caption = 0;
         page_credits = 0;
         page_status  = 0;
+        page_origin  = 0;
 
         captionPage  = 0;
         creditsPage  = 0;
         statusPage   = 0;
+        originPage   = 0;
     }
 
     QByteArray   iptcData;
@@ -68,10 +71,12 @@
     QFrame      *page_caption;
     QFrame      *page_credits;
     QFrame      *page_status;
+    QFrame      *page_origin;
 
     IPTCCaption *captionPage;
     IPTCCredits *creditsPage;
     IPTCStatus  *statusPage;
+    IPTCOrigin  *originPage;
 };
 
 IPTCEditDialog::IPTCEditDialog(QWidget* parent, QByteArray iptcData, const QString& fileName)
@@ -95,6 +100,10 @@
                               BarIcon("messagebox_info", KIcon::SizeMedium));
     d->statusPage   = new IPTCStatus(d->page_status, d->iptcData);
 
+    d->page_origin  = addPage(i18n("Origin"), i18n("IPTC Origin Informations"),
+                              BarIcon("www", KIcon::SizeMedium));
+    d->originPage   = new IPTCOrigin(d->page_origin, d->iptcData);
+
     readSettings();
     show();
 }
@@ -121,7 +130,7 @@
 {
     KConfig config("kipirc");
     config.setGroup("Metadata Edit Settings");
-    showPage(config.readNumEntry("IPTC Edit Page", Caption));
+    showPage(config.readNumEntry("IPTC Edit Page", 0));
     resize(configDialogSize(config, QString("IPTC Edit Dialog")));
 }
 
@@ -144,7 +153,7 @@
     d->captionPage->applyMetadata(d->iptcData);
     d->creditsPage->applyMetadata(d->iptcData);
     d->statusPage->applyMetadata(d->iptcData);
-
+    d->originPage->applyMetadata(d->iptcData);
     saveSettings();
     accept();
 }
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptceditdialog.h #595151:595152
@@ -40,19 +40,6 @@
 
 public:
 
-    enum Page 
-    {
-        LastPageUsed = -1,
-        Caption = 0,
-        Keywords,
-        Categories,
-        Credits,
-        Status,
-        Origin
-    };
-
-public:
-
     IPTCEditDialog(QWidget* parent, QByteArray iptcData, const QString& fileName);
     ~IPTCEditDialog();
 
Comment 8 caulier.gilles 2006-10-13 15:49:57 UTC
SVN commit 595192 by cgilles:

kipiplugins from trunk : MetadataEdit plugin:

Added IPTC Date & Time informations in IPTC Edit dialog

CCMAIL: kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 M  +2 -1      Makefile.am  
 A             iptcdatetime.cpp   [License: GPL]
 A             iptcdatetime.h   [License: GPL]
 M  +38 -28    iptceditdialog.cpp  


--- trunk/extragear/libs/kipi-plugins/metadataedit/Makefile.am #595191:595192
@@ -11,7 +11,8 @@
 # Srcs for the plugin
 kipiplugin_metadataedit_la_SOURCES = plugin_metadataedit.cpp metadataeditdialog.cpp \
 	                                 metadataitem.cpp iptceditdialog.cpp iptccaption.cpp \
-	                                 iptccredits.cpp iptcstatus.cpp iptcorigin.cpp 
+	                                 iptccredits.cpp iptcstatus.cpp iptcorigin.cpp \
+	                                 iptcdatetime.cpp 
 
 # Libs needed by the plugin
 kipiplugin_metadataedit_la_LIBADD = $(top_builddir)/kipi-plugins/common/exiv2iface/libexiv2iface.la \
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptceditdialog.cpp #595191:595192
@@ -42,6 +42,7 @@
 #include "iptccredits.h"
 #include "iptcstatus.h"
 #include "iptcorigin.h"
+#include "iptcdatetime.h"
 #include "iptceditdialog.h"
 #include "iptceditdialog.moc"
 
@@ -55,28 +56,32 @@
 
     IPTCEditDialogDialogPrivate()
     {
-        page_caption = 0;
-        page_credits = 0;
-        page_status  = 0;
-        page_origin  = 0;
+        page_caption  = 0;
+        page_credits  = 0;
+        page_status   = 0;
+        page_origin   = 0;
+        page_datetime = 0;
 
-        captionPage  = 0;
-        creditsPage  = 0;
-        statusPage   = 0;
-        originPage   = 0;
+        captionPage   = 0;
+        creditsPage   = 0;
+        statusPage    = 0;
+        originPage    = 0;
+        datetimePage  = 0;
     }
 
     QByteArray   iptcData;
 
-    QFrame      *page_caption;
-    QFrame      *page_credits;
-    QFrame      *page_status;
-    QFrame      *page_origin;
+    QFrame       *page_caption;
+    QFrame       *page_credits;
+    QFrame       *page_status;
+    QFrame       *page_origin;
+    QFrame       *page_datetime;
 
-    IPTCCaption *captionPage;
-    IPTCCredits *creditsPage;
-    IPTCStatus  *statusPage;
-    IPTCOrigin  *originPage;
+    IPTCCaption  *captionPage;
+    IPTCCredits  *creditsPage;
+    IPTCStatus   *statusPage;
+    IPTCOrigin   *originPage;
+    IPTCDateTime *datetimePage;
 };
 
 IPTCEditDialog::IPTCEditDialog(QWidget* parent, QByteArray iptcData, const QString& fileName)
@@ -88,22 +93,26 @@
 
     setHelp("metadataedit", "kipi-plugins");
 
-    d->page_caption = addPage(i18n("Caption"), i18n("IPTC Caption Informations"),
-                              BarIcon("editclear", KIcon::SizeMedium));
-    d->captionPage  = new IPTCCaption(d->page_caption, d->iptcData);
+    d->page_caption  = addPage(i18n("Caption"), i18n("IPTC Caption Informations"),
+                               BarIcon("editclear", KIcon::SizeMedium));
+    d->captionPage   = new IPTCCaption(d->page_caption, d->iptcData);
 
-    d->page_credits = addPage(i18n("Credits"), i18n("IPTC Credits Informations"),
-                              BarIcon("identity", KIcon::SizeMedium));
-    d->creditsPage  = new IPTCCredits(d->page_credits, d->iptcData);
+    d->page_credits  = addPage(i18n("Credits"), i18n("IPTC Credits Informations"),
+                               BarIcon("identity", KIcon::SizeMedium));
+    d->creditsPage   = new IPTCCredits(d->page_credits, d->iptcData);
 
-    d->page_status  = addPage(i18n("Status"), i18n("IPTC Status Informations"),
-                              BarIcon("messagebox_info", KIcon::SizeMedium));
-    d->statusPage   = new IPTCStatus(d->page_status, d->iptcData);
+    d->page_status   = addPage(i18n("Status"), i18n("IPTC Status Informations"),
+                               BarIcon("messagebox_info", KIcon::SizeMedium));
+    d->statusPage    = new IPTCStatus(d->page_status, d->iptcData);
 
-    d->page_origin  = addPage(i18n("Origin"), i18n("IPTC Origin Informations"),
-                              BarIcon("www", KIcon::SizeMedium));
-    d->originPage   = new IPTCOrigin(d->page_origin, d->iptcData);
+    d->page_origin   = addPage(i18n("Origin"), i18n("IPTC Origin Informations"),
+                               BarIcon("www", KIcon::SizeMedium));
+    d->originPage    = new IPTCOrigin(d->page_origin, d->iptcData);
 
+    d->page_datetime = addPage(i18n("Date & Time"), i18n("IPTC Date and Time Informations"),
+                               BarIcon("today", KIcon::SizeMedium));
+    d->datetimePage  = new IPTCDateTime(d->page_datetime, d->iptcData);
+
     readSettings();
     show();
 }
@@ -154,6 +163,7 @@
     d->creditsPage->applyMetadata(d->iptcData);
     d->statusPage->applyMetadata(d->iptcData);
     d->originPage->applyMetadata(d->iptcData);
+    d->datetimePage->applyMetadata(d->iptcData);
     saveSettings();
     accept();
 }
Comment 9 caulier.gilles 2006-10-13 16:12:20 UTC
SVN commit 595205 by cgilles:

kipiplugins from trunk : MetadataEdit plugin:

Missing IPTC Contact and Subject tags.

CCMAIL: kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 M  +25 -9     iptccaption.cpp  
 M  +16 -1     iptccredits.cpp  


--- trunk/extragear/libs/kipi-plugins/metadataedit/iptccaption.cpp #595204:595205
@@ -50,11 +50,13 @@
     IPTCCaptionPriv()
     {
         captionEdit            = 0;
+        subjectEdit            = 0;
         writerEdit             = 0;
         headlineEdit           = 0;
         specialInstructionEdit = 0;
     }
 
+    KLineEdit *subjectEdit;
     KLineEdit *writerEdit;
     KLineEdit *headlineEdit;
 
@@ -86,36 +88,48 @@
 
     // --------------------------------------------------------
 
-    QLabel *label2 = new QLabel(i18n("Caption Writer:"), parent);
+    QLabel *label2 = new QLabel(i18n("Subject:"), parent);
+    d->subjectEdit = new KLineEdit(parent);
+    d->subjectEdit->setValidator(asciiValidator);
+    d->subjectEdit->setMaxLength(236);
+    label2->setBuddy(d->subjectEdit);
+    vlay->addWidget(label2);
+    vlay->addWidget(d->subjectEdit);
+    QWhatsThis::add(d->subjectEdit, i18n("<p>Set here the structured definition of the subject. "
+                    "This field is limited to 236 ASCII characters."));
+
+    // --------------------------------------------------------
+
+    QLabel *label3 = new QLabel(i18n("Caption Writer:"), parent);
     d->writerEdit  = new KLineEdit(parent);
     d->writerEdit->setValidator(asciiValidator);
     d->writerEdit->setMaxLength(32);
-    label2->setBuddy(d->writerEdit);
-    vlay->addWidget(label2);
+    label3->setBuddy(d->writerEdit);
+    vlay->addWidget(label3);
     vlay->addWidget(d->writerEdit);
     QWhatsThis::add(d->writerEdit, i18n("<p>Set here the person responsible for caption. This field is limited "
                                         "to 32 ASCII characters."));
         
     // --------------------------------------------------------
 
-    QLabel *label3  = new QLabel(i18n("Headline:"), parent);
+    QLabel *label4  = new QLabel(i18n("Headline:"), parent);
     d->headlineEdit = new KLineEdit(parent);
     d->headlineEdit->setValidator(asciiValidator);
     d->headlineEdit->setMaxLength(256);
-    label3->setBuddy(d->headlineEdit);
-    vlay->addWidget(label3);
+    label4->setBuddy(d->headlineEdit);
+    vlay->addWidget(label4);
     vlay->addWidget(d->headlineEdit);
     QWhatsThis::add(d->headlineEdit, i18n("<p>Set here the content synopsis. This field is limited "
                                           "to 256 ASCII characters."));
 
     // --------------------------------------------------------
 
-    QLabel *label4            = new QLabel(i18n("Special Instructions:"), parent);
+    QLabel *label5            = new QLabel(i18n("Special Instructions:"), parent);
     d->specialInstructionEdit = new KTextEdit(parent);
 /*    d->specialInstructionEdit->setValidator(asciiValidator);
     d->specialInstructionEdit->setMaxLength(256);*/
-    label4->setBuddy(d->specialInstructionEdit);
-    vlay->addWidget(label4);
+    label5->setBuddy(d->specialInstructionEdit);
+    vlay->addWidget(label5);
     vlay->addWidget(d->specialInstructionEdit);
     QWhatsThis::add(d->specialInstructionEdit, i18n("<p>Set here the editorial usage instructions. "
                                                     "This field is limited to 256 ASCII characters."));
@@ -142,6 +156,7 @@
     KIPIPlugins::Exiv2Iface exiv2Iface;
     exiv2Iface.setIptc(iptcData);
     d->captionEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Caption", false));
+    d->subjectEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Subject", false));
     d->writerEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Writer", false));
     d->headlineEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Headline", false));
     d->specialInstructionEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.SpecialInstructions", false));
@@ -152,6 +167,7 @@
     KIPIPlugins::Exiv2Iface exiv2Iface;
     exiv2Iface.setIptc(iptcData);
     exiv2Iface.setIptcTagString("Iptc.Application2.Caption", d->captionEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.Subject", d->subjectEdit->text());
     exiv2Iface.setIptcTagString("Iptc.Application2.Writer", d->writerEdit->text());
     exiv2Iface.setIptcTagString("Iptc.Application2.Headline", d->headlineEdit->text());
     exiv2Iface.setIptcTagString("Iptc.Application2.SpecialInstructions", d->specialInstructionEdit->text());
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptccredits.cpp #595204:595205
@@ -53,6 +53,7 @@
         bylineTitleEdit = 0;
         creditEdit      = 0;
         sourceEdit      = 0;
+        contactEdit     = 0;
     }
 
     KLineEdit *copyrightEdit;
@@ -60,6 +61,7 @@
     KLineEdit *bylineTitleEdit;
     KLineEdit *creditEdit;
     KLineEdit *sourceEdit;
+    KLineEdit *contactEdit;
 };
 
 IPTCCredits::IPTCCredits(QWidget* parent, QByteArray& iptcData)
@@ -134,6 +136,18 @@
 
     // --------------------------------------------------------
 
+    QLabel *label6 = new QLabel(i18n("Contact:"), parent);
+    d->contactEdit  = new KLineEdit(parent);
+    d->contactEdit->setValidator(asciiValidator);
+    d->contactEdit->setMaxLength(128);
+    label6->setBuddy(d->sourceEdit);
+    vlay->addWidget(label6);
+    vlay->addWidget(d->contactEdit);
+    QWhatsThis::add(d->contactEdit, i18n("<p>Set here the person or organisation to contact. "
+                                         "This field is limited to 128 ASCII characters."));
+
+    // --------------------------------------------------------
+
     QLabel *iptcNote = new QLabel(i18n("<b>Note: IPTC text tags only support printable "
                                        "ASCII characters set.</b>"), parent);
     vlay->addWidget(iptcNote);
@@ -158,6 +172,7 @@
     d->bylineTitleEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.BylineTitle", false));
     d->creditEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Credit", false));
     d->sourceEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Source", false));
+    d->contactEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.Contact", false));
 }
 
 void IPTCCredits::applyMetadata(QByteArray& iptcData)
@@ -168,7 +183,7 @@
     exiv2Iface.setIptcTagString("Iptc.Application2.Byline", d->bylineEdit->text());
     exiv2Iface.setIptcTagString("Iptc.Application2.BylineTitle", d->bylineTitleEdit->text());
     exiv2Iface.setIptcTagString("Iptc.Application2.Credit", d->creditEdit->text());
-    exiv2Iface.setIptcTagString("Iptc.Application2.Source", d->sourceEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.Source", d->sourceEdit->text());    exiv2Iface.setIptcTagString("Iptc.Application2.Contact", d->contactEdit->text());
     iptcData = exiv2Iface.getIptc();
 }
 
Comment 10 caulier.gilles 2006-10-13 16:32:44 UTC
SVN commit 595212 by cgilles:

kipiplugins from trunk : MetadataEdit plugin:

Missing IPTC LocationName and LocationCode tags.

CCMAIL: kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 M  +36 -5     iptcorigin.cpp  


--- trunk/extragear/libs/kipi-plugins/metadataedit/iptcorigin.cpp #595211:595212
@@ -52,6 +52,8 @@
         provinceEdit      = 0;
         countryEdit       = 0;
         countryCodeEdit   = 0;
+        locationEdit      = 0;
+        locationCodeEdit  = 0;
         originalTransEdit = 0;
     }
 
@@ -61,6 +63,8 @@
     KLineEdit *provinceEdit;
     KLineEdit *countryEdit;
     KLineEdit *countryCodeEdit;
+    KLineEdit *locationEdit;
+    KLineEdit *locationCodeEdit;
     KLineEdit *originalTransEdit;
 };
 
@@ -89,6 +93,30 @@
 
     // --------------------------------------------------------
 
+    QLabel *label2  = new QLabel(i18n("Location:"), parent);
+    d->locationEdit = new KLineEdit(parent);
+    d->locationEdit->setValidator(asciiValidator);
+    d->locationEdit->setMaxLength(64);
+    label2->setBuddy(d->locationEdit);
+    grid->addMultiCellWidget(label2, 2, 2, 0, 0);
+    grid->addMultiCellWidget(d->locationEdit, 2, 2, 1, 2);
+    QWhatsThis::add(d->locationEdit, i18n("<p>Set here the full country name referenced by the content. "
+                                          "This field is limited to 64 ASCII characters."));
+
+    // --------------------------------------------------------
+
+    QLabel *label3      = new QLabel(i18n("Location code:"), parent);
+    d->locationCodeEdit = new KLineEdit(parent);
+    d->locationCodeEdit->setValidator(asciiValidator);
+    d->locationCodeEdit->setMaxLength(3);
+    label3->setBuddy(d->locationCodeEdit);
+    grid->addMultiCellWidget(label3, 3, 3, 0, 0);
+    grid->addMultiCellWidget(d->locationCodeEdit, 3, 3, 1, 1);
+    QWhatsThis::add(d->locationCodeEdit, i18n("<p>Set here the ISO country code referenced by the content. "
+                                              "This field is limited to 3 ASCII characters."));
+
+    // --------------------------------------------------------
+
     QLabel *label4 = new QLabel(i18n("City:"), parent);
     d->cityEdit    = new KLineEdit(parent);
     d->cityEdit->setValidator(asciiValidator);
@@ -117,7 +145,7 @@
     d->provinceEdit = new KLineEdit(parent);
     d->provinceEdit->setValidator(asciiValidator);
     d->provinceEdit->setMaxLength(32);
-    label5->setBuddy(d->provinceEdit);
+    label6->setBuddy(d->provinceEdit);
     grid->addMultiCellWidget(label6, 8, 8, 0, 0);
     grid->addMultiCellWidget(d->provinceEdit, 8, 8, 1, 2);
     QWhatsThis::add(d->provinceEdit, i18n("<p>Set here the Province or State of content origin. "
@@ -129,10 +157,10 @@
     d->countryEdit = new KLineEdit(parent);
     d->countryEdit->setValidator(asciiValidator);
     d->countryEdit->setMaxLength(64);
-    label5->setBuddy(d->countryEdit);
+    label7->setBuddy(d->countryEdit);
     grid->addMultiCellWidget(label7, 9, 9, 0, 0);
     grid->addMultiCellWidget(d->countryEdit, 9, 9, 1, 2);
-    QWhatsThis::add(d->provinceEdit, i18n("<p>Set here the full country name of content origin. "
+    QWhatsThis::add(d->countryEdit, i18n("<p>Set here the full country name of content origin. "
                                           "This field is limited to 64 ASCII characters."));
 
     // --------------------------------------------------------
@@ -143,7 +171,7 @@
     d->countryCodeEdit->setMaxLength(3);
     label5->setBuddy(d->countryCodeEdit);
     grid->addMultiCellWidget(label8, 10, 10, 0, 0);
-    grid->addMultiCellWidget(d->countryCodeEdit, 10, 10, 1, 2);
+    grid->addMultiCellWidget(d->countryCodeEdit, 10, 10, 1, 1);
     QWhatsThis::add(d->countryCodeEdit, i18n("<p>Set here the ISO country code of content origin. "
                                              "This field is limited to 3 ASCII characters."));
 
@@ -183,6 +211,8 @@
     exiv2Iface.setIptc(iptcData);
 
     d->objectNameEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.ObjectName", false));
+    d->locationEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.LocationName", false));
+    d->locationCodeEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.LocationCode", false));
     d->cityEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.City", false));
     d->sublocationEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.SubLocation", false));
     d->provinceEdit->setText(exiv2Iface.getIptcTagString("Iptc.Application2.ProvinceState", false));
@@ -197,7 +227,8 @@
     exiv2Iface.setIptc(iptcData);
 
     exiv2Iface.setIptcTagString("Iptc.Application2.ObjectName", d->objectNameEdit->text());
-    exiv2Iface.setIptcTagString("Iptc.Application2.City", d->cityEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.LocationName", d->locationEdit->text());
+    exiv2Iface.setIptcTagString("Iptc.Application2.LocationCode", d->locationCodeEdit->text());    exiv2Iface.setIptcTagString("Iptc.Application2.City", d->cityEdit->text());
     exiv2Iface.setIptcTagString("Iptc.Application2.SubLocation", d->sublocationEdit->text());
     exiv2Iface.setIptcTagString("Iptc.Application2.ProvinceState", d->provinceEdit->text());
     exiv2Iface.setIptcTagString("Iptc.Application2.CountryName", d->countryEdit->text());
Comment 11 caulier.gilles 2006-10-15 18:32:17 UTC
SVN commit 595780 by cgilles:

kipi-plugins from trunk : MetadataEdit plugin : IPTC Keywords editor page is now implemented.

CCMAIL: digikam-devel@kde.org, kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 M  +1 -1      Makefile.am  
 M  +10 -0     iptceditdialog.cpp  
 A             iptckeywords.cpp   [License: GPL]
 A             iptckeywords.h   [License: GPL]


--- trunk/extragear/libs/kipi-plugins/metadataedit/Makefile.am #595779:595780
@@ -12,7 +12,7 @@
 kipiplugin_metadataedit_la_SOURCES = plugin_metadataedit.cpp metadataeditdialog.cpp \
 	                                 metadataitem.cpp iptceditdialog.cpp iptccaption.cpp \
 	                                 iptccredits.cpp iptcstatus.cpp iptcorigin.cpp \
-	                                 iptcdatetime.cpp 
+	                                 iptcdatetime.cpp iptckeywords.cpp 
 
 # Libs needed by the plugin
 kipiplugin_metadataedit_la_LIBADD = $(top_builddir)/kipi-plugins/common/exiv2iface/libexiv2iface.la \
--- trunk/extragear/libs/kipi-plugins/metadataedit/iptceditdialog.cpp #595779:595780
@@ -43,6 +43,7 @@
 #include "iptcstatus.h"
 #include "iptcorigin.h"
 #include "iptcdatetime.h"
+#include "iptckeywords.h"
 #include "iptceditdialog.h"
 #include "iptceditdialog.moc"
 
@@ -57,12 +58,14 @@
     IPTCEditDialogDialogPrivate()
     {
         page_caption  = 0;
+        page_keywords = 0;
         page_credits  = 0;
         page_status   = 0;
         page_origin   = 0;
         page_datetime = 0;
 
         captionPage   = 0;
+        keywordsPage  = 0;
         creditsPage   = 0;
         statusPage    = 0;
         originPage    = 0;
@@ -72,12 +75,14 @@
     QByteArray   iptcData;
 
     QFrame       *page_caption;
+    QFrame       *page_keywords;
     QFrame       *page_credits;
     QFrame       *page_status;
     QFrame       *page_origin;
     QFrame       *page_datetime;
 
     IPTCCaption  *captionPage;
+    IPTCKeywords *keywordsPage;
     IPTCCredits  *creditsPage;
     IPTCStatus   *statusPage;
     IPTCOrigin   *originPage;
@@ -97,6 +102,10 @@
                                BarIcon("editclear", KIcon::SizeMedium));
     d->captionPage   = new IPTCCaption(d->page_caption, d->iptcData);
 
+    d->page_keywords = addPage(i18n("Keywords"), i18n("IPTC Keywords Informations"),
+                               BarIcon("bookmark", KIcon::SizeMedium));
+    d->keywordsPage  = new IPTCKeywords(d->page_keywords, d->iptcData);
+
     d->page_credits  = addPage(i18n("Credits"), i18n("IPTC Credits Informations"),
                                BarIcon("identity", KIcon::SizeMedium));
     d->creditsPage   = new IPTCCredits(d->page_credits, d->iptcData);
@@ -160,6 +169,7 @@
 void IPTCEditDialog::slotOk()
 {
     d->captionPage->applyMetadata(d->iptcData);
+    d->keywordsPage->applyMetadata(d->iptcData);
     d->creditsPage->applyMetadata(d->iptcData);
     d->statusPage->applyMetadata(d->iptcData);
     d->originPage->applyMetadata(d->iptcData);
Comment 12 caulier.gilles 2006-10-16 09:38:59 UTC
SVN commit 595932 by cgilles:

kipi-plugins from trunk : MetadataEdit plugin : IPTC Categories editor page is now implemented.

CCMAIL: digikam-devel@kde.org, kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 A             iptccategories.cpp   [License: GPL]
 A             iptccategories.h   [License: GPL]
Comment 13 caulier.gilles 2006-10-16 11:03:06 UTC
SVN commit 595953 by cgilles:

kipi-plugins from trunk : MetadataEdit plugin : add ObjectType IPTC tag to status editor page.

CCBUGS: 91812, 133276, 103255

 M  +67 -12    iptcstatus.cpp  


--- trunk/extragear/libs/kipi-plugins/metadataedit/iptcstatus.cpp #595952:595953
@@ -50,12 +50,14 @@
     {
         priorityCB          = 0;
         objectCycleCB       = 0;
+        objectTypeCB        = 0;
         statusEdit          = 0;
         JobIDEdit           = 0;
         programEdit         = 0;
         programVersionEdit  = 0;
         priorityCheck       = 0;
         objectCycleCheck    = 0;
+        objectTypeCheck     = 0;
         statusCheck         = 0;
         JobIDCheck          = 0;
         programCheck        = 0;
@@ -63,6 +65,7 @@
     }
 
     QCheckBox *priorityCheck;
+    QCheckBox *objectTypeCheck;
     QCheckBox *objectCycleCheck;
     QCheckBox *statusCheck;
     QCheckBox *JobIDCheck;
@@ -71,8 +74,10 @@
 
     QComboBox *priorityCB;
     QComboBox *objectCycleCB;
+    QComboBox *objectTypeCB;
 
     KLineEdit *statusEdit;
+    KLineEdit *objectTypeDescEdit;
     KLineEdit *JobIDEdit;
     KLineEdit *programEdit;
     KLineEdit *programVersionEdit;
@@ -83,7 +88,7 @@
 {
     d = new IPTCStatusPriv;
 
-    QGridLayout* grid = new QGridLayout(parent, 11, 2, KDialog::spacingHint());
+    QGridLayout* grid = new QGridLayout(parent, 12, 2, KDialog::spacingHint());
 
     // IPTC only accept printable Ascii char.
     QRegExp asciiRx("[\x20-\x7F]+$");
@@ -121,21 +126,38 @@
 
     d->objectCycleCheck = new QCheckBox(i18n("Object Cycle:"), parent);
     d->objectCycleCB    = new QComboBox(false, parent);
-    d->objectCycleCB->insertItem(i18n("a: Morning"),   0);
-    d->objectCycleCB->insertItem(i18n("b: Afternoon"), 1);
-    d->objectCycleCB->insertItem(i18n("c: Evening"),   2);
+    d->objectCycleCB->insertItem(i18n("Morning"),   0);
+    d->objectCycleCB->insertItem(i18n("Afternoon"), 1);
+    d->objectCycleCB->insertItem(i18n("Evening"),   2);
     grid->addMultiCellWidget(d->objectCycleCheck, 3, 3, 0, 0);
     grid->addMultiCellWidget(d->objectCycleCB, 3, 3, 1, 1);
     QWhatsThis::add(d->objectCycleCB, i18n("<p>Select here the editorial cycle of content."));
       
     // --------------------------------------------------------
 
+    d->objectTypeCheck    = new QCheckBox(i18n("Object Type:"), parent);
+    d->objectTypeCB       = new QComboBox(false, parent);
+    d->objectTypeDescEdit = new KLineEdit(parent);
+    d->objectTypeDescEdit->setValidator(asciiValidator);
+    d->objectTypeDescEdit->setMaxLength(32);
+    d->objectTypeCB->insertItem(i18n("News"),     0);
+    d->objectTypeCB->insertItem(i18n("Data"),     1);
+    d->objectTypeCB->insertItem(i18n("Advisory"), 2);
+    grid->addMultiCellWidget(d->objectTypeCheck, 4, 4, 0, 0);
+    grid->addMultiCellWidget(d->objectTypeCB, 4, 4, 1, 1);
+    grid->addMultiCellWidget(d->objectTypeDescEdit, 4, 4, 2, 2);
+    QWhatsThis::add(d->objectTypeCB, i18n("<p>Select here the editorial type of content."));
+    QWhatsThis::add(d->objectTypeDescEdit, i18n("<p>Set here the editorial description of content. "
+                                                "This field is limited to 64 ASCII characters."));
+
+    // --------------------------------------------------------
+
     d->JobIDCheck = new QCheckBox(i18n("Job ID:"), parent);
     d->JobIDEdit  = new KLineEdit(parent);
     d->JobIDEdit->setValidator(asciiValidator);
     d->JobIDEdit->setMaxLength(32);
-    grid->addMultiCellWidget(d->JobIDCheck, 4, 4, 0, 2);
-    grid->addMultiCellWidget(d->JobIDEdit, 5, 5, 0, 2);
+    grid->addMultiCellWidget(d->JobIDCheck, 5, 5, 0, 2);
+    grid->addMultiCellWidget(d->JobIDEdit, 6, 6, 0, 2);
     QWhatsThis::add(d->JobIDEdit, i18n("<p>Set here the string that identifies content that recurs. "
                                        "This field is limited to 32 ASCII characters."));
 
@@ -145,8 +167,8 @@
     d->programEdit  = new KLineEdit(parent);
     d->programEdit->setValidator(asciiValidator);
     d->programEdit->setMaxLength(32);
-    grid->addMultiCellWidget(d->programCheck, 6, 6, 0, 2);
-    grid->addMultiCellWidget(d->programEdit, 7, 7, 0, 2);
+    grid->addMultiCellWidget(d->programCheck, 7, 7, 0, 2);
+    grid->addMultiCellWidget(d->programEdit, 8, 8, 0, 2);
     QWhatsThis::add(d->programEdit, i18n("<p>Set here the content creation program name. "
                                          "This field is limited to 32 ASCII characters."));
 
@@ -156,8 +178,8 @@
     d->programVersionEdit  = new KLineEdit(parent);
     d->programVersionEdit->setValidator(asciiValidator);
     d->programVersionEdit->setMaxLength(10);
-    grid->addMultiCellWidget(d->programVersionCheck, 8, 8, 0, 2);
-    grid->addMultiCellWidget(d->programVersionEdit, 9, 9, 0, 0);
+    grid->addMultiCellWidget(d->programVersionCheck, 9, 9, 0, 2);
+    grid->addMultiCellWidget(d->programVersionEdit, 10, 10, 0, 0);
     QWhatsThis::add(d->programVersionEdit, i18n("<p>Set here the content creation program version. "
                                                 "This field is limited to 10 ASCII characters."));
 
@@ -165,9 +187,9 @@
 
     QLabel *iptcNote = new QLabel(i18n("<b>Note: IPTC text tags only support printable "
                                        "ASCII characters set.</b>"), parent);
-    grid->addMultiCellWidget(iptcNote, 10, 10, 0, 2);
+    grid->addMultiCellWidget(iptcNote, 11, 11, 0, 2);
     grid->setColStretch(2, 10);                     
-    grid->setRowStretch(11, 10);                     
+    grid->setRowStretch(12, 10);                     
 
     // --------------------------------------------------------
 
@@ -177,6 +199,12 @@
     connect(d->objectCycleCheck, SIGNAL(toggled(bool)),
             d->objectCycleCB, SLOT(setEnabled(bool)));
 
+    connect(d->objectTypeCheck, SIGNAL(toggled(bool)),
+            d->objectTypeCB, SLOT(setEnabled(bool)));
+
+    connect(d->objectTypeCheck, SIGNAL(toggled(bool)),
+            d->objectTypeDescEdit, SLOT(setEnabled(bool)));
+
     connect(d->statusCheck, SIGNAL(toggled(bool)),
             d->statusEdit, SLOT(setEnabled(bool)));
 
@@ -213,6 +241,24 @@
     }
     d->statusEdit->setEnabled(d->statusCheck->isChecked());
 
+    data = exiv2Iface.getIptcTagString("Iptc.Application2.ObjectType", false);    
+    if (!data.isNull())
+    {
+        QString typeSec = data.section(":", 0, 0);
+        if (!typeSec.isEmpty())
+        {
+            int type = typeSec.toInt();
+            if (type < 3 && type >= 0)
+            {
+                d->objectTypeCB->setCurrentItem(type);
+                d->objectTypeDescEdit->setText(data.section(":", -1));
+                d->objectTypeCheck->setChecked(true);
+            }
+        }
+    }
+    d->objectTypeCB->setEnabled(d->objectTypeCheck->isChecked());
+    d->objectTypeDescEdit->setEnabled(d->objectTypeCheck->isChecked());
+
     data = exiv2Iface.getIptcTagString("Iptc.Application2.FixtureId", false);    
     if (!data.isNull())
     {
@@ -270,6 +316,15 @@
     else
         exiv2Iface.removeIptcTag("Iptc.Application2.EditStatus");
 
+    if (d->objectTypeCheck->isChecked())
+    {
+        QString objectType = QString("0%1:%2").arg(d->objectTypeCB->currentItem())
+                                              .arg(d->objectTypeDescEdit->text());
+        exiv2Iface.setIptcTagString("Iptc.Application2.ObjectType", objectType);
+    }
+    else
+        exiv2Iface.removeIptcTag("Iptc.Application2.ObjectType");
+
     if (d->JobIDCheck->isChecked())
         exiv2Iface.setIptcTagString("Iptc.Application2.FixtureId", d->JobIDEdit->text());
     else
Comment 14 caulier.gilles 2006-10-16 11:50:26 UTC
SVN commit 595961 by cgilles:

kipi-plugins from trunk : MetadataEdit plugin : add ObjectAttribute IPTC tag to status editor page.

CCBUGS: 91812, 133276, 103255

 M  +90 -16    iptcstatus.cpp  


--- trunk/extragear/libs/kipi-plugins/metadataedit/iptcstatus.cpp #595960:595961
@@ -67,6 +67,7 @@
     QCheckBox *priorityCheck;
     QCheckBox *objectTypeCheck;
     QCheckBox *objectCycleCheck;
+    QCheckBox *objectAttributeCheck;
     QCheckBox *statusCheck;
     QCheckBox *JobIDCheck;
     QCheckBox *programCheck;
@@ -75,9 +76,11 @@
     QComboBox *priorityCB;
     QComboBox *objectCycleCB;
     QComboBox *objectTypeCB;
+    QComboBox *objectAttributeCB;
 
     KLineEdit *statusEdit;
     KLineEdit *objectTypeDescEdit;
+    KLineEdit *objectAttributeDescEdit;
     KLineEdit *JobIDEdit;
     KLineEdit *programEdit;
     KLineEdit *programVersionEdit;
@@ -88,7 +91,7 @@
 {
     d = new IPTCStatusPriv;
 
-    QGridLayout* grid = new QGridLayout(parent, 12, 2, KDialog::spacingHint());
+    QGridLayout* grid = new QGridLayout(parent, 14, 2, KDialog::spacingHint());
 
     // IPTC only accept printable Ascii char.
     QRegExp asciiRx("[\x20-\x7F]+$");
@@ -139,25 +142,61 @@
     d->objectTypeCB       = new QComboBox(false, parent);
     d->objectTypeDescEdit = new KLineEdit(parent);
     d->objectTypeDescEdit->setValidator(asciiValidator);
-    d->objectTypeDescEdit->setMaxLength(32);
+    d->objectTypeDescEdit->setMaxLength(64);
     d->objectTypeCB->insertItem(i18n("News"),     0);
     d->objectTypeCB->insertItem(i18n("Data"),     1);
     d->objectTypeCB->insertItem(i18n("Advisory"), 2);
     grid->addMultiCellWidget(d->objectTypeCheck, 4, 4, 0, 0);
     grid->addMultiCellWidget(d->objectTypeCB, 4, 4, 1, 1);
-    grid->addMultiCellWidget(d->objectTypeDescEdit, 4, 4, 2, 2);
+    grid->addMultiCellWidget(d->objectTypeDescEdit, 5, 5, 0, 2);
     QWhatsThis::add(d->objectTypeCB, i18n("<p>Select here the editorial type of content."));
-    QWhatsThis::add(d->objectTypeDescEdit, i18n("<p>Set here the editorial description of content. "
+    QWhatsThis::add(d->objectTypeDescEdit, i18n("<p>Set here the editorial type description of content. "
                                                 "This field is limited to 64 ASCII characters."));
 
     // --------------------------------------------------------
 
+    d->objectAttributeCheck    = new QCheckBox(i18n("Object Attribute:"), parent);
+    d->objectAttributeCB       = new QComboBox(false, parent);
+    d->objectAttributeDescEdit = new KLineEdit(parent);
+    d->objectAttributeDescEdit->setValidator(asciiValidator);
+    d->objectAttributeDescEdit->setMaxLength(64);
+    d->objectAttributeCB->insertItem(i18n("Current"),                           0);
+    d->objectAttributeCB->insertItem(i18n("Analysis"),                          1);
+    d->objectAttributeCB->insertItem(i18n("Archive material"),                  2);
+    d->objectAttributeCB->insertItem(i18n("Background"),                        3);
+    d->objectAttributeCB->insertItem(i18n("Feature"),                           4);
+    d->objectAttributeCB->insertItem(i18n("Forecast"),                          5);
+    d->objectAttributeCB->insertItem(i18n("History"),                           6);
+    d->objectAttributeCB->insertItem(i18n("Obituary"),                          7);
+    d->objectAttributeCB->insertItem(i18n("Opinion"),                           8);
+    d->objectAttributeCB->insertItem(i18n("Polls & Surveys"),                   9);
+    d->objectAttributeCB->insertItem(i18n("Profile"),                           10);
+    d->objectAttributeCB->insertItem(i18n("Results Listings & Table"),          11);
+    d->objectAttributeCB->insertItem(i18n("Side bar & Supporting information"), 12);
+    d->objectAttributeCB->insertItem(i18n("Summary"),                           13);
+    d->objectAttributeCB->insertItem(i18n("Transcript & Verbatim"),             14);
+    d->objectAttributeCB->insertItem(i18n("Interview"),                         15);
+    d->objectAttributeCB->insertItem(i18n("From the Scene"),                    16);
+    d->objectAttributeCB->insertItem(i18n("Retrospective"),                     17);
+    d->objectAttributeCB->insertItem(i18n("Statistics"),                        18);
+    d->objectAttributeCB->insertItem(i18n("Update"),                            19);
+    d->objectAttributeCB->insertItem(i18n("Wrap-up"),                           20);
+    d->objectAttributeCB->insertItem(i18n("Press Release"),                     21);
+    grid->addMultiCellWidget(d->objectAttributeCheck, 6, 6, 0, 0);
+    grid->addMultiCellWidget(d->objectAttributeCB, 6, 6, 1, 2);
+    grid->addMultiCellWidget(d->objectAttributeDescEdit, 7, 7, 0, 2);
+    QWhatsThis::add(d->objectAttributeCB, i18n("<p>Select here the editorial attribute of content."));
+    QWhatsThis::add(d->objectAttributeDescEdit, i18n("<p>Set here the editorial attribute description of "
+                                                     "content. This field is limited to 64 ASCII characters."));
+
+    // --------------------------------------------------------
+
     d->JobIDCheck = new QCheckBox(i18n("Job ID:"), parent);
     d->JobIDEdit  = new KLineEdit(parent);
     d->JobIDEdit->setValidator(asciiValidator);
     d->JobIDEdit->setMaxLength(32);
-    grid->addMultiCellWidget(d->JobIDCheck, 5, 5, 0, 2);
-    grid->addMultiCellWidget(d->JobIDEdit, 6, 6, 0, 2);
+    grid->addMultiCellWidget(d->JobIDCheck, 8, 8, 0, 2);
+    grid->addMultiCellWidget(d->JobIDEdit, 9, 9, 0, 2);
     QWhatsThis::add(d->JobIDEdit, i18n("<p>Set here the string that identifies content that recurs. "
                                        "This field is limited to 32 ASCII characters."));
 
@@ -167,8 +206,8 @@
     d->programEdit  = new KLineEdit(parent);
     d->programEdit->setValidator(asciiValidator);
     d->programEdit->setMaxLength(32);
-    grid->addMultiCellWidget(d->programCheck, 7, 7, 0, 2);
-    grid->addMultiCellWidget(d->programEdit, 8, 8, 0, 2);
+    grid->addMultiCellWidget(d->programCheck, 10, 10, 0, 2);
+    grid->addMultiCellWidget(d->programEdit, 11, 11, 0, 2);
     QWhatsThis::add(d->programEdit, i18n("<p>Set here the content creation program name. "
                                          "This field is limited to 32 ASCII characters."));
 
@@ -178,8 +217,8 @@
     d->programVersionEdit  = new KLineEdit(parent);
     d->programVersionEdit->setValidator(asciiValidator);
     d->programVersionEdit->setMaxLength(10);
-    grid->addMultiCellWidget(d->programVersionCheck, 9, 9, 0, 2);
-    grid->addMultiCellWidget(d->programVersionEdit, 10, 10, 0, 0);
+    grid->addMultiCellWidget(d->programVersionCheck, 12, 12, 0, 2);
+    grid->addMultiCellWidget(d->programVersionEdit, 13, 13, 0, 0);
     QWhatsThis::add(d->programVersionEdit, i18n("<p>Set here the content creation program version. "
                                                 "This field is limited to 10 ASCII characters."));
 
@@ -187,9 +226,9 @@
 
     QLabel *iptcNote = new QLabel(i18n("<b>Note: IPTC text tags only support printable "
                                        "ASCII characters set.</b>"), parent);
-    grid->addMultiCellWidget(iptcNote, 11, 11, 0, 2);
+    grid->addMultiCellWidget(iptcNote, 14, 14, 0, 2);
     grid->setColStretch(2, 10);                     
-    grid->setRowStretch(12, 10);                     
+    grid->setRowStretch(14, 10);                     
 
     // --------------------------------------------------------
 
@@ -205,6 +244,12 @@
     connect(d->objectTypeCheck, SIGNAL(toggled(bool)),
             d->objectTypeDescEdit, SLOT(setEnabled(bool)));
 
+    connect(d->objectAttributeCheck, SIGNAL(toggled(bool)),
+            d->objectAttributeCB, SLOT(setEnabled(bool)));
+
+    connect(d->objectAttributeCheck, SIGNAL(toggled(bool)),
+            d->objectAttributeDescEdit, SLOT(setEnabled(bool)));
+
     connect(d->statusCheck, SIGNAL(toggled(bool)),
             d->statusEdit, SLOT(setEnabled(bool)));
 
@@ -247,7 +292,7 @@
         QString typeSec = data.section(":", 0, 0);
         if (!typeSec.isEmpty())
         {
-            int type = typeSec.toInt();
+            int type = typeSec.toInt()-1;
             if (type < 3 && type >= 0)
             {
                 d->objectTypeCB->setCurrentItem(type);
@@ -259,6 +304,24 @@
     d->objectTypeCB->setEnabled(d->objectTypeCheck->isChecked());
     d->objectTypeDescEdit->setEnabled(d->objectTypeCheck->isChecked());
 
+    data = exiv2Iface.getIptcTagString("Iptc.Application2.ObjectAttribute", false);    
+    if (!data.isNull())
+    {
+        QString attSec = data.section(":", 0, 0);
+        if (!attSec.isEmpty())
+        {
+            int att = attSec.toInt()-1;
+            if (att < 21 && att >= 0)
+            {
+                d->objectAttributeCB->setCurrentItem(att);
+                d->objectAttributeDescEdit->setText(data.section(":", -1));
+                d->objectAttributeCheck->setChecked(true);
+            }
+        }
+    }
+    d->objectAttributeCB->setEnabled(d->objectAttributeCheck->isChecked());
+    d->objectAttributeDescEdit->setEnabled(d->objectAttributeCheck->isChecked());
+
     data = exiv2Iface.getIptcTagString("Iptc.Application2.FixtureId", false);    
     if (!data.isNull())
     {
@@ -318,13 +381,24 @@
 
     if (d->objectTypeCheck->isChecked())
     {
-        QString objectType = QString("0%1:%2").arg(d->objectTypeCB->currentItem())
-                                              .arg(d->objectTypeDescEdit->text());
+        QString objectType;
+        objectType.sprintf("%2d", d->objectTypeCB->currentItem()+1);
+        objectType.append(QString(":%1").arg(d->objectTypeDescEdit->text()));
         exiv2Iface.setIptcTagString("Iptc.Application2.ObjectType", objectType);
     }
     else
-        exiv2Iface.removeIptcTag("Iptc.Application2.ObjectType");
+        exiv2Iface.removeIptcTag("Iptc.Application2.ObjectAttribute");
 
+    if (d->objectAttributeCheck->isChecked())
+    {
+        QString objectAttribute;
+        objectAttribute.sprintf("%3d", d->objectAttributeCB->currentItem()+1);
+        objectAttribute.append(QString(":%1").arg(d->objectAttributeDescEdit->text()));
+        exiv2Iface.setIptcTagString("Iptc.Application2.ObjectAttribute", objectAttribute);
+    }
+    else
+        exiv2Iface.removeIptcTag("Iptc.Application2.ObjectAttribute");
+
     if (d->JobIDCheck->isChecked())
         exiv2Iface.setIptcTagString("Iptc.Application2.FixtureId", d->JobIDEdit->text());
     else
Comment 15 caulier.gilles 2006-10-16 13:07:25 UTC
SVN commit 595975 by cgilles:

kipi-plugins from trunk : MetadataEdit plugin : polish source code : set automaticly IPTC Program/version tags

CCBUGS: 91812, 133276, 103255

 M  +7 -66     iptcstatus.cpp  


--- trunk/extragear/libs/kipi-plugins/metadataedit/iptcstatus.cpp #595974:595975
@@ -35,6 +35,7 @@
 
 // Local includes.
 
+#include "pluginsversion.h"
 #include "exiv2iface.h"
 #include "iptcstatus.h"
 #include "iptcstatus.moc"
@@ -53,15 +54,11 @@
         objectTypeCB        = 0;
         statusEdit          = 0;
         JobIDEdit           = 0;
-        programEdit         = 0;
-        programVersionEdit  = 0;
         priorityCheck       = 0;
         objectCycleCheck    = 0;
         objectTypeCheck     = 0;
         statusCheck         = 0;
         JobIDCheck          = 0;
-        programCheck        = 0;
-        programVersionCheck = 0;
     }
 
     QCheckBox *priorityCheck;
@@ -70,8 +67,6 @@
     QCheckBox *objectAttributeCheck;
     QCheckBox *statusCheck;
     QCheckBox *JobIDCheck;
-    QCheckBox *programCheck;
-    QCheckBox *programVersionCheck;
 
     QComboBox *priorityCB;
     QComboBox *objectCycleCB;
@@ -82,8 +77,6 @@
     KLineEdit *objectTypeDescEdit;
     KLineEdit *objectAttributeDescEdit;
     KLineEdit *JobIDEdit;
-    KLineEdit *programEdit;
-    KLineEdit *programVersionEdit;
 };
 
 IPTCStatus::IPTCStatus(QWidget* parent, QByteArray& iptcData)
@@ -91,7 +84,7 @@
 {
     d = new IPTCStatusPriv;
 
-    QGridLayout* grid = new QGridLayout(parent, 14, 2, KDialog::spacingHint());
+    QGridLayout* grid = new QGridLayout(parent, 11, 2, KDialog::spacingHint());
 
     // IPTC only accept printable Ascii char.
     QRegExp asciiRx("[\x20-\x7F]+$");
@@ -191,7 +184,7 @@
 
     // --------------------------------------------------------
 
-    d->JobIDCheck = new QCheckBox(i18n("Job ID:"), parent);
+    d->JobIDCheck = new QCheckBox(i18n("Job Identification:"), parent);
     d->JobIDEdit  = new KLineEdit(parent);
     d->JobIDEdit->setValidator(asciiValidator);
     d->JobIDEdit->setMaxLength(32);
@@ -202,33 +195,11 @@
 
     // --------------------------------------------------------
 
-    d->programCheck = new QCheckBox(i18n("Program:"), parent);
-    d->programEdit  = new KLineEdit(parent);
-    d->programEdit->setValidator(asciiValidator);
-    d->programEdit->setMaxLength(32);
-    grid->addMultiCellWidget(d->programCheck, 10, 10, 0, 2);
-    grid->addMultiCellWidget(d->programEdit, 11, 11, 0, 2);
-    QWhatsThis::add(d->programEdit, i18n("<p>Set here the content creation program name. "
-                                         "This field is limited to 32 ASCII characters."));
-
-    // --------------------------------------------------------
-
-    d->programVersionCheck = new QCheckBox(i18n("Program Version:"), parent);
-    d->programVersionEdit  = new KLineEdit(parent);
-    d->programVersionEdit->setValidator(asciiValidator);
-    d->programVersionEdit->setMaxLength(10);
-    grid->addMultiCellWidget(d->programVersionCheck, 12, 12, 0, 2);
-    grid->addMultiCellWidget(d->programVersionEdit, 13, 13, 0, 0);
-    QWhatsThis::add(d->programVersionEdit, i18n("<p>Set here the content creation program version. "
-                                                "This field is limited to 10 ASCII characters."));
-
-    // --------------------------------------------------------
-
     QLabel *iptcNote = new QLabel(i18n("<b>Note: IPTC text tags only support printable "
                                        "ASCII characters set.</b>"), parent);
-    grid->addMultiCellWidget(iptcNote, 14, 14, 0, 2);
+    grid->addMultiCellWidget(iptcNote, 10, 10, 0, 2);
     grid->setColStretch(2, 10);                     
-    grid->setRowStretch(14, 10);                     
+    grid->setRowStretch(11, 10);                     
 
     // --------------------------------------------------------
 
@@ -256,12 +227,6 @@
     connect(d->JobIDCheck, SIGNAL(toggled(bool)),
             d->JobIDEdit, SLOT(setEnabled(bool)));
 
-    connect(d->programCheck, SIGNAL(toggled(bool)),
-            d->programEdit, SLOT(setEnabled(bool)));
-
-    connect(d->programVersionCheck, SIGNAL(toggled(bool)),
-            d->programVersionEdit, SLOT(setEnabled(bool)));
-
     // --------------------------------------------------------
 
     readMetadata(iptcData);
@@ -330,22 +295,6 @@
     }
     d->JobIDEdit->setEnabled(d->JobIDCheck->isChecked());
 
-    data = exiv2Iface.getIptcTagString("Iptc.Application2.Program", false);    
-    if (!data.isNull())
-    {
-        d->programEdit->setText(data);
-        d->programCheck->setChecked(true);
-    }
-    d->programEdit->setEnabled(d->programCheck->isChecked());
-
-    data = exiv2Iface.getIptcTagString("Iptc.Application2.ProgramVersion", false);    
-    if (!data.isNull())
-    {
-        d->programVersionEdit->setText(data);
-        d->programVersionCheck->setChecked(true);
-    }
-    d->programVersionEdit->setEnabled(d->programVersionCheck->isChecked());
-
     data = exiv2Iface.getIptcTagString("Iptc.Application2.Urgency", false);    
     if (!data.isNull())
     {
@@ -404,16 +353,6 @@
     else
         exiv2Iface.removeIptcTag("Iptc.Application2.FixtureId");
 
-    if (d->programCheck->isChecked())
-        exiv2Iface.setIptcTagString("Iptc.Application2.Program", d->programEdit->text());
-    else
-        exiv2Iface.removeIptcTag("Iptc.Application2.Program");
-
-    if (d->programVersionCheck->isChecked())
-        exiv2Iface.setIptcTagString("Iptc.Application2.ProgramVersion", d->programVersionEdit->text());
-    else
-        exiv2Iface.removeIptcTag("Iptc.Application2.ProgramVersion");
-
     if (d->priorityCheck->isChecked())
         exiv2Iface.setIptcTagString("Iptc.Application2.Urgency", QString::number(d->priorityCB->currentItem()));
     else
@@ -439,6 +378,8 @@
     else
         exiv2Iface.removeIptcTag("Iptc.Application2.ObjectCycle");
 
+    exiv2Iface.setImageProgramId(QString("Kipi MetadataEdit"), QString(kipiplugins_version));
+
     iptcData = exiv2Iface.getIptc();
 }
 
Comment 16 caulier.gilles 2006-10-17 10:36:32 UTC
SVN commit 596354 by cgilles:

kipiplugins from trunk : MetadataEdit plugin: IPTC Origin informations editor now support all country codes define by ISO-3166 norm.

CCMAIL: kde-imaging@kde.org
CCBUGS: 91812, 133276, 103255

 M  +340 -103  iptcorigin.cpp  
Comment 17 caulier.gilles 2006-12-11 14:56:17 UTC
The TimeAdjust kipi-plugin have been improved in this way :

http://digikam3rdparty.free.fr/Screenshots/digikam0.9.0-timeadjustkipiplugin.png

I close this file now.

Gilles Caulier