#include "showclendar.h"
#include <QDesktopWidget>
#include <QApplication>
#include <QDebug>

#define QM_INSTALL "/usr/share/ukui/translations/ukui-tablet-desktop/ukui-calendar_zh_CN.qm"

#ifdef QT_NO_DEBUG
#define CALENDAR_PATH "/usr/bin/lunarcalendarwidget"

#else
#define CALENDAR_PATH "/tmp/lunarcalendarwidget"
#endif


ShowClendar::ShowClendar(QObject *parent) : QObject(parent)
{
    translator();
}
void ShowClendar::showItem()
{
    QProcess p;
    p.startDetached(CALENDAR_PATH);
}

void ShowClendar::translator()
{
    QTranslator *translator = new QTranslator(this);

    if(translator->load(QM_INSTALL)) {
        QCoreApplication::installTranslator(translator);
    } else {
        qDebug() << "日历的翻译文件加载失败！";
    }
}
