Plugin advanced view #29
19
plugins/advancedviewplugin/advancedviewplugin.cpp
Normal file
19
plugins/advancedviewplugin/advancedviewplugin.cpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#include "advancedviewplugin.h"
|
||||||
|
|
||||||
|
#include <QBoxLayout>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "stripswidget.h"
|
||||||
|
#include "advancedviewwidget.h"
|
||||||
|
|
||||||
|
AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) :
|
||||||
|
ZeiterfassungPlugin(parent)
|
||||||
|
{
|
||||||
|
Q_INIT_RESOURCE(advancedviewplugin_resources);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvancedViewPlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
{
|
||||||
|
for(auto stripsWidget : mainWindow.stripsWidgets())
|
||||||
|
stripsWidget->headerLayout()->addWidget(new AdvancedViewWidget(*stripsWidget));
|
||||||
|
}
|
23
plugins/advancedviewplugin/advancedviewplugin.h
Normal file
23
plugins/advancedviewplugin/advancedviewplugin.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef ADVANCEDVIEWPLUGIN_H
|
||||||
|
#define ADVANCEDVIEWPLUGIN_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
#include "zeiterfassungplugin.h"
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
class Q_DECL_EXPORT AdvancedViewPlugin : public ZeiterfassungPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "advancedviewplugin.json")
|
||||||
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AdvancedViewPlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
// ZeiterfassungPlugin interface
|
||||||
|
void attachTo(MainWindow &mainWindow);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ADVANCEDVIEWPLUGIN_H
|
0
plugins/advancedviewplugin/advancedviewplugin.json
Normal file
0
plugins/advancedviewplugin/advancedviewplugin.json
Normal file
41
plugins/advancedviewplugin/advancedviewplugin.pro
Normal file
41
plugins/advancedviewplugin/advancedviewplugin.pro
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
QT += core network gui widgets
|
||||||
|
|
||||||
|
TARGET = advancedviewplugin
|
||||||
|
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 += advanvedviewdialog.h \
|
||||||
|
advancedviewplugin.h \
|
||||||
|
advancedviewwidget.h \
|
||||||
|
dialogs/bookingdialog.h \
|
||||||
|
dialogs/timeassignmentdialog.h \
|
||||||
|
models/bookingsmodel.h \
|
||||||
|
models/timeassignmentsmodel.h
|
||||||
|
|
||||||
|
SOURCES += advanvedviewdialog.cpp \
|
||||||
|
advancedviewplugin.cpp \
|
||||||
|
advancedviewwidget.cpp \
|
||||||
|
dialogs/bookingdialog.cpp \
|
||||||
|
dialogs/timeassignmentdialog.cpp \
|
||||||
|
models/bookingsmodel.cpp \
|
||||||
|
models/timeassignmentsmodel.cpp
|
||||||
|
|
||||||
|
FORMS += advanvedviewdialog.ui \
|
||||||
|
dialogs/bookingdialog.ui \
|
||||||
|
dialogs/timeassignmentdialog.ui
|
||||||
|
|
||||||
|
RESOURCES += advancedviewplugin_resources.qrc
|
||||||
|
|
||||||
|
TRANSLATIONS +=
|
||||||
|
|
||||||
|
OTHER_FILES += advancedviewplugin.json
|
@@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/zeiterfassunglib/plugins/advancedviewplugin">
|
||||||
|
<file>images/advanced-view.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
29
plugins/advancedviewplugin/advancedviewwidget.cpp
Normal file
29
plugins/advancedviewplugin/advancedviewwidget.cpp
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#include "advancedviewwidget.h"
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
|
#include "stripswidget.h"
|
||||||
|
#include "advanvedviewdialog.h"
|
||||||
|
|
||||||
|
AdvancedViewWidget::AdvancedViewWidget(StripsWidget &stripsWidget) :
|
||||||
|
QPushButton(&stripsWidget),
|
||||||
|
m_stripsWidget(stripsWidget)
|
||||||
|
{
|
||||||
|
setIcon(QIcon(QStringLiteral(":/zeiterfassunglib/plugins/advancedviewplugin/images/advanced-view.png")));
|
||||||
|
|
||||||
|
connect(&stripsWidget, &StripsWidget::dateChanged, this, &AdvancedViewWidget::dateChanged);
|
||||||
|
dateChanged(stripsWidget.date());
|
||||||
|
|
||||||
|
connect(this, &QAbstractButton::pressed, this, &AdvancedViewWidget::pressedSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvancedViewWidget::dateChanged(const QDate &date)
|
||||||
|
{
|
||||||
|
setEnabled(date.isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvancedViewWidget::pressedSlot()
|
||||||
|
{
|
||||||
|
AdvanvedViewDialog dialog(m_stripsWidget);
|
||||||
|
dialog.exec();
|
||||||
|
}
|
23
plugins/advancedviewplugin/advancedviewwidget.h
Normal file
23
plugins/advancedviewplugin/advancedviewwidget.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef ADVANCEDVIEWWIDGET_H
|
||||||
|
#define ADVANCEDVIEWWIDGET_H
|
||||||
|
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
class StripsWidget;
|
||||||
|
|
||||||
|
class AdvancedViewWidget : public QPushButton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AdvancedViewWidget(StripsWidget &stripsWidget);
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void dateChanged(const QDate &date);
|
||||||
|
void pressedSlot();
|
||||||
|
|
||||||
|
private:
|
||||||
|
StripsWidget &m_stripsWidget;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ADVANCEDVIEWWIDGET_H
|
293
plugins/advancedviewplugin/advanvedviewdialog.cpp
Normal file
293
plugins/advancedviewplugin/advanvedviewdialog.cpp
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
#include "advanvedviewdialog.h"
|
||||||
|
#include "ui_advanvedviewdialog.h"
|
||||||
|
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QEventLoop>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QStringBuilder>
|
||||||
|
|
||||||
|
#include "replies/createbookingreply.h"
|
||||||
|
#include "replies/updatebookingreply.h"
|
||||||
|
#include "replies/deletebookingreply.h"
|
||||||
|
#include "replies/createtimeassignmentreply.h"
|
||||||
|
#include "replies/updatetimeassignmentreply.h"
|
||||||
|
#include "replies/deletetimeassignmentreply.h"
|
||||||
|
|
||||||
|
#include "stripswidget.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "timeutils.h"
|
||||||
|
#include "dialogs/bookingdialog.h"
|
||||||
|
#include "dialogs/timeassignmentdialog.h"
|
||||||
|
#include "models/bookingsmodel.h"
|
||||||
|
#include "models/timeassignmentsmodel.h"
|
||||||
|
|
||||||
|
AdvanvedViewDialog::AdvanvedViewDialog(StripsWidget &stripsWidget) :
|
||||||
|
QDialog(&stripsWidget.mainWindow()),
|
||||||
|
ui(new Ui::AdvanvedViewDialog),
|
||||||
|
m_stripsWidget(stripsWidget),
|
||||||
|
m_bookingsModel(new BookingsModel(stripsWidget, this)),
|
||||||
|
m_timeAssignmentsModel(new TimeAssignmentsModel(stripsWidget, this))
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ui->bookingsView->setModel(m_bookingsModel);
|
||||||
|
ui->bookingsView->setEnabled(m_bookingsModel->enabled());
|
||||||
|
connect(m_bookingsModel, &BookingsModel::enabledChanged, ui->bookingsView, &QWidget::setEnabled);
|
||||||
|
connect(ui->bookingsView, &QWidget::customContextMenuRequested, this, &AdvanvedViewDialog::contextMenuBooking);
|
||||||
|
|
||||||
|
ui->timeAssignmentsView->setModel(m_timeAssignmentsModel);
|
||||||
|
ui->timeAssignmentsView->setEnabled(m_timeAssignmentsModel->enabled());
|
||||||
|
connect(m_timeAssignmentsModel, &TimeAssignmentsModel::enabledChanged, ui->timeAssignmentsView, &QWidget::setEnabled);
|
||||||
|
connect(ui->timeAssignmentsView, &QWidget::customContextMenuRequested, this, &AdvanvedViewDialog::contextMenuTimeAssignment);
|
||||||
|
}
|
||||||
|
|
||||||
|
AdvanvedViewDialog::~AdvanvedViewDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos)
|
||||||
|
{
|
||||||
|
auto index = ui->bookingsView->indexAt(pos);
|
||||||
|
|
||||||
|
if(!index.isValid())
|
||||||
|
{
|
||||||
|
QMenu menu;
|
||||||
|
auto createAction = menu.addAction(tr("Create booking"));
|
||||||
|
auto refreshAction = menu.addAction(QIcon(QPixmap(QStringLiteral(":/zeiterfassunglib/images/refresh.png"))), tr("Refresh bookings"));
|
||||||
|
auto selectedAction = menu.exec(ui->bookingsView->viewport()->mapToGlobal(pos));
|
||||||
|
if(selectedAction == createAction)
|
||||||
|
{
|
||||||
|
BookingDialog dialog(this);
|
||||||
|
dialog.setTime(timeNormalise(QTime::currentTime()));
|
||||||
|
again2:
|
||||||
|
if(dialog.exec() == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
auto reply = m_stripsWidget.mainWindow().erfassung().doCreateBooking(
|
||||||
|
m_stripsWidget.mainWindow().userInfo().userId,
|
||||||
|
m_stripsWidget.date(),
|
||||||
|
dialog.getTime(),
|
||||||
|
dialog.getTimespan(),
|
||||||
|
dialog.getType(),
|
||||||
|
dialog.getText()
|
||||||
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
QEventLoop eventLoop;
|
||||||
|
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||||
|
eventLoop.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(reply->success())
|
||||||
|
{
|
||||||
|
m_stripsWidget.refreshBookings();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Could not create booking!"), tr("Could not create booking!") % "\n\n" % reply->message());
|
||||||
|
goto again2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(selectedAction == refreshAction)
|
||||||
|
{
|
||||||
|
m_stripsWidget.refreshBookings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto booking = m_stripsWidget.bookings().at(index.row());
|
||||||
|
|
||||||
|
QMenu menu;
|
||||||
|
auto editAction = menu.addAction(tr("Edit booking"));
|
||||||
|
auto deleteAction = menu.addAction(tr("Delete booking"));
|
||||||
|
auto selectedAction = menu.exec(ui->bookingsView->viewport()->mapToGlobal(pos));
|
||||||
|
if(selectedAction == editAction)
|
||||||
|
{
|
||||||
|
BookingDialog dialog(this);
|
||||||
|
dialog.setTime(booking.time);
|
||||||
|
dialog.setTimespan(booking.timespan);
|
||||||
|
dialog.setType(booking.type);
|
||||||
|
dialog.setText(booking.text);
|
||||||
|
again1:
|
||||||
|
if(dialog.exec() == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
auto reply = m_stripsWidget.mainWindow().erfassung().doUpdateBooking(
|
||||||
|
booking.id,
|
||||||
|
m_stripsWidget.mainWindow().userInfo().userId,
|
||||||
|
m_stripsWidget.date(),
|
||||||
|
dialog.getTime(),
|
||||||
|
dialog.getTimespan(),
|
||||||
|
dialog.getType(),
|
||||||
|
dialog.getText()
|
||||||
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
QEventLoop eventLoop;
|
||||||
|
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||||
|
eventLoop.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(reply->success())
|
||||||
|
{
|
||||||
|
m_stripsWidget.refreshBookings();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Could not edit booking!"), tr("Could not edit booking!") % "\n\n" % reply->message());
|
||||||
|
goto again1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(selectedAction == deleteAction)
|
||||||
|
{
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setText(tr("Do you really want to delete the booking?"));
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
|
||||||
|
msgBox.setDefaultButton(QMessageBox::Cancel);
|
||||||
|
if(msgBox.exec() == QMessageBox::Yes)
|
||||||
|
{
|
||||||
|
auto reply = m_stripsWidget.mainWindow().erfassung().doDeleteBooking(booking.id);
|
||||||
|
|
||||||
|
{
|
||||||
|
QEventLoop eventLoop;
|
||||||
|
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||||
|
eventLoop.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(reply->success())
|
||||||
|
m_stripsWidget.refreshBookings();
|
||||||
|
else
|
||||||
|
QMessageBox::warning(this, tr("Could not delete booking!"), tr("Could not delete booking!") % "\n\n" % reply->message());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
||||||
|
{
|
||||||
|
auto index = ui->timeAssignmentsView->indexAt(pos);
|
||||||
|
|
||||||
|
if(!index.isValid())
|
||||||
|
{
|
||||||
|
QMenu menu;
|
||||||
|
auto createAction = menu.addAction(tr("Create time assignment"));
|
||||||
|
auto refreshAction = menu.addAction(QIcon(QPixmap(QStringLiteral(":/zeiterfassunglib/images/refresh.png"))), tr("Refresh time assignments"));
|
||||||
|
auto selectedAction = menu.exec(ui->timeAssignmentsView->viewport()->mapToGlobal(pos));
|
||||||
|
if(selectedAction == createAction)
|
||||||
|
{
|
||||||
|
TimeAssignmentDialog dialog(m_stripsWidget.mainWindow().projects(),
|
||||||
|
m_stripsWidget.mainWindow().settings(), this);
|
||||||
|
again2:
|
||||||
|
if(dialog.exec() == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
auto reply = m_stripsWidget.mainWindow().erfassung().doCreateTimeAssignment(
|
||||||
|
m_stripsWidget.mainWindow().userInfo().userId,
|
||||||
|
m_stripsWidget.date(),
|
||||||
|
dialog.getTime(),
|
||||||
|
dialog.getTimespan(),
|
||||||
|
dialog.getProject(),
|
||||||
|
dialog.getSubproject(),
|
||||||
|
dialog.getWorkpackage(),
|
||||||
|
dialog.getText()
|
||||||
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
QEventLoop eventLoop;
|
||||||
|
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||||
|
eventLoop.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(reply->success())
|
||||||
|
{
|
||||||
|
m_stripsWidget.refreshTimeAssignments();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Could not create time assignment!"), tr("Could not create time assignment!") % "\n\n" % reply->message());
|
||||||
|
goto again2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(selectedAction == refreshAction)
|
||||||
|
{
|
||||||
|
m_stripsWidget.refreshTimeAssignments();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto timeAssignment = m_stripsWidget.timeAssignments().at(index.row());
|
||||||
|
|
||||||
|
QMenu menu;
|
||||||
|
auto editAction = menu.addAction(tr("Edit time assignment"));
|
||||||
|
auto deleteAction = menu.addAction(tr("Delete time assignment"));
|
||||||
|
auto selectedAction = menu.exec(ui->timeAssignmentsView->viewport()->mapToGlobal(pos));
|
||||||
|
if(selectedAction == editAction)
|
||||||
|
{
|
||||||
|
TimeAssignmentDialog dialog(m_stripsWidget.mainWindow().projects(),
|
||||||
|
m_stripsWidget.mainWindow().settings(), this);
|
||||||
|
dialog.setTime(timeAssignment.time);
|
||||||
|
dialog.setTimespan(timeAssignment.timespan);
|
||||||
|
dialog.setProject(timeAssignment.project);
|
||||||
|
dialog.setSubproject(timeAssignment.subproject);
|
||||||
|
dialog.setWorkpackage(timeAssignment.workpackage);
|
||||||
|
dialog.setText(timeAssignment.text);
|
||||||
|
again1:
|
||||||
|
if(dialog.exec() == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
auto reply = m_stripsWidget.mainWindow().erfassung().doUpdateTimeAssignment(
|
||||||
|
timeAssignment.id,
|
||||||
|
m_stripsWidget.mainWindow().userInfo().userId,
|
||||||
|
m_stripsWidget.date(),
|
||||||
|
dialog.getTime(),
|
||||||
|
dialog.getTimespan(),
|
||||||
|
dialog.getProject(),
|
||||||
|
dialog.getSubproject(),
|
||||||
|
dialog.getWorkpackage(),
|
||||||
|
dialog.getText()
|
||||||
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
QEventLoop eventLoop;
|
||||||
|
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||||
|
eventLoop.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(reply->success())
|
||||||
|
{
|
||||||
|
m_stripsWidget.refreshTimeAssignments();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Could not edit time assignment!"), tr("Could not edit time assignment!") % "\n\n" % reply->message());
|
||||||
|
goto again1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(selectedAction == deleteAction)
|
||||||
|
{
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setText(tr("Do you really want to delete the time assignment?"));
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
|
||||||
|
msgBox.setDefaultButton(QMessageBox::Cancel);
|
||||||
|
if(msgBox.exec() == QMessageBox::Yes)
|
||||||
|
{
|
||||||
|
auto reply = m_stripsWidget.mainWindow().erfassung().doDeleteTimeAssignment(timeAssignment.id);
|
||||||
|
|
||||||
|
{
|
||||||
|
QEventLoop eventLoop;
|
||||||
|
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||||
|
eventLoop.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(reply->success())
|
||||||
|
{
|
||||||
|
m_stripsWidget.refreshTimeAssignments();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
QMessageBox::warning(this, tr("Could not delete time assignment!"), tr("Could not delete time assignment!") % "\n\n" % reply->message());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
32
plugins/advancedviewplugin/advanvedviewdialog.h
Normal file
32
plugins/advancedviewplugin/advanvedviewdialog.h
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#ifndef ADVANVEDVIEWDIALOG_H
|
||||||
|
#define ADVANVEDVIEWDIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui { class AdvanvedViewDialog; }
|
||||||
|
class StripsWidget;
|
||||||
|
class BookingsModel;
|
||||||
|
class TimeAssignmentsModel;
|
||||||
|
|
||||||
|
class AdvanvedViewDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AdvanvedViewDialog(StripsWidget &stripsWidget);
|
||||||
|
~AdvanvedViewDialog();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void contextMenuBooking(const QPoint &pos);
|
||||||
|
void contextMenuTimeAssignment(const QPoint &pos);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::AdvanvedViewDialog *ui;
|
||||||
|
|
||||||
|
StripsWidget &m_stripsWidget;
|
||||||
|
|
||||||
|
BookingsModel *m_bookingsModel;
|
||||||
|
TimeAssignmentsModel *m_timeAssignmentsModel;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ADVANVEDVIEWDIALOG_H
|
81
plugins/advancedviewplugin/advanvedviewdialog.ui
Normal file
81
plugins/advancedviewplugin/advanvedviewdialog.ui
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AdvanvedViewDialog</class>
|
||||||
|
<widget class="QDialog" name="AdvanvedViewDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1024</width>
|
||||||
|
<height>480</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Advanced view</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
|
||||||
|
<item>
|
||||||
|
<widget class="QSplitter" name="splitter">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<widget class="QTreeView" name="bookingsView">
|
||||||
|
<property name="contextMenuPolicy">
|
||||||
|
<enum>Qt::CustomContextMenu</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QTreeView" name="timeAssignmentsView">
|
||||||
|
<property name="contextMenuPolicy">
|
||||||
|
<enum>Qt::CustomContextMenu</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>AdvanvedViewDialog</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>AdvanvedViewDialog</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>
|
BIN
plugins/advancedviewplugin/images/advanced-view.png
Normal file
BIN
plugins/advancedviewplugin/images/advanced-view.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
88
plugins/advancedviewplugin/models/bookingsmodel.cpp
Normal file
88
plugins/advancedviewplugin/models/bookingsmodel.cpp
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
#include "bookingsmodel.h"
|
||||||
|
|
||||||
|
#include "stripswidget.h"
|
||||||
|
|
||||||
|
BookingsModel::BookingsModel(StripsWidget &stripsWidget, QObject *parent) :
|
||||||
|
QAbstractListModel(parent),
|
||||||
|
m_stripsWidget(stripsWidget)
|
||||||
|
{
|
||||||
|
connect(&stripsWidget, &StripsWidget::bookingsChanged, this, &BookingsModel::bookingsChanged);
|
||||||
|
connect(&stripsWidget, &StripsWidget::refreshingBookingsChanged, [=](bool refreshing){ enabledChanged(!refreshing); });
|
||||||
|
}
|
||||||
|
|
||||||
|
StripsWidget &BookingsModel::stripsWidget() const
|
||||||
|
{
|
||||||
|
return m_stripsWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BookingsModel::enabled() const
|
||||||
|
{
|
||||||
|
return !m_stripsWidget.refreshingBookings();
|
||||||
|
}
|
||||||
|
|
||||||
|
int BookingsModel::rowCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
|
return m_stripsWidget.bookings().count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int BookingsModel::columnCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant BookingsModel::data(const QModelIndex &index, int role) const
|
||||||
|
{
|
||||||
|
Q_ASSERT(index.row() < m_stripsWidget.bookings().count());
|
||||||
|
const auto &booking = m_stripsWidget.bookings().at(index.row());
|
||||||
|
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
switch(index.column())
|
||||||
|
{
|
||||||
|
case 0: return booking.id;
|
||||||
|
case 1: return booking.time;
|
||||||
|
case 2: return booking.timespan;
|
||||||
|
case 3: return booking.type;
|
||||||
|
case 4: return booking.text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant BookingsModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
|
{
|
||||||
|
switch(orientation)
|
||||||
|
{
|
||||||
|
case Qt::Horizontal:
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
switch(section)
|
||||||
|
{
|
||||||
|
case 0: return tr("ID");
|
||||||
|
case 1: return tr("Time");
|
||||||
|
case 2: return tr("Timespan");
|
||||||
|
case 3: return tr("Type");
|
||||||
|
case 4: return tr("Text");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
qt_noop();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BookingsModel::bookingsChanged()
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
endResetModel();
|
||||||
|
}
|
@@ -12,14 +12,12 @@ class StripsWidget;
|
|||||||
class ZEITERFASSUNGLIBSHARED_EXPORT BookingsModel : public QAbstractListModel
|
class ZEITERFASSUNGLIBSHARED_EXPORT BookingsModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(StripsWidget* stripsWidget READ stripsWidget WRITE setStripsWidget NOTIFY stripsWidgetChanged)
|
|
||||||
Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged)
|
Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BookingsModel(QObject *parent = Q_NULLPTR);
|
explicit BookingsModel(StripsWidget &stripsWidget, QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
StripsWidget *stripsWidget() const;
|
StripsWidget &stripsWidget() const;
|
||||||
void setStripsWidget(StripsWidget *stripsWidget);
|
|
||||||
|
|
||||||
bool enabled() const;
|
bool enabled() const;
|
||||||
|
|
||||||
@@ -30,16 +28,13 @@ public:
|
|||||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void stripsWidgetChanged(StripsWidget *stripsWidget);
|
|
||||||
void enabledChanged(bool enabled);
|
void enabledChanged(bool enabled);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void bookingsChanged();
|
void bookingsChanged();
|
||||||
void refreshingChanged(bool refreshing);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StripsWidget *m_stripsWidget;
|
StripsWidget &m_stripsWidget;
|
||||||
bool m_enabled;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BOOKINGSMODEL_H
|
#endif // BOOKINGSMODEL_H
|
92
plugins/advancedviewplugin/models/timeassignmentsmodel.cpp
Normal file
92
plugins/advancedviewplugin/models/timeassignmentsmodel.cpp
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
#include "timeassignmentsmodel.h"
|
||||||
|
|
||||||
|
#include "stripswidget.h"
|
||||||
|
|
||||||
|
TimeAssignmentsModel::TimeAssignmentsModel(StripsWidget &stripsWidget, QObject *parent) :
|
||||||
|
QAbstractListModel(parent),
|
||||||
|
m_stripsWidget(stripsWidget)
|
||||||
|
{
|
||||||
|
connect(&stripsWidget, &StripsWidget::timeAssignmentsChanged, this, &TimeAssignmentsModel::timeAssignmentsChanged);
|
||||||
|
connect(&stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, [=](bool refreshing){ enabledChanged(!refreshing); });
|
||||||
|
}
|
||||||
|
|
||||||
|
StripsWidget &TimeAssignmentsModel::stripsWidget() const
|
||||||
|
{
|
||||||
|
return m_stripsWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TimeAssignmentsModel::enabled() const
|
||||||
|
{
|
||||||
|
return !m_stripsWidget.refreshingTimeAssignments();
|
||||||
|
}
|
||||||
|
|
||||||
|
int TimeAssignmentsModel::rowCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
|
return m_stripsWidget.timeAssignments().count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int TimeAssignmentsModel::columnCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
|
return 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant TimeAssignmentsModel::data(const QModelIndex &index, int role) const
|
||||||
|
{
|
||||||
|
Q_ASSERT(index.row() < m_stripsWidget.timeAssignments().count());
|
||||||
|
const auto &timeAssignment = m_stripsWidget.timeAssignments().at(index.row());
|
||||||
|
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
switch(index.column())
|
||||||
|
{
|
||||||
|
case 0: return timeAssignment.id;
|
||||||
|
case 1: return timeAssignment.time;
|
||||||
|
case 2: return timeAssignment.timespan;
|
||||||
|
case 3: return timeAssignment.project;
|
||||||
|
case 4: return timeAssignment.subproject;
|
||||||
|
case 5: return timeAssignment.workpackage;
|
||||||
|
case 6: return timeAssignment.text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant TimeAssignmentsModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
|
{
|
||||||
|
switch(orientation)
|
||||||
|
{
|
||||||
|
case Qt::Horizontal:
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
switch(section)
|
||||||
|
{
|
||||||
|
case 0: return tr("ID");
|
||||||
|
case 1: return tr("Time");
|
||||||
|
case 2: return tr("Timespan");
|
||||||
|
case 3: return tr("Project");
|
||||||
|
case 4: return tr("Subproject");
|
||||||
|
case 5: return tr("Workpackage");
|
||||||
|
case 6: return tr("Text");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
qt_noop();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TimeAssignmentsModel::timeAssignmentsChanged()
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
endResetModel();
|
||||||
|
}
|
@@ -12,14 +12,12 @@ class StripsWidget;
|
|||||||
class ZEITERFASSUNGLIBSHARED_EXPORT TimeAssignmentsModel : public QAbstractListModel
|
class ZEITERFASSUNGLIBSHARED_EXPORT TimeAssignmentsModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(StripsWidget* stripsWidget READ stripsWidget WRITE setStripsWidget NOTIFY stripsWidgetChanged)
|
|
||||||
Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged)
|
Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TimeAssignmentsModel(QObject *parent = Q_NULLPTR);
|
explicit TimeAssignmentsModel(StripsWidget &stripsWidget, QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
StripsWidget *stripsWidget() const;
|
StripsWidget &stripsWidget() const;
|
||||||
void setStripsWidget(StripsWidget *stripsWidget);
|
|
||||||
|
|
||||||
bool enabled() const;
|
bool enabled() const;
|
||||||
|
|
||||||
@@ -38,8 +36,7 @@ private Q_SLOTS:
|
|||||||
void refreshingChanged(bool refreshing);
|
void refreshingChanged(bool refreshing);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StripsWidget *m_stripsWidget;
|
StripsWidget &m_stripsWidget;
|
||||||
bool m_enabled;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TIMEASSIGNMENTSMODEL_H
|
#endif // TIMEASSIGNMENTSMODEL_H
|
@@ -12,7 +12,7 @@ class Q_DECL_EXPORT LunchMealPlugin : public ZeiterfassungPlugin
|
|||||||
Q_INTERFACES(ZeiterfassungPlugin)
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LunchMealPlugin(QObject *parent = 0);
|
explicit LunchMealPlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
// ZeiterfassungPlugin interface
|
// ZeiterfassungPlugin interface
|
||||||
};
|
};
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
SUBDIRS += lunchmealplugin \
|
SUBDIRS += advancedviewplugin \
|
||||||
|
lunchmealplugin \
|
||||||
presenceplugin \
|
presenceplugin \
|
||||||
weatherplugin
|
weatherplugin
|
||||||
|
@@ -14,7 +14,7 @@ class Q_DECL_EXPORT PresencePlugin : public ZeiterfassungPlugin
|
|||||||
Q_INTERFACES(ZeiterfassungPlugin)
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PresencePlugin(QObject *parent = 0);
|
explicit PresencePlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
// ZeiterfassungPlugin interface
|
// ZeiterfassungPlugin interface
|
||||||
void attachTo(MainWindow &mainWindow);
|
void attachTo(MainWindow &mainWindow);
|
||||||
|
@@ -12,7 +12,7 @@ class Q_DECL_EXPORT WeatherPlugin : public ZeiterfassungPlugin
|
|||||||
Q_INTERFACES(ZeiterfassungPlugin)
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WeatherPlugin(QObject *parent = 0);
|
explicit WeatherPlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
// ZeiterfassungPlugin interface
|
// ZeiterfassungPlugin interface
|
||||||
};
|
};
|
||||||
|
@@ -21,21 +21,13 @@
|
|||||||
#include "stripfactory.h"
|
#include "stripfactory.h"
|
||||||
#include "stripswidget.h"
|
#include "stripswidget.h"
|
||||||
#include "dialogs/aboutmedialog.h"
|
#include "dialogs/aboutmedialog.h"
|
||||||
#include "dialogs/bookingdialog.h"
|
|
||||||
#include "dialogs/timeassignmentdialog.h"
|
|
||||||
#include "dialogs/settingsdialog.h"
|
#include "dialogs/settingsdialog.h"
|
||||||
#include "dialogs/updatedialog.h"
|
#include "dialogs/updatedialog.h"
|
||||||
#include "models/bookingsmodel.h"
|
|
||||||
#include "models/timeassignmentsmodel.h"
|
|
||||||
#include "replies/getprojectsreply.h"
|
#include "replies/getprojectsreply.h"
|
||||||
#include "replies/getauswertungreply.h"
|
#include "replies/getauswertungreply.h"
|
||||||
#include "replies/updatebookingreply.h"
|
|
||||||
#include "replies/deletebookingreply.h"
|
|
||||||
#include "replies/createbookingreply.h"
|
#include "replies/createbookingreply.h"
|
||||||
#include "replies/updatetimeassignmentreply.h"
|
|
||||||
#include "replies/deletetimeassignmentreply.h"
|
|
||||||
#include "replies/createtimeassignmentreply.h"
|
#include "replies/createtimeassignmentreply.h"
|
||||||
#include "replies/createbookingreply.h"
|
#include "replies/updatetimeassignmentreply.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfassung, const GetUserInfoReply::UserInfo &userInfo,
|
MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfassung, const GetUserInfoReply::UserInfo &userInfo,
|
||||||
StripFactory &stripFactory, QWidget *parent) :
|
StripFactory &stripFactory, QWidget *parent) :
|
||||||
@@ -47,15 +39,13 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
|||||||
m_stripFactory(stripFactory),
|
m_stripFactory(stripFactory),
|
||||||
m_getProjectsReply(Q_NULLPTR),
|
m_getProjectsReply(Q_NULLPTR),
|
||||||
m_getAuswertungReply(Q_NULLPTR),
|
m_getAuswertungReply(Q_NULLPTR),
|
||||||
m_bookingsModel(new BookingsModel(this)),
|
|
||||||
m_timeAssignmentsModel(new TimeAssignmentsModel(this)),
|
|
||||||
m_currentStripWidget(Q_NULLPTR)
|
m_currentStripWidget(Q_NULLPTR)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
for(quint8 i = 0; i < 7; i++)
|
for(quint8 i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
m_stripsWidgets[i] = new StripsWidget(m_erfassung, m_userInfo.userId, m_stripFactory, m_projects, ui->widgetWeek);
|
m_stripsWidgets[i] = new StripsWidget(*this, ui->widgetWeek);
|
||||||
connect(m_stripsWidgets[i], &StripsWidget::refreshingChanged, this, &MainWindow::refreshingChanged);
|
connect(m_stripsWidgets[i], &StripsWidget::refreshingChanged, this, &MainWindow::refreshingChanged);
|
||||||
ui->layoutWeek->addWidget(m_stripsWidgets[i]);
|
ui->layoutWeek->addWidget(m_stripsWidgets[i]);
|
||||||
}
|
}
|
||||||
@@ -100,14 +90,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->treeViewBookings->setModel(m_bookingsModel);
|
|
||||||
connect(m_bookingsModel, &BookingsModel::enabledChanged, ui->treeViewBookings, &QWidget::setEnabled);
|
|
||||||
connect(ui->treeViewBookings, &QWidget::customContextMenuRequested, this, &MainWindow::contextMenuBooking);
|
|
||||||
|
|
||||||
ui->treeViewTimeAssignments->setModel(m_timeAssignmentsModel);
|
|
||||||
connect(m_timeAssignmentsModel, &TimeAssignmentsModel::enabledChanged, ui->treeViewTimeAssignments, &QWidget::setEnabled);
|
|
||||||
connect(ui->treeViewTimeAssignments, &QWidget::customContextMenuRequested, this, &MainWindow::contextMenuTimeAssignment);
|
|
||||||
|
|
||||||
ui->statusbar->addPermanentWidget(m_balanceLabel = new QLabel(ui->statusbar));
|
ui->statusbar->addPermanentWidget(m_balanceLabel = new QLabel(ui->statusbar));
|
||||||
m_balanceLabel->setFrameShape(QFrame::Panel);
|
m_balanceLabel->setFrameShape(QFrame::Panel);
|
||||||
m_balanceLabel->setFrameShadow(QFrame::Sunken);
|
m_balanceLabel->setFrameShadow(QFrame::Sunken);
|
||||||
@@ -166,6 +148,16 @@ StripFactory &MainWindow::stripFactory() const
|
|||||||
return m_stripFactory;
|
return m_stripFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QMap<QString, QString> &MainWindow::projects() const
|
||||||
|
{
|
||||||
|
return m_projects;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::array<StripsWidget*, 7> &MainWindow::stripsWidgets() const
|
||||||
|
{
|
||||||
|
return m_stripsWidgets;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::getProjectsFinished()
|
void MainWindow::getProjectsFinished()
|
||||||
{
|
{
|
||||||
if(m_getProjectsReply->success())
|
if(m_getProjectsReply->success())
|
||||||
@@ -244,225 +236,6 @@ void MainWindow::getAuswertungFinished()
|
|||||||
m_getAuswertungReply = Q_NULLPTR;
|
m_getAuswertungReply = Q_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::contextMenuBooking(const QPoint &pos)
|
|
||||||
{
|
|
||||||
auto index = ui->treeViewBookings->indexAt(pos);
|
|
||||||
|
|
||||||
if(!index.isValid())
|
|
||||||
{
|
|
||||||
QMenu menu;
|
|
||||||
auto createAction = menu.addAction(tr("Create booking"));
|
|
||||||
auto refreshAction = menu.addAction(QIcon(QPixmap(QStringLiteral(":/zeiterfassunglib/images/refresh.png"))), tr("Refresh bookings"));
|
|
||||||
auto selectedAction = menu.exec(ui->treeViewBookings->viewport()->mapToGlobal(pos));
|
|
||||||
if(selectedAction == createAction)
|
|
||||||
{
|
|
||||||
BookingDialog dialog(this);
|
|
||||||
dialog.setTime(timeNormalise(QTime::currentTime()));
|
|
||||||
again2:
|
|
||||||
if(dialog.exec() == QDialog::Accepted)
|
|
||||||
{
|
|
||||||
auto reply = m_erfassung.doCreateBooking(m_userInfo.userId, ui->dateEditDate->date(),
|
|
||||||
dialog.getTime(), dialog.getTimespan(),
|
|
||||||
dialog.getType(), dialog.getText());
|
|
||||||
|
|
||||||
{
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
|
||||||
eventLoop.exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(reply->success())
|
|
||||||
{
|
|
||||||
m_currentStripWidget->refreshBookings();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Could not create booking!"), tr("Could not create booking!") % "\n\n" % reply->message());
|
|
||||||
goto again2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(selectedAction == refreshAction)
|
|
||||||
{
|
|
||||||
m_currentStripWidget->refreshBookings();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
auto booking = m_currentStripWidget->bookings().at(index.row());
|
|
||||||
|
|
||||||
QMenu menu;
|
|
||||||
auto editAction = menu.addAction(tr("Edit booking"));
|
|
||||||
auto deleteAction = menu.addAction(tr("Delete booking"));
|
|
||||||
auto selectedAction = menu.exec(ui->treeViewBookings->viewport()->mapToGlobal(pos));
|
|
||||||
if(selectedAction == editAction)
|
|
||||||
{
|
|
||||||
BookingDialog dialog(this);
|
|
||||||
dialog.setTime(booking.time);
|
|
||||||
dialog.setTimespan(booking.timespan);
|
|
||||||
dialog.setType(booking.type);
|
|
||||||
dialog.setText(booking.text);
|
|
||||||
again1:
|
|
||||||
if(dialog.exec() == QDialog::Accepted)
|
|
||||||
{
|
|
||||||
auto reply = m_erfassung.doUpdateBooking(booking.id, m_userInfo.userId, ui->dateEditDate->date(),
|
|
||||||
dialog.getTime(), dialog.getTimespan(),
|
|
||||||
dialog.getType(), dialog.getText());
|
|
||||||
|
|
||||||
{
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
|
||||||
eventLoop.exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(reply->success())
|
|
||||||
{
|
|
||||||
m_currentStripWidget->refreshBookings();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Could not edit booking!"), tr("Could not edit booking!") % "\n\n" % reply->message());
|
|
||||||
goto again1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(selectedAction == deleteAction)
|
|
||||||
{
|
|
||||||
QMessageBox msgBox;
|
|
||||||
msgBox.setText(tr("Do you really want to delete the booking?"));
|
|
||||||
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
|
|
||||||
msgBox.setDefaultButton(QMessageBox::Cancel);
|
|
||||||
if(msgBox.exec() == QMessageBox::Yes)
|
|
||||||
{
|
|
||||||
auto reply = m_erfassung.doDeleteBooking(booking.id);
|
|
||||||
|
|
||||||
{
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
|
||||||
eventLoop.exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(reply->success())
|
|
||||||
m_currentStripWidget->refreshBookings();
|
|
||||||
else
|
|
||||||
QMessageBox::warning(this, tr("Could not delete booking!"), tr("Could not delete booking!") % "\n\n" % reply->message());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::contextMenuTimeAssignment(const QPoint &pos)
|
|
||||||
{
|
|
||||||
auto index = ui->treeViewTimeAssignments->indexAt(pos);
|
|
||||||
|
|
||||||
if(!index.isValid())
|
|
||||||
{
|
|
||||||
QMenu menu;
|
|
||||||
auto createAction = menu.addAction(tr("Create time assignment"));
|
|
||||||
auto refreshAction = menu.addAction(QIcon(QPixmap(QStringLiteral(":/zeiterfassunglib/images/refresh.png"))), tr("Refresh time assignments"));
|
|
||||||
auto selectedAction = menu.exec(ui->treeViewTimeAssignments->viewport()->mapToGlobal(pos));
|
|
||||||
if(selectedAction == createAction)
|
|
||||||
{
|
|
||||||
TimeAssignmentDialog dialog(m_projects, m_settings, this);
|
|
||||||
again2:
|
|
||||||
if(dialog.exec() == QDialog::Accepted)
|
|
||||||
{
|
|
||||||
auto reply = m_erfassung.doCreateTimeAssignment(m_userInfo.userId, ui->dateEditDate->date(),
|
|
||||||
dialog.getTime(), dialog.getTimespan(),
|
|
||||||
dialog.getProject(), dialog.getSubproject(),
|
|
||||||
dialog.getWorkpackage(), dialog.getText());
|
|
||||||
|
|
||||||
{
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
|
||||||
eventLoop.exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(reply->success())
|
|
||||||
{
|
|
||||||
m_currentStripWidget->refreshTimeAssignments();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Could not create time assignment!"), tr("Could not create time assignment!") % "\n\n" % reply->message());
|
|
||||||
goto again2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(selectedAction == refreshAction)
|
|
||||||
{
|
|
||||||
m_currentStripWidget->refreshTimeAssignments();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
auto timeAssignment = m_currentStripWidget->timeAssignments().at(index.row());
|
|
||||||
|
|
||||||
QMenu menu;
|
|
||||||
auto editAction = menu.addAction(tr("Edit time assignment"));
|
|
||||||
auto deleteAction = menu.addAction(tr("Delete time assignment"));
|
|
||||||
auto selectedAction = menu.exec(ui->treeViewTimeAssignments->viewport()->mapToGlobal(pos));
|
|
||||||
if(selectedAction == editAction)
|
|
||||||
{
|
|
||||||
TimeAssignmentDialog dialog(m_projects, m_settings, this);
|
|
||||||
dialog.setTime(timeAssignment.time);
|
|
||||||
dialog.setTimespan(timeAssignment.timespan);
|
|
||||||
dialog.setProject(timeAssignment.project);
|
|
||||||
dialog.setSubproject(timeAssignment.subproject);
|
|
||||||
dialog.setWorkpackage(timeAssignment.workpackage);
|
|
||||||
dialog.setText(timeAssignment.text);
|
|
||||||
again1:
|
|
||||||
if(dialog.exec() == QDialog::Accepted)
|
|
||||||
{
|
|
||||||
auto reply = m_erfassung.doUpdateTimeAssignment(timeAssignment.id, m_userInfo.userId, ui->dateEditDate->date(),
|
|
||||||
dialog.getTime(), dialog.getTimespan(),
|
|
||||||
dialog.getProject(), dialog.getSubproject(),
|
|
||||||
dialog.getWorkpackage(), dialog.getText());
|
|
||||||
|
|
||||||
{
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
|
||||||
eventLoop.exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(reply->success())
|
|
||||||
{
|
|
||||||
m_currentStripWidget->refreshTimeAssignments();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Could not edit time assignment!"), tr("Could not edit time assignment!") % "\n\n" % reply->message());
|
|
||||||
goto again1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(selectedAction == deleteAction)
|
|
||||||
{
|
|
||||||
QMessageBox msgBox;
|
|
||||||
msgBox.setText(tr("Do you really want to delete the time assignment?"));
|
|
||||||
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
|
|
||||||
msgBox.setDefaultButton(QMessageBox::Cancel);
|
|
||||||
if(msgBox.exec() == QMessageBox::Yes)
|
|
||||||
{
|
|
||||||
auto reply = m_erfassung.doDeleteTimeAssignment(timeAssignment.id);
|
|
||||||
|
|
||||||
{
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
|
||||||
eventLoop.exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(reply->success())
|
|
||||||
{
|
|
||||||
m_currentStripWidget->refreshTimeAssignments();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
QMessageBox::warning(this, tr("Could not delete time assignment!"), tr("Could not delete time assignment!") % "\n\n" % reply->message());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::pushButtonStartPressed()
|
void MainWindow::pushButtonStartPressed()
|
||||||
{
|
{
|
||||||
auto bookingsChanged = false;
|
auto bookingsChanged = false;
|
||||||
@@ -642,9 +415,6 @@ void MainWindow::dateChanged(bool force)
|
|||||||
|
|
||||||
m_currentStripWidget = m_stripsWidgets[i];
|
m_currentStripWidget = m_stripsWidgets[i];
|
||||||
|
|
||||||
m_bookingsModel->setStripsWidget(m_currentStripWidget);
|
|
||||||
m_timeAssignmentsModel->setStripsWidget(m_currentStripWidget);
|
|
||||||
|
|
||||||
minimumTimeChanged();
|
minimumTimeChanged();
|
||||||
startEnabledChanged();
|
startEnabledChanged();
|
||||||
endEnabledChanged();
|
endEnabledChanged();
|
||||||
|
@@ -41,11 +41,12 @@ public:
|
|||||||
const GetUserInfoReply::UserInfo &userInfo() const;
|
const GetUserInfoReply::UserInfo &userInfo() const;
|
||||||
StripFactory &stripFactory() const;
|
StripFactory &stripFactory() const;
|
||||||
|
|
||||||
|
const QMap<QString, QString> &projects() const;
|
||||||
|
const std::array<StripsWidget*, 7> &stripsWidgets() const;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void getProjectsFinished();
|
void getProjectsFinished();
|
||||||
void getAuswertungFinished();
|
void getAuswertungFinished();
|
||||||
void contextMenuBooking(const QPoint &pos);
|
|
||||||
void contextMenuTimeAssignment(const QPoint &pos);
|
|
||||||
void pushButtonStartPressed();
|
void pushButtonStartPressed();
|
||||||
void pushButtonEndPressed();
|
void pushButtonEndPressed();
|
||||||
void dateChanged(bool force = false);
|
void dateChanged(bool force = false);
|
||||||
|
@@ -167,70 +167,26 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
<property name="currentIndex">
|
<property name="frameShape">
|
||||||
<number>0</number>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<property name="frameShadow">
|
||||||
<property name="frameShape">
|
<enum>QFrame::Plain</enum>
|
||||||
<enum>QFrame::NoFrame</enum>
|
</property>
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="widgetWeek">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1393</width>
|
||||||
|
<height>440</height>
|
||||||
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<layout class="QHBoxLayout" name="layoutWeek"/>
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Optimized view</string>
|
|
||||||
</attribute>
|
|
||||||
<widget class="QWidget" name="widgetWeek">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>1389</width>
|
|
||||||
<height>409</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="layoutWeek"/>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QSplitter" name="splitter">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Advanced view</string>
|
|
||||||
</attribute>
|
|
||||||
<widget class="QGroupBox" name="groupBoxBookings">
|
|
||||||
<property name="title">
|
|
||||||
<string>Bookings</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QTreeView" name="treeViewBookings">
|
|
||||||
<property name="contextMenuPolicy">
|
|
||||||
<enum>Qt::CustomContextMenu</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QGroupBox" name="groupBoxTimeAssignments">
|
|
||||||
<property name="title">
|
|
||||||
<string>Time assignments</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QTreeView" name="treeViewTimeAssignments">
|
|
||||||
<property name="contextMenuPolicy">
|
|
||||||
<enum>Qt::CustomContextMenu</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@@ -1,123 +0,0 @@
|
|||||||
#include "bookingsmodel.h"
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#include "stripswidget.h"
|
|
||||||
|
|
||||||
BookingsModel::BookingsModel(QObject *parent) :
|
|
||||||
QAbstractListModel(parent),
|
|
||||||
m_stripsWidget(Q_NULLPTR),
|
|
||||||
m_enabled(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
StripsWidget *BookingsModel::stripsWidget() const
|
|
||||||
{
|
|
||||||
return m_stripsWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BookingsModel::setStripsWidget(StripsWidget *stripsWidget)
|
|
||||||
{
|
|
||||||
if(m_stripsWidget != stripsWidget)
|
|
||||||
{
|
|
||||||
if(m_stripsWidget)
|
|
||||||
{
|
|
||||||
disconnect(m_stripsWidget, &StripsWidget::bookingsChanged, this, &BookingsModel::bookingsChanged);
|
|
||||||
disconnect(m_stripsWidget, &StripsWidget::refreshingBookingsChanged, this, &BookingsModel::refreshingChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
beginResetModel();
|
|
||||||
Q_EMIT stripsWidgetChanged(m_stripsWidget = stripsWidget);
|
|
||||||
endResetModel();
|
|
||||||
|
|
||||||
if(m_stripsWidget)
|
|
||||||
{
|
|
||||||
connect(m_stripsWidget, &StripsWidget::bookingsChanged, this, &BookingsModel::bookingsChanged);
|
|
||||||
connect(m_stripsWidget, &StripsWidget::refreshingBookingsChanged, this, &BookingsModel::refreshingChanged);
|
|
||||||
|
|
||||||
if(m_enabled == m_stripsWidget->refreshingBookings())
|
|
||||||
Q_EMIT enabledChanged(m_enabled = !m_stripsWidget->refreshingBookings());
|
|
||||||
}
|
|
||||||
else if(m_enabled)
|
|
||||||
Q_EMIT enabledChanged(m_enabled = false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool BookingsModel::enabled() const
|
|
||||||
{
|
|
||||||
return m_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
int BookingsModel::rowCount(const QModelIndex &parent) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(parent)
|
|
||||||
|
|
||||||
return m_stripsWidget ? m_stripsWidget->bookings().count() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int BookingsModel::columnCount(const QModelIndex &parent) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(parent)
|
|
||||||
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant BookingsModel::data(const QModelIndex &index, int role) const
|
|
||||||
{
|
|
||||||
Q_ASSERT(m_stripsWidget != Q_NULLPTR);
|
|
||||||
Q_ASSERT(index.row() < m_stripsWidget->bookings().count());
|
|
||||||
const auto &booking = m_stripsWidget->bookings().at(index.row());
|
|
||||||
|
|
||||||
switch(role)
|
|
||||||
{
|
|
||||||
case Qt::DisplayRole:
|
|
||||||
case Qt::EditRole:
|
|
||||||
switch(index.column())
|
|
||||||
{
|
|
||||||
case 0: return booking.id;
|
|
||||||
case 1: return booking.time;
|
|
||||||
case 2: return booking.timespan;
|
|
||||||
case 3: return booking.type;
|
|
||||||
case 4: return booking.text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant BookingsModel::headerData(int section, Qt::Orientation orientation, int role) const
|
|
||||||
{
|
|
||||||
switch(orientation)
|
|
||||||
{
|
|
||||||
case Qt::Horizontal:
|
|
||||||
switch(role)
|
|
||||||
{
|
|
||||||
case Qt::DisplayRole:
|
|
||||||
case Qt::EditRole:
|
|
||||||
switch(section)
|
|
||||||
{
|
|
||||||
case 0: return tr("ID");
|
|
||||||
case 1: return tr("Time");
|
|
||||||
case 2: return tr("Timespan");
|
|
||||||
case 3: return tr("Type");
|
|
||||||
case 4: return tr("Text");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
qt_noop();
|
|
||||||
}
|
|
||||||
|
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BookingsModel::bookingsChanged()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BookingsModel::refreshingChanged(bool refreshing)
|
|
||||||
{
|
|
||||||
if(m_enabled == refreshing)
|
|
||||||
Q_EMIT enabledChanged(m_enabled = !refreshing);
|
|
||||||
}
|
|
@@ -1,127 +0,0 @@
|
|||||||
#include "timeassignmentsmodel.h"
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#include "stripswidget.h"
|
|
||||||
|
|
||||||
TimeAssignmentsModel::TimeAssignmentsModel(QObject *parent) :
|
|
||||||
QAbstractListModel(parent),
|
|
||||||
m_stripsWidget(Q_NULLPTR),
|
|
||||||
m_enabled(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
StripsWidget *TimeAssignmentsModel::stripsWidget() const
|
|
||||||
{
|
|
||||||
return m_stripsWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TimeAssignmentsModel::setStripsWidget(StripsWidget *stripsWidget)
|
|
||||||
{
|
|
||||||
if(m_stripsWidget != stripsWidget)
|
|
||||||
{
|
|
||||||
if(m_stripsWidget)
|
|
||||||
{
|
|
||||||
disconnect(m_stripsWidget, &StripsWidget::timeAssignmentsChanged, this, &TimeAssignmentsModel::timeAssignmentsChanged);
|
|
||||||
disconnect(m_stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, this, &TimeAssignmentsModel::refreshingChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
beginResetModel();
|
|
||||||
m_stripsWidget = stripsWidget;
|
|
||||||
endResetModel();
|
|
||||||
|
|
||||||
if(m_stripsWidget)
|
|
||||||
{
|
|
||||||
connect(m_stripsWidget, &StripsWidget::timeAssignmentsChanged, this, &TimeAssignmentsModel::timeAssignmentsChanged);
|
|
||||||
connect(m_stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, this, &TimeAssignmentsModel::refreshingChanged);
|
|
||||||
|
|
||||||
if(m_enabled == m_stripsWidget->refreshingTimeAssignments())
|
|
||||||
Q_EMIT enabledChanged(m_enabled = !m_stripsWidget->refreshingTimeAssignments());
|
|
||||||
}
|
|
||||||
else if(m_enabled)
|
|
||||||
Q_EMIT enabledChanged(m_enabled = false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TimeAssignmentsModel::enabled() const
|
|
||||||
{
|
|
||||||
return m_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TimeAssignmentsModel::rowCount(const QModelIndex &parent) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(parent)
|
|
||||||
|
|
||||||
return m_stripsWidget ? m_stripsWidget->timeAssignments().count() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TimeAssignmentsModel::columnCount(const QModelIndex &parent) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(parent)
|
|
||||||
|
|
||||||
return 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant TimeAssignmentsModel::data(const QModelIndex &index, int role) const
|
|
||||||
{
|
|
||||||
Q_ASSERT(m_stripsWidget != Q_NULLPTR);
|
|
||||||
Q_ASSERT(index.row() < m_stripsWidget->timeAssignments().count());
|
|
||||||
const auto &timeAssignment = m_stripsWidget->timeAssignments().at(index.row());
|
|
||||||
|
|
||||||
switch(role)
|
|
||||||
{
|
|
||||||
case Qt::DisplayRole:
|
|
||||||
case Qt::EditRole:
|
|
||||||
switch(index.column())
|
|
||||||
{
|
|
||||||
case 0: return timeAssignment.id;
|
|
||||||
case 1: return timeAssignment.time;
|
|
||||||
case 2: return timeAssignment.timespan;
|
|
||||||
case 3: return timeAssignment.project;
|
|
||||||
case 4: return timeAssignment.subproject;
|
|
||||||
case 5: return timeAssignment.workpackage;
|
|
||||||
case 6: return timeAssignment.text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant TimeAssignmentsModel::headerData(int section, Qt::Orientation orientation, int role) const
|
|
||||||
{
|
|
||||||
switch(orientation)
|
|
||||||
{
|
|
||||||
case Qt::Horizontal:
|
|
||||||
switch(role)
|
|
||||||
{
|
|
||||||
case Qt::DisplayRole:
|
|
||||||
case Qt::EditRole:
|
|
||||||
switch(section)
|
|
||||||
{
|
|
||||||
case 0: return tr("ID");
|
|
||||||
case 1: return tr("Time");
|
|
||||||
case 2: return tr("Timespan");
|
|
||||||
case 3: return tr("Project");
|
|
||||||
case 4: return tr("Subproject");
|
|
||||||
case 5: return tr("Workpackage");
|
|
||||||
case 6: return tr("Text");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
qt_noop();
|
|
||||||
}
|
|
||||||
|
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TimeAssignmentsModel::timeAssignmentsChanged()
|
|
||||||
{
|
|
||||||
beginResetModel();
|
|
||||||
endResetModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TimeAssignmentsModel::refreshingChanged(bool refreshing)
|
|
||||||
{
|
|
||||||
if(m_enabled == refreshing)
|
|
||||||
Q_EMIT enabledChanged(m_enabled = !refreshing);
|
|
||||||
}
|
|
@@ -7,27 +7,58 @@
|
|||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
#include "zeiterfassungapi.h"
|
#include "zeiterfassungapi.h"
|
||||||
#include "timeutils.h"
|
#include "timeutils.h"
|
||||||
#include "stripfactory.h"
|
#include "stripfactory.h"
|
||||||
|
|
||||||
StripsWidget::StripsWidget(ZeiterfassungApi &erfassung, int userId, StripFactory &stripFactory,
|
StripsWidget::StripsWidget(MainWindow &mainWindow, QWidget *parent) :
|
||||||
const QMap<QString, QString> &projects, QWidget *parent) :
|
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
m_erfassung(erfassung),
|
m_mainWindow(mainWindow),
|
||||||
m_userId(userId),
|
|
||||||
m_stripFactory(stripFactory),
|
|
||||||
m_projects(projects),
|
|
||||||
m_layout(new QVBoxLayout(this)),
|
|
||||||
m_refreshing(false),
|
m_refreshing(false),
|
||||||
m_refreshingBookings(false),
|
m_refreshingBookings(false),
|
||||||
m_refreshingTimeAssignments(false),
|
m_refreshingTimeAssignments(false),
|
||||||
m_startEnabled(false),
|
m_startEnabled(false),
|
||||||
m_endEnabled(false),
|
m_endEnabled(false)
|
||||||
m_getBookingsReply(Q_NULLPTR),
|
|
||||||
m_getTimeAssignmentsReply(Q_NULLPTR)
|
|
||||||
{
|
{
|
||||||
setLayout(m_layout);
|
auto layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
|
m_headerLayout = new QHBoxLayout(this);
|
||||||
|
m_label = new QLabel(this);
|
||||||
|
{
|
||||||
|
auto font = m_label->font();
|
||||||
|
font.setBold(true);
|
||||||
|
m_label->setFont(font);
|
||||||
|
}
|
||||||
|
m_headerLayout->addWidget(m_label, 1);
|
||||||
|
layout->addLayout(m_headerLayout);
|
||||||
|
|
||||||
|
m_stripsLayout = new QVBoxLayout(this);
|
||||||
|
layout->addLayout(m_stripsLayout);
|
||||||
|
|
||||||
|
layout->addStretch(1);
|
||||||
|
|
||||||
|
setLayout(layout);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindow &StripsWidget::mainWindow() const
|
||||||
|
{
|
||||||
|
return m_mainWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
QBoxLayout *StripsWidget::headerLayout() const
|
||||||
|
{
|
||||||
|
return m_headerLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
QBoxLayout *StripsWidget::stripsLayout() const
|
||||||
|
{
|
||||||
|
return m_stripsLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLabel *StripsWidget::label() const
|
||||||
|
{
|
||||||
|
return m_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QDate &StripsWidget::date() const
|
const QDate &StripsWidget::date() const
|
||||||
@@ -37,8 +68,20 @@ const QDate &StripsWidget::date() const
|
|||||||
|
|
||||||
void StripsWidget::setDate(const QDate &date)
|
void StripsWidget::setDate(const QDate &date)
|
||||||
{
|
{
|
||||||
m_date = date;
|
if(m_date != date)
|
||||||
refresh();
|
{
|
||||||
|
Q_EMIT dateChanged(m_date = date);
|
||||||
|
|
||||||
|
if(m_date.isValid())
|
||||||
|
m_label->setText(tr("%0 (%1)")
|
||||||
|
.arg(std::array<QString, 7> { tr("Monday"), tr("Tuesday"), tr("Wednesday"), tr("Thursday"),
|
||||||
|
tr("Friday"), tr("Saturday"), tr("Sunday") }[m_date.dayOfWeek() - 1])
|
||||||
|
.arg(m_date.toString(tr("dd.MM.yyyy"))));
|
||||||
|
else
|
||||||
|
m_label->setText(tr("Invalid"));
|
||||||
|
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVector<GetBookingsReply::Booking> &StripsWidget::bookings() const
|
const QVector<GetBookingsReply::Booking> &StripsWidget::bookings() const
|
||||||
@@ -95,14 +138,13 @@ void StripsWidget::refresh()
|
|||||||
{
|
{
|
||||||
clearStrips();
|
clearStrips();
|
||||||
|
|
||||||
m_layout->addWidget(new QLabel(tr("Loading..."), this));
|
m_stripsLayout->addWidget(new QLabel(tr("Loading..."), this));
|
||||||
m_layout->addStretch(1);
|
|
||||||
|
|
||||||
refreshBookings();
|
refreshBookings(false);
|
||||||
refreshTimeAssignments();
|
refreshTimeAssignments(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StripsWidget::refreshBookings()
|
void StripsWidget::refreshBookings(bool createLabel)
|
||||||
{
|
{
|
||||||
if(!m_date.isValid())
|
if(!m_date.isValid())
|
||||||
{
|
{
|
||||||
@@ -110,7 +152,14 @@ void StripsWidget::refreshBookings()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_bookings.count())
|
if(createLabel)
|
||||||
|
{
|
||||||
|
clearStrips();
|
||||||
|
|
||||||
|
m_stripsLayout->addWidget(new QLabel(tr("Loading..."), this));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!m_bookings.empty())
|
||||||
{
|
{
|
||||||
m_bookings.clear();
|
m_bookings.clear();
|
||||||
Q_EMIT bookingsChanged(m_bookings);
|
Q_EMIT bookingsChanged(m_bookings);
|
||||||
@@ -124,11 +173,11 @@ void StripsWidget::refreshBookings()
|
|||||||
|
|
||||||
invalidateValues();
|
invalidateValues();
|
||||||
|
|
||||||
m_getBookingsReply = m_erfassung.doGetBookings(m_userId, m_date, m_date);
|
m_getBookingsReply = m_mainWindow.erfassung().doGetBookings(m_mainWindow.userInfo().userId, m_date, m_date);
|
||||||
connect(m_getBookingsReply.get(), &ZeiterfassungReply::finished, this, &StripsWidget::getBookingsFinished);
|
connect(m_getBookingsReply.get(), &ZeiterfassungReply::finished, this, &StripsWidget::getBookingsFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StripsWidget::refreshTimeAssignments()
|
void StripsWidget::refreshTimeAssignments(bool createLabel)
|
||||||
{
|
{
|
||||||
if(!m_date.isValid())
|
if(!m_date.isValid())
|
||||||
{
|
{
|
||||||
@@ -136,7 +185,14 @@ void StripsWidget::refreshTimeAssignments()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_timeAssignments.count())
|
if(createLabel)
|
||||||
|
{
|
||||||
|
clearStrips();
|
||||||
|
|
||||||
|
m_stripsLayout->addWidget(new QLabel(tr("Loading..."), this));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!m_timeAssignments.empty())
|
||||||
{
|
{
|
||||||
m_timeAssignments.clear();
|
m_timeAssignments.clear();
|
||||||
Q_EMIT timeAssignmentsChanged(m_timeAssignments);
|
Q_EMIT timeAssignmentsChanged(m_timeAssignments);
|
||||||
@@ -150,7 +206,7 @@ void StripsWidget::refreshTimeAssignments()
|
|||||||
|
|
||||||
invalidateValues();
|
invalidateValues();
|
||||||
|
|
||||||
m_getTimeAssignmentsReply = m_erfassung.doGetTimeAssignments(m_userId, m_date, m_date);
|
m_getTimeAssignmentsReply = m_mainWindow.erfassung().doGetTimeAssignments(m_mainWindow.userInfo().userId, m_date, m_date);
|
||||||
connect(m_getTimeAssignmentsReply.get(), &ZeiterfassungReply::finished, this, &StripsWidget::getTimeAssignmentsFinished);
|
connect(m_getTimeAssignmentsReply.get(), &ZeiterfassungReply::finished, this, &StripsWidget::getTimeAssignmentsFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +255,7 @@ bool StripsWidget::createStrips()
|
|||||||
{
|
{
|
||||||
auto breakTime = timeBetween(lastBooking->time, startBooking.time);
|
auto breakTime = timeBetween(lastBooking->time, startBooking.time);
|
||||||
auto label = new QLabel(tr("%0: %1").arg(tr("Break")).arg(tr("%0h").arg(breakTime.toString(tr("HH:mm")))), this);
|
auto label = new QLabel(tr("%0: %1").arg(tr("Break")).arg(tr("%0h").arg(breakTime.toString(tr("HH:mm")))), this);
|
||||||
m_layout->addWidget(label);
|
m_stripsLayout->addWidget(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastBooking = &startBooking;
|
lastBooking = &startBooking;
|
||||||
@@ -392,7 +448,7 @@ bool StripsWidget::createStrips()
|
|||||||
auto label = new QLabel(tr("%0: %1")
|
auto label = new QLabel(tr("%0: %1")
|
||||||
.arg(tr("Assigned time"))
|
.arg(tr("Assigned time"))
|
||||||
.arg(tr("%0h").arg(timeAssignmentTime.toString(tr("HH:mm")))), this);
|
.arg(tr("%0h").arg(timeAssignmentTime.toString(tr("HH:mm")))), this);
|
||||||
m_layout->addWidget(label);
|
m_stripsLayout->addWidget(label);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -406,7 +462,7 @@ bool StripsWidget::createStrips()
|
|||||||
"Your bookings and time assignments for this day are in an illegal state!") % "\n" %
|
"Your bookings and time assignments for this day are in an illegal state!") % "\n" %
|
||||||
errorMessage, this);
|
errorMessage, this);
|
||||||
label->setStyleSheet("color: red;");
|
label->setStyleSheet("color: red;");
|
||||||
m_layout->addWidget(label);
|
m_stripsLayout->addWidget(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_timeAssignmentTime != timeAssignmentTime)
|
if(m_timeAssignmentTime != timeAssignmentTime)
|
||||||
@@ -424,33 +480,16 @@ bool StripsWidget::createStrips()
|
|||||||
if(m_endEnabled != endEnabled)
|
if(m_endEnabled != endEnabled)
|
||||||
Q_EMIT endEnabledChanged(m_endEnabled = endEnabled);
|
Q_EMIT endEnabledChanged(m_endEnabled = endEnabled);
|
||||||
|
|
||||||
m_layout->addStretch(1);
|
|
||||||
|
|
||||||
return !errorMessage.isEmpty();
|
return !errorMessage.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StripsWidget::clearStrips()
|
void StripsWidget::clearStrips()
|
||||||
{
|
{
|
||||||
while(QLayoutItem *item = m_layout->takeAt(0))
|
while(QLayoutItem *item = m_stripsLayout->takeAt(0))
|
||||||
{
|
{
|
||||||
delete item->widget();
|
delete item->widget();
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto label = new QLabel(this);
|
|
||||||
if(m_date.isValid())
|
|
||||||
label->setText(tr("%0 (%1)")
|
|
||||||
.arg(std::array<QString, 7> { tr("Monday"), tr("Tuesday"), tr("Wednesday"), tr("Thursday"),
|
|
||||||
tr("Friday"), tr("Saturday"), tr("Sunday") }[m_date.dayOfWeek() - 1])
|
|
||||||
.arg(m_date.toString(tr("dd.MM.yyyy"))));
|
|
||||||
else
|
|
||||||
label->setText(tr("Invalid"));
|
|
||||||
{
|
|
||||||
auto font = label->font();
|
|
||||||
font.setBold(true);
|
|
||||||
label->setFont(font);
|
|
||||||
}
|
|
||||||
m_layout->addWidget(label);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StripsWidget::getBookingsFinished()
|
void StripsWidget::getBookingsFinished()
|
||||||
@@ -507,10 +546,10 @@ void StripsWidget::invalidateValues()
|
|||||||
Q_EMIT endEnabledChanged(m_endEnabled = false);
|
Q_EMIT endEnabledChanged(m_endEnabled = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StripsWidget::buildProjectString(const QString &project)
|
QString StripsWidget::buildProjectString(const QString &project) const
|
||||||
{
|
{
|
||||||
if(m_projects.contains(project))
|
if(m_mainWindow.projects().contains(project))
|
||||||
return m_projects.value(project) % "\n" % project;
|
return m_mainWindow.projects().value(project) % "\n" % project;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qWarning() << "could not find project" << project;
|
qWarning() << "could not find project" << project;
|
||||||
@@ -520,7 +559,7 @@ QString StripsWidget::buildProjectString(const QString &project)
|
|||||||
|
|
||||||
QWidget *StripsWidget::appendBookingStartStrip(int id, const QTime &time)
|
QWidget *StripsWidget::appendBookingStartStrip(int id, const QTime &time)
|
||||||
{
|
{
|
||||||
auto widget = m_stripFactory.createBookingStartStrip(this).release();
|
auto widget = m_mainWindow.stripFactory().createBookingStartStrip(this).release();
|
||||||
|
|
||||||
if(auto labelTime = widget->findChild<QWidget*>(QStringLiteral("labelTime")))
|
if(auto labelTime = widget->findChild<QWidget*>(QStringLiteral("labelTime")))
|
||||||
labelTime->setProperty("text", time.toString(tr("HH:mm")));
|
labelTime->setProperty("text", time.toString(tr("HH:mm")));
|
||||||
@@ -532,14 +571,14 @@ QWidget *StripsWidget::appendBookingStartStrip(int id, const QTime &time)
|
|||||||
else
|
else
|
||||||
qWarning() << "no labelId found!";
|
qWarning() << "no labelId found!";
|
||||||
|
|
||||||
m_layout->addWidget(widget);
|
m_stripsLayout->addWidget(widget);
|
||||||
|
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *StripsWidget::appendBookingEndStrip(int id, const QTime &time)
|
QWidget *StripsWidget::appendBookingEndStrip(int id, const QTime &time)
|
||||||
{
|
{
|
||||||
auto widget = m_stripFactory.createBookingEndStrip(this).release();
|
auto widget = m_mainWindow.stripFactory().createBookingEndStrip(this).release();
|
||||||
|
|
||||||
if(auto labelTime = widget->findChild<QWidget*>(QStringLiteral("labelTime")))
|
if(auto labelTime = widget->findChild<QWidget*>(QStringLiteral("labelTime")))
|
||||||
labelTime->setProperty("text", time.toString(tr("HH:mm")));
|
labelTime->setProperty("text", time.toString(tr("HH:mm")));
|
||||||
@@ -551,14 +590,14 @@ QWidget *StripsWidget::appendBookingEndStrip(int id, const QTime &time)
|
|||||||
else
|
else
|
||||||
qWarning() << "no labelId found!";
|
qWarning() << "no labelId found!";
|
||||||
|
|
||||||
m_layout->addWidget(widget);
|
m_stripsLayout->addWidget(widget);
|
||||||
|
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *StripsWidget::appendTimeAssignmentStrip(int id, const QTime &duration, const QString &project, const QString &subproject, const QString &workpackage, const QString &text)
|
QWidget *StripsWidget::appendTimeAssignmentStrip(int id, const QTime &duration, const QString &project, const QString &subproject, const QString &workpackage, const QString &text)
|
||||||
{
|
{
|
||||||
auto widget = m_stripFactory.createTimeAssignmentStrip(this).release();
|
auto widget = m_mainWindow.stripFactory().createTimeAssignmentStrip(this).release();
|
||||||
|
|
||||||
if(auto labelTime = widget->findChild<QWidget*>(QStringLiteral("labelTime")))
|
if(auto labelTime = widget->findChild<QWidget*>(QStringLiteral("labelTime")))
|
||||||
labelTime->setProperty("text", duration == QTime(0, 0) ? tr("Open") : duration.toString(tr("HH:mm")));
|
labelTime->setProperty("text", duration == QTime(0, 0) ? tr("Open") : duration.toString(tr("HH:mm")));
|
||||||
@@ -590,7 +629,7 @@ QWidget *StripsWidget::appendTimeAssignmentStrip(int id, const QTime &duration,
|
|||||||
else
|
else
|
||||||
qWarning() << "no labelText found!";
|
qWarning() << "no labelText found!";
|
||||||
|
|
||||||
m_layout->addWidget(widget);
|
m_stripsLayout->addWidget(widget);
|
||||||
|
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
@@ -11,19 +11,24 @@
|
|||||||
#include "replies/gettimeassignmentsreply.h"
|
#include "replies/gettimeassignmentsreply.h"
|
||||||
|
|
||||||
class QBoxLayout;
|
class QBoxLayout;
|
||||||
template <class Key, class T> class QMap;
|
class QLabel;
|
||||||
template <typename T> class QVector;
|
template <typename T> class QVector;
|
||||||
|
|
||||||
class ZeiterfassungApi;
|
class MainWindow;
|
||||||
class StripFactory;
|
|
||||||
|
|
||||||
class ZEITERFASSUNGLIBSHARED_EXPORT StripsWidget : public QWidget
|
class ZEITERFASSUNGLIBSHARED_EXPORT StripsWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit StripsWidget(ZeiterfassungApi &erfassung, int userId, StripFactory &stripFactory,
|
explicit StripsWidget(MainWindow &mainWindow, QWidget *parent = Q_NULLPTR);
|
||||||
const QMap<QString, QString> &projects, QWidget *parent = Q_NULLPTR);
|
|
||||||
|
MainWindow &mainWindow() const;
|
||||||
|
|
||||||
|
QBoxLayout *headerLayout() const;
|
||||||
|
QBoxLayout *stripsLayout() const;
|
||||||
|
|
||||||
|
QLabel *label() const;
|
||||||
|
|
||||||
const QDate &date() const;
|
const QDate &date() const;
|
||||||
void setDate(const QDate &date);
|
void setDate(const QDate &date);
|
||||||
@@ -41,12 +46,14 @@ public:
|
|||||||
bool endEnabled() const;
|
bool endEnabled() const;
|
||||||
|
|
||||||
void refresh();
|
void refresh();
|
||||||
void refreshBookings();
|
void refreshBookings(bool createLabel = true);
|
||||||
void refreshTimeAssignments();
|
void refreshTimeAssignments(bool createLabel = true);
|
||||||
bool createStrips();
|
bool createStrips();
|
||||||
void clearStrips();
|
void clearStrips();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
void dateChanged(const QDate &date);
|
||||||
|
|
||||||
void bookingsChanged(const QVector<GetBookingsReply::Booking> &bookings);
|
void bookingsChanged(const QVector<GetBookingsReply::Booking> &bookings);
|
||||||
void timeAssignmentsChanged(const QVector<GetTimeAssignmentsReply::TimeAssignment> &timeAssignments);
|
void timeAssignmentsChanged(const QVector<GetTimeAssignmentsReply::TimeAssignment> &timeAssignments);
|
||||||
|
|
||||||
@@ -64,21 +71,20 @@ private Q_SLOTS:
|
|||||||
void getTimeAssignmentsFinished();
|
void getTimeAssignmentsFinished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void invalidateValues();
|
void invalidateValues();
|
||||||
|
QString buildProjectString(const QString &project) const;
|
||||||
QString buildProjectString(const QString &project);
|
|
||||||
|
|
||||||
QWidget *appendBookingStartStrip(int id, const QTime &time);
|
QWidget *appendBookingStartStrip(int id, const QTime &time);
|
||||||
QWidget *appendBookingEndStrip(int id, const QTime &time);
|
QWidget *appendBookingEndStrip(int id, const QTime &time);
|
||||||
QWidget *appendTimeAssignmentStrip(int id, const QTime &duration, const QString &project, const QString &subproject,
|
QWidget *appendTimeAssignmentStrip(int id, const QTime &duration, const QString &project, const QString &subproject,
|
||||||
const QString &workpackage, const QString &text);
|
const QString &workpackage, const QString &text);
|
||||||
|
|
||||||
ZeiterfassungApi &m_erfassung;
|
MainWindow &m_mainWindow;
|
||||||
int m_userId;
|
|
||||||
StripFactory &m_stripFactory;
|
|
||||||
const QMap<QString, QString> &m_projects;
|
|
||||||
|
|
||||||
QBoxLayout *m_layout;
|
QBoxLayout *m_headerLayout;
|
||||||
|
QBoxLayout *m_stripsLayout;
|
||||||
|
|
||||||
|
QLabel *m_label;
|
||||||
|
|
||||||
QDate m_date;
|
QDate m_date;
|
||||||
|
|
||||||
|
@@ -376,8 +376,8 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="143"/>
|
<location filename="../mainwindow.ui" line="143"/>
|
||||||
<location filename="../mainwindow.cpp" line="730"/>
|
<location filename="../mainwindow.cpp" line="740"/>
|
||||||
<location filename="../mainwindow.cpp" line="741"/>
|
<location filename="../mainwindow.cpp" line="751"/>
|
||||||
<source>Start</source>
|
<source>Start</source>
|
||||||
<translation>Kommen</translation>
|
<translation>Kommen</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -477,13 +477,13 @@
|
|||||||
<translation>Zeiterfassung - %0 (%1)</translation>
|
<translation>Zeiterfassung - %0 (%1)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="679"/>
|
<location filename="../mainwindow.cpp" line="689"/>
|
||||||
<location filename="../mainwindow.cpp" line="688"/>
|
<location filename="../mainwindow.cpp" line="698"/>
|
||||||
<source>Could not open auswertung!</source>
|
<source>Could not open auswertung!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="688"/>
|
<location filename="../mainwindow.cpp" line="698"/>
|
||||||
<source>Could not open default PDF viewer!</source>
|
<source>Could not open default PDF viewer!</source>
|
||||||
<translation>Konnte den PDF-Anzeiger nicht öffnen!</translation>
|
<translation>Konnte den PDF-Anzeiger nicht öffnen!</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -503,147 +503,147 @@
|
|||||||
<translation>Text</translation>
|
<translation>Text</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="241"/>
|
<location filename="../mainwindow.cpp" line="251"/>
|
||||||
<location filename="../mainwindow.cpp" line="242"/>
|
<location filename="../mainwindow.cpp" line="252"/>
|
||||||
<location filename="../mainwindow.cpp" line="747"/>
|
<location filename="../mainwindow.cpp" line="757"/>
|
||||||
<location filename="../mainwindow.cpp" line="748"/>
|
<location filename="../mainwindow.cpp" line="758"/>
|
||||||
<source>%0: %1</source>
|
<source>%0: %1</source>
|
||||||
<translation>%0: %1</translation>
|
<translation>%0: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="747"/>
|
<location filename="../mainwindow.cpp" line="757"/>
|
||||||
<location filename="../mainwindow.cpp" line="748"/>
|
<location filename="../mainwindow.cpp" line="758"/>
|
||||||
<source>???</source>
|
<source>???</source>
|
||||||
<translation>???</translation>
|
<translation>???</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="241"/>
|
<location filename="../mainwindow.cpp" line="251"/>
|
||||||
<location filename="../mainwindow.cpp" line="747"/>
|
<location filename="../mainwindow.cpp" line="757"/>
|
||||||
<source>Balance</source>
|
<source>Balance</source>
|
||||||
<translation>Saldo</translation>
|
<translation>Saldo</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="242"/>
|
<location filename="../mainwindow.cpp" line="252"/>
|
||||||
<location filename="../mainwindow.cpp" line="748"/>
|
<location filename="../mainwindow.cpp" line="758"/>
|
||||||
<source>Holidays</source>
|
<source>Holidays</source>
|
||||||
<translation>Urlaubstage</translation>
|
<translation>Urlaubstage</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="181"/>
|
<location filename="../mainwindow.cpp" line="191"/>
|
||||||
<location filename="../mainwindow.cpp" line="182"/>
|
<location filename="../mainwindow.cpp" line="192"/>
|
||||||
<source>Could not load bookings!</source>
|
<source>Could not load bookings!</source>
|
||||||
<translation>Konnte Buchungen nicht laden!</translation>
|
<translation>Konnte Buchungen nicht laden!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="203"/>
|
<location filename="../mainwindow.cpp" line="213"/>
|
||||||
<source>Could not load Auswertung!</source>
|
<source>Could not load Auswertung!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="235"/>
|
<location filename="../mainwindow.cpp" line="245"/>
|
||||||
<source>%0h</source>
|
<source>%0h</source>
|
||||||
<translation>%0h</translation>
|
<translation>%0h</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="348"/>
|
<location filename="../mainwindow.cpp" line="358"/>
|
||||||
<source>Could not delete booking!</source>
|
<source>Could not delete booking!</source>
|
||||||
<translation>Konnte Buchung nicht löschen!</translation>
|
<translation>Konnte Buchung nicht löschen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="295"/>
|
<location filename="../mainwindow.cpp" line="305"/>
|
||||||
<source>Edit booking</source>
|
<source>Edit booking</source>
|
||||||
<translation>Buchung bearbeiten</translation>
|
<translation>Buchung bearbeiten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="296"/>
|
<location filename="../mainwindow.cpp" line="306"/>
|
||||||
<source>Delete booking</source>
|
<source>Delete booking</source>
|
||||||
<translation>Buchung löschen</translation>
|
<translation>Buchung löschen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="324"/>
|
<location filename="../mainwindow.cpp" line="334"/>
|
||||||
<source>Could not edit booking!</source>
|
<source>Could not edit booking!</source>
|
||||||
<translation>Konnte Buchung nicht bearbeiten!</translation>
|
<translation>Konnte Buchung nicht bearbeiten!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="254"/>
|
<location filename="../mainwindow.cpp" line="264"/>
|
||||||
<source>Create booking</source>
|
<source>Create booking</source>
|
||||||
<translation>Buchung erstellen</translation>
|
<translation>Buchung erstellen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="211"/>
|
<location filename="../mainwindow.cpp" line="221"/>
|
||||||
<location filename="../mainwindow.cpp" line="222"/>
|
<location filename="../mainwindow.cpp" line="232"/>
|
||||||
<source>n/a</source>
|
<source>n/a</source>
|
||||||
<translation>n/v</translation>
|
<translation>n/v</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="255"/>
|
<location filename="../mainwindow.cpp" line="265"/>
|
||||||
<source>Refresh bookings</source>
|
<source>Refresh bookings</source>
|
||||||
<translation>Buchungen aktualisieren</translation>
|
<translation>Buchungen aktualisieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="280"/>
|
<location filename="../mainwindow.cpp" line="290"/>
|
||||||
<location filename="../mainwindow.cpp" line="485"/>
|
<location filename="../mainwindow.cpp" line="495"/>
|
||||||
<location filename="../mainwindow.cpp" line="607"/>
|
<location filename="../mainwindow.cpp" line="617"/>
|
||||||
<source>Could not create booking!</source>
|
<source>Could not create booking!</source>
|
||||||
<translation>Konnte Buchung nicht erstellen!</translation>
|
<translation>Konnte Buchung nicht erstellen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="332"/>
|
<location filename="../mainwindow.cpp" line="342"/>
|
||||||
<source>Do you really want to delete the booking?</source>
|
<source>Do you really want to delete the booking?</source>
|
||||||
<translation>Möchten Sie die Buchung wirklich löschen?</translation>
|
<translation>Möchten Sie die Buchung wirklich löschen?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="362"/>
|
<location filename="../mainwindow.cpp" line="372"/>
|
||||||
<source>Refresh time assignments</source>
|
<source>Refresh time assignments</source>
|
||||||
<translation>Kontierungen aktualisieren</translation>
|
<translation>Kontierungen aktualisieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="402"/>
|
<location filename="../mainwindow.cpp" line="412"/>
|
||||||
<source>Edit time assignment</source>
|
<source>Edit time assignment</source>
|
||||||
<translation>Kontierung bearbeiten</translation>
|
<translation>Kontierung bearbeiten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="403"/>
|
<location filename="../mainwindow.cpp" line="413"/>
|
||||||
<source>Delete time assignment</source>
|
<source>Delete time assignment</source>
|
||||||
<translation>Kontierung löschen</translation>
|
<translation>Kontierung löschen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="434"/>
|
<location filename="../mainwindow.cpp" line="444"/>
|
||||||
<location filename="../mainwindow.cpp" line="517"/>
|
<location filename="../mainwindow.cpp" line="527"/>
|
||||||
<location filename="../mainwindow.cpp" line="588"/>
|
<location filename="../mainwindow.cpp" line="598"/>
|
||||||
<source>Could not edit time assignment!</source>
|
<source>Could not edit time assignment!</source>
|
||||||
<translation>Konnte Kontierung nicht bearbeiten!</translation>
|
<translation>Konnte Kontierung nicht bearbeiten!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="442"/>
|
<location filename="../mainwindow.cpp" line="452"/>
|
||||||
<source>Do you really want to delete the time assignment?</source>
|
<source>Do you really want to delete the time assignment?</source>
|
||||||
<translation>Möchten Sie die Kontierung wirklich löschen?</translation>
|
<translation>Möchten Sie die Kontierung wirklich löschen?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="460"/>
|
<location filename="../mainwindow.cpp" line="470"/>
|
||||||
<source>Could not delete time assignment!</source>
|
<source>Could not delete time assignment!</source>
|
||||||
<translation>Konnte Kontierung nicht löschen!</translation>
|
<translation>Konnte Kontierung nicht löschen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="773"/>
|
<location filename="../mainwindow.cpp" line="783"/>
|
||||||
<location filename="../mainwindow.cpp" line="782"/>
|
<location filename="../mainwindow.cpp" line="792"/>
|
||||||
<source>%0 (%1)</source>
|
<source>%0 (%1)</source>
|
||||||
<translation>%0 (%1)</translation>
|
<translation>%0 (%1)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="361"/>
|
<location filename="../mainwindow.cpp" line="371"/>
|
||||||
<source>Create time assignment</source>
|
<source>Create time assignment</source>
|
||||||
<translation>Kontierung erstellen</translation>
|
<translation>Kontierung erstellen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="387"/>
|
<location filename="../mainwindow.cpp" line="397"/>
|
||||||
<location filename="../mainwindow.cpp" line="538"/>
|
<location filename="../mainwindow.cpp" line="548"/>
|
||||||
<source>Could not create time assignment!</source>
|
<source>Could not create time assignment!</source>
|
||||||
<translation>Konnte Kontierung nicht erstellen!</translation>
|
<translation>Konnte Kontierung nicht erstellen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="730"/>
|
<location filename="../mainwindow.cpp" line="740"/>
|
||||||
<location filename="../mainwindow.cpp" line="741"/>
|
<location filename="../mainwindow.cpp" line="751"/>
|
||||||
<source>Switch</source>
|
<source>Switch</source>
|
||||||
<translation>Wechseln</translation>
|
<translation>Wechseln</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -728,178 +728,178 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>StripsWidget</name>
|
<name>StripsWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="98"/>
|
<location filename="../stripswidget.cpp" line="141"/>
|
||||||
<source>Loading...</source>
|
<source>Loading...</source>
|
||||||
<translation>Lade...</translation>
|
<translation>Lade...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="185"/>
|
<location filename="../stripswidget.cpp" line="227"/>
|
||||||
<source>Missing booking!</source>
|
<source>Missing booking!</source>
|
||||||
<translation>Kontierung fehlend!</translation>
|
<translation>Kontierung fehlend!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="192"/>
|
<location filename="../stripswidget.cpp" line="234"/>
|
||||||
<source>Expected start booking, instead got type %0
|
<source>Expected start booking, instead got type %0
|
||||||
Booking ID: %1</source>
|
Booking ID: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="201"/>
|
<location filename="../stripswidget.cpp" line="243"/>
|
||||||
<location filename="../stripswidget.cpp" line="392"/>
|
<location filename="../stripswidget.cpp" line="434"/>
|
||||||
<source>%0: %1</source>
|
<source>%0: %1</source>
|
||||||
<translation>%0: %1</translation>
|
<translation>%0: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="201"/>
|
<location filename="../stripswidget.cpp" line="243"/>
|
||||||
<source>Break</source>
|
<source>Break</source>
|
||||||
<translation>Pause</translation>
|
<translation>Pause</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="201"/>
|
<location filename="../stripswidget.cpp" line="243"/>
|
||||||
<location filename="../stripswidget.cpp" line="323"/>
|
<location filename="../stripswidget.cpp" line="365"/>
|
||||||
<location filename="../stripswidget.cpp" line="394"/>
|
<location filename="../stripswidget.cpp" line="436"/>
|
||||||
<source>%0h</source>
|
<source>%0h</source>
|
||||||
<translation>%0h</translation>
|
<translation>%0h</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="201"/>
|
<location filename="../stripswidget.cpp" line="243"/>
|
||||||
<location filename="../stripswidget.cpp" line="394"/>
|
<location filename="../stripswidget.cpp" line="436"/>
|
||||||
<location filename="../stripswidget.cpp" line="526"/>
|
<location filename="../stripswidget.cpp" line="551"/>
|
||||||
<location filename="../stripswidget.cpp" line="545"/>
|
<location filename="../stripswidget.cpp" line="570"/>
|
||||||
<location filename="../stripswidget.cpp" line="564"/>
|
<location filename="../stripswidget.cpp" line="589"/>
|
||||||
<source>HH:mm</source>
|
<source>HH:mm</source>
|
||||||
<translation>HH:mm</translation>
|
<translation>HH:mm</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="212"/>
|
<location filename="../stripswidget.cpp" line="254"/>
|
||||||
<source>Missing time assignment!</source>
|
<source>Missing time assignment!</source>
|
||||||
<translation>Kontierung fehlend!</translation>
|
<translation>Kontierung fehlend!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="219"/>
|
<location filename="../stripswidget.cpp" line="261"/>
|
||||||
<location filename="../stripswidget.cpp" line="270"/>
|
<location filename="../stripswidget.cpp" line="312"/>
|
||||||
<location filename="../stripswidget.cpp" line="333"/>
|
<location filename="../stripswidget.cpp" line="375"/>
|
||||||
<source>Expected %0 but received %1 in time assignment.
|
<source>Expected %0 but received %1 in time assignment.
|
||||||
Time assignment ID: %2</source>
|
Time assignment ID: %2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="220"/>
|
<location filename="../stripswidget.cpp" line="262"/>
|
||||||
<location filename="../stripswidget.cpp" line="221"/>
|
<location filename="../stripswidget.cpp" line="263"/>
|
||||||
<location filename="../stripswidget.cpp" line="271"/>
|
<location filename="../stripswidget.cpp" line="313"/>
|
||||||
<location filename="../stripswidget.cpp" line="272"/>
|
<location filename="../stripswidget.cpp" line="314"/>
|
||||||
<location filename="../stripswidget.cpp" line="323"/>
|
<location filename="../stripswidget.cpp" line="365"/>
|
||||||
<location filename="../stripswidget.cpp" line="334"/>
|
|
||||||
<location filename="../stripswidget.cpp" line="335"/>
|
|
||||||
<location filename="../stripswidget.cpp" line="375"/>
|
|
||||||
<location filename="../stripswidget.cpp" line="376"/>
|
<location filename="../stripswidget.cpp" line="376"/>
|
||||||
|
<location filename="../stripswidget.cpp" line="377"/>
|
||||||
|
<location filename="../stripswidget.cpp" line="417"/>
|
||||||
|
<location filename="../stripswidget.cpp" line="418"/>
|
||||||
<source>HH:mm:ss</source>
|
<source>HH:mm:ss</source>
|
||||||
<translation>HH:mm:ss</translation>
|
<translation>HH:mm:ss</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="233"/>
|
<location filename="../stripswidget.cpp" line="275"/>
|
||||||
<location filename="../stripswidget.cpp" line="347"/>
|
<location filename="../stripswidget.cpp" line="389"/>
|
||||||
<source>There is another booking after an unfinished time assignment.
|
<source>There is another booking after an unfinished time assignment.
|
||||||
Booking ID: %0
|
Booking ID: %0
|
||||||
Time assignment ID: %1</source>
|
Time assignment ID: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="241"/>
|
<location filename="../stripswidget.cpp" line="283"/>
|
||||||
<location filename="../stripswidget.cpp" line="284"/>
|
<location filename="../stripswidget.cpp" line="326"/>
|
||||||
<location filename="../stripswidget.cpp" line="356"/>
|
<location filename="../stripswidget.cpp" line="398"/>
|
||||||
<source>There is another time assignment after an unfinished time assignment.
|
<source>There is another time assignment after an unfinished time assignment.
|
||||||
Time assignment ID: %0
|
Time assignment ID: %0
|
||||||
Time assignment ID: %1</source>
|
Time assignment ID: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="262"/>
|
<location filename="../stripswidget.cpp" line="304"/>
|
||||||
<source>The last time assignment is finished without end booking
|
<source>The last time assignment is finished without end booking
|
||||||
Time assignment ID: %0</source>
|
Time assignment ID: %0</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="307"/>
|
<location filename="../stripswidget.cpp" line="349"/>
|
||||||
<source>Expected end booking, instead got type %0
|
<source>Expected end booking, instead got type %0
|
||||||
Booking ID: %1</source>
|
Booking ID: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="322"/>
|
<location filename="../stripswidget.cpp" line="364"/>
|
||||||
<source>Missing time assignment! Missing: %0</source>
|
<source>Missing time assignment! Missing: %0</source>
|
||||||
<translation>Kontierung fehlend! %0 nicht kontiert</translation>
|
<translation>Kontierung fehlend! %0 nicht kontiert</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="393"/>
|
<location filename="../stripswidget.cpp" line="435"/>
|
||||||
<source>Assigned time</source>
|
<source>Assigned time</source>
|
||||||
<translation>Kontierte Zeit</translation>
|
<translation>Kontierte Zeit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="445"/>
|
<location filename="../stripswidget.cpp" line="79"/>
|
||||||
<source>dd.MM.yyyy</source>
|
<source>dd.MM.yyyy</source>
|
||||||
<translation>dd.MM.yyyy</translation>
|
<translation>dd.MM.yyyy</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="442"/>
|
<location filename="../stripswidget.cpp" line="76"/>
|
||||||
<source>%0 (%1)</source>
|
<source>%0 (%1)</source>
|
||||||
<translation>%0 (%1)</translation>
|
<translation>%0 (%1)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="374"/>
|
<location filename="../stripswidget.cpp" line="416"/>
|
||||||
<source>Time assignment time longer than booking time!
|
<source>Time assignment time longer than booking time!
|
||||||
Time assignment: %0
|
Time assignment: %0
|
||||||
Booking: %1</source>
|
Booking: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="405"/>
|
<location filename="../stripswidget.cpp" line="447"/>
|
||||||
<source>Strip rendering aborted due error.
|
<source>Strip rendering aborted due error.
|
||||||
Your bookings and time assignments for this day are in an illegal state!</source>
|
Your bookings and time assignments for this day are in an illegal state!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="443"/>
|
<location filename="../stripswidget.cpp" line="77"/>
|
||||||
<source>Monday</source>
|
<source>Monday</source>
|
||||||
<translation>Montag</translation>
|
<translation>Montag</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="443"/>
|
<location filename="../stripswidget.cpp" line="77"/>
|
||||||
<source>Tuesday</source>
|
<source>Tuesday</source>
|
||||||
<translation>Dienstag</translation>
|
<translation>Dienstag</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="443"/>
|
<location filename="../stripswidget.cpp" line="77"/>
|
||||||
<source>Wednesday</source>
|
<source>Wednesday</source>
|
||||||
<translation>Mittwoch</translation>
|
<translation>Mittwoch</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="443"/>
|
<location filename="../stripswidget.cpp" line="77"/>
|
||||||
<source>Thursday</source>
|
<source>Thursday</source>
|
||||||
<translation>Donnerstag</translation>
|
<translation>Donnerstag</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="444"/>
|
<location filename="../stripswidget.cpp" line="78"/>
|
||||||
<source>Friday</source>
|
<source>Friday</source>
|
||||||
<translation>Freitag</translation>
|
<translation>Freitag</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="444"/>
|
<location filename="../stripswidget.cpp" line="78"/>
|
||||||
<source>Saturday</source>
|
<source>Saturday</source>
|
||||||
<translation>Samstag</translation>
|
<translation>Samstag</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="444"/>
|
<location filename="../stripswidget.cpp" line="78"/>
|
||||||
<source>Sunday</source>
|
<source>Sunday</source>
|
||||||
<translation>Sonntag</translation>
|
<translation>Sonntag</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="447"/>
|
<location filename="../stripswidget.cpp" line="81"/>
|
||||||
<source>Invalid</source>
|
<source>Invalid</source>
|
||||||
<translation>Ungültig</translation>
|
<translation>Ungültig</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="564"/>
|
<location filename="../stripswidget.cpp" line="589"/>
|
||||||
<source>Open</source>
|
<source>Open</source>
|
||||||
<translation>Offen</translation>
|
<translation>Offen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -376,8 +376,8 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="143"/>
|
<location filename="../mainwindow.ui" line="143"/>
|
||||||
<location filename="../mainwindow.cpp" line="730"/>
|
<location filename="../mainwindow.cpp" line="740"/>
|
||||||
<location filename="../mainwindow.cpp" line="741"/>
|
<location filename="../mainwindow.cpp" line="751"/>
|
||||||
<source>Start</source>
|
<source>Start</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -492,158 +492,158 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="747"/>
|
<location filename="../mainwindow.cpp" line="757"/>
|
||||||
<location filename="../mainwindow.cpp" line="748"/>
|
<location filename="../mainwindow.cpp" line="758"/>
|
||||||
<source>???</source>
|
<source>???</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="181"/>
|
<location filename="../mainwindow.cpp" line="191"/>
|
||||||
<location filename="../mainwindow.cpp" line="182"/>
|
<location filename="../mainwindow.cpp" line="192"/>
|
||||||
<source>Could not load bookings!</source>
|
<source>Could not load bookings!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="203"/>
|
<location filename="../mainwindow.cpp" line="213"/>
|
||||||
<source>Could not load Auswertung!</source>
|
<source>Could not load Auswertung!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="211"/>
|
<location filename="../mainwindow.cpp" line="221"/>
|
||||||
<location filename="../mainwindow.cpp" line="222"/>
|
<location filename="../mainwindow.cpp" line="232"/>
|
||||||
<source>n/a</source>
|
<source>n/a</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="235"/>
|
<location filename="../mainwindow.cpp" line="245"/>
|
||||||
<source>%0h</source>
|
<source>%0h</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="241"/>
|
<location filename="../mainwindow.cpp" line="251"/>
|
||||||
<location filename="../mainwindow.cpp" line="242"/>
|
<location filename="../mainwindow.cpp" line="252"/>
|
||||||
<location filename="../mainwindow.cpp" line="747"/>
|
<location filename="../mainwindow.cpp" line="757"/>
|
||||||
<location filename="../mainwindow.cpp" line="748"/>
|
<location filename="../mainwindow.cpp" line="758"/>
|
||||||
<source>%0: %1</source>
|
<source>%0: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="241"/>
|
<location filename="../mainwindow.cpp" line="251"/>
|
||||||
<location filename="../mainwindow.cpp" line="747"/>
|
<location filename="../mainwindow.cpp" line="757"/>
|
||||||
<source>Balance</source>
|
<source>Balance</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="242"/>
|
<location filename="../mainwindow.cpp" line="252"/>
|
||||||
<location filename="../mainwindow.cpp" line="748"/>
|
<location filename="../mainwindow.cpp" line="758"/>
|
||||||
<source>Holidays</source>
|
<source>Holidays</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="254"/>
|
<location filename="../mainwindow.cpp" line="264"/>
|
||||||
<source>Create booking</source>
|
<source>Create booking</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="255"/>
|
<location filename="../mainwindow.cpp" line="265"/>
|
||||||
<source>Refresh bookings</source>
|
<source>Refresh bookings</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="280"/>
|
<location filename="../mainwindow.cpp" line="290"/>
|
||||||
<location filename="../mainwindow.cpp" line="485"/>
|
<location filename="../mainwindow.cpp" line="495"/>
|
||||||
<location filename="../mainwindow.cpp" line="607"/>
|
<location filename="../mainwindow.cpp" line="617"/>
|
||||||
<source>Could not create booking!</source>
|
<source>Could not create booking!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="295"/>
|
<location filename="../mainwindow.cpp" line="305"/>
|
||||||
<source>Edit booking</source>
|
<source>Edit booking</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="296"/>
|
<location filename="../mainwindow.cpp" line="306"/>
|
||||||
<source>Delete booking</source>
|
<source>Delete booking</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="324"/>
|
<location filename="../mainwindow.cpp" line="334"/>
|
||||||
<source>Could not edit booking!</source>
|
<source>Could not edit booking!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="332"/>
|
<location filename="../mainwindow.cpp" line="342"/>
|
||||||
<source>Do you really want to delete the booking?</source>
|
<source>Do you really want to delete the booking?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="348"/>
|
<location filename="../mainwindow.cpp" line="358"/>
|
||||||
<source>Could not delete booking!</source>
|
<source>Could not delete booking!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="361"/>
|
<location filename="../mainwindow.cpp" line="371"/>
|
||||||
<source>Create time assignment</source>
|
<source>Create time assignment</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="362"/>
|
<location filename="../mainwindow.cpp" line="372"/>
|
||||||
<source>Refresh time assignments</source>
|
<source>Refresh time assignments</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="387"/>
|
<location filename="../mainwindow.cpp" line="397"/>
|
||||||
<location filename="../mainwindow.cpp" line="538"/>
|
<location filename="../mainwindow.cpp" line="548"/>
|
||||||
<source>Could not create time assignment!</source>
|
<source>Could not create time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="402"/>
|
<location filename="../mainwindow.cpp" line="412"/>
|
||||||
<source>Edit time assignment</source>
|
<source>Edit time assignment</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="403"/>
|
<location filename="../mainwindow.cpp" line="413"/>
|
||||||
<source>Delete time assignment</source>
|
<source>Delete time assignment</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="434"/>
|
<location filename="../mainwindow.cpp" line="444"/>
|
||||||
<location filename="../mainwindow.cpp" line="517"/>
|
<location filename="../mainwindow.cpp" line="527"/>
|
||||||
<location filename="../mainwindow.cpp" line="588"/>
|
<location filename="../mainwindow.cpp" line="598"/>
|
||||||
<source>Could not edit time assignment!</source>
|
<source>Could not edit time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="442"/>
|
<location filename="../mainwindow.cpp" line="452"/>
|
||||||
<source>Do you really want to delete the time assignment?</source>
|
<source>Do you really want to delete the time assignment?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="460"/>
|
<location filename="../mainwindow.cpp" line="470"/>
|
||||||
<source>Could not delete time assignment!</source>
|
<source>Could not delete time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="679"/>
|
<location filename="../mainwindow.cpp" line="689"/>
|
||||||
<location filename="../mainwindow.cpp" line="688"/>
|
<location filename="../mainwindow.cpp" line="698"/>
|
||||||
<source>Could not open auswertung!</source>
|
<source>Could not open auswertung!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="688"/>
|
<location filename="../mainwindow.cpp" line="698"/>
|
||||||
<source>Could not open default PDF viewer!</source>
|
<source>Could not open default PDF viewer!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="730"/>
|
<location filename="../mainwindow.cpp" line="740"/>
|
||||||
<location filename="../mainwindow.cpp" line="741"/>
|
<location filename="../mainwindow.cpp" line="751"/>
|
||||||
<source>Switch</source>
|
<source>Switch</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="773"/>
|
<location filename="../mainwindow.cpp" line="783"/>
|
||||||
<location filename="../mainwindow.cpp" line="782"/>
|
<location filename="../mainwindow.cpp" line="792"/>
|
||||||
<source>%0 (%1)</source>
|
<source>%0 (%1)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -728,178 +728,178 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>StripsWidget</name>
|
<name>StripsWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="98"/>
|
<location filename="../stripswidget.cpp" line="141"/>
|
||||||
<source>Loading...</source>
|
<source>Loading...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="185"/>
|
<location filename="../stripswidget.cpp" line="227"/>
|
||||||
<source>Missing booking!</source>
|
<source>Missing booking!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="192"/>
|
<location filename="../stripswidget.cpp" line="234"/>
|
||||||
<source>Expected start booking, instead got type %0
|
<source>Expected start booking, instead got type %0
|
||||||
Booking ID: %1</source>
|
Booking ID: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="201"/>
|
<location filename="../stripswidget.cpp" line="243"/>
|
||||||
<location filename="../stripswidget.cpp" line="392"/>
|
<location filename="../stripswidget.cpp" line="434"/>
|
||||||
<source>%0: %1</source>
|
<source>%0: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="201"/>
|
<location filename="../stripswidget.cpp" line="243"/>
|
||||||
<source>Break</source>
|
<source>Break</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="201"/>
|
<location filename="../stripswidget.cpp" line="243"/>
|
||||||
<location filename="../stripswidget.cpp" line="323"/>
|
<location filename="../stripswidget.cpp" line="365"/>
|
||||||
<location filename="../stripswidget.cpp" line="394"/>
|
<location filename="../stripswidget.cpp" line="436"/>
|
||||||
<source>%0h</source>
|
<source>%0h</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="201"/>
|
<location filename="../stripswidget.cpp" line="243"/>
|
||||||
<location filename="../stripswidget.cpp" line="394"/>
|
<location filename="../stripswidget.cpp" line="436"/>
|
||||||
<location filename="../stripswidget.cpp" line="526"/>
|
<location filename="../stripswidget.cpp" line="551"/>
|
||||||
<location filename="../stripswidget.cpp" line="545"/>
|
<location filename="../stripswidget.cpp" line="570"/>
|
||||||
<location filename="../stripswidget.cpp" line="564"/>
|
<location filename="../stripswidget.cpp" line="589"/>
|
||||||
<source>HH:mm</source>
|
<source>HH:mm</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="212"/>
|
<location filename="../stripswidget.cpp" line="254"/>
|
||||||
<source>Missing time assignment!</source>
|
<source>Missing time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="219"/>
|
<location filename="../stripswidget.cpp" line="261"/>
|
||||||
<location filename="../stripswidget.cpp" line="270"/>
|
<location filename="../stripswidget.cpp" line="312"/>
|
||||||
<location filename="../stripswidget.cpp" line="333"/>
|
<location filename="../stripswidget.cpp" line="375"/>
|
||||||
<source>Expected %0 but received %1 in time assignment.
|
<source>Expected %0 but received %1 in time assignment.
|
||||||
Time assignment ID: %2</source>
|
Time assignment ID: %2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="220"/>
|
<location filename="../stripswidget.cpp" line="262"/>
|
||||||
<location filename="../stripswidget.cpp" line="221"/>
|
<location filename="../stripswidget.cpp" line="263"/>
|
||||||
<location filename="../stripswidget.cpp" line="271"/>
|
<location filename="../stripswidget.cpp" line="313"/>
|
||||||
<location filename="../stripswidget.cpp" line="272"/>
|
<location filename="../stripswidget.cpp" line="314"/>
|
||||||
<location filename="../stripswidget.cpp" line="323"/>
|
<location filename="../stripswidget.cpp" line="365"/>
|
||||||
<location filename="../stripswidget.cpp" line="334"/>
|
|
||||||
<location filename="../stripswidget.cpp" line="335"/>
|
|
||||||
<location filename="../stripswidget.cpp" line="375"/>
|
|
||||||
<location filename="../stripswidget.cpp" line="376"/>
|
<location filename="../stripswidget.cpp" line="376"/>
|
||||||
|
<location filename="../stripswidget.cpp" line="377"/>
|
||||||
|
<location filename="../stripswidget.cpp" line="417"/>
|
||||||
|
<location filename="../stripswidget.cpp" line="418"/>
|
||||||
<source>HH:mm:ss</source>
|
<source>HH:mm:ss</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="233"/>
|
<location filename="../stripswidget.cpp" line="275"/>
|
||||||
<location filename="../stripswidget.cpp" line="347"/>
|
<location filename="../stripswidget.cpp" line="389"/>
|
||||||
<source>There is another booking after an unfinished time assignment.
|
<source>There is another booking after an unfinished time assignment.
|
||||||
Booking ID: %0
|
Booking ID: %0
|
||||||
Time assignment ID: %1</source>
|
Time assignment ID: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="241"/>
|
<location filename="../stripswidget.cpp" line="283"/>
|
||||||
<location filename="../stripswidget.cpp" line="284"/>
|
<location filename="../stripswidget.cpp" line="326"/>
|
||||||
<location filename="../stripswidget.cpp" line="356"/>
|
<location filename="../stripswidget.cpp" line="398"/>
|
||||||
<source>There is another time assignment after an unfinished time assignment.
|
<source>There is another time assignment after an unfinished time assignment.
|
||||||
Time assignment ID: %0
|
Time assignment ID: %0
|
||||||
Time assignment ID: %1</source>
|
Time assignment ID: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="262"/>
|
<location filename="../stripswidget.cpp" line="304"/>
|
||||||
<source>The last time assignment is finished without end booking
|
<source>The last time assignment is finished without end booking
|
||||||
Time assignment ID: %0</source>
|
Time assignment ID: %0</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="307"/>
|
<location filename="../stripswidget.cpp" line="349"/>
|
||||||
<source>Expected end booking, instead got type %0
|
<source>Expected end booking, instead got type %0
|
||||||
Booking ID: %1</source>
|
Booking ID: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="322"/>
|
<location filename="../stripswidget.cpp" line="364"/>
|
||||||
<source>Missing time assignment! Missing: %0</source>
|
<source>Missing time assignment! Missing: %0</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="374"/>
|
<location filename="../stripswidget.cpp" line="416"/>
|
||||||
<source>Time assignment time longer than booking time!
|
<source>Time assignment time longer than booking time!
|
||||||
Time assignment: %0
|
Time assignment: %0
|
||||||
Booking: %1</source>
|
Booking: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="393"/>
|
<location filename="../stripswidget.cpp" line="435"/>
|
||||||
<source>Assigned time</source>
|
<source>Assigned time</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="405"/>
|
<location filename="../stripswidget.cpp" line="447"/>
|
||||||
<source>Strip rendering aborted due error.
|
<source>Strip rendering aborted due error.
|
||||||
Your bookings and time assignments for this day are in an illegal state!</source>
|
Your bookings and time assignments for this day are in an illegal state!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="442"/>
|
<location filename="../stripswidget.cpp" line="76"/>
|
||||||
<source>%0 (%1)</source>
|
<source>%0 (%1)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="443"/>
|
<location filename="../stripswidget.cpp" line="77"/>
|
||||||
<source>Monday</source>
|
<source>Monday</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="443"/>
|
<location filename="../stripswidget.cpp" line="77"/>
|
||||||
<source>Tuesday</source>
|
<source>Tuesday</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="443"/>
|
<location filename="../stripswidget.cpp" line="77"/>
|
||||||
<source>Wednesday</source>
|
<source>Wednesday</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="443"/>
|
<location filename="../stripswidget.cpp" line="77"/>
|
||||||
<source>Thursday</source>
|
<source>Thursday</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="444"/>
|
<location filename="../stripswidget.cpp" line="78"/>
|
||||||
<source>Friday</source>
|
<source>Friday</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="444"/>
|
<location filename="../stripswidget.cpp" line="78"/>
|
||||||
<source>Saturday</source>
|
<source>Saturday</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="444"/>
|
<location filename="../stripswidget.cpp" line="78"/>
|
||||||
<source>Sunday</source>
|
<source>Sunday</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="445"/>
|
<location filename="../stripswidget.cpp" line="79"/>
|
||||||
<source>dd.MM.yyyy</source>
|
<source>dd.MM.yyyy</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="447"/>
|
<location filename="../stripswidget.cpp" line="81"/>
|
||||||
<source>Invalid</source>
|
<source>Invalid</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../stripswidget.cpp" line="564"/>
|
<location filename="../stripswidget.cpp" line="589"/>
|
||||||
<source>Open</source>
|
<source>Open</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -19,13 +19,9 @@ SOURCES += mainwindow.cpp \
|
|||||||
zeiterfassungsettings.cpp \
|
zeiterfassungsettings.cpp \
|
||||||
dialogs/aboutmedialog.cpp \
|
dialogs/aboutmedialog.cpp \
|
||||||
dialogs/authenticationdialog.cpp \
|
dialogs/authenticationdialog.cpp \
|
||||||
dialogs/bookingdialog.cpp \
|
|
||||||
dialogs/languageselectiondialog.cpp \
|
dialogs/languageselectiondialog.cpp \
|
||||||
dialogs/settingsdialog.cpp \
|
dialogs/settingsdialog.cpp \
|
||||||
dialogs/timeassignmentdialog.cpp \
|
|
||||||
dialogs/updatedialog.cpp \
|
dialogs/updatedialog.cpp \
|
||||||
models/bookingsmodel.cpp \
|
|
||||||
models/timeassignmentsmodel.cpp \
|
|
||||||
replies/createbookingreply.cpp \
|
replies/createbookingreply.cpp \
|
||||||
replies/createtimeassignmentreply.cpp \
|
replies/createtimeassignmentreply.cpp \
|
||||||
replies/deletebookingreply.cpp \
|
replies/deletebookingreply.cpp \
|
||||||
@@ -40,7 +36,7 @@ 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
|
||||||
|
|
||||||
HEADERS += cpp14polyfills.h \
|
HEADERS += cpp14polyfills.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
@@ -53,13 +49,9 @@ HEADERS += cpp14polyfills.h \
|
|||||||
zeiterfassungsettings.h \
|
zeiterfassungsettings.h \
|
||||||
dialogs/aboutmedialog.h \
|
dialogs/aboutmedialog.h \
|
||||||
dialogs/authenticationdialog.h \
|
dialogs/authenticationdialog.h \
|
||||||
dialogs/bookingdialog.h \
|
|
||||||
dialogs/languageselectiondialog.h \
|
dialogs/languageselectiondialog.h \
|
||||||
dialogs/settingsdialog.h \
|
dialogs/settingsdialog.h \
|
||||||
dialogs/timeassignmentdialog.h \
|
|
||||||
dialogs/updatedialog.h \
|
dialogs/updatedialog.h \
|
||||||
models/bookingsmodel.h \
|
|
||||||
models/timeassignmentsmodel.h \
|
|
||||||
replies/createbookingreply.h \
|
replies/createbookingreply.h \
|
||||||
replies/createtimeassignmentreply.h \
|
replies/createtimeassignmentreply.h \
|
||||||
replies/deletebookingreply.h \
|
replies/deletebookingreply.h \
|
||||||
@@ -74,16 +66,14 @@ 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
|
||||||
|
|
||||||
FORMS += mainwindow.ui \
|
FORMS += mainwindow.ui \
|
||||||
dialogs/updatedialog.ui \
|
dialogs/updatedialog.ui \
|
||||||
dialogs/settingsdialog.ui \
|
dialogs/settingsdialog.ui \
|
||||||
dialogs/languageselectiondialog.ui \
|
dialogs/languageselectiondialog.ui \
|
||||||
dialogs/authenticationdialog.ui \
|
dialogs/authenticationdialog.ui \
|
||||||
dialogs/bookingdialog.ui \
|
dialogs/aboutmedialog.ui
|
||||||
dialogs/aboutmedialog.ui \
|
|
||||||
dialogs/timeassignmentdialog.ui
|
|
||||||
|
|
||||||
RESOURCES += resources.qrc
|
RESOURCES += resources.qrc
|
||||||
|
|
||||||
|
@@ -13,10 +13,9 @@ class ZEITERFASSUNGLIBSHARED_EXPORT ZeiterfassungPlugin : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ZeiterfassungPlugin(QObject *parent = 0);
|
explicit ZeiterfassungPlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
virtual void attachTo(MainWindow &mainWindow) { Q_UNUSED(mainWindow) }
|
virtual void attachTo(MainWindow &mainWindow) { Q_UNUSED(mainWindow) }
|
||||||
virtual void attachTo(StripsWidget &stripsWidget) { Q_UNUSED(stripsWidget) }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_INTERFACE(ZeiterfassungPlugin, "dbsoftware.zeiterfassung.plugin/1.0")
|
Q_DECLARE_INTERFACE(ZeiterfassungPlugin, "dbsoftware.zeiterfassung.plugin/1.0")
|
||||||
|
Reference in New Issue
Block a user