Added absenceplugin
This commit is contained in:
31
plugins/absenceplugin/absenceplugin.cpp
Normal file
31
plugins/absenceplugin/absenceplugin.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "absenceplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
|
||||
AbsencePlugin::AbsencePlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
qDebug() << "called";
|
||||
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(m_translator.load(QLocale(), QStringLiteral("absenceplugin"), QStringLiteral("_"), dir))
|
||||
{
|
||||
if(!QCoreApplication::installTranslator(&m_translator))
|
||||
{
|
||||
qWarning() << "could not install translation absenceplugin";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "could not load translation absenceplugin";
|
||||
}
|
||||
}
|
||||
|
||||
void AbsencePlugin::attachTo(MainWindow &mainWindow)
|
||||
{
|
||||
//TODO
|
||||
}
|
24
plugins/absenceplugin/absenceplugin.h
Normal file
24
plugins/absenceplugin/absenceplugin.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Q_DECL_EXPORT AbsencePlugin : public ZeiterfassungPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "absenceplugin.json")
|
||||
Q_INTERFACES(ZeiterfassungPlugin)
|
||||
|
||||
public:
|
||||
explicit AbsencePlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
0
plugins/absenceplugin/absenceplugin.json
Normal file
0
plugins/absenceplugin/absenceplugin.json
Normal file
33
plugins/absenceplugin/absenceplugin.pro
Normal file
33
plugins/absenceplugin/absenceplugin.pro
Normal file
@@ -0,0 +1,33 @@
|
||||
QT += core network gui widgets
|
||||
|
||||
TARGET = absenceplugin
|
||||
TEMPLATE = lib
|
||||
|
||||
CONFIG += shared c++14
|
||||
|
||||
PROJECT_ROOT = ../..
|
||||
|
||||
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||
|
||||
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||
|
||||
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += \
|
||||
absenceplugin.h
|
||||
|
||||
SOURCES += \
|
||||
absenceplugin.cpp
|
||||
|
||||
FORMS +=
|
||||
|
||||
RESOURCES +=
|
||||
|
||||
TRANSLATIONS +=
|
||||
|
||||
OTHER_FILES += absenceplugin.json
|
||||
|
||||
include(../../lrelease.pri)
|
@@ -1,6 +1,7 @@
|
||||
TEMPLATE = subdirs
|
||||
|
||||
SUBDIRS += advancedviewplugin \
|
||||
SUBDIRS += absenceplugin \
|
||||
advancedviewplugin \
|
||||
devtoolsplugin \
|
||||
lunchmealplugin \
|
||||
profileplugin \
|
||||
|
@@ -37,7 +37,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../resources.qrc">:/zeiterfassungguilib/images/authentication.png</pixmap>
|
||||
<pixmap resource="../zeiterfassungguilib_resources.qrc">:/zeiterfassungguilib/images/authentication.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
@@ -105,7 +105,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
<include location="../zeiterfassungguilib_resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
Reference in New Issue
Block a user