42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
#include "profileplugin.h"
|
|
|
|
#include <QDebug>
|
|
#include <QDir>
|
|
#include <QCoreApplication>
|
|
#include <QLocale>
|
|
#include <QMenu>
|
|
#include <QAction>
|
|
|
|
#include "utils/fileutils.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "profiledialog.h"
|
|
|
|
ProfilePlugin::ProfilePlugin(QObject *parent) :
|
|
ZeiterfassungPlugin(parent)
|
|
{
|
|
qDebug() << "called";
|
|
|
|
if(m_translator.load(QLocale(), QStringLiteral("profileplugin"), QStringLiteral("_"), translationsDir()))
|
|
{
|
|
if(!QCoreApplication::installTranslator(&m_translator))
|
|
{
|
|
qWarning() << "could not install translation profileplugin";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
qWarning() << "could not load translation profileplugin";
|
|
}
|
|
}
|
|
|
|
void ProfilePlugin::attachTo(MainWindow &mainWindow)
|
|
{
|
|
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/profileplugin/images/profile.png")),
|
|
tr("My profile"), &mainWindow, [&mainWindow](){
|
|
ProfileDialog dialog(mainWindow.userInfo(), &mainWindow);
|
|
dialog.exec();
|
|
});
|
|
}
|