diff --git a/plugins/devtoolsplugin/devtoolsplugin.cpp b/plugins/devtoolsplugin/devtoolsplugin.cpp new file mode 100644 index 0000000..9fc1c28 --- /dev/null +++ b/plugins/devtoolsplugin/devtoolsplugin.cpp @@ -0,0 +1,33 @@ +#include "devtoolsplugin.h" + +#include +#include +#include +#include + +#include "mainwindow.h" + +DevToolsPlugin::DevToolsPlugin(QObject *parent) : + ZeiterfassungPlugin(parent) +{ + qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("devtoolsplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation devtoolsplugin"; + } + } + else + { + qWarning() << "could not load translation devtoolsplugin"; + } +} + +void DevToolsPlugin::attachTo(MainWindow &mainWindow) +{ + //TODO +} diff --git a/plugins/devtoolsplugin/devtoolsplugin.h b/plugins/devtoolsplugin/devtoolsplugin.h new file mode 100644 index 0000000..f02e084 --- /dev/null +++ b/plugins/devtoolsplugin/devtoolsplugin.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include + +#include "zeiterfassungplugin.h" + +class Q_DECL_EXPORT DevToolsPlugin : public ZeiterfassungPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "devtoolsplugin.json") + Q_INTERFACES(ZeiterfassungPlugin) + +public: + explicit DevToolsPlugin(QObject *parent = Q_NULLPTR); + + // ZeiterfassungPlugin interface + void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; + +private: + QTranslator m_translator; +}; diff --git a/plugins/devtoolsplugin/devtoolsplugin.json b/plugins/devtoolsplugin/devtoolsplugin.json new file mode 100644 index 0000000..e69de29 diff --git a/plugins/devtoolsplugin/devtoolsplugin.pro b/plugins/devtoolsplugin/devtoolsplugin.pro new file mode 100644 index 0000000..b22008b --- /dev/null +++ b/plugins/devtoolsplugin/devtoolsplugin.pro @@ -0,0 +1,35 @@ +QT += core network gui widgets + +TARGET = devtoolsplugin +TEMPLATE = lib + +CONFIG += shared c++14 + +DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung + +LIBS += -L$$OUT_PWD/../../lib -lzeiterfassungcorelib -lzeiterfassungguilib + +INCLUDEPATH += $$PWD/../../zeiterfassungcorelib $$PWD/../../zeiterfassungguilib +DEPENDPATH += $$PWD/../../zeiterfassungcorelib $$PWD/../../zeiterfassungguilib + +DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT + +HEADERS += devtoolsplugin.h + +SOURCES += devtoolsplugin.cpp + +FORMS += + +RESOURCES += + +TRANSLATIONS += translations/devtoolsplugin_en.ts \ + translations/devtoolsplugin_de.ts + +OTHER_FILES += devtoolsplugin.json + +include(../../lrelease.pri) + +COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/devtoolsplugin_en.qm \ + $${OUT_PWD}/translations/devtoolsplugin_de.qm + +include(../copy_translations.pri) diff --git a/plugins/devtoolsplugin/translations/devtoolsplugin_de.ts b/plugins/devtoolsplugin/translations/devtoolsplugin_de.ts new file mode 100644 index 0000000..1552582 --- /dev/null +++ b/plugins/devtoolsplugin/translations/devtoolsplugin_de.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins/devtoolsplugin/translations/devtoolsplugin_en.ts b/plugins/devtoolsplugin/translations/devtoolsplugin_en.ts new file mode 100644 index 0000000..bc6d6e7 --- /dev/null +++ b/plugins/devtoolsplugin/translations/devtoolsplugin_en.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins/plugins.pro b/plugins/plugins.pro index f8c26c3..dab007d 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -1,6 +1,7 @@ TEMPLATE = subdirs SUBDIRS += advancedviewplugin \ + devtoolsplugin \ lunchmealplugin \ presenceplugin \ reportsplugin \