#include "aboutdialog.h"
#include "src/common/utils.h"
#include "src/po/translation.h"
#include "KF5/KWindowSystem/kwindowsystem.h"

AboutDialog *AboutDialog::m_oInstance = nullptr;
QMutex       AboutDialog::m_oMutex;

AboutDialog::AboutDialog(QWidget *parent) :
    kdk::KAboutDialog(parent)
{
    setAppIcon(QIcon::fromTheme("burner"));
    setAppName(_("Burner"));
    setAppVersion(_("Version") + ": " + Utils::getVersion());
    setAccessibleName("kylin-burner_KAboutDialog_AboutDialog");
    this->setFixedSize(450,336);
    this->setModal(true);
    this->closeButton()->setToolTip(_("Close"));
    KWindowSystem::setState(this->winId(), NET::SkipPager | NET::SkipSwitcher | NET::SkipTaskbar);
}

AboutDialog *AboutDialog::instance(QWidget *parent)
{
    if (nullptr == m_oInstance)
    {
        QMutexLocker locker(&m_oMutex);
        if (nullptr == m_oInstance)
            m_oInstance = new AboutDialog(parent);
    }
    return m_oInstance;
}

