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

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 Onedrive 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 "odwidget.h"
0016 
0017 // Qt includes
0018 
0019 #include <QLabel>
0020 #include <QGroupBox>
0021 
0022 namespace DigikamGenericOneDrivePlugin
0023 {
0024 
0025 ODWidget::ODWidget(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 ODWidget::~ODWidget()
0035 {
0036 }
0037 
0038 void ODWidget::updateLabels(const QString& name, const QString& url)
0039 {
0040     QString web(QLatin1String("https://www.onedrive.com/"));
0041 
0042     if (!url.isEmpty())
0043         web = url;
0044 
0045     getHeaderLbl()->setText(QString::fromLatin1(
0046         "<b><h2><a href='%1'>"
0047         "<font color=\"#9ACD32\">Onedrive</font>"
0048         "</a></h2></b>").arg(web));
0049 
0050     if (name.isEmpty())
0051     {
0052         getUserNameLabel()->clear();
0053     }
0054     else
0055     {
0056         getUserNameLabel()->setText(QString::fromLatin1("<b>%1</b>").arg(name));
0057     }
0058 }
0059 
0060 } // namespace DigikamGenericOneDrivePlugin
0061 
0062 #include "moc_odwidget.cpp"