Release 1.5 #39
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "stripswidget.h"
|
||||
|
||||
#include "advancedviewwidget.h"
|
||||
|
||||
AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) :
|
||||
|
@@ -6,10 +6,11 @@
|
||||
#include "advancedviewdialog.h"
|
||||
|
||||
AdvancedViewWidget::AdvancedViewWidget(StripsWidget &stripsWidget) :
|
||||
QPushButton(&stripsWidget),
|
||||
QToolButton(&stripsWidget),
|
||||
m_stripsWidget(stripsWidget)
|
||||
{
|
||||
setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/advancedviewplugin/images/advanced-view.png")));
|
||||
setText(tr("Advanced view"));
|
||||
|
||||
connect(&stripsWidget, &StripsWidget::dateChanged, this, &AdvancedViewWidget::dateChanged);
|
||||
dateChanged(stripsWidget.date());
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#ifndef ADVANCEDVIEWWIDGET_H
|
||||
#define ADVANCEDVIEWWIDGET_H
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QToolButton>
|
||||
|
||||
class StripsWidget;
|
||||
|
||||
class AdvancedViewWidget : public QPushButton
|
||||
class AdvancedViewWidget : public QToolButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
BIN
plugins/lunchmealplugin/images/lunch-meal.png
Normal file
BIN
plugins/lunchmealplugin/images/lunch-meal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
@@ -1,9 +1,21 @@
|
||||
#include "lunchmealplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QBoxLayout>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "stripswidget.h"
|
||||
|
||||
#include "lunchmealwidget.h"
|
||||
|
||||
LunchMealPlugin::LunchMealPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
qDebug() << "called";
|
||||
}
|
||||
|
||||
void LunchMealPlugin::attachTo(MainWindow &mainWindow)
|
||||
{
|
||||
for(auto stripsWidget : mainWindow.stripsWidgets())
|
||||
stripsWidget->headerLayout()->addWidget(new LunchMealWidget(*stripsWidget));
|
||||
}
|
||||
|
@@ -5,6 +5,8 @@
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Q_DECL_EXPORT LunchMealPlugin : public ZeiterfassungPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -15,6 +17,7 @@ public:
|
||||
explicit LunchMealPlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // LUNCHMEALPLUGIN_H
|
||||
|
@@ -14,8 +14,16 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += lunchmealplugin.h
|
||||
HEADERS += lunchmealplugin.h \
|
||||
lunchmealwidget.h
|
||||
|
||||
SOURCES += lunchmealplugin.cpp
|
||||
SOURCES += lunchmealplugin.cpp \
|
||||
lunchmealwidget.cpp
|
||||
|
||||
FORMS +=
|
||||
|
||||
RESOURCES += lunchmealplugin_resources.qrc
|
||||
|
||||
TRANSLATIONS +=
|
||||
|
||||
OTHER_FILES += lunchmealplugin.json
|
||||
|
5
plugins/lunchmealplugin/lunchmealplugin_resources.qrc
Normal file
5
plugins/lunchmealplugin/lunchmealplugin_resources.qrc
Normal file
@@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/zeiterfassung/plugins/lunchmealplugin">
|
||||
<file>images/lunch-meal.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
22
plugins/lunchmealplugin/lunchmealwidget.cpp
Normal file
22
plugins/lunchmealplugin/lunchmealwidget.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "lunchmealwidget.h"
|
||||
|
||||
#include <QIcon>
|
||||
|
||||
#include "stripswidget.h"
|
||||
#include "mainwindow.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
LunchMealWidget::LunchMealWidget(StripsWidget &stripsWidget) :
|
||||
QToolButton(&stripsWidget),
|
||||
m_stripsWidget(stripsWidget)
|
||||
{
|
||||
setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/lunchmealplugin/images/lunch-meal.png")));
|
||||
setText(tr("Lunch meal"));
|
||||
|
||||
connect(this, &QAbstractButton::pressed, this, &LunchMealWidget::pressedSlot);
|
||||
}
|
||||
|
||||
void LunchMealWidget::pressedSlot()
|
||||
{
|
||||
|
||||
}
|
21
plugins/lunchmealplugin/lunchmealwidget.h
Normal file
21
plugins/lunchmealplugin/lunchmealwidget.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef LUNCHMEALWIDGET_H
|
||||
#define LUNCHMEALWIDGET_H
|
||||
|
||||
#include <QToolButton>
|
||||
|
||||
class StripsWidget;
|
||||
|
||||
class LunchMealWidget : public QToolButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LunchMealWidget(StripsWidget &stripsWidget);
|
||||
|
||||
private Q_SLOTS:
|
||||
void pressedSlot();
|
||||
|
||||
private:
|
||||
StripsWidget &m_stripsWidget;
|
||||
};
|
||||
|
||||
#endif // LUNCHMEALWIDGET_H
|
Reference in New Issue
Block a user