2017-12-18 23:10:36 +01:00
|
|
|
#include "reportsplugin.h"
|
|
|
|
|
|
|
|
|
|
#include <QDebug>
|
2017-12-19 23:54:58 +01:00
|
|
|
#include <QDir>
|
|
|
|
|
#include <QCoreApplication>
|
|
|
|
|
#include <QLocale>
|
2017-12-23 10:48:56 +01:00
|
|
|
#include <QStatusBar>
|
|
|
|
|
|
|
|
|
|
#include "mainwindow.h"
|
2017-12-18 23:10:36 +01:00
|
|
|
|
2017-12-19 00:12:41 +01:00
|
|
|
#include "reportswidget.h"
|
|
|
|
|
|
2017-12-18 23:10:36 +01:00
|
|
|
ReportsPlugin::ReportsPlugin(QObject *parent) :
|
|
|
|
|
ZeiterfassungPlugin(parent)
|
|
|
|
|
{
|
|
|
|
|
qDebug() << "called";
|
2017-12-19 23:54:58 +01:00
|
|
|
|
|
|
|
|
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
|
|
|
|
|
|
|
|
|
if(m_translator.load(QLocale(), QStringLiteral("reportsplugin"), QStringLiteral("_"), dir))
|
|
|
|
|
{
|
|
|
|
|
if(!QCoreApplication::installTranslator(&m_translator))
|
|
|
|
|
{
|
|
|
|
|
qWarning() << "could not install translation reportsplugin";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
qWarning() << "could not load translation reportsplugin";
|
|
|
|
|
}
|
2017-12-18 23:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ReportsPlugin::attachTo(MainWindow &mainWindow)
|
|
|
|
|
{
|
2017-12-23 10:48:56 +01:00
|
|
|
mainWindow.statusBar()->addPermanentWidget(new ReportsWidget(mainWindow));
|
2017-12-18 23:10:36 +01:00
|
|
|
}
|