Added favorites plugin
This commit is contained in:
26
plugins/favoritesplugin/favoritesplugin.cpp
Normal file
26
plugins/favoritesplugin/favoritesplugin.cpp
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#include "favoritesplugin.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QLocale>
|
||||||
|
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
}
|
19
plugins/favoritesplugin/favoritesplugin.h
Normal file
19
plugins/favoritesplugin/favoritesplugin.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
|
#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;
|
||||||
|
};
|
0
plugins/favoritesplugin/favoritesplugin.json
Normal file
0
plugins/favoritesplugin/favoritesplugin.json
Normal file
20
plugins/favoritesplugin/favoritesplugin.pro
Normal file
20
plugins/favoritesplugin/favoritesplugin.pro
Normal file
@@ -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)
|
4
plugins/favoritesplugin/favoritesplugin_resources.qrc
Normal file
4
plugins/favoritesplugin/favoritesplugin_resources.qrc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/zeiterfassung/plugins/favoritesplugin">
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="de_DE">
|
||||||
|
</TS>
|
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US">
|
||||||
|
</TS>
|
@@ -3,6 +3,7 @@ TEMPLATE = subdirs
|
|||||||
SUBDIRS += absenceplugin \
|
SUBDIRS += absenceplugin \
|
||||||
advancedviewplugin \
|
advancedviewplugin \
|
||||||
devtoolsplugin \
|
devtoolsplugin \
|
||||||
|
favoritesplugin \
|
||||||
lunchmealplugin \
|
lunchmealplugin \
|
||||||
profileplugin \
|
profileplugin \
|
||||||
presenceplugin \
|
presenceplugin \
|
||||||
|
Reference in New Issue
Block a user