From f397c64e9a1c3e1549aa784b5f4dcf87962f6bb5 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Thu, 21 Dec 2017 21:42:23 +0100 Subject: [PATCH] Added webradioplugin --- plugins/plugins.pro | 3 +- plugins/webradioplugin/images/web-radio.png | Bin 0 -> 4209 bytes .../translations/webradioplugin_de.ts | 12 ++++++ .../translations/webradioplugin_en.ts | 12 ++++++ plugins/webradioplugin/webradioplugin.cpp | 40 ++++++++++++++++++ plugins/webradioplugin/webradioplugin.h | 22 ++++++++++ plugins/webradioplugin/webradioplugin.json | 0 plugins/webradioplugin/webradioplugin.pro | 35 +++++++++++++++ .../webradioplugin_resources.qrc | 5 +++ 9 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 plugins/webradioplugin/images/web-radio.png create mode 100644 plugins/webradioplugin/translations/webradioplugin_de.ts create mode 100644 plugins/webradioplugin/translations/webradioplugin_en.ts create mode 100644 plugins/webradioplugin/webradioplugin.cpp create mode 100644 plugins/webradioplugin/webradioplugin.h create mode 100644 plugins/webradioplugin/webradioplugin.json create mode 100644 plugins/webradioplugin/webradioplugin.pro create mode 100644 plugins/webradioplugin/webradioplugin_resources.qrc diff --git a/plugins/plugins.pro b/plugins/plugins.pro index dab007d..5a6d1f5 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -6,4 +6,5 @@ SUBDIRS += advancedviewplugin \ presenceplugin \ reportsplugin \ updaterplugin \ - weatherplugin + weatherplugin \ + webradioplugin diff --git a/plugins/webradioplugin/images/web-radio.png b/plugins/webradioplugin/images/web-radio.png new file mode 100644 index 0000000000000000000000000000000000000000..c68d7c11690f317fe2d334bf8705d11bc5e390d5 GIT binary patch literal 4209 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hE_w~w{4WI=2eWdR@rErt<2IDFkwQ2%b(68{QnksEZEo-FhyQaZIi<(`3Vz# zCjM(+2@+8f6zEJ%d356ei<0%W#PVzRzQ5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ebRadioPlugin + + + Play webradio + + + + diff --git a/plugins/webradioplugin/translations/webradioplugin_en.ts b/plugins/webradioplugin/translations/webradioplugin_en.ts new file mode 100644 index 0000000..9db9347 --- /dev/null +++ b/plugins/webradioplugin/translations/webradioplugin_en.ts @@ -0,0 +1,12 @@ + + + + + WebRadioPlugin + + + Play webradio + + + + diff --git a/plugins/webradioplugin/webradioplugin.cpp b/plugins/webradioplugin/webradioplugin.cpp new file mode 100644 index 0000000..98a0b99 --- /dev/null +++ b/plugins/webradioplugin/webradioplugin.cpp @@ -0,0 +1,40 @@ +#include "webradioplugin.h" + +#include +#include +#include +#include +#include +#include +#include + +#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); +} diff --git a/plugins/webradioplugin/webradioplugin.h b/plugins/webradioplugin/webradioplugin.h new file mode 100644 index 0000000..e11932d --- /dev/null +++ b/plugins/webradioplugin/webradioplugin.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include + +#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; +}; diff --git a/plugins/webradioplugin/webradioplugin.json b/plugins/webradioplugin/webradioplugin.json new file mode 100644 index 0000000..e69de29 diff --git a/plugins/webradioplugin/webradioplugin.pro b/plugins/webradioplugin/webradioplugin.pro new file mode 100644 index 0000000..d56f0d6 --- /dev/null +++ b/plugins/webradioplugin/webradioplugin.pro @@ -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) diff --git a/plugins/webradioplugin/webradioplugin_resources.qrc b/plugins/webradioplugin/webradioplugin_resources.qrc new file mode 100644 index 0000000..f7b12b5 --- /dev/null +++ b/plugins/webradioplugin/webradioplugin_resources.qrc @@ -0,0 +1,5 @@ + + + images/web-radio.png + +