File indexing completed on 2025-01-05 03:53:24

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