Devel #56
@@ -1,10 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>WebRadioDialog</name>
|
||||
<message>
|
||||
<location filename="../webradiodialog.ui" line="14"/>
|
||||
<source>Dialog</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../webradiodialog.ui" line="42"/>
|
||||
<source>PushButton</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WebRadioPlugin</name>
|
||||
<message>
|
||||
<location filename="../webradioplugin.cpp" line="36"/>
|
||||
<location filename="../webradioplugin.cpp" line="38"/>
|
||||
<source>Play webradio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@@ -1,10 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>WebRadioDialog</name>
|
||||
<message>
|
||||
<location filename="../webradiodialog.ui" line="14"/>
|
||||
<source>Dialog</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../webradiodialog.ui" line="42"/>
|
||||
<source>PushButton</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WebRadioPlugin</name>
|
||||
<message>
|
||||
<location filename="../webradioplugin.cpp" line="36"/>
|
||||
<location filename="../webradioplugin.cpp" line="38"/>
|
||||
<source>Play webradio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
26
plugins/webradioplugin/webradiodialog.cpp
Normal file
26
plugins/webradioplugin/webradiodialog.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "webradiodialog.h"
|
||||
#include "ui_webradiodialog.h"
|
||||
|
||||
#include <QMediaPlayer>
|
||||
|
||||
WebRadioDialog::WebRadioDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::WebRadioDialog),
|
||||
m_player(new QMediaPlayer(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_player->setMedia(QMediaContent(QUrl(QStringLiteral("http://stream.drumandbass.fm:9002"))));
|
||||
|
||||
connect(ui->pushButton, &QAbstractButton::pressed, m_player, &QMediaPlayer::play);
|
||||
}
|
||||
|
||||
WebRadioDialog::~WebRadioDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void WebRadioDialog::play()
|
||||
{
|
||||
|
||||
}
|
27
plugins/webradioplugin/webradiodialog.h
Normal file
27
plugins/webradioplugin/webradiodialog.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef WEBRADIODIALOG_H
|
||||
#define WEBRADIODIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class QMediaPlayer;
|
||||
|
||||
namespace Ui { class WebRadioDialog; }
|
||||
|
||||
class WebRadioDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WebRadioDialog(QWidget *parent = 0);
|
||||
~WebRadioDialog();
|
||||
|
||||
private Q_SLOTS:
|
||||
void play();
|
||||
|
||||
private:
|
||||
Ui::WebRadioDialog *ui;
|
||||
|
||||
QMediaPlayer *m_player;
|
||||
};
|
||||
|
||||
#endif // WEBRADIODIALOG_H
|
81
plugins/webradioplugin/webradiodialog.ui
Normal file
81
plugins/webradioplugin/webradiodialog.ui
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>WebRadioDialog</class>
|
||||
<widget class="QDialog" name="WebRadioDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>240</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>60</y>
|
||||
<width>191</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>WebRadioDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>WebRadioDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@@ -4,12 +4,13 @@
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
#include <QDialog>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "webradiodialog.h"
|
||||
|
||||
WebRadioPlugin::WebRadioPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
@@ -32,9 +33,7 @@ WebRadioPlugin::WebRadioPlugin(QObject *parent) :
|
||||
|
||||
void WebRadioPlugin::attachTo(MainWindow &mainWindow)
|
||||
{
|
||||
auto dialog = new QDialog(&mainWindow);
|
||||
dialog->setWindowFlag(Qt::WindowCloseButtonHint, true);
|
||||
dialog->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||
auto dialog = new WebRadioDialog(&mainWindow);
|
||||
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/webradioplugin/images/web-radio.png")),
|
||||
tr("Play webradio"), dialog, &QWidget::show);
|
||||
}
|
||||
|
@@ -14,11 +14,14 @@ DEPENDPATH += $$PWD/../../zeiterfassungcorelib $$PWD/../../zeiterfassungguilib
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += webradioplugin.h
|
||||
HEADERS += webradioplugin.h \
|
||||
webradiodialog.h
|
||||
|
||||
SOURCES += webradioplugin.cpp
|
||||
SOURCES += webradioplugin.cpp \
|
||||
webradiodialog.cpp
|
||||
|
||||
FORMS +=
|
||||
FORMS += \
|
||||
webradiodialog.ui
|
||||
|
||||
RESOURCES += webradioplugin_resources.qrc
|
||||
|
||||
|
Reference in New Issue
Block a user