Added devtoolsplugin
This commit is contained in:
33
plugins/devtoolsplugin/devtoolsplugin.cpp
Normal file
33
plugins/devtoolsplugin/devtoolsplugin.cpp
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#include "devtoolsplugin.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QLocale>
|
||||||
|
|
||||||
|
#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
|
||||||
|
}
|
22
plugins/devtoolsplugin/devtoolsplugin.h
Normal file
22
plugins/devtoolsplugin/devtoolsplugin.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
|
#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;
|
||||||
|
};
|
0
plugins/devtoolsplugin/devtoolsplugin.json
Normal file
0
plugins/devtoolsplugin/devtoolsplugin.json
Normal file
35
plugins/devtoolsplugin/devtoolsplugin.pro
Normal file
35
plugins/devtoolsplugin/devtoolsplugin.pro
Normal file
@@ -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)
|
4
plugins/devtoolsplugin/translations/devtoolsplugin_de.ts
Normal file
4
plugins/devtoolsplugin/translations/devtoolsplugin_de.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="de_DE">
|
||||||
|
</TS>
|
4
plugins/devtoolsplugin/translations/devtoolsplugin_en.ts
Normal file
4
plugins/devtoolsplugin/translations/devtoolsplugin_en.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US">
|
||||||
|
</TS>
|
@@ -1,6 +1,7 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
SUBDIRS += advancedviewplugin \
|
SUBDIRS += advancedviewplugin \
|
||||||
|
devtoolsplugin \
|
||||||
lunchmealplugin \
|
lunchmealplugin \
|
||||||
presenceplugin \
|
presenceplugin \
|
||||||
reportsplugin \
|
reportsplugin \
|
||||||
|
Reference in New Issue
Block a user