Imported existing sources

This commit is contained in:
0xFEEDC0DE64 committed 2018-09-17 19:43:21 +02:00
1 parent 6cac15ff54
commit c1f1b884ff
11 files changed
+718

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
#include "profileplugin.h"
#include <QDebug>
#include <QDir>
#include <QCoreApplication>
#include <QLocale>
#include <QMenu>
#include <QAction>
#include "mainwindow.h"
#include "profiledialog.h"
ProfilePlugin::ProfilePlugin(QObject *parent) :
ZeiterfassungPlugin(parent)
{
qDebug() << "called";
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
if(m_translator.load(QLocale(), QStringLiteral("profileplugin"), QStringLiteral("_"), dir))
{
if(!QCoreApplication::installTranslator(&m_translator))
{
qWarning() << "could not install translation profileplugin";
}
}
else
{
qWarning() << "could not load translation profileplugin";
}
}
void ProfilePlugin::attachTo(MainWindow &mainWindow)
{
auto dialog = new ProfileDialog(mainWindow.userInfo(), &mainWindow);
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/profileplugin/images/profile.png")),
tr("My profile"), dialog, &QDialog::open);
}