Added webradioplugin
This commit is contained in:
@@ -6,4 +6,5 @@ SUBDIRS += advancedviewplugin \
|
|||||||
presenceplugin \
|
presenceplugin \
|
||||||
reportsplugin \
|
reportsplugin \
|
||||||
updaterplugin \
|
updaterplugin \
|
||||||
weatherplugin
|
weatherplugin \
|
||||||
|
webradioplugin
|
||||||
|
BIN
plugins/webradioplugin/images/web-radio.png
Normal file
BIN
plugins/webradioplugin/images/web-radio.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
12
plugins/webradioplugin/translations/webradioplugin_de.ts
Normal file
12
plugins/webradioplugin/translations/webradioplugin_de.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="de_DE">
|
||||||
|
<context>
|
||||||
|
<name>WebRadioPlugin</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradioplugin.cpp" line="36"/>
|
||||||
|
<source>Play webradio</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
12
plugins/webradioplugin/translations/webradioplugin_en.ts
Normal file
12
plugins/webradioplugin/translations/webradioplugin_en.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US">
|
||||||
|
<context>
|
||||||
|
<name>WebRadioPlugin</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradioplugin.cpp" line="36"/>
|
||||||
|
<source>Play webradio</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
40
plugins/webradioplugin/webradioplugin.cpp
Normal file
40
plugins/webradioplugin/webradioplugin.cpp
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#include "webradioplugin.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
WebRadioPlugin::WebRadioPlugin(QObject *parent) :
|
||||||
|
ZeiterfassungPlugin(parent)
|
||||||
|
{
|
||||||
|
qDebug() << "called";
|
||||||
|
|
||||||
|
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||||
|
|
||||||
|
if(m_translator.load(QLocale(), QStringLiteral("webradioplugin"), QStringLiteral("_"), dir))
|
||||||
|
{
|
||||||
|
if(!QCoreApplication::installTranslator(&m_translator))
|
||||||
|
{
|
||||||
|
qWarning() << "could not install translation webradioplugin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning() << "could not load translation webradioplugin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WebRadioPlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
{
|
||||||
|
auto dialog = new QDialog(&mainWindow);
|
||||||
|
dialog->setWindowFlag(Qt::WindowCloseButtonHint, true);
|
||||||
|
dialog->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
|
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/webradioplugin/images/web-radio.png")),
|
||||||
|
tr("Play webradio"), dialog, &QWidget::show);
|
||||||
|
}
|
22
plugins/webradioplugin/webradioplugin.h
Normal file
22
plugins/webradioplugin/webradioplugin.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
|
#include "zeiterfassungplugin.h"
|
||||||
|
|
||||||
|
class Q_DECL_EXPORT WebRadioPlugin : public ZeiterfassungPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "webradioplugin.json")
|
||||||
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit WebRadioPlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
// ZeiterfassungPlugin interface
|
||||||
|
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTranslator m_translator;
|
||||||
|
};
|
0
plugins/webradioplugin/webradioplugin.json
Normal file
0
plugins/webradioplugin/webradioplugin.json
Normal file
35
plugins/webradioplugin/webradioplugin.pro
Normal file
35
plugins/webradioplugin/webradioplugin.pro
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
QT += core network gui widgets multimedia
|
||||||
|
|
||||||
|
TARGET = webradioplugin
|
||||||
|
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 += webradioplugin.h
|
||||||
|
|
||||||
|
SOURCES += webradioplugin.cpp
|
||||||
|
|
||||||
|
FORMS +=
|
||||||
|
|
||||||
|
RESOURCES += webradioplugin_resources.qrc
|
||||||
|
|
||||||
|
TRANSLATIONS += translations/webradioplugin_en.ts \
|
||||||
|
translations/webradioplugin_de.ts
|
||||||
|
|
||||||
|
OTHER_FILES += webradioplugin.json
|
||||||
|
|
||||||
|
include(../../lrelease.pri)
|
||||||
|
|
||||||
|
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/webradioplugin_en.qm \
|
||||||
|
$${OUT_PWD}/translations/webradioplugin_de.qm
|
||||||
|
|
||||||
|
include(../copy_translations.pri)
|
5
plugins/webradioplugin/webradioplugin_resources.qrc
Normal file
5
plugins/webradioplugin/webradioplugin_resources.qrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/zeiterfassung/plugins/webradioplugin">
|
||||||
|
<file>images/web-radio.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
Reference in New Issue
Block a user