From af805754b856869b3f966b41a90fdc13535317cb Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Thu, 21 Dec 2017 21:16:37 +0100 Subject: [PATCH] Added devtoolsplugin --- plugins/devtoolsplugin/devtoolsplugin.cpp | 33 +++++++++++++++++ plugins/devtoolsplugin/devtoolsplugin.h | 22 ++++++++++++ plugins/devtoolsplugin/devtoolsplugin.json | 0 plugins/devtoolsplugin/devtoolsplugin.pro | 35 +++++++++++++++++++ .../translations/devtoolsplugin_de.ts | 4 +++ .../translations/devtoolsplugin_en.ts | 4 +++ plugins/plugins.pro | 1 + 7 files changed, 99 insertions(+) create mode 100644 plugins/devtoolsplugin/devtoolsplugin.cpp create mode 100644 plugins/devtoolsplugin/devtoolsplugin.h create mode 100644 plugins/devtoolsplugin/devtoolsplugin.json create mode 100644 plugins/devtoolsplugin/devtoolsplugin.pro create mode 100644 plugins/devtoolsplugin/translations/devtoolsplugin_de.ts create mode 100644 plugins/devtoolsplugin/translations/devtoolsplugin_en.ts 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 \