File indexing completed on 2025-01-05 04:00:13
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2003-08-03 0007 * Description : setup Metadata tab. 0008 * 0009 * SPDX-FileCopyrightText: 2003-2004 by Ralf Holzer <ralf at well dot com> 0010 * SPDX-FileCopyrightText: 2003-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * SPDX-FileCopyrightText: 2009-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de> 0012 * SPDX-FileCopyrightText: 2017 by Simon Frei <freisim93 at gmail dot com> 0013 * 0014 * SPDX-License-Identifier: GPL-2.0-or-later 0015 * 0016 * ============================================================ */ 0017 0018 #include "setupmetadata_p.h" 0019 0020 namespace Digikam 0021 { 0022 0023 void SetupMetadata::appendBalooTab() 0024 { 0025 0026 #ifdef HAVE_KFILEMETADATA 0027 0028 QWidget* const balooPanel = new QWidget(d->tab); 0029 QVBoxLayout* const balooLayout = new QVBoxLayout(balooPanel); 0030 0031 QGroupBox* const balooGroup = new QGroupBox(i18nc("@option", "Baloo Desktop Search"), balooPanel); 0032 QVBoxLayout* const gLayout3 = new QVBoxLayout(balooGroup); 0033 0034 d->saveToBalooBox = new QCheckBox; 0035 d->saveToBalooBox->setText(i18nc("@option", "Store metadata from digiKam in Baloo")); 0036 d->saveToBalooBox->setWhatsThis(i18nc("@info", "Turn on this option to push rating, comments and tags " 0037 "from digiKam into the Baloo storage")); 0038 0039 d->readFromBalooBox = new QCheckBox; 0040 d->readFromBalooBox->setText(i18nc("@option", "Read metadata from Baloo")); 0041 d->readFromBalooBox->setWhatsThis(i18nc("@info", "Turn on this option if you want to apply changes to " 0042 "rating, comments and tags made in Baloo to digiKam's metadata storage. " 0043 "Please note that image metadata will not be edited automatically.")); 0044 0045 gLayout3->addWidget(d->saveToBalooBox); 0046 gLayout3->addWidget(d->readFromBalooBox); 0047 0048 // -------------------------------------------------------- 0049 0050 QFrame* const balooBox = new QFrame(balooPanel); 0051 QGridLayout* const balooGrid = new QGridLayout(balooBox); 0052 balooBox->setFrameStyle(QFrame::StyledPanel | QFrame::Raised); 0053 0054 QLabel* const balooLogoLabel = new QLabel; 0055 balooLogoLabel->setPixmap(QIcon::fromTheme(QLatin1String("baloo")).pixmap(48)); 0056 0057 QLabel* const balooExplanation = new QLabel(balooBox); 0058 balooExplanation->setOpenExternalLinks(true); 0059 balooExplanation->setWordWrap(true); 0060 QString balootxt; 0061 0062 balootxt.append(QString::fromUtf8("<p><a href='https://community.kde.org/Baloo'>Baloo</a> %1</p>") 0063 .arg(i18nc("@info", "provides the basis to handle all kinds of metadata on the KDE desktop in a generic fashion. " 0064 "It allows you to tag, rate and comment your files in KDE applications like Dolphin. " 0065 "Please set here if you want to synchronize the metadata stored by digiKam desktop-wide with the " 0066 "Baloo Desktop Search."))); 0067 0068 balooExplanation->setText(balootxt); 0069 0070 balooGrid->addWidget(balooLogoLabel, 0, 0, 1, 1); 0071 balooGrid->addWidget(balooExplanation, 0, 1, 1, 2); 0072 balooGrid->setColumnStretch(1, 10); 0073 balooGrid->setSpacing(0); 0074 0075 // -------------------------------------------------------- 0076 0077 balooLayout->addWidget(balooGroup); 0078 balooLayout->addWidget(balooBox); 0079 /* 0080 balooLayout->addWidget(d->resyncButton, 0, Qt::AlignRight); 0081 */ 0082 balooLayout->addStretch(); 0083 0084 d->tab->insertTab(Baloo, balooPanel, i18nc("@title:tab", "Baloo")); 0085 0086 #endif // HAVE_KFILEMETADATA 0087 0088 } 0089 0090 } // namespace Digikam