Commit 605d85c6 authored by Laurent Montel's avatar Laurent Montel 😁

Use parentWidget

parent 0a409bf4
......@@ -27,10 +27,12 @@
#include <AkonadiCore/agentinstancecreatejob.h>
#include <QMetaMethod>
#include <QWidget>
using namespace Akonadi;
using namespace LibImportWizard;
AbstractBase::AbstractBase()
: mParentWidget(nullptr)
{
mCreateResource = new PimCommon::CreateResource();
connect(mCreateResource, &PimCommon::CreateResource::createResourceInfo, this, &AbstractBase::slotCreateResourceInfo);
......@@ -47,6 +49,16 @@ QString LibImportWizard::AbstractBase::createResource(const QString &resources,
return mCreateResource->createResource(resources, name, settings);
}
void AbstractBase::setParentWidget(QWidget *parent)
{
mParentWidget = parent;
}
QWidget *AbstractBase::parentWidget() const
{
return mParentWidget;
}
void AbstractBase::slotCreateResourceError(const QString &msg)
{
addImportError(msg);
......
......@@ -26,6 +26,7 @@
#include <QMap>
#include <QVariant>
class QWidget;
namespace PimCommon
{
class CreateResource;
......@@ -41,6 +42,9 @@ public:
QString createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings);
void setParentWidget(QWidget *parent);
QWidget *parentWidget() const;
protected:
virtual void addImportInfo(const QString &log) = 0;
virtual void addImportError(const QString &log) = 0;
......@@ -49,6 +53,7 @@ private:
void slotCreateResourceError(const QString &);
void slotCreateResourceInfo(const QString &);
PimCommon::CreateResource *mCreateResource;
QWidget *mParentWidget;
};
}
#endif // ABSTRACTBASE_H
......@@ -26,3 +26,33 @@ AbstractDisplayInfo::AbstractDisplayInfo()
{
}
void AbstractDisplayInfo::calendarImportError(const QString &log)
{
}
void AbstractDisplayInfo::settingsImportError(const QString &log)
{
}
void AbstractDisplayInfo::addressbookImportError(const QString &log)
{
}
void AbstractDisplayInfo::calendarImportInfo(const QString &log)
{
}
void AbstractDisplayInfo::settingsImportInfo(const QString &log)
{
}
void AbstractDisplayInfo::addressbookImportInfo(const QString &log)
{
}
......@@ -21,6 +21,7 @@
#define ABSTRACTDISPLAYINFO_H
#include "libimportwizard_export.h"
#include <QString>
namespace LibImportWizard
{
......@@ -28,6 +29,14 @@ class LIBIMPORTWIZARD_EXPORT AbstractDisplayInfo
{
public:
AbstractDisplayInfo();
virtual void calendarImportError(const QString &log);
virtual void settingsImportError(const QString &log);
virtual void addressbookImportError(const QString &log);
virtual void calendarImportInfo(const QString &log);
virtual void settingsImportInfo(const QString &log);
virtual void addressbookImportInfo(const QString &log);
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment