diff --git a/plugins/favoritesplugin/favoritesplugin.cpp b/plugins/favoritesplugin/favoritesplugin.cpp new file mode 100644 index 0000000..87c2482 --- /dev/null +++ b/plugins/favoritesplugin/favoritesplugin.cpp @@ -0,0 +1,26 @@ +#include "favoritesplugin.h" + +#include +#include +#include +#include + +FavoritesPlugin::FavoritesPlugin(QObject *parent) : + ZeiterfassungPlugin(parent) +{ + qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("favoritesplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation favoritesplugin"; + } + } + else + { + qWarning() << "could not load translation favoritesplugin"; + } +} diff --git a/plugins/favoritesplugin/favoritesplugin.h b/plugins/favoritesplugin/favoritesplugin.h new file mode 100644 index 0000000..988c2c1 --- /dev/null +++ b/plugins/favoritesplugin/favoritesplugin.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include + +#include "zeiterfassungplugin.h" + +class Q_DECL_EXPORT FavoritesPlugin : public ZeiterfassungPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "favoritesplugin.json") + Q_INTERFACES(ZeiterfassungPlugin) + +public: + explicit FavoritesPlugin(QObject *parent = Q_NULLPTR); + +private: + QTranslator m_translator; +}; diff --git a/plugins/favoritesplugin/favoritesplugin.json b/plugins/favoritesplugin/favoritesplugin.json new file mode 100644 index 0000000..e69de29 diff --git a/plugins/favoritesplugin/favoritesplugin.pro b/plugins/favoritesplugin/favoritesplugin.pro new file mode 100644 index 0000000..d920e64 --- /dev/null +++ b/plugins/favoritesplugin/favoritesplugin.pro @@ -0,0 +1,20 @@ +QT += core network gui widgets + +TARGET = favoritesplugin + +DBLIBS += core gui + +HEADERS += favoritesplugin.h + +SOURCES += favoritesplugin.cpp + +FORMS += + +RESOURCES += favoritesplugin_resources.qrc + +TRANSLATIONS += translations/favoritesplugin_en.ts \ + translations/favoritesplugin_de.ts + +OTHER_FILES += favoritesplugin.json + +include(../plugin.pri) diff --git a/plugins/favoritesplugin/favoritesplugin_resources.qrc b/plugins/favoritesplugin/favoritesplugin_resources.qrc new file mode 100644 index 0000000..f316704 --- /dev/null +++ b/plugins/favoritesplugin/favoritesplugin_resources.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/plugins/favoritesplugin/translations/favoritesplugin_de.ts b/plugins/favoritesplugin/translations/favoritesplugin_de.ts new file mode 100644 index 0000000..1552582 --- /dev/null +++ b/plugins/favoritesplugin/translations/favoritesplugin_de.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins/favoritesplugin/translations/favoritesplugin_en.ts b/plugins/favoritesplugin/translations/favoritesplugin_en.ts new file mode 100644 index 0000000..bc6d6e7 --- /dev/null +++ b/plugins/favoritesplugin/translations/favoritesplugin_en.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins/plugins.pro b/plugins/plugins.pro index 09d0bcd..b7a4ec7 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -3,6 +3,7 @@ TEMPLATE = subdirs SUBDIRS += absenceplugin \ advancedviewplugin \ devtoolsplugin \ + favoritesplugin \ lunchmealplugin \ profileplugin \ presenceplugin \