diff --git a/core/libs/dplugins/core/dpluginauthor.cpp b/core/libs/dplugins/core/dpluginauthor.cpp index c10a3c4e8a..c3da69533d 100644 --- a/core/libs/dplugins/core/dpluginauthor.cpp +++ b/core/libs/dplugins/core/dpluginauthor.cpp @@ -1,49 +1,63 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-07-30 * Description : author data container for external plugin * * Copyright (C) 2018-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "dpluginauthor.h" +// KDE includes + +#include + namespace Digikam { +DPluginAuthor::DPluginAuthor(const QString& n, + const QString& e, + const QString& y) + : name(n), + email(e), + years(y), + roles(i18n("Developer")) +{ +} + DPluginAuthor::DPluginAuthor(const QString& n, const QString& e, const QString& y, const QString& r) : name(n), email(e), years(y), roles(r) { } DPluginAuthor::~DPluginAuthor() { } QString DPluginAuthor::toString() const { return (QString::fromLatin1("%1 <%2> %3 [%4]").arg(name).arg(email).arg(years).arg(roles)); } } // namespace Digikam diff --git a/core/libs/dplugins/core/dpluginauthor.h b/core/libs/dplugins/core/dpluginauthor.h index 954bd11f05..156ed552f9 100644 --- a/core/libs/dplugins/core/dpluginauthor.h +++ b/core/libs/dplugins/core/dpluginauthor.h @@ -1,69 +1,69 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-07-30 * Description : author data container for external plugin * * Copyright (C) 2018-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPLUGIN_AUTHOR_H #define DIGIKAM_DPLUGIN_AUTHOR_H // Qt includes #include -// KDE includes - -#include - // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT DPluginAuthor { public: - explicit DPluginAuthor(const QString& n, - const QString& e, - const QString& y, - const QString& r = i18n("Developer")); + DPluginAuthor(const QString& n, + const QString& e, + const QString& y); + + DPluginAuthor(const QString& n, + const QString& e, + const QString& y, + const QString& r); ~DPluginAuthor(); /** * Return author details as string. * For debug purpose only. */ QString toString() const; public: QString name; // Author name and surname QString email; // Email anti-spammed QString years; // Copyrights years QString roles; // Author roles, as "Developer", "Designer", "Translator", etc. }; } // namespace Digikam #endif // DIGIKAM_DPLUGIN_AUTHOR_H diff --git a/core/libs/dplugins/setup/dpluginaboutdlg.cpp b/core/libs/dplugins/setup/dpluginaboutdlg.cpp index 2d75a861d0..928cb3db17 100644 --- a/core/libs/dplugins/setup/dpluginaboutdlg.cpp +++ b/core/libs/dplugins/setup/dpluginaboutdlg.cpp @@ -1,158 +1,162 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-12-31 * Description : digiKam plugin about dialog * * Copyright (C) 2018-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "dpluginaboutdlg.h" // Qt includes #include #include #include #include #include #include #include #include #include #include #include #include #include +// KDE includes + +#include + namespace Digikam { DPluginAboutDlg::DPluginAboutDlg(DPlugin* const tool, QWidget* const parent) : QDialog(parent) { setWindowFlags((windowFlags() & ~Qt::Dialog) | Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowMinMaxButtonsHint); setModal(false); setWindowTitle(i18n("About %1 Plugin", tool->name())); QDialogButtonBox* const buttons = new QDialogButtonBox(QDialogButtonBox::Ok, this); buttons->button(QDialogButtonBox::Ok)->setDefault(true); QWidget* const page = new QWidget(this); QGridLayout* const grid = new QGridLayout(page); // -------------------------------------------------------- QLabel* const logo = new QLabel(page); logo->setPixmap(tool->icon().pixmap(QSize(48, 48))); // -------------------------------------------------------- QLabel* const header = new QLabel(page); header->setWordWrap(true); header->setText(i18n("%1
" "Version %2" "

%3

", tool->name(), tool->version(), tool->description())); QTabWidget* const tab = new QTabWidget(page); // -------------------------------------------------------- QTextBrowser* const details = new QTextBrowser(tab); details->setOpenExternalLinks(true); details->setFocusPolicy(Qt::NoFocus); details->setText(tool->details()); tab->addTab(details, i18n("Details")); // -------------------------------------------------------- QTextBrowser* const authors = new QTextBrowser(tab); authors->setOpenExternalLinks(false); authors->setOpenLinks(false); authors->setFocusPolicy(Qt::NoFocus); QString alist; foreach (const DPluginAuthor& auth, tool->authors()) { alist += QString::fromUtf8("%1
    " "
  • %2
  • " "
  • %3
  • " "
  • %4

") .arg(auth.name) .arg(auth.email) .arg(auth.years) .arg(auth.roles); } authors->setText(alist); tab->addTab(authors, i18n("Authors")); // -------------------------------------------------------- QTreeWidget* const props = new QTreeWidget(tab); props->setSortingEnabled(false); props->setRootIsDecorated(false); props->setSelectionMode(QAbstractItemView::SingleSelection); props->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); props->setAllColumnsShowFocus(true); props->setColumnCount(2); props->setHeaderLabels(QStringList() << i18n("Name") << i18n("Value")); new QTreeWidgetItem(props, QStringList() << i18n("Interface ID") << tool->ifaceIid()); new QTreeWidgetItem(props, QStringList() << i18n("Tool ID") << tool->iid()); new QTreeWidgetItem(props, QStringList() << i18n("Library") << tool->libraryFileName()); tab->addTab(props, i18n("Properties")); // -------------------------------------------------------- grid->addWidget(logo, 0, 0, 1, 1); grid->addWidget(header, 0, 1, 1, 1); grid->addWidget(tab, 2, 0, 1, -1); grid->setColumnStretch(1, 10); grid->setRowStretch(2, 10); grid->setContentsMargins(QMargins()); grid->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing)); QVBoxLayout* const vbx = new QVBoxLayout(this); vbx->addWidget(page); vbx->addWidget(buttons); setLayout(vbx); // -------------------------------------------------------- connect(buttons->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept())); resize(400, 500); } DPluginAboutDlg::~DPluginAboutDlg() { } } // namespace Digikam