#include "qgscopeobject.h"
#include "qglogger.h"
#include "qgscopeworkbench.h"

QgScopeObject::QgScopeObject(const QString &name, QObject *parent) :
    QObject(parent),
    m_name(name),
    m_scriptableName(name)

{
    if (!name.isEmpty())
        setObjectName(name);

    m_wb=&QgScopeWorkbench::instance();
    m_log=new QgLogger("?", this);
}

QgScopeObject::~QgScopeObject()
{
}

QString QgScopeObject::scriptableName() const
{
    return m_scriptableName;
}

void QgScopeObject::setScriptableName(const QString& name)
{
    m_scriptableName=name;
}

QString QgScopeObject::description() const
{
    return m_description;
}

void QgScopeObject::setDescription(const QString& descr)
{
    m_description=descr;
}

QString QgScopeObject::statusString() const
{
    return m_statusString;
}

void QgScopeObject::setStatusString(const QString& msg)
{
    if (m_statusString!=msg)
    {
        m_statusString=msg;
        Q_EMIT statusStringChanged(m_statusString);
    }
}

QString QgScopeObject::tooltipString() const
{
    return m_tooltipString;
}

void QgScopeObject::setTooltipString(const QString& msg)
{
    if (m_tooltipString!=msg)
    {
        m_tooltipString=msg;
        Q_EMIT tooltipChanged(m_tooltipString);
    }
}
