File indexing completed on 2025-01-19 03:53:10

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2018-05-20
0007  * Description : a tool to export images to Pinterest web service
0008  *
0009  * SPDX-FileCopyrightText: 2018      by Tarek Talaat <tarektalaat93 at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #include "pwidget.h"
0016 
0017 // Qt includes
0018 
0019 #include <QLabel>
0020 #include <QGroupBox>
0021 
0022 namespace DigikamGenericPinterestPlugin
0023 {
0024 
0025 PWidget::PWidget(QWidget* const parent,
0026                  DInfoInterface* const iface,
0027                  const QString& toolName)
0028     : WSSettingsWidget(parent, iface, toolName)
0029 {
0030     getUploadBox()->hide();
0031     getSizeBox()->hide();
0032 }
0033 
0034 PWidget::~PWidget()
0035 {
0036 }
0037 
0038 void PWidget::updateLabels(const QString& name, const QString& url)
0039 {
0040     QString web(QLatin1String("https://www.pinterest.com/"));
0041 
0042     if (!url.isEmpty())
0043     {
0044         web = url;
0045     }
0046 
0047     getHeaderLbl()->setText(QString::fromLatin1(
0048         "<b><h2><a href='%1'>"
0049         "<font color=\"#9ACD32\">Pinterest</font>"
0050         "</a></h2></b>").arg(web));
0051 
0052     if (name.isEmpty())
0053     {
0054         getUserNameLabel()->clear();
0055     }
0056     else
0057     {
0058         getUserNameLabel()->setText(QString::fromLatin1("<b>%1</b>").arg(name));
0059     }
0060 }
0061 
0062 } // namespace DigikamGenericPinterestPlugin
0063 
0064 #include "moc_pwidget.cpp"