Reports plugin #34
@@ -1,5 +1,5 @@
|
|||||||
#include "advanvedviewdialog.h"
|
#include "advancedviewdialog.h"
|
||||||
#include "ui_advanvedviewdialog.h"
|
#include "ui_advancedviewdialog.h"
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@@ -21,9 +21,9 @@
|
|||||||
#include "models/bookingsmodel.h"
|
#include "models/bookingsmodel.h"
|
||||||
#include "models/timeassignmentsmodel.h"
|
#include "models/timeassignmentsmodel.h"
|
||||||
|
|
||||||
AdvanvedViewDialog::AdvanvedViewDialog(StripsWidget &stripsWidget) :
|
AdvancedViewDialog::AdvancedViewDialog(StripsWidget &stripsWidget) :
|
||||||
QDialog(&stripsWidget.mainWindow()),
|
QDialog(&stripsWidget.mainWindow()),
|
||||||
ui(new Ui::AdvanvedViewDialog),
|
ui(new Ui::AdvancedViewDialog),
|
||||||
m_stripsWidget(stripsWidget),
|
m_stripsWidget(stripsWidget),
|
||||||
m_bookingsModel(new BookingsModel(stripsWidget, this)),
|
m_bookingsModel(new BookingsModel(stripsWidget, this)),
|
||||||
m_timeAssignmentsModel(new TimeAssignmentsModel(stripsWidget, this))
|
m_timeAssignmentsModel(new TimeAssignmentsModel(stripsWidget, this))
|
||||||
@@ -33,20 +33,20 @@ AdvanvedViewDialog::AdvanvedViewDialog(StripsWidget &stripsWidget) :
|
|||||||
ui->bookingsView->setModel(m_bookingsModel);
|
ui->bookingsView->setModel(m_bookingsModel);
|
||||||
ui->bookingsView->setEnabled(m_bookingsModel->enabled());
|
ui->bookingsView->setEnabled(m_bookingsModel->enabled());
|
||||||
connect(m_bookingsModel, &BookingsModel::enabledChanged, ui->bookingsView, &QWidget::setEnabled);
|
connect(m_bookingsModel, &BookingsModel::enabledChanged, ui->bookingsView, &QWidget::setEnabled);
|
||||||
connect(ui->bookingsView, &QWidget::customContextMenuRequested, this, &AdvanvedViewDialog::contextMenuBooking);
|
connect(ui->bookingsView, &QWidget::customContextMenuRequested, this, &AdvancedViewDialog::contextMenuBooking);
|
||||||
|
|
||||||
ui->timeAssignmentsView->setModel(m_timeAssignmentsModel);
|
ui->timeAssignmentsView->setModel(m_timeAssignmentsModel);
|
||||||
ui->timeAssignmentsView->setEnabled(m_timeAssignmentsModel->enabled());
|
ui->timeAssignmentsView->setEnabled(m_timeAssignmentsModel->enabled());
|
||||||
connect(m_timeAssignmentsModel, &TimeAssignmentsModel::enabledChanged, ui->timeAssignmentsView, &QWidget::setEnabled);
|
connect(m_timeAssignmentsModel, &TimeAssignmentsModel::enabledChanged, ui->timeAssignmentsView, &QWidget::setEnabled);
|
||||||
connect(ui->timeAssignmentsView, &QWidget::customContextMenuRequested, this, &AdvanvedViewDialog::contextMenuTimeAssignment);
|
connect(ui->timeAssignmentsView, &QWidget::customContextMenuRequested, this, &AdvancedViewDialog::contextMenuTimeAssignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
AdvanvedViewDialog::~AdvanvedViewDialog()
|
AdvancedViewDialog::~AdvancedViewDialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos)
|
void AdvancedViewDialog::contextMenuBooking(const QPoint &pos)
|
||||||
{
|
{
|
||||||
auto index = ui->bookingsView->indexAt(pos);
|
auto index = ui->bookingsView->indexAt(pos);
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
void AdvancedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
||||||
{
|
{
|
||||||
auto index = ui->timeAssignmentsView->indexAt(pos);
|
auto index = ui->timeAssignmentsView->indexAt(pos);
|
||||||
|
|
@@ -1,27 +1,27 @@
|
|||||||
#ifndef ADVANVEDVIEWDIALOG_H
|
#ifndef ADVANCEDVIEWDIALOG_H
|
||||||
#define ADVANVEDVIEWDIALOG_H
|
#define ADVANCEDVIEWDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace Ui { class AdvanvedViewDialog; }
|
namespace Ui { class AdvancedViewDialog; }
|
||||||
class StripsWidget;
|
class StripsWidget;
|
||||||
class BookingsModel;
|
class BookingsModel;
|
||||||
class TimeAssignmentsModel;
|
class TimeAssignmentsModel;
|
||||||
|
|
||||||
class AdvanvedViewDialog : public QDialog
|
class AdvancedViewDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AdvanvedViewDialog(StripsWidget &stripsWidget);
|
explicit AdvancedViewDialog(StripsWidget &stripsWidget);
|
||||||
~AdvanvedViewDialog();
|
~AdvancedViewDialog();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void contextMenuBooking(const QPoint &pos);
|
void contextMenuBooking(const QPoint &pos);
|
||||||
void contextMenuTimeAssignment(const QPoint &pos);
|
void contextMenuTimeAssignment(const QPoint &pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AdvanvedViewDialog *ui;
|
Ui::AdvancedViewDialog *ui;
|
||||||
|
|
||||||
StripsWidget &m_stripsWidget;
|
StripsWidget &m_stripsWidget;
|
||||||
|
|
||||||
@@ -29,4 +29,4 @@ private:
|
|||||||
TimeAssignmentsModel *m_timeAssignmentsModel;
|
TimeAssignmentsModel *m_timeAssignmentsModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ADVANVEDVIEWDIALOG_H
|
#endif // ADVANCEDVIEWDIALOG_H
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>AdvanvedViewDialog</class>
|
<class>AdvancedViewDialog</class>
|
||||||
<widget class="QDialog" name="AdvanvedViewDialog">
|
<widget class="QDialog" name="AdvancedViewDialog">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>AdvanvedViewDialog</receiver>
|
<receiver>AdvancedViewDialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>rejected()</signal>
|
||||||
<receiver>AdvanvedViewDialog</receiver>
|
<receiver>AdvancedViewDialog</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
@@ -11,7 +11,6 @@ AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) :
|
|||||||
ZeiterfassungPlugin(parent)
|
ZeiterfassungPlugin(parent)
|
||||||
{
|
{
|
||||||
qDebug() << "called";
|
qDebug() << "called";
|
||||||
Q_INIT_RESOURCE(advancedviewplugin_resources);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvancedViewPlugin::attachTo(MainWindow &mainWindow)
|
void AdvancedViewPlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
@@ -14,7 +14,7 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib
|
|||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
HEADERS += advanvedviewdialog.h \
|
HEADERS += advancedviewdialog.h \
|
||||||
advancedviewplugin.h \
|
advancedviewplugin.h \
|
||||||
advancedviewwidget.h \
|
advancedviewwidget.h \
|
||||||
dialogs/bookingdialog.h \
|
dialogs/bookingdialog.h \
|
||||||
@@ -22,7 +22,7 @@ HEADERS += advanvedviewdialog.h \
|
|||||||
models/bookingsmodel.h \
|
models/bookingsmodel.h \
|
||||||
models/timeassignmentsmodel.h
|
models/timeassignmentsmodel.h
|
||||||
|
|
||||||
SOURCES += advanvedviewdialog.cpp \
|
SOURCES += advancedviewdialog.cpp \
|
||||||
advancedviewplugin.cpp \
|
advancedviewplugin.cpp \
|
||||||
advancedviewwidget.cpp \
|
advancedviewwidget.cpp \
|
||||||
dialogs/bookingdialog.cpp \
|
dialogs/bookingdialog.cpp \
|
||||||
@@ -30,7 +30,7 @@ SOURCES += advanvedviewdialog.cpp \
|
|||||||
models/bookingsmodel.cpp \
|
models/bookingsmodel.cpp \
|
||||||
models/timeassignmentsmodel.cpp
|
models/timeassignmentsmodel.cpp
|
||||||
|
|
||||||
FORMS += advanvedviewdialog.ui \
|
FORMS += advancedviewdialog.ui \
|
||||||
dialogs/bookingdialog.ui \
|
dialogs/bookingdialog.ui \
|
||||||
dialogs/timeassignmentdialog.ui
|
dialogs/timeassignmentdialog.ui
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/zeiterfassunglib/plugins/advancedviewplugin">
|
<qresource prefix="/zeiterfassung/plugins/advancedviewplugin">
|
||||||
<file>images/advanced-view.png</file>
|
<file>images/advanced-view.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@@ -3,13 +3,13 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include "stripswidget.h"
|
#include "stripswidget.h"
|
||||||
#include "advanvedviewdialog.h"
|
#include "advancedviewdialog.h"
|
||||||
|
|
||||||
AdvancedViewWidget::AdvancedViewWidget(StripsWidget &stripsWidget) :
|
AdvancedViewWidget::AdvancedViewWidget(StripsWidget &stripsWidget) :
|
||||||
QPushButton(&stripsWidget),
|
QPushButton(&stripsWidget),
|
||||||
m_stripsWidget(stripsWidget)
|
m_stripsWidget(stripsWidget)
|
||||||
{
|
{
|
||||||
setIcon(QIcon(QStringLiteral(":/zeiterfassunglib/plugins/advancedviewplugin/images/advanced-view.png")));
|
setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/advancedviewplugin/images/advanced-view.png")));
|
||||||
|
|
||||||
connect(&stripsWidget, &StripsWidget::dateChanged, this, &AdvancedViewWidget::dateChanged);
|
connect(&stripsWidget, &StripsWidget::dateChanged, this, &AdvancedViewWidget::dateChanged);
|
||||||
dateChanged(stripsWidget.date());
|
dateChanged(stripsWidget.date());
|
||||||
@@ -24,6 +24,6 @@ void AdvancedViewWidget::dateChanged(const QDate &date)
|
|||||||
|
|
||||||
void AdvancedViewWidget::pressedSlot()
|
void AdvancedViewWidget::pressedSlot()
|
||||||
{
|
{
|
||||||
AdvanvedViewDialog dialog(m_stripsWidget);
|
AdvancedViewDialog dialog(m_stripsWidget);
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@ BookingsModel::BookingsModel(StripsWidget &stripsWidget, QObject *parent) :
|
|||||||
m_stripsWidget(stripsWidget)
|
m_stripsWidget(stripsWidget)
|
||||||
{
|
{
|
||||||
connect(&stripsWidget, &StripsWidget::bookingsChanged, this, &BookingsModel::bookingsChanged);
|
connect(&stripsWidget, &StripsWidget::bookingsChanged, this, &BookingsModel::bookingsChanged);
|
||||||
connect(&stripsWidget, &StripsWidget::refreshingBookingsChanged, [=](bool refreshing){ enabledChanged(!refreshing); });
|
connect(&stripsWidget, &StripsWidget::refreshingBookingsChanged, this, &BookingsModel::refreshingChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
StripsWidget &BookingsModel::stripsWidget() const
|
StripsWidget &BookingsModel::stripsWidget() const
|
||||||
@@ -86,3 +86,8 @@ void BookingsModel::bookingsChanged()
|
|||||||
beginResetModel();
|
beginResetModel();
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BookingsModel::refreshingChanged(bool refreshing)
|
||||||
|
{
|
||||||
|
Q_EMIT enabledChanged(!refreshing);
|
||||||
|
}
|
||||||
|
@@ -32,6 +32,7 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void bookingsChanged();
|
void bookingsChanged();
|
||||||
|
void refreshingChanged(bool refreshing);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StripsWidget &m_stripsWidget;
|
StripsWidget &m_stripsWidget;
|
||||||
|
@@ -7,7 +7,7 @@ TimeAssignmentsModel::TimeAssignmentsModel(StripsWidget &stripsWidget, QObject *
|
|||||||
m_stripsWidget(stripsWidget)
|
m_stripsWidget(stripsWidget)
|
||||||
{
|
{
|
||||||
connect(&stripsWidget, &StripsWidget::timeAssignmentsChanged, this, &TimeAssignmentsModel::timeAssignmentsChanged);
|
connect(&stripsWidget, &StripsWidget::timeAssignmentsChanged, this, &TimeAssignmentsModel::timeAssignmentsChanged);
|
||||||
connect(&stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, [=](bool refreshing){ enabledChanged(!refreshing); });
|
connect(&stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, this, &TimeAssignmentsModel::refreshingChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
StripsWidget &TimeAssignmentsModel::stripsWidget() const
|
StripsWidget &TimeAssignmentsModel::stripsWidget() const
|
||||||
@@ -90,3 +90,8 @@ void TimeAssignmentsModel::timeAssignmentsChanged()
|
|||||||
beginResetModel();
|
beginResetModel();
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TimeAssignmentsModel::refreshingChanged(bool refreshing)
|
||||||
|
{
|
||||||
|
Q_EMIT enabledChanged(!refreshing);
|
||||||
|
}
|
||||||
|
@@ -3,5 +3,6 @@ TEMPLATE = subdirs
|
|||||||
SUBDIRS += advancedviewplugin \
|
SUBDIRS += advancedviewplugin \
|
||||||
lunchmealplugin \
|
lunchmealplugin \
|
||||||
presenceplugin \
|
presenceplugin \
|
||||||
|
reportsplugin \
|
||||||
updaterplugin \
|
updaterplugin \
|
||||||
weatherplugin
|
weatherplugin
|
||||||
|
BIN
plugins/presenceplugin/images/refresh.png
Normal file
BIN
plugins/presenceplugin/images/refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include "presencewidget.h"
|
#include "presencewidget.h"
|
||||||
|
|
||||||
PresencePlugin::PresencePlugin(QObject *parent) :
|
PresencePlugin::PresencePlugin(QObject *parent) :
|
||||||
|
@@ -20,4 +20,10 @@ HEADERS += presenceplugin.h \
|
|||||||
SOURCES += presenceplugin.cpp \
|
SOURCES += presenceplugin.cpp \
|
||||||
presencewidget.cpp
|
presencewidget.cpp
|
||||||
|
|
||||||
|
FORMS +=
|
||||||
|
|
||||||
|
RESOURCES += presenceplugin_resources.qrc
|
||||||
|
|
||||||
|
TRANSLATIONS +=
|
||||||
|
|
||||||
OTHER_FILES += presenceplugin.json
|
OTHER_FILES += presenceplugin.json
|
||||||
|
5
plugins/presenceplugin/presenceplugin_resources.qrc
Normal file
5
plugins/presenceplugin/presenceplugin_resources.qrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/zeiterfassung/plugins/presenceplugin">
|
||||||
|
<file>images/refresh.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
|
#include <QMenu>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
@@ -23,6 +24,9 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) :
|
|||||||
m_labelNotAvailable->setFrameShadow(QFrame::Sunken);
|
m_labelNotAvailable->setFrameShadow(QFrame::Sunken);
|
||||||
m_mainWindow.statusBar()->addWidget(m_labelNotAvailable);
|
m_mainWindow.statusBar()->addWidget(m_labelNotAvailable);
|
||||||
|
|
||||||
|
m_action = m_mainWindow.menuView()->addAction(QIcon(QStringLiteral(":zeiterfassung/plugins/presenceplugin/images/refresh.png")),
|
||||||
|
tr("Refresh presence"), this, &PresenceWidget::timeout);
|
||||||
|
|
||||||
auto timer = new QTimer(this);
|
auto timer = new QTimer(this);
|
||||||
timer->setInterval(60000);
|
timer->setInterval(60000);
|
||||||
connect(timer, &QTimer::timeout, this, &PresenceWidget::timeout);
|
connect(timer, &QTimer::timeout, this, &PresenceWidget::timeout);
|
||||||
@@ -33,15 +37,11 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) :
|
|||||||
|
|
||||||
void PresenceWidget::timeout()
|
void PresenceWidget::timeout()
|
||||||
{
|
{
|
||||||
if(m_reply)
|
|
||||||
{
|
|
||||||
qWarning() << "last request not finished yet!";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_labelAvailable->setText(tr("%0: %1").arg(tr("Available")).arg(tr("???")));
|
m_labelAvailable->setText(tr("%0: %1").arg(tr("Available")).arg(tr("???")));
|
||||||
m_labelNotAvailable->setText(tr("%0: %1").arg(tr("Not available")).arg(tr("???")));
|
m_labelNotAvailable->setText(tr("%0: %1").arg(tr("Not available")).arg(tr("???")));
|
||||||
|
|
||||||
|
m_action->setEnabled(false);
|
||||||
|
|
||||||
m_reply = m_mainWindow.erfassung().doGetPresenceStatus();
|
m_reply = m_mainWindow.erfassung().doGetPresenceStatus();
|
||||||
connect(m_reply.get(), &ZeiterfassungReply::finished, this, &PresenceWidget::finished);
|
connect(m_reply.get(), &ZeiterfassungReply::finished, this, &PresenceWidget::finished);
|
||||||
}
|
}
|
||||||
@@ -73,5 +73,6 @@ void PresenceWidget::finished()
|
|||||||
}
|
}
|
||||||
|
|
||||||
after:
|
after:
|
||||||
|
m_action->setEnabled(true);
|
||||||
m_reply = Q_NULLPTR;
|
m_reply = Q_NULLPTR;
|
||||||
}
|
}
|
||||||
|
@@ -6,12 +6,14 @@
|
|||||||
#include "replies/getpresencestatusreply.h"
|
#include "replies/getpresencestatusreply.h"
|
||||||
|
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
class QAction;
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
||||||
class PresenceWidget : public QWidget
|
class PresenceWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PresenceWidget(MainWindow &mainWindow);
|
explicit PresenceWidget(MainWindow &mainWindow);
|
||||||
|
|
||||||
@@ -25,6 +27,8 @@ private:
|
|||||||
QLabel *m_labelAvailable;
|
QLabel *m_labelAvailable;
|
||||||
QLabel *m_labelNotAvailable;
|
QLabel *m_labelNotAvailable;
|
||||||
|
|
||||||
|
QAction *m_action;
|
||||||
|
|
||||||
std::unique_ptr<GetPresenceStatusReply> m_reply;
|
std::unique_ptr<GetPresenceStatusReply> m_reply;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
BIN
plugins/reportsplugin/images/refresh.png
Normal file
BIN
plugins/reportsplugin/images/refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
16
plugins/reportsplugin/reportsplugin.cpp
Normal file
16
plugins/reportsplugin/reportsplugin.cpp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#include "reportsplugin.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "reportswidget.h"
|
||||||
|
|
||||||
|
ReportsPlugin::ReportsPlugin(QObject *parent) :
|
||||||
|
ZeiterfassungPlugin(parent)
|
||||||
|
{
|
||||||
|
qDebug() << "called";
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportsPlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
{
|
||||||
|
new ReportsWidget(mainWindow);
|
||||||
|
}
|
23
plugins/reportsplugin/reportsplugin.h
Normal file
23
plugins/reportsplugin/reportsplugin.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef REPORTSPLUGIN_H
|
||||||
|
#define REPORTSPLUGIN_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
#include "zeiterfassungplugin.h"
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
class Q_DECL_EXPORT ReportsPlugin : public ZeiterfassungPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "reportsplugin.json")
|
||||||
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ReportsPlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
// ZeiterfassungPlugin interface
|
||||||
|
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // REPORTSPLUGIN_H
|
0
plugins/reportsplugin/reportsplugin.json
Normal file
0
plugins/reportsplugin/reportsplugin.json
Normal file
29
plugins/reportsplugin/reportsplugin.pro
Normal file
29
plugins/reportsplugin/reportsplugin.pro
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
QT += core network gui widgets
|
||||||
|
|
||||||
|
TARGET = reportsplugin
|
||||||
|
TEMPLATE = lib
|
||||||
|
|
||||||
|
CONFIG += shared c++14
|
||||||
|
|
||||||
|
DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung
|
||||||
|
|
||||||
|
LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../../zeiterfassunglib
|
||||||
|
DEPENDPATH += $$PWD/../../zeiterfassunglib
|
||||||
|
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
|
HEADERS += reportsplugin.h \
|
||||||
|
reportswidget.h
|
||||||
|
|
||||||
|
SOURCES += reportsplugin.cpp \
|
||||||
|
reportswidget.cpp
|
||||||
|
|
||||||
|
FORMS +=
|
||||||
|
|
||||||
|
RESOURCES += reportsplugin_resources.qrc
|
||||||
|
|
||||||
|
TRANSLATIONS +=
|
||||||
|
|
||||||
|
OTHER_FILES += reportsplugin.json
|
6
plugins/reportsplugin/reportsplugin_resources.qrc
Normal file
6
plugins/reportsplugin/reportsplugin_resources.qrc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/zeiterfassung/plugins/reportsplugin">
|
||||||
|
<file>images/refresh.png</file>
|
||||||
|
<file>images/report.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
145
plugins/reportsplugin/reportswidget.cpp
Normal file
145
plugins/reportsplugin/reportswidget.cpp
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
#include "reportswidget.h"
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QStatusBar>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QStringBuilder>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
#include <QTemporaryFile>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "zeiterfassungapi.h"
|
||||||
|
|
||||||
|
ReportsWidget::ReportsWidget(MainWindow &mainWindow) :
|
||||||
|
QWidget(&mainWindow),
|
||||||
|
m_mainWindow(mainWindow)
|
||||||
|
{
|
||||||
|
m_labelBalance = new QLabel(this);
|
||||||
|
m_labelBalance->setFrameShape(QFrame::Panel);
|
||||||
|
m_labelBalance->setFrameShadow(QFrame::Sunken);
|
||||||
|
m_mainWindow.statusBar()->addPermanentWidget(m_labelBalance);
|
||||||
|
|
||||||
|
m_labelHolidays = new QLabel(this);
|
||||||
|
m_labelHolidays->setFrameShape(QFrame::Panel);
|
||||||
|
m_labelHolidays->setFrameShadow(QFrame::Sunken);
|
||||||
|
m_mainWindow.statusBar()->addPermanentWidget(m_labelHolidays);
|
||||||
|
|
||||||
|
m_actionRefreshReport = m_mainWindow.menuView()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/refresh.png")),
|
||||||
|
tr("Refresh report"), this, &ReportsWidget::refresh);
|
||||||
|
|
||||||
|
m_actionOpenReport = m_mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/report.png")),
|
||||||
|
tr("Open report"), this, &ReportsWidget::openReport);
|
||||||
|
m_mainWindow.toolBar()->addAction(m_actionOpenReport);
|
||||||
|
|
||||||
|
dateChanged(m_mainWindow.date());
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportsWidget::dateChanged(const QDate &date)
|
||||||
|
{
|
||||||
|
if(!date.isValid())
|
||||||
|
{
|
||||||
|
qWarning() << "invalid date" << date;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto monthBegin = QDate(date.year(), date.month(), 1);
|
||||||
|
if(monthBegin != m_date)
|
||||||
|
{
|
||||||
|
m_date = monthBegin;
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportsWidget::refresh()
|
||||||
|
{
|
||||||
|
if(!m_date.isValid())
|
||||||
|
{
|
||||||
|
qWarning() << "invalid date" << m_date;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_actionRefreshReport->setEnabled(false);
|
||||||
|
m_actionOpenReport->setEnabled(false);
|
||||||
|
|
||||||
|
m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("???")));
|
||||||
|
m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("???")));
|
||||||
|
|
||||||
|
m_reply = m_mainWindow.erfassung().doGetReport(m_mainWindow.userInfo().userId, m_date);
|
||||||
|
connect(m_reply.get(), &ZeiterfassungReply::finished, this, &ReportsWidget::finished);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportsWidget::finished()
|
||||||
|
{
|
||||||
|
if(!m_reply->success())
|
||||||
|
{
|
||||||
|
m_date = QDate();
|
||||||
|
QMessageBox::warning(this, tr("Could not load report!"), tr("Could not load report!") % "\n\n" % m_reply->message());
|
||||||
|
goto after;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto content = m_reply->content();
|
||||||
|
|
||||||
|
{
|
||||||
|
static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)"));
|
||||||
|
auto match = regex.match(content);
|
||||||
|
if(match.hasMatch())
|
||||||
|
{
|
||||||
|
auto balance = match.captured(2);
|
||||||
|
if(balance.endsWith(QChar('-')))
|
||||||
|
{
|
||||||
|
balance.chop(1);
|
||||||
|
balance = QChar('-') % balance;
|
||||||
|
}
|
||||||
|
m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("%0h").arg(balance)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("n/a")));
|
||||||
|
qWarning() << "balance not found in PDF";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)"));
|
||||||
|
auto match = regex.match(content);
|
||||||
|
if(match.hasMatch())
|
||||||
|
m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(match.captured(2)));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("n/a")));
|
||||||
|
qWarning() << "holidays not found in PDF";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("reportXXXXXX.pdf")));
|
||||||
|
file.setAutoRemove(false);
|
||||||
|
if(!file.open())
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Could not write report!"), tr("Could not write report!") % "\n\n" % file.errorString());
|
||||||
|
goto after;
|
||||||
|
}
|
||||||
|
|
||||||
|
file.write(content);
|
||||||
|
|
||||||
|
m_url = QUrl::fromLocalFile(file.fileName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_actionOpenReport->setEnabled(true);
|
||||||
|
|
||||||
|
after:
|
||||||
|
m_actionRefreshReport->setEnabled(true);
|
||||||
|
m_reply = Q_NULLPTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportsWidget::openReport()
|
||||||
|
{
|
||||||
|
if(!QDesktopServices::openUrl(m_url))
|
||||||
|
QMessageBox::warning(this, tr("Could not launch your default PDF viewer!"), tr("Could not launch your default PDF viewer!"));
|
||||||
|
}
|
43
plugins/reportsplugin/reportswidget.h
Normal file
43
plugins/reportsplugin/reportswidget.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#ifndef REPORTSWIDGET_H
|
||||||
|
#define REPORTSWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QDate>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
|
#include "replies/getreportreply.h"
|
||||||
|
|
||||||
|
class QLabel;
|
||||||
|
class QAction;
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
class ReportsWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ReportsWidget(MainWindow &mainWindow);
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void dateChanged(const QDate &date);
|
||||||
|
void refresh();
|
||||||
|
void finished();
|
||||||
|
void openReport();
|
||||||
|
|
||||||
|
private:
|
||||||
|
MainWindow &m_mainWindow;
|
||||||
|
|
||||||
|
QLabel *m_labelBalance;
|
||||||
|
QLabel *m_labelHolidays;
|
||||||
|
|
||||||
|
QAction *m_actionOpenReport;
|
||||||
|
QAction *m_actionRefreshReport;
|
||||||
|
|
||||||
|
QDate m_date;
|
||||||
|
QUrl m_url;
|
||||||
|
|
||||||
|
std::unique_ptr<GetReportReply> m_reply;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // REPORTSWIDGET_H
|
@@ -27,22 +27,8 @@ UpdaterDialog::UpdaterDialog(MainWindow &mainWindow) :
|
|||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, [=]() {
|
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &UpdaterDialog::acceptedSlot);
|
||||||
if(ui->checkBoxDontShow->isChecked())
|
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &UpdaterDialog::rejectedSlot);
|
||||||
m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate());
|
|
||||||
|
|
||||||
if(!QDesktopServices::openUrl(m_url))
|
|
||||||
QMessageBox::warning(this, tr("Could not open default webbrowser!"), tr("Could not open default webbrowser!"));
|
|
||||||
|
|
||||||
accept();
|
|
||||||
});
|
|
||||||
|
|
||||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [=](){
|
|
||||||
if(ui->checkBoxDontShow->isChecked())
|
|
||||||
m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate());
|
|
||||||
|
|
||||||
reject();
|
|
||||||
});
|
|
||||||
|
|
||||||
auto url = m_mainWindow.settings().value(QStringLiteral("UpdaterPlugin/url"),
|
auto url = m_mainWindow.settings().value(QStringLiteral("UpdaterPlugin/url"),
|
||||||
QUrl(QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases"))).toUrl();
|
QUrl(QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases"))).toUrl();
|
||||||
@@ -55,6 +41,25 @@ UpdaterDialog::~UpdaterDialog()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdaterDialog::acceptedSlot()
|
||||||
|
{
|
||||||
|
if(ui->checkBoxDontShow->isChecked())
|
||||||
|
m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate());
|
||||||
|
|
||||||
|
if(!QDesktopServices::openUrl(m_url))
|
||||||
|
QMessageBox::warning(this, tr("Could not open default webbrowser!"), tr("Could not open default webbrowser!"));
|
||||||
|
|
||||||
|
accept();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdaterDialog::rejectedSlot()
|
||||||
|
{
|
||||||
|
if(ui->checkBoxDontShow->isChecked())
|
||||||
|
m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate());
|
||||||
|
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
|
||||||
void UpdaterDialog::finished()
|
void UpdaterDialog::finished()
|
||||||
{
|
{
|
||||||
if(m_reply->error() != QNetworkReply::NoError)
|
if(m_reply->error() != QNetworkReply::NoError)
|
||||||
|
@@ -20,6 +20,8 @@ public:
|
|||||||
~UpdaterDialog();
|
~UpdaterDialog();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void acceptedSlot();
|
||||||
|
void rejectedSlot();
|
||||||
void finished();
|
void finished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -16,8 +16,6 @@ UpdaterPlugin::UpdaterPlugin(QObject *parent) :
|
|||||||
|
|
||||||
void UpdaterPlugin::attachTo(MainWindow &mainWindow)
|
void UpdaterPlugin::attachTo(MainWindow &mainWindow)
|
||||||
{
|
{
|
||||||
qDebug() << "called";
|
|
||||||
|
|
||||||
if(mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate().isNull() ||
|
if(mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate().isNull() ||
|
||||||
mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate() < QDate::currentDate())
|
mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate() < QDate::currentDate())
|
||||||
new UpdaterDialog(mainWindow);
|
new UpdaterDialog(mainWindow);
|
||||||
|
@@ -22,7 +22,6 @@
|
|||||||
#include "dialogs/aboutmedialog.h"
|
#include "dialogs/aboutmedialog.h"
|
||||||
#include "dialogs/settingsdialog.h"
|
#include "dialogs/settingsdialog.h"
|
||||||
#include "replies/getprojectsreply.h"
|
#include "replies/getprojectsreply.h"
|
||||||
#include "replies/getauswertungreply.h"
|
|
||||||
#include "replies/createbookingreply.h"
|
#include "replies/createbookingreply.h"
|
||||||
#include "replies/createtimeassignmentreply.h"
|
#include "replies/createtimeassignmentreply.h"
|
||||||
#include "replies/updatetimeassignmentreply.h"
|
#include "replies/updatetimeassignmentreply.h"
|
||||||
@@ -35,8 +34,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
|||||||
m_erfassung(erfassung),
|
m_erfassung(erfassung),
|
||||||
m_userInfo(userInfo),
|
m_userInfo(userInfo),
|
||||||
m_stripFactory(stripFactory),
|
m_stripFactory(stripFactory),
|
||||||
m_getProjectsReply(Q_NULLPTR),
|
|
||||||
m_getAuswertungReply(Q_NULLPTR),
|
|
||||||
m_currentStripWidget(Q_NULLPTR)
|
m_currentStripWidget(Q_NULLPTR)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@@ -57,8 +54,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
|||||||
ui->actionRefresh->setShortcut(QKeySequence::Refresh);
|
ui->actionRefresh->setShortcut(QKeySequence::Refresh);
|
||||||
connect(ui->actionRefresh, &QAction::triggered, this, [=](){ dateChanged(true); });
|
connect(ui->actionRefresh, &QAction::triggered, this, [=](){ dateChanged(true); });
|
||||||
|
|
||||||
connect(ui->actionAuswertung, &QAction::triggered, this, &MainWindow::openAuswertung);
|
|
||||||
|
|
||||||
connect(ui->actionAboutMe, &QAction::triggered, [=](){ AboutMeDialog(userInfo, this).exec(); });
|
connect(ui->actionAboutMe, &QAction::triggered, [=](){ AboutMeDialog(userInfo, this).exec(); });
|
||||||
connect(ui->actionSettings, &QAction::triggered, [=](){ SettingsDialog(m_settings, this).exec(); });
|
connect(ui->actionSettings, &QAction::triggered, [=](){ SettingsDialog(m_settings, this).exec(); });
|
||||||
|
|
||||||
@@ -88,13 +83,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
|||||||
connect(ui->pushButtonStart, &QAbstractButton::pressed, this, &MainWindow::pushButtonStartPressed);
|
connect(ui->pushButtonStart, &QAbstractButton::pressed, this, &MainWindow::pushButtonStartPressed);
|
||||||
connect(ui->pushButtonEnd, &QAbstractButton::pressed, this, &MainWindow::pushButtonEndPressed);
|
connect(ui->pushButtonEnd, &QAbstractButton::pressed, this, &MainWindow::pushButtonEndPressed);
|
||||||
|
|
||||||
ui->statusbar->addPermanentWidget(m_balanceLabel = new QLabel(ui->statusbar));
|
|
||||||
m_balanceLabel->setFrameShape(QFrame::Panel);
|
|
||||||
m_balanceLabel->setFrameShadow(QFrame::Sunken);
|
|
||||||
ui->statusbar->addPermanentWidget(m_holidaysLabel = new QLabel(ui->statusbar));
|
|
||||||
m_holidaysLabel->setFrameShape(QFrame::Panel);
|
|
||||||
m_holidaysLabel->setFrameShadow(QFrame::Sunken);
|
|
||||||
|
|
||||||
dateChanged();
|
dateChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +111,11 @@ QMenu *MainWindow::menuAbout() const
|
|||||||
return ui->menuAbout;
|
return ui->menuAbout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QToolBar *MainWindow::toolBar() const
|
||||||
|
{
|
||||||
|
return ui->mainToolBar;
|
||||||
|
}
|
||||||
|
|
||||||
ZeiterfassungSettings &MainWindow::settings() const
|
ZeiterfassungSettings &MainWindow::settings() const
|
||||||
{
|
{
|
||||||
return m_settings;
|
return m_settings;
|
||||||
@@ -143,6 +136,11 @@ StripFactory &MainWindow::stripFactory() const
|
|||||||
return m_stripFactory;
|
return m_stripFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDate MainWindow::date() const
|
||||||
|
{
|
||||||
|
return ui->dateEditDate->date();
|
||||||
|
}
|
||||||
|
|
||||||
const QMap<QString, QString> &MainWindow::projects() const
|
const QMap<QString, QString> &MainWindow::projects() const
|
||||||
{
|
{
|
||||||
return m_projects;
|
return m_projects;
|
||||||
@@ -171,66 +169,6 @@ void MainWindow::getProjectsFinished()
|
|||||||
m_getProjectsReply = Q_NULLPTR;
|
m_getProjectsReply = Q_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::getAuswertungFinished()
|
|
||||||
{
|
|
||||||
if(std::none_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget){
|
|
||||||
return stripsWidget->refreshing();
|
|
||||||
}))
|
|
||||||
{
|
|
||||||
ui->actionToday->setEnabled(true);
|
|
||||||
ui->actionRefresh->setEnabled(true);
|
|
||||||
ui->dateEditDate->setReadOnly(false);
|
|
||||||
ui->pushButtonPrev->setEnabled(true);
|
|
||||||
ui->pushButtonNext->setEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!m_getAuswertungReply->success())
|
|
||||||
{
|
|
||||||
m_auswertungDate = QDate();
|
|
||||||
QMessageBox::warning(this, tr("Could not load Auswertung!"), tr("Could not load Auswertung!") % "\n\n" % m_getAuswertungReply->message());
|
|
||||||
m_getAuswertungReply = Q_NULLPTR;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->actionAuswertung->setEnabled(true);
|
|
||||||
m_auswertung = m_getAuswertungReply->auswertung();
|
|
||||||
|
|
||||||
auto urlaubsAnspruch = tr("n/a");
|
|
||||||
|
|
||||||
{
|
|
||||||
static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)"));
|
|
||||||
auto match = regex.match(m_auswertung);
|
|
||||||
if(match.hasMatch())
|
|
||||||
urlaubsAnspruch = match.captured(2);
|
|
||||||
else
|
|
||||||
qWarning() << "Urlaubsanspruch not found";
|
|
||||||
}
|
|
||||||
|
|
||||||
auto gleitzeit = tr("n/a");
|
|
||||||
|
|
||||||
{
|
|
||||||
static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)"));
|
|
||||||
auto match = regex.match(m_auswertung);
|
|
||||||
if(match.hasMatch())
|
|
||||||
{
|
|
||||||
gleitzeit = match.captured(2);
|
|
||||||
if(gleitzeit.endsWith(QChar('-')))
|
|
||||||
{
|
|
||||||
gleitzeit.chop(1);
|
|
||||||
gleitzeit = QChar('-') % gleitzeit;
|
|
||||||
}
|
|
||||||
gleitzeit = tr("%0h").arg(gleitzeit);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
qWarning() << "Gleitzeit not found";
|
|
||||||
}
|
|
||||||
|
|
||||||
m_balanceLabel->setText(tr("%0: %1").arg(tr("Balance")).arg(gleitzeit));
|
|
||||||
m_holidaysLabel->setText(tr("%0: %1").arg(tr("Holidays")).arg(urlaubsAnspruch));
|
|
||||||
|
|
||||||
m_getAuswertungReply = Q_NULLPTR;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::pushButtonStartPressed()
|
void MainWindow::pushButtonStartPressed()
|
||||||
{
|
{
|
||||||
auto bookingsChanged = false;
|
auto bookingsChanged = false;
|
||||||
@@ -307,8 +245,7 @@ void MainWindow::pushButtonStartPressed()
|
|||||||
if(bookingsChanged)
|
if(bookingsChanged)
|
||||||
{
|
{
|
||||||
m_currentStripWidget->refresh();
|
m_currentStripWidget->refresh();
|
||||||
|
//refreshReport();
|
||||||
refreshAuswertung();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_currentStripWidget->refreshTimeAssignments();
|
m_currentStripWidget->refreshTimeAssignments();
|
||||||
@@ -359,7 +296,7 @@ void MainWindow::pushButtonEndPressed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_currentStripWidget->refresh();
|
m_currentStripWidget->refresh();
|
||||||
refreshAuswertung();
|
//refreshReport();
|
||||||
|
|
||||||
ui->actionToday->setEnabled(false);
|
ui->actionToday->setEnabled(false);
|
||||||
ui->actionRefresh->setEnabled(false);
|
ui->actionRefresh->setEnabled(false);
|
||||||
@@ -400,12 +337,9 @@ void MainWindow::dateChanged(bool force)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(force || m_auswertungDate != QDate(ui->dateEditDate->date().year(), ui->dateEditDate->date().month(), 1))
|
|
||||||
refreshAuswertung();
|
|
||||||
|
|
||||||
if(std::any_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget) {
|
if(std::any_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget) {
|
||||||
return stripsWidget->refreshing();
|
return stripsWidget->refreshing();
|
||||||
}) || m_getAuswertungReply)
|
}))
|
||||||
{
|
{
|
||||||
ui->actionToday->setEnabled(false);
|
ui->actionToday->setEnabled(false);
|
||||||
ui->actionRefresh->setEnabled(false);
|
ui->actionRefresh->setEnabled(false);
|
||||||
@@ -415,26 +349,6 @@ void MainWindow::dateChanged(bool force)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::openAuswertung()
|
|
||||||
{
|
|
||||||
QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("auswertungXXXXXX.pdf")));
|
|
||||||
file.setAutoRemove(false);
|
|
||||||
if(!file.open())
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Could not open auswertung!"), tr("Could not open auswertung!") % "\n\n" % file.errorString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
file.write(m_auswertung);
|
|
||||||
file.close();
|
|
||||||
|
|
||||||
if(!QDesktopServices::openUrl(QUrl::fromLocalFile(file.fileName())))
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Could not open auswertung!"), tr("Could not open default PDF viewer!"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::minimumTimeChanged()
|
void MainWindow::minimumTimeChanged()
|
||||||
{
|
{
|
||||||
ui->timeEditTime->setMinimumTime(m_currentStripWidget->minimumTime());
|
ui->timeEditTime->setMinimumTime(m_currentStripWidget->minimumTime());
|
||||||
@@ -442,9 +356,6 @@ void MainWindow::minimumTimeChanged()
|
|||||||
|
|
||||||
void MainWindow::refreshingChanged()
|
void MainWindow::refreshingChanged()
|
||||||
{
|
{
|
||||||
if(m_getAuswertungReply)
|
|
||||||
return;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
auto allFinished = std::none_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget){
|
auto allFinished = std::none_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget){
|
||||||
return stripsWidget->refreshing();
|
return stripsWidget->refreshing();
|
||||||
@@ -487,19 +398,6 @@ void MainWindow::endEnabledChanged()
|
|||||||
ui->pushButtonEnd->setEnabled(endEnabled);
|
ui->pushButtonEnd->setEnabled(endEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::refreshAuswertung()
|
|
||||||
{
|
|
||||||
m_balanceLabel->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("???")));
|
|
||||||
m_holidaysLabel->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("???")));
|
|
||||||
|
|
||||||
ui->actionAuswertung->setEnabled(false);
|
|
||||||
m_auswertung.clear();
|
|
||||||
|
|
||||||
m_auswertungDate = QDate(ui->dateEditDate->date().year(), ui->dateEditDate->date().month(), 1);
|
|
||||||
m_getAuswertungReply = m_erfassung.doGetAuswertung(m_userInfo.userId, m_auswertungDate);
|
|
||||||
connect(m_getAuswertungReply.get(), &ZeiterfassungReply::finished, this, &MainWindow::getAuswertungFinished);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::updateComboboxes()
|
void MainWindow::updateComboboxes()
|
||||||
{
|
{
|
||||||
ui->comboBoxProject->clear();
|
ui->comboBoxProject->clear();
|
||||||
|
@@ -9,9 +9,10 @@
|
|||||||
#include "zeiterfassunglib_global.h"
|
#include "zeiterfassunglib_global.h"
|
||||||
#include "replies/getuserinforeply.h"
|
#include "replies/getuserinforeply.h"
|
||||||
#include "replies/getprojectsreply.h"
|
#include "replies/getprojectsreply.h"
|
||||||
#include "replies/getauswertungreply.h"
|
|
||||||
#include "replies/getpresencestatusreply.h"
|
#include "replies/getpresencestatusreply.h"
|
||||||
|
|
||||||
|
class QMenu;
|
||||||
|
class QToolBar;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
class QBoxLayout;
|
class QBoxLayout;
|
||||||
|
|
||||||
@@ -19,8 +20,6 @@ namespace Ui { class MainWindow; }
|
|||||||
class ZeiterfassungSettings;
|
class ZeiterfassungSettings;
|
||||||
class StripFactory;
|
class StripFactory;
|
||||||
class StripsWidget;
|
class StripsWidget;
|
||||||
class BookingsModel;
|
|
||||||
class TimeAssignmentsModel;
|
|
||||||
|
|
||||||
class ZEITERFASSUNGLIBSHARED_EXPORT MainWindow : public QMainWindow
|
class ZEITERFASSUNGLIBSHARED_EXPORT MainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
@@ -35,22 +34,23 @@ public:
|
|||||||
QMenu *menuView() const;
|
QMenu *menuView() const;
|
||||||
QMenu *menuTools() const;
|
QMenu *menuTools() const;
|
||||||
QMenu *menuAbout() const;
|
QMenu *menuAbout() const;
|
||||||
|
QToolBar *toolBar() const;
|
||||||
|
|
||||||
ZeiterfassungSettings &settings() const;
|
ZeiterfassungSettings &settings() const;
|
||||||
ZeiterfassungApi &erfassung() const;
|
ZeiterfassungApi &erfassung() const;
|
||||||
const GetUserInfoReply::UserInfo &userInfo() const;
|
const GetUserInfoReply::UserInfo &userInfo() const;
|
||||||
StripFactory &stripFactory() const;
|
StripFactory &stripFactory() const;
|
||||||
|
|
||||||
|
QDate date() const;
|
||||||
|
|
||||||
const QMap<QString, QString> &projects() const;
|
const QMap<QString, QString> &projects() const;
|
||||||
const std::array<StripsWidget*, 7> &stripsWidgets() const;
|
const std::array<StripsWidget*, 7> &stripsWidgets() const;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void getProjectsFinished();
|
void getProjectsFinished();
|
||||||
void getAuswertungFinished();
|
|
||||||
void pushButtonStartPressed();
|
void pushButtonStartPressed();
|
||||||
void pushButtonEndPressed();
|
void pushButtonEndPressed();
|
||||||
void dateChanged(bool force = false);
|
void dateChanged(bool force = false);
|
||||||
void openAuswertung();
|
|
||||||
|
|
||||||
void minimumTimeChanged();
|
void minimumTimeChanged();
|
||||||
void refreshingChanged();
|
void refreshingChanged();
|
||||||
@@ -58,7 +58,6 @@ private Q_SLOTS:
|
|||||||
void endEnabledChanged();
|
void endEnabledChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void refreshAuswertung();
|
|
||||||
void updateComboboxes();
|
void updateComboboxes();
|
||||||
|
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
@@ -68,19 +67,9 @@ private:
|
|||||||
StripFactory &m_stripFactory;
|
StripFactory &m_stripFactory;
|
||||||
|
|
||||||
std::unique_ptr<GetProjectsReply> m_getProjectsReply;
|
std::unique_ptr<GetProjectsReply> m_getProjectsReply;
|
||||||
std::unique_ptr<GetAuswertungReply> m_getAuswertungReply;
|
|
||||||
|
|
||||||
BookingsModel *m_bookingsModel;
|
|
||||||
TimeAssignmentsModel *m_timeAssignmentsModel;
|
|
||||||
|
|
||||||
QMap<QString, QString> m_projects;
|
QMap<QString, QString> m_projects;
|
||||||
|
|
||||||
QDate m_auswertungDate;
|
|
||||||
QByteArray m_auswertung;
|
|
||||||
|
|
||||||
QLabel *m_balanceLabel;
|
|
||||||
QLabel *m_holidaysLabel;
|
|
||||||
|
|
||||||
std::array<StripsWidget*, 7> m_stripsWidgets;
|
std::array<StripsWidget*, 7> m_stripsWidgets;
|
||||||
StripsWidget *m_currentStripWidget;
|
StripsWidget *m_currentStripWidget;
|
||||||
};
|
};
|
||||||
|
@@ -229,7 +229,6 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&Tools</string>
|
<string>&Tools</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionAuswertung"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menuView"/>
|
<addaction name="menuView"/>
|
||||||
@@ -245,8 +244,6 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="actionToday"/>
|
<addaction name="actionToday"/>
|
||||||
<addaction name="actionRefresh"/>
|
<addaction name="actionRefresh"/>
|
||||||
<addaction name="actionAuswertung"/>
|
|
||||||
<addaction name="actionSettings"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
<action name="actionQuit">
|
<action name="actionQuit">
|
||||||
@@ -299,15 +296,6 @@
|
|||||||
<string>&Refresh everything</string>
|
<string>&Refresh everything</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionAuswertung">
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="resources.qrc">
|
|
||||||
<normaloff>:/zeiterfassunglib/images/auswertung.png</normaloff>:/zeiterfassunglib/images/auswertung.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Auswertung</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionSettings">
|
<action name="actionSettings">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="resources.qrc">
|
||||||
|
@@ -1,30 +0,0 @@
|
|||||||
#ifndef GETAUSWERTUNGREPLY_H
|
|
||||||
#define GETAUSWERTUNGREPLY_H
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include <QNetworkReply>
|
|
||||||
#include <QByteArray>
|
|
||||||
|
|
||||||
#include "zeiterfassunglib_global.h"
|
|
||||||
#include "zeiterfassungreply.h"
|
|
||||||
|
|
||||||
class ZEITERFASSUNGLIBSHARED_EXPORT GetAuswertungReply : public ZeiterfassungReply
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
GetAuswertungReply(std::unique_ptr<QNetworkReply> &&reply, ZeiterfassungApi *zeiterfassung);
|
|
||||||
|
|
||||||
const QByteArray &auswertung() const;
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
|
||||||
void request0Finished();
|
|
||||||
void request1Finished();
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::unique_ptr<QNetworkReply> m_reply;
|
|
||||||
QByteArray m_auswertung;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // GETAUSWERTUNGREPLY_H
|
|
@@ -1,20 +1,20 @@
|
|||||||
#include "getauswertungreply.h"
|
#include "getreportreply.h"
|
||||||
|
|
||||||
#include "zeiterfassungapi.h"
|
#include "zeiterfassungapi.h"
|
||||||
|
|
||||||
GetAuswertungReply::GetAuswertungReply(std::unique_ptr<QNetworkReply> &&reply, ZeiterfassungApi *zeiterfassung) :
|
GetReportReply::GetReportReply(std::unique_ptr<QNetworkReply> &&reply, ZeiterfassungApi *zeiterfassung) :
|
||||||
ZeiterfassungReply(zeiterfassung),
|
ZeiterfassungReply(zeiterfassung),
|
||||||
m_reply(std::move(reply))
|
m_reply(std::move(reply))
|
||||||
{
|
{
|
||||||
connect(m_reply.get(), &QNetworkReply::finished, this, &GetAuswertungReply::request0Finished);
|
connect(m_reply.get(), &QNetworkReply::finished, this, &GetReportReply::request0Finished);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QByteArray &GetAuswertungReply::auswertung() const
|
const QByteArray &GetReportReply::content() const
|
||||||
{
|
{
|
||||||
return m_auswertung;
|
return m_content;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetAuswertungReply::request0Finished()
|
void GetReportReply::request0Finished()
|
||||||
{
|
{
|
||||||
if(m_reply->error() != QNetworkReply::NoError)
|
if(m_reply->error() != QNetworkReply::NoError)
|
||||||
{
|
{
|
||||||
@@ -29,10 +29,10 @@ void GetAuswertungReply::request0Finished()
|
|||||||
url.setPath(QString(m_reply->readAll()));
|
url.setPath(QString(m_reply->readAll()));
|
||||||
|
|
||||||
m_reply = std::unique_ptr<QNetworkReply>(zeiterfassung()->manager()->get(QNetworkRequest(url)));
|
m_reply = std::unique_ptr<QNetworkReply>(zeiterfassung()->manager()->get(QNetworkRequest(url)));
|
||||||
connect(m_reply.get(), &QNetworkReply::finished, this, &GetAuswertungReply::request1Finished);
|
connect(m_reply.get(), &QNetworkReply::finished, this, &GetReportReply::request1Finished);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetAuswertungReply::request1Finished()
|
void GetReportReply::request1Finished()
|
||||||
{
|
{
|
||||||
if(m_reply->error() != QNetworkReply::NoError)
|
if(m_reply->error() != QNetworkReply::NoError)
|
||||||
{
|
{
|
||||||
@@ -42,7 +42,7 @@ void GetAuswertungReply::request1Finished()
|
|||||||
}
|
}
|
||||||
|
|
||||||
setSuccess(true);
|
setSuccess(true);
|
||||||
m_auswertung = m_reply->readAll();
|
m_content = m_reply->readAll();
|
||||||
|
|
||||||
end:
|
end:
|
||||||
m_reply = Q_NULLPTR;
|
m_reply = Q_NULLPTR;
|
30
zeiterfassunglib/replies/getreportreply.h
Normal file
30
zeiterfassunglib/replies/getreportreply.h
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#ifndef GETREPORTREPLY_H
|
||||||
|
#define GETREPORTREPLY_H
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QByteArray>
|
||||||
|
|
||||||
|
#include "zeiterfassunglib_global.h"
|
||||||
|
#include "zeiterfassungreply.h"
|
||||||
|
|
||||||
|
class ZEITERFASSUNGLIBSHARED_EXPORT GetReportReply : public ZeiterfassungReply
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
GetReportReply(std::unique_ptr<QNetworkReply> &&reply, ZeiterfassungApi *zeiterfassung);
|
||||||
|
|
||||||
|
const QByteArray &content() const;
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void request0Finished();
|
||||||
|
void request1Finished();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QNetworkReply> m_reply;
|
||||||
|
QByteArray m_content;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GETREPORTREPLY_H
|
@@ -1,7 +1,6 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/zeiterfassunglib">
|
<qresource prefix="/zeiterfassunglib">
|
||||||
<file>images/about.png</file>
|
<file>images/about.png</file>
|
||||||
<file>images/auswertung.png</file>
|
|
||||||
<file>images/authentication.png</file>
|
<file>images/authentication.png</file>
|
||||||
<file>images/help.png</file>
|
<file>images/help.png</file>
|
||||||
<file>images/icon.png</file>
|
<file>images/icon.png</file>
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
#include "replies/createtimeassignmentreply.h"
|
#include "replies/createtimeassignmentreply.h"
|
||||||
#include "replies/deletebookingreply.h"
|
#include "replies/deletebookingreply.h"
|
||||||
#include "replies/deletetimeassignmentreply.h"
|
#include "replies/deletetimeassignmentreply.h"
|
||||||
#include "replies/getauswertungreply.h"
|
#include "replies/getreportreply.h"
|
||||||
#include "replies/getbookingsreply.h"
|
#include "replies/getbookingsreply.h"
|
||||||
#include "replies/getpresencestatusreply.h"
|
#include "replies/getpresencestatusreply.h"
|
||||||
#include "replies/getprojectsreply.h"
|
#include "replies/getprojectsreply.h"
|
||||||
@@ -286,7 +286,7 @@ std::unique_ptr<GetProjectsReply> ZeiterfassungApi::doGetProjects(int userId, co
|
|||||||
return std::make_unique<GetProjectsReply>(std::move(reply), this);
|
return std::make_unique<GetProjectsReply>(std::move(reply), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<GetAuswertungReply> ZeiterfassungApi::doGetAuswertung(int userId, const QDate &date)
|
std::unique_ptr<GetReportReply> ZeiterfassungApi::doGetReport(int userId, const QDate &date)
|
||||||
{
|
{
|
||||||
QNetworkRequest request(QUrl(QStringLiteral("%0json/auswertung/month?persNr=%1&date=%2")
|
QNetworkRequest request(QUrl(QStringLiteral("%0json/auswertung/month?persNr=%1&date=%2")
|
||||||
.arg(m_url)
|
.arg(m_url)
|
||||||
@@ -296,7 +296,7 @@ std::unique_ptr<GetAuswertungReply> ZeiterfassungApi::doGetAuswertung(int userId
|
|||||||
|
|
||||||
auto reply = std::unique_ptr<QNetworkReply>(m_manager->get(request));
|
auto reply = std::unique_ptr<QNetworkReply>(m_manager->get(request));
|
||||||
|
|
||||||
return std::make_unique<GetAuswertungReply>(std::move(reply), this);
|
return std::make_unique<GetReportReply>(std::move(reply), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<GetPresenceStatusReply> ZeiterfassungApi::doGetPresenceStatus()
|
std::unique_ptr<GetPresenceStatusReply> ZeiterfassungApi::doGetPresenceStatus()
|
||||||
|
@@ -24,7 +24,7 @@ class CreateTimeAssignmentReply;
|
|||||||
class UpdateTimeAssignmentReply;
|
class UpdateTimeAssignmentReply;
|
||||||
class DeleteTimeAssignmentReply;
|
class DeleteTimeAssignmentReply;
|
||||||
class GetProjectsReply;
|
class GetProjectsReply;
|
||||||
class GetAuswertungReply;
|
class GetReportReply;
|
||||||
class GetPresenceStatusReply;
|
class GetPresenceStatusReply;
|
||||||
|
|
||||||
class ZEITERFASSUNGLIBSHARED_EXPORT ZeiterfassungApi : public QObject
|
class ZEITERFASSUNGLIBSHARED_EXPORT ZeiterfassungApi : public QObject
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
std::unique_ptr<DeleteTimeAssignmentReply> doDeleteTimeAssignment(int timeAssignmentId);
|
std::unique_ptr<DeleteTimeAssignmentReply> doDeleteTimeAssignment(int timeAssignmentId);
|
||||||
|
|
||||||
std::unique_ptr<GetProjectsReply> doGetProjects(int userId, const QDate &date);
|
std::unique_ptr<GetProjectsReply> doGetProjects(int userId, const QDate &date);
|
||||||
std::unique_ptr<GetAuswertungReply> doGetAuswertung(int userId, const QDate &date);
|
std::unique_ptr<GetReportReply> doGetReport(int userId, const QDate &date);
|
||||||
std::unique_ptr<GetPresenceStatusReply> doGetPresenceStatus();
|
std::unique_ptr<GetPresenceStatusReply> doGetPresenceStatus();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -25,7 +25,6 @@ SOURCES += mainwindow.cpp \
|
|||||||
replies/createtimeassignmentreply.cpp \
|
replies/createtimeassignmentreply.cpp \
|
||||||
replies/deletebookingreply.cpp \
|
replies/deletebookingreply.cpp \
|
||||||
replies/deletetimeassignmentreply.cpp \
|
replies/deletetimeassignmentreply.cpp \
|
||||||
replies/getauswertungreply.cpp \
|
|
||||||
replies/getbookingsreply.cpp \
|
replies/getbookingsreply.cpp \
|
||||||
replies/getpresencestatusreply.cpp \
|
replies/getpresencestatusreply.cpp \
|
||||||
replies/getprojectsreply.cpp \
|
replies/getprojectsreply.cpp \
|
||||||
@@ -35,7 +34,8 @@ SOURCES += mainwindow.cpp \
|
|||||||
replies/updatebookingreply.cpp \
|
replies/updatebookingreply.cpp \
|
||||||
replies/updatetimeassignmentreply.cpp \
|
replies/updatetimeassignmentreply.cpp \
|
||||||
replies/zeiterfassungreply.cpp \
|
replies/zeiterfassungreply.cpp \
|
||||||
replies/getuserinforeply.cpp
|
replies/getuserinforeply.cpp \
|
||||||
|
replies/getreportreply.cpp
|
||||||
|
|
||||||
HEADERS += cpp14polyfills.h \
|
HEADERS += cpp14polyfills.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
@@ -54,7 +54,6 @@ HEADERS += cpp14polyfills.h \
|
|||||||
replies/createtimeassignmentreply.h \
|
replies/createtimeassignmentreply.h \
|
||||||
replies/deletebookingreply.h \
|
replies/deletebookingreply.h \
|
||||||
replies/deletetimeassignmentreply.h \
|
replies/deletetimeassignmentreply.h \
|
||||||
replies/getauswertungreply.h \
|
|
||||||
replies/getbookingsreply.h \
|
replies/getbookingsreply.h \
|
||||||
replies/getpresencestatusreply.h \
|
replies/getpresencestatusreply.h \
|
||||||
replies/getprojectsreply.h \
|
replies/getprojectsreply.h \
|
||||||
@@ -64,7 +63,8 @@ HEADERS += cpp14polyfills.h \
|
|||||||
replies/updatebookingreply.h \
|
replies/updatebookingreply.h \
|
||||||
replies/updatetimeassignmentreply.h \
|
replies/updatetimeassignmentreply.h \
|
||||||
replies/zeiterfassungreply.h \
|
replies/zeiterfassungreply.h \
|
||||||
replies/getuserinforeply.h
|
replies/getuserinforeply.h \
|
||||||
|
replies/getreportreply.h
|
||||||
|
|
||||||
FORMS += mainwindow.ui \
|
FORMS += mainwindow.ui \
|
||||||
dialogs/settingsdialog.ui \
|
dialogs/settingsdialog.ui \
|
||||||
|
Reference in New Issue
Block a user