File indexing completed on 2025-01-05 03:57:18
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2009-07-06 0007 * Description : metadata template settings panel. 0008 * 0009 * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #include "templatepanel.h" 0016 0017 // Qt includes 0018 0019 #include <QLabel> 0020 #include <QGridLayout> 0021 #include <QFrame> 0022 #include <QIcon> 0023 #include <QLineEdit> 0024 #include <QApplication> 0025 #include <QStyle> 0026 0027 // KDE includes 0028 0029 #include <klocalizedstring.h> 0030 0031 // Local includes 0032 0033 #include "templatelist.h" 0034 #include "subjectedit.h" 0035 #include "dtextedit.h" 0036 #include "altlangstredit.h" 0037 #include "countryselector.h" 0038 #include "digikam_globals.h" 0039 0040 namespace Digikam 0041 { 0042 0043 class Q_DECL_HIDDEN TemplatePanel::Private 0044 { 0045 0046 public: 0047 0048 explicit Private() 0049 : authorsEdit (nullptr), 0050 authorsPositionEdit (nullptr), 0051 creditEdit (nullptr), 0052 sourceEdit (nullptr), 0053 instructionsEdit (nullptr), 0054 copyrightEdit (nullptr), 0055 rightUsageEdit (nullptr), 0056 locationCountryCodeEdit (nullptr), 0057 locationProvinceStateEdit (nullptr), 0058 locationCityEdit (nullptr), 0059 locationSublocationEdit (nullptr), 0060 contactCityEdit (nullptr), 0061 contactCountryEdit (nullptr), 0062 contactAddressEdit (nullptr), 0063 contactPostalCodeEdit (nullptr), 0064 contactProvinceStateEdit (nullptr), 0065 contactEmailEdit (nullptr), 0066 contactPhoneEdit (nullptr), 0067 contactWebUrlEdit (nullptr), 0068 subjects (nullptr) 0069 { 0070 } 0071 0072 /// Rights template information panel. 0073 QLineEdit* authorsEdit; 0074 DTextEdit* authorsPositionEdit; 0075 DTextEdit* creditEdit; 0076 DTextEdit* sourceEdit; 0077 DTextEdit* instructionsEdit; 0078 0079 AltLangStrEdit* copyrightEdit; 0080 AltLangStrEdit* rightUsageEdit; 0081 0082 /// Location template information panel. 0083 CountrySelector* locationCountryCodeEdit; 0084 QLineEdit* locationProvinceStateEdit; 0085 QLineEdit* locationCityEdit; 0086 QLineEdit* locationSublocationEdit; 0087 0088 /// Contact template information panel. 0089 QLineEdit* contactCityEdit; 0090 QLineEdit* contactCountryEdit; 0091 QLineEdit* contactAddressEdit; 0092 QLineEdit* contactPostalCodeEdit; 0093 QLineEdit* contactProvinceStateEdit; 0094 QLineEdit* contactEmailEdit; 0095 QLineEdit* contactPhoneEdit; 0096 QLineEdit* contactWebUrlEdit; 0097 0098 //// Subjects template information panel. 0099 SubjectEdit* subjects; 0100 }; 0101 0102 TemplatePanel::TemplatePanel(QWidget* const parent) 0103 : QTabWidget(parent), 0104 d (new Private) 0105 { 0106 // -- Rights Template information panel ------------------------------------------------------------- 0107 0108 QWidget* const page1 = new QWidget(this); 0109 QGridLayout* const grid1 = new QGridLayout(page1); 0110 0111 QLabel* const label1 = new QLabel(i18n("Author Names:"), page1); 0112 d->authorsEdit = new QLineEdit(page1); 0113 d->authorsEdit->setClearButtonEnabled(true); 0114 d->authorsEdit->setPlaceholderText(i18n("Enter the names of the photograph's creators. Use semi-colons as separator here.")); 0115 label1->setBuddy(d->authorsEdit); 0116 d->authorsEdit->setWhatsThis(i18n("<p>This field should contain the names of the persons who created the photograph. " 0117 "If it is not appropriate to add the name of the photographer (for example, if the identity of " 0118 "the photographer needs to be protected) the name of a company or organization can also be used. " 0119 "Once saved, this field should not be changed by anyone.</p>" 0120 "<p>To enter more than one name, use <b>semi-colons as separators</b>.</p>" 0121 "<p>With IPTC, this field is limited to 32 characters.</p>")); 0122 0123 // -------------------------------------------------------- 0124 0125 QLabel* const label2 = new QLabel(i18n("Authors' Positions:"), page1); 0126 d->authorsPositionEdit = new DTextEdit(page1); 0127 d->authorsPositionEdit->setPlaceholderText(i18n("Enter the job titles of the authors here.")); 0128 label2->setBuddy(d->authorsPositionEdit); 0129 d->authorsPositionEdit->setWhatsThis(i18n("<p>This field should contain the job titles of the authors. Examples might include " 0130 "titles such as: Staff Photographer, Freelance Photographer, or Independent Commercial " 0131 "Photographer. Since this is a qualifier for the Author field, the Author field must also " 0132 "be filled out.</p>" 0133 "<p>With IPTC, this field is limited to 32 characters.</p>")); 0134 0135 // -------------------------------------------------------- 0136 0137 QLabel* const label3 = new QLabel(i18n("Credit:"), page1); 0138 d->creditEdit = new DTextEdit(page1); 0139 d->creditEdit->setPlaceholderText(i18n("Enter the photograph credit here.")); 0140 label3->setBuddy(d->creditEdit); 0141 d->creditEdit->setWhatsThis(i18n("<p>(synonymous to Provider): Use the Provider field to identify who is providing the photograph. " 0142 "This does not necessarily have to be the author. If a photographer is working for a news agency " 0143 "such as Reuters or the Associated Press, these organizations could be listed here as they are " 0144 "\"providing\" the image for use by others. If the image is a stock photograph, then the group " 0145 "(agency) involved in supplying the image should be listed here.</p>" 0146 "<p>With IPTC, this field is limited to 32 characters.</p>")); 0147 0148 // -------------------------------------------------------- 0149 0150 d->copyrightEdit = new AltLangStrEdit(page1); 0151 d->copyrightEdit->setTitle(i18n("Copyright:")); 0152 d->copyrightEdit->setFixedHeight(75); 0153 d->copyrightEdit->setPlaceholderText(i18n("Enter the copyright notice to identify the current owner(s) of the copyright here.")); 0154 d->copyrightEdit->setWhatsThis(i18n("<p>The Copyright Notice should contain any necessary copyright notice for claiming the intellectual " 0155 "property, and should identify the current owner(s) of the copyright for the photograph. Usually, " 0156 "this would be the photographer, but if the image was done by an employee or as work-for-hire, " 0157 "then the agency or company should be listed. Use the form appropriate to your country. USA: " 0158 "© {date of first publication} name of copyright owner, as in \"©2005 John Doe.\" " 0159 "Note, the word \"copyright\" or the abbreviation \"copr\" may be used in place of the © symbol. " 0160 "In some foreign countries only the copyright symbol is recognized and the abbreviation does not work. " 0161 "Furthermore the copyright symbol must be a full circle with a \"c\" inside; using something like (c) " 0162 "where the parentheses form a partial circle is not sufficient. For additional protection worldwide, " 0163 "use of the phrase, \"all rights reserved\" following the notice above is encouraged. \nIn Europe " 0164 "you would use: Copyright {Year} {Copyright owner}, all rights reserved. \nIn Japan, for maximum " 0165 "protection, the following three items should appear in the copyright field of the IPTC Core: " 0166 "(a) the word, Copyright; (b) year of the first publication; and (c) name of the author. " 0167 "You may also wish to include the phrase \"all rights reserved\".</p>" 0168 "<p>With XMP, you can include more than one copyright string using different languages.</p>" 0169 "<p>With IPTC, this field is limited to 128 characters.</p>")); 0170 0171 // -------------------------------------------------------- 0172 0173 d->rightUsageEdit = new AltLangStrEdit(page1); 0174 d->rightUsageEdit->setTitle(i18n("Right Usage Terms:")); 0175 d->rightUsageEdit->setFixedHeight(75); 0176 d->rightUsageEdit->setPlaceholderText(i18n("Enter the list of instructions on how a resource can be legally used here.")); 0177 d->rightUsageEdit->setWhatsThis(i18n("<p>The Right Usage Terms field should be used to list instructions on how " 0178 "a resource can be legally used.</p>" 0179 "<p>With XMP, you can include more than one right usage terms string using " 0180 "different languages.</p>" 0181 "<p>This field does not exist with IPTC.</p>")); 0182 0183 // -------------------------------------------------------- 0184 0185 QLabel* const label6 = new QLabel(i18nc("@label: template properties", "Source:"), page1); 0186 d->sourceEdit = new DTextEdit(page1); 0187 d->sourceEdit->setPlaceholderText(i18n("Enter the original owner of the photograph here.")); 0188 label6->setBuddy(d->sourceEdit); 0189 d->sourceEdit->setWhatsThis(i18n("<p>The Source field should be used to identify the original owner or copyright holder of the " 0190 "photograph. The value of this field should never be changed after the information is entered " 0191 "following the image's creation. While not yet enforced by the custom panels, you should consider " 0192 "this to be a \"write-once\" field. The source could be an individual, an agency, or a " 0193 "member of an agency. To aid in later searches, it is suggested to separate any slashes " 0194 "\"/\" with a blank space. Use the form \"photographer / agency\" rather than " 0195 "\"photographer/agency.\" Source may also be different from Creator and from the names " 0196 "listed in the Copyright Notice.</p>" 0197 "<p>With IPTC, this field is limited to 32 characters.</p>")); 0198 0199 // -------------------------------------------------------- 0200 0201 QLabel* const label7 = new QLabel(i18n("Instructions:"), page1); 0202 d->instructionsEdit = new DTextEdit(page1); 0203 d->instructionsEdit->setPlaceholderText(i18n("Enter the editorial notice here.")); 0204 label7->setBuddy(d->instructionsEdit); 0205 d->instructionsEdit->setWhatsThis(i18n("<p>The Instructions field should be used to list editorial " 0206 "instructions concerning the use of photograph.</p>" 0207 "<p>With IPTC, this field is limited to 256 characters.</p>")); 0208 0209 // -------------------------------------------------------- 0210 0211 const int spacing = qMin(QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing), 0212 QApplication::style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing)); 0213 0214 grid1->setContentsMargins(spacing, spacing, spacing, spacing); 0215 grid1->setSpacing(spacing); 0216 grid1->setAlignment(Qt::AlignTop); 0217 grid1->setColumnStretch(1, 10); 0218 grid1->addWidget(label1, 0, 0, 1, 1); 0219 grid1->addWidget(d->authorsEdit, 0, 1, 1, 2); 0220 grid1->addWidget(label2, 1, 0, 1, 2); 0221 grid1->addWidget(d->authorsPositionEdit, 2, 0, 1, 2); 0222 grid1->addWidget(label3, 3, 0, 1, 2); 0223 grid1->addWidget(d->creditEdit, 4, 0, 1, 2); 0224 grid1->addWidget(d->copyrightEdit, 5, 0, 1, 2); 0225 grid1->addWidget(d->rightUsageEdit, 6, 0, 1, 2); 0226 grid1->addWidget(label6, 7, 0, 1, 2); 0227 grid1->addWidget(d->sourceEdit, 8, 0, 1, 2); 0228 grid1->addWidget(label7, 9, 0, 1, 2); 0229 grid1->addWidget(d->instructionsEdit, 10, 0, 1, 2); 0230 0231 insertTab(RIGHTS, page1, QIcon::fromTheme(QLatin1String("flag")), i18n("Rights")); 0232 0233 // -- Location Template information panel ------------------------------------------------------------- 0234 0235 QWidget* const page2 = new QWidget(this); 0236 0237 // -------------------------------------------------------- 0238 0239 QLabel* const label9 = new QLabel(i18n("City:")); 0240 d->locationCityEdit = new QLineEdit; 0241 d->locationCityEdit->setClearButtonEnabled(true); 0242 d->locationCityEdit->setPlaceholderText(i18n("Enter the city of contents here.")); 0243 label9->setBuddy(d->locationCityEdit); 0244 d->locationCityEdit->setWhatsThis(i18n("<p>This field should contain the name of the city " 0245 "where the photograph was taken.</p>")); 0246 0247 // -------------------------------------------------------- 0248 0249 QLabel* const label10 = new QLabel(i18n("Sublocation:")); 0250 d->locationSublocationEdit = new QLineEdit; 0251 d->locationSublocationEdit->setClearButtonEnabled(true); 0252 d->locationSublocationEdit->setPlaceholderText(i18n("Enter the city sublocation of contents here.")); 0253 label10->setBuddy(d->locationSublocationEdit); 0254 d->locationSublocationEdit->setWhatsThis(i18n("<p>This field should contain the sublocation of the city " 0255 "where the photograph was taken.</p>")); 0256 0257 // -------------------------------------------------------- 0258 0259 QLabel* const label11 = new QLabel(i18n("State/Province:")); 0260 d->locationProvinceStateEdit = new QLineEdit; 0261 d->locationProvinceStateEdit->setClearButtonEnabled(true); 0262 d->locationProvinceStateEdit->setPlaceholderText(i18n("Enter the province or state of contents here.")); 0263 label11->setBuddy(d->locationProvinceStateEdit); 0264 d->locationProvinceStateEdit->setWhatsThis(i18n("<p>This field should contain the province or state " 0265 "where the photograph was taken.</p>")); 0266 0267 // -------------------------------------------------------- 0268 0269 QLabel* const label12 = new QLabel(i18n("Country:")); 0270 d->locationCountryCodeEdit = new CountrySelector(page2); 0271 label12->setBuddy(d->locationCountryCodeEdit); 0272 d->locationCountryCodeEdit->setWhatsThis(i18n("<p>Select here the country " 0273 "where the photograph was taken.</p>")); 0274 0275 // -------------------------------------------------------- 0276 0277 QGridLayout* grid2 = new QGridLayout; 0278 grid2->addWidget(label9, 0, 0, 1, 1); 0279 grid2->addWidget(d->locationCityEdit, 0, 1, 1, 2); 0280 grid2->addWidget(label10, 1, 0, 1, 1); 0281 grid2->addWidget(d->locationSublocationEdit, 1, 1, 1, 2); 0282 grid2->addWidget(label11, 2, 0, 1, 1); 0283 grid2->addWidget(d->locationProvinceStateEdit, 2, 1, 1, 2); 0284 grid2->addWidget(label12, 3, 0, 1, 1); 0285 grid2->addWidget(d->locationCountryCodeEdit, 3, 1, 1, 2); 0286 grid2->setContentsMargins(spacing, spacing, spacing, spacing); 0287 grid2->setSpacing(spacing); 0288 grid2->setAlignment(Qt::AlignTop); 0289 grid2->setColumnStretch(1, 10); 0290 grid2->setRowStretch(4, 10); 0291 page2->setLayout(grid2); 0292 0293 page2->setTabOrder(d->locationCityEdit, d->locationSublocationEdit); 0294 page2->setTabOrder(d->locationSublocationEdit, d->locationProvinceStateEdit); 0295 page2->setTabOrder(d->locationProvinceStateEdit, d->locationCountryCodeEdit); 0296 0297 insertTab(LOCATION, page2, QIcon::fromTheme(QLatin1String("globe")), i18n("Location")); 0298 0299 // -- Contact Template information panel ------------------------------------------------------------- 0300 0301 QWidget* const page3 = new QWidget(this); 0302 0303 QLabel* const label13 = new QLabel(i18n("City:"), page3); 0304 d->contactCityEdit = new QLineEdit(page3); 0305 d->contactCityEdit->setClearButtonEnabled(true); 0306 d->contactCityEdit->setPlaceholderText(i18n("Enter the city name of the lead author here.")); 0307 label13->setBuddy(d->contactCityEdit); 0308 d->contactCityEdit->setWhatsThis(i18n("<p>This field should contain the city name " 0309 "where the lead author lives.</p>")); 0310 0311 // -------------------------------------------------------- 0312 0313 QLabel* const label14 = new QLabel(i18n("Country:"), page3); 0314 d->contactCountryEdit = new QLineEdit(page3); 0315 d->contactCountryEdit->setClearButtonEnabled(true); 0316 d->contactCountryEdit->setPlaceholderText(i18n("Enter the country name of the lead author here.")); 0317 label14->setBuddy(d->contactCountryEdit); 0318 d->contactCountryEdit->setWhatsThis(i18n("<p>This field should contain the country name " 0319 "where the lead author lives.</p>")); 0320 0321 // -------------------------------------------------------- 0322 0323 QLabel* const label15 = new QLabel(i18nc("@label: template properties", "Address:"), page3); 0324 d->contactAddressEdit = new QLineEdit(page3); 0325 d->contactAddressEdit->setClearButtonEnabled(true); 0326 d->contactAddressEdit->setPlaceholderText(i18n("Enter the address of the lead author here.")); 0327 label15->setBuddy(d->contactAddressEdit); 0328 d->contactAddressEdit->setWhatsThis(i18n("<p>This field should contain the address " 0329 "where the lead author lives.</p>")); 0330 0331 // -------------------------------------------------------- 0332 0333 QLabel* const label16 = new QLabel(i18n("Postal Code:"), page3); 0334 d->contactPostalCodeEdit = new QLineEdit(page3); 0335 d->contactPostalCodeEdit->setClearButtonEnabled(true); 0336 d->contactPostalCodeEdit->setPlaceholderText(i18n("Enter the postal code of the lead author here.")); 0337 label16->setBuddy(d->contactPostalCodeEdit); 0338 d->contactPostalCodeEdit->setWhatsThis(i18n("<p>This field should contain the postal code " 0339 "where the lead author lives.</p>")); 0340 0341 // -------------------------------------------------------- 0342 0343 QLabel* const label17 = new QLabel(i18n("Province:"), page3); 0344 d->contactProvinceStateEdit = new QLineEdit(page3); 0345 d->contactProvinceStateEdit->setClearButtonEnabled(true); 0346 d->contactProvinceStateEdit->setPlaceholderText(i18n("Enter the province of the lead author here.")); 0347 label17->setBuddy(d->contactProvinceStateEdit); 0348 d->contactProvinceStateEdit->setWhatsThis(i18n("<p>This field should contain the province " 0349 "where the lead author lives.</p>")); 0350 0351 // -------------------------------------------------------- 0352 0353 QLabel* const label18 = new QLabel(i18nc("@label: template properties", "Email:"), page3); 0354 d->contactEmailEdit = new QLineEdit(page3); 0355 d->contactEmailEdit->setClearButtonEnabled(true); 0356 d->contactEmailEdit->setPlaceholderText(i18n("Enter the email of the lead author here.")); 0357 label18->setBuddy(d->contactEmailEdit); 0358 d->contactEmailEdit->setWhatsThis(i18n("<p>This field should contain the email " 0359 "of the lead author.</p>")); 0360 0361 // -------------------------------------------------------- 0362 0363 QLabel* const label19 = new QLabel(i18n("Phone:"), page3); 0364 d->contactPhoneEdit = new QLineEdit(page3); 0365 d->contactPhoneEdit->setClearButtonEnabled(true); 0366 d->contactPhoneEdit->setPlaceholderText(i18n("Enter the phone number of the lead author here.")); 0367 label19->setBuddy(d->contactPhoneEdit); 0368 d->contactPhoneEdit->setWhatsThis(i18n("<p>This field should contain the phone number " 0369 "of the lead author.</p>")); 0370 0371 // -------------------------------------------------------- 0372 0373 QLabel* const label20 = new QLabel(i18n("URL:"), page3); 0374 d->contactWebUrlEdit = new QLineEdit(page3); 0375 d->contactWebUrlEdit->setClearButtonEnabled(true); 0376 d->contactWebUrlEdit->setPlaceholderText(i18n("Enter the web site URL of the lead author here.")); 0377 label20->setBuddy(d->contactWebUrlEdit); 0378 d->contactWebUrlEdit->setWhatsThis(i18n("<p>This field should contain the web site URL " 0379 "of the lead author.</p>")); 0380 0381 // -------------------------------------------------------- 0382 0383 QGridLayout* const grid3 = new QGridLayout; 0384 grid3->addWidget(label15, 0, 0, 1, 1); 0385 grid3->addWidget(d->contactAddressEdit, 0, 1, 1, 2); 0386 grid3->addWidget(label16, 1, 0, 1, 1); 0387 grid3->addWidget(d->contactPostalCodeEdit, 1, 1, 1, 2); 0388 grid3->addWidget(label13, 2, 0, 1, 1); 0389 grid3->addWidget(d->contactCityEdit, 2, 1, 1, 2); 0390 grid3->addWidget(label17, 3, 0, 1, 1); 0391 grid3->addWidget(d->contactProvinceStateEdit, 3, 1, 1, 2); 0392 grid3->addWidget(label14, 4, 0, 1, 1); 0393 grid3->addWidget(d->contactCountryEdit, 4, 1, 1, 2); 0394 grid3->addWidget(label19, 5, 0, 1, 1); 0395 grid3->addWidget(d->contactPhoneEdit, 5, 1, 1, 2); 0396 grid3->addWidget(label18, 6, 0, 1, 1); 0397 grid3->addWidget(d->contactEmailEdit, 6, 1, 1, 2); 0398 grid3->addWidget(label20, 7, 0, 1, 1); 0399 grid3->addWidget(d->contactWebUrlEdit, 7, 1, 1, 2); 0400 grid3->setContentsMargins(spacing, spacing, spacing, spacing); 0401 grid3->setSpacing(spacing); 0402 grid3->setAlignment(Qt::AlignTop); 0403 grid3->setColumnStretch(1, 10); 0404 grid3->setRowStretch(8, 10); 0405 page3->setLayout(grid3); 0406 0407 page3->setTabOrder(d->contactAddressEdit, d->contactPostalCodeEdit); 0408 page3->setTabOrder(d->contactPostalCodeEdit, d->contactCityEdit); 0409 page3->setTabOrder(d->contactCityEdit, d->contactProvinceStateEdit); 0410 page3->setTabOrder(d->contactProvinceStateEdit, d->contactCountryEdit); 0411 page3->setTabOrder(d->contactCountryEdit, d->contactPhoneEdit); 0412 page3->setTabOrder(d->contactPhoneEdit, d->contactEmailEdit); 0413 page3->setTabOrder(d->contactEmailEdit, d->contactWebUrlEdit); 0414 0415 insertTab(CONTACT, page3, QIcon::fromTheme(QLatin1String("view-pim-contacts")), i18n("Contact")); 0416 0417 // -- Subjects Template information panel ------------------------------------------------------------- 0418 0419 QWidget* const page4 = new QWidget(this); 0420 QGridLayout* const grid4 = new QGridLayout(page4); 0421 d->subjects = new SubjectEdit(page4); 0422 0423 grid4->setContentsMargins(spacing, spacing, spacing, spacing); 0424 grid4->setSpacing(spacing); 0425 grid4->setAlignment(Qt::AlignTop); 0426 grid4->addWidget(d->subjects, 0, 0, 1, 1); 0427 grid4->setRowStretch(1, 10); 0428 0429 insertTab(SUBJECTS, page4, QIcon::fromTheme(QLatin1String("feed-subscribe")), i18n("Subjects")); 0430 } 0431 0432 TemplatePanel::~TemplatePanel() 0433 { 0434 delete d; 0435 } 0436 0437 void TemplatePanel::setTemplate(const Template& t) 0438 { 0439 d->authorsEdit->setText(t.authors().join(QLatin1Char(';'))); 0440 d->authorsPositionEdit->setText(t.authorsPosition()); 0441 d->creditEdit->setText(t.credit()); 0442 d->copyrightEdit->setValues(t.copyright()); 0443 d->rightUsageEdit->setValues(t.rightUsageTerms()); 0444 d->sourceEdit->setText(t.source()); 0445 d->instructionsEdit->setText(t.instructions()); 0446 0447 d->locationCountryCodeEdit->setCountry(t.locationInfo().countryCode); 0448 d->locationProvinceStateEdit->setText(t.locationInfo().provinceState); 0449 d->locationCityEdit->setText(t.locationInfo().city); 0450 d->locationSublocationEdit->setText(t.locationInfo().location); 0451 0452 d->contactCityEdit->setText(t.contactInfo().city); 0453 d->contactCountryEdit->setText(t.contactInfo().country); 0454 d->contactAddressEdit->setText(t.contactInfo().address); 0455 d->contactPostalCodeEdit->setText(t.contactInfo().postalCode); 0456 d->contactProvinceStateEdit->setText(t.contactInfo().provinceState); 0457 d->contactEmailEdit->setText(t.contactInfo().email); 0458 d->contactPhoneEdit->setText(t.contactInfo().phone); 0459 d->contactWebUrlEdit->setText(t.contactInfo().webUrl); 0460 0461 d->subjects->setSubjectsList(t.IptcSubjects()); 0462 } 0463 0464 Template TemplatePanel::getTemplate() const 0465 { 0466 Template t; 0467 t.setAuthors(d->authorsEdit->text().split(QLatin1Char(';'), QT_SKIP_EMPTY_PARTS)); 0468 t.setAuthorsPosition(d->authorsPositionEdit->text()); 0469 t.setCredit(d->creditEdit->text()); 0470 t.setCopyright(d->copyrightEdit->values()); 0471 t.setRightUsageTerms(d->rightUsageEdit->values()); 0472 t.setSource(d->sourceEdit->text()); 0473 t.setInstructions(d->instructionsEdit->text()); 0474 0475 IptcCoreLocationInfo inf1; 0476 d->locationCountryCodeEdit->country(inf1.countryCode, inf1.country); 0477 inf1.provinceState = d->locationProvinceStateEdit->text(); 0478 inf1.city = d->locationCityEdit->text(); 0479 inf1.location = d->locationSublocationEdit->text(); 0480 t.setLocationInfo(inf1); 0481 0482 IptcCoreContactInfo inf2; 0483 inf2.city = d->contactCityEdit->text(); 0484 inf2.country = d->contactCountryEdit->text(); 0485 inf2.address = d->contactAddressEdit->text(); 0486 inf2.postalCode = d->contactPostalCodeEdit->text(); 0487 inf2.provinceState = d->contactProvinceStateEdit->text(); 0488 inf2.email = d->contactEmailEdit->text(); 0489 inf2.phone = d->contactPhoneEdit->text(); 0490 inf2.webUrl = d->contactWebUrlEdit->text(); 0491 t.setContactInfo(inf2); 0492 0493 t.setIptcSubjects(d->subjects->subjectsList()); 0494 0495 return t; 0496 } 0497 0498 void TemplatePanel::apply() 0499 { 0500 } 0501 0502 } // namespace Digikam 0503 0504 #include "moc_templatepanel.cpp"