/*
   SPDX-FileCopyrightText: 2015-2022 Laurent Montel <montel@kde.org>

   SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "importexportprogressindicatorbase.h"
#include <KMessageBox>
#include <QDebug>
#include <kwidgetsaddons_version.h>

ImportExportProgressIndicatorBase::ImportExportProgressIndicatorBase(QObject *parent)
    : QObject(parent)
{
}

ImportExportProgressIndicatorBase::~ImportExportProgressIndicatorBase() = default;

void ImportExportProgressIndicatorBase::increaseProgressDialog()
{
    // Nothing
}

void ImportExportProgressIndicatorBase::createProgressDialog(const QString &title)
{
    // Nothing
    Q_UNUSED(title)
}

void ImportExportProgressIndicatorBase::setProgressDialogLabel(const QString &text)
{
    Q_EMIT info(text);
}

bool ImportExportProgressIndicatorBase::wasCanceled() const
{
    return false;
}

void ImportExportProgressIndicatorBase::setNumberOfStep(int numberOfStep)
{
    mNumberOfStep = numberOfStep;
}

int ImportExportProgressIndicatorBase::mergeConfigMessageBox(const QString &configName) const
{
    Q_UNUSED(configName)
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
    return KMessageBox::ButtonCode::PrimaryAction;
#else
    return KMessageBox::Yes;
#endif
}

bool ImportExportProgressIndicatorBase::overwriteConfigMessageBox(const QString &configName) const
{
    Q_UNUSED(configName)
    return true;
}

bool ImportExportProgressIndicatorBase::overwriteDirectoryMessageBox(const QString &directory) const
{
    Q_UNUSED(directory)
    return true;
}

void ImportExportProgressIndicatorBase::showErrorMessage(const QString &message, const QString &title)
{
    qDebug() << " message : " << message << " title " << title;
}
