39 lines
915 B
C++
39 lines
915 B
C++
#include "absenceplugin.h"
|
|
|
|
#include <QDebug>
|
|
#include <QDir>
|
|
#include <QCoreApplication>
|
|
#include <QLocale>
|
|
#include <QBoxLayout>
|
|
|
|
#include "utils/fileutils.h"
|
|
|
|
#include "mainwindow.h"
|
|
#include "stripswidget.h"
|
|
|
|
#include "absencewidget.h"
|
|
|
|
AbsencePlugin::AbsencePlugin(QObject *parent) :
|
|
ZeiterfassungPlugin(parent)
|
|
{
|
|
qDebug() << "called";
|
|
|
|
if(m_translator.load(QLocale(), QStringLiteral("absenceplugin"), QStringLiteral("_"), translationsDir()))
|
|
{
|
|
if(!QCoreApplication::installTranslator(&m_translator))
|
|
{
|
|
qWarning() << "could not install translation absenceplugin";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
qWarning() << "could not load translation absenceplugin";
|
|
}
|
|
}
|
|
|
|
void AbsencePlugin::attachTo(MainWindow &mainWindow)
|
|
{
|
|
for(auto stripsWidget : mainWindow.stripsWidgets())
|
|
stripsWidget->headerLayout()->addWidget(new AbsenceWidget(*stripsWidget));
|
|
}
|