Added sketchplugin project
This commit is contained in:
@@ -7,6 +7,7 @@ SUBDIRS += absenceplugin \
|
||||
profileplugin \
|
||||
presenceplugin \
|
||||
reportsplugin \
|
||||
sketchplugin \
|
||||
updaterplugin \
|
||||
weatherplugin \
|
||||
webradioplugin
|
||||
|
26
plugins/sketchplugin/sketchplugin.cpp
Normal file
26
plugins/sketchplugin/sketchplugin.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "sketchplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
|
||||
SketchPlugin::SketchPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
qDebug() << "called";
|
||||
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(m_translator.load(QLocale(), QStringLiteral("sketchplugin"), QStringLiteral("_"), dir))
|
||||
{
|
||||
if(!QCoreApplication::installTranslator(&m_translator))
|
||||
{
|
||||
qWarning() << "could not install translation sketchplugin";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "could not load translation sketchplugin";
|
||||
}
|
||||
}
|
21
plugins/sketchplugin/sketchplugin.h
Normal file
21
plugins/sketchplugin/sketchplugin.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Q_DECL_EXPORT SketchPlugin : public ZeiterfassungPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "sketchplugin.json")
|
||||
Q_INTERFACES(ZeiterfassungPlugin)
|
||||
|
||||
public:
|
||||
explicit SketchPlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
0
plugins/sketchplugin/sketchplugin.json
Normal file
0
plugins/sketchplugin/sketchplugin.json
Normal file
20
plugins/sketchplugin/sketchplugin.pro
Normal file
20
plugins/sketchplugin/sketchplugin.pro
Normal file
@@ -0,0 +1,20 @@
|
||||
QT += core network gui widgets
|
||||
|
||||
TARGET = sketchplugin
|
||||
|
||||
DBLIBS += core gui
|
||||
|
||||
HEADERS += sketchplugin.h
|
||||
|
||||
SOURCES += sketchplugin.cpp
|
||||
|
||||
FORMS +=
|
||||
|
||||
RESOURCES += sketchplugin_resources.qrc
|
||||
|
||||
TRANSLATIONS += translations/sketchplugin_en.ts \
|
||||
translations/sketchplugin_de.ts
|
||||
|
||||
OTHER_FILES += sketchplugin.json
|
||||
|
||||
include(../plugin.pri)
|
4
plugins/sketchplugin/sketchplugin_resources.qrc
Normal file
4
plugins/sketchplugin/sketchplugin_resources.qrc
Normal file
@@ -0,0 +1,4 @@
|
||||
<RCC>
|
||||
<qresource prefix="/zeiterfassung/plugins/sketchplugin">
|
||||
</qresource>
|
||||
</RCC>
|
4
plugins/sketchplugin/translations/sketchplugin_de.ts
Normal file
4
plugins/sketchplugin/translations/sketchplugin_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/sketchplugin/translations/sketchplugin_en.ts
Normal file
4
plugins/sketchplugin/translations/sketchplugin_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>
|
Reference in New Issue
Block a user