Release 1.5 #39
@@ -1,9 +1,8 @@
|
||||
#include "advanvedviewdialog.h"
|
||||
#include "ui_advanvedviewdialog.h"
|
||||
#include "advancedviewdialog.h"
|
||||
#include "ui_advancedviewdialog.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QEventLoop>
|
||||
#include <QMessageBox>
|
||||
#include <QStringBuilder>
|
||||
|
||||
@@ -22,9 +21,9 @@
|
||||
#include "models/bookingsmodel.h"
|
||||
#include "models/timeassignmentsmodel.h"
|
||||
|
||||
AdvanvedViewDialog::AdvanvedViewDialog(StripsWidget &stripsWidget) :
|
||||
AdvancedViewDialog::AdvancedViewDialog(StripsWidget &stripsWidget) :
|
||||
QDialog(&stripsWidget.mainWindow()),
|
||||
ui(new Ui::AdvanvedViewDialog),
|
||||
ui(new Ui::AdvancedViewDialog),
|
||||
m_stripsWidget(stripsWidget),
|
||||
m_bookingsModel(new BookingsModel(stripsWidget, this)),
|
||||
m_timeAssignmentsModel(new TimeAssignmentsModel(stripsWidget, this))
|
||||
@@ -34,20 +33,20 @@ AdvanvedViewDialog::AdvanvedViewDialog(StripsWidget &stripsWidget) :
|
||||
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);
|
||||
connect(ui->bookingsView, &QWidget::customContextMenuRequested, this, &AdvancedViewDialog::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);
|
||||
connect(ui->timeAssignmentsView, &QWidget::customContextMenuRequested, this, &AdvancedViewDialog::contextMenuTimeAssignment);
|
||||
}
|
||||
|
||||
AdvanvedViewDialog::~AdvanvedViewDialog()
|
||||
AdvancedViewDialog::~AdvancedViewDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos)
|
||||
void AdvancedViewDialog::contextMenuBooking(const QPoint &pos)
|
||||
{
|
||||
auto index = ui->bookingsView->indexAt(pos);
|
||||
|
||||
@@ -73,11 +72,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos)
|
||||
dialog.getText()
|
||||
);
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(reply->success())
|
||||
{
|
||||
@@ -123,11 +118,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos)
|
||||
dialog.getText()
|
||||
);
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(reply->success())
|
||||
{
|
||||
@@ -150,11 +141,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos)
|
||||
{
|
||||
auto reply = m_stripsWidget.mainWindow().erfassung().doDeleteBooking(booking.id);
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(reply->success())
|
||||
m_stripsWidget.refreshBookings();
|
||||
@@ -165,7 +152,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos)
|
||||
}
|
||||
}
|
||||
|
||||
void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
||||
void AdvancedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
||||
{
|
||||
auto index = ui->timeAssignmentsView->indexAt(pos);
|
||||
|
||||
@@ -193,11 +180,7 @@ void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
||||
dialog.getText()
|
||||
);
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(reply->success())
|
||||
{
|
||||
@@ -248,11 +231,7 @@ void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
||||
dialog.getText()
|
||||
);
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(reply->success())
|
||||
{
|
||||
@@ -275,11 +254,7 @@ void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
||||
{
|
||||
auto reply = m_stripsWidget.mainWindow().erfassung().doDeleteTimeAssignment(timeAssignment.id);
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(reply->success())
|
||||
{
|
@@ -1,27 +1,27 @@
|
||||
#ifndef ADVANVEDVIEWDIALOG_H
|
||||
#define ADVANVEDVIEWDIALOG_H
|
||||
#ifndef ADVANCEDVIEWDIALOG_H
|
||||
#define ADVANCEDVIEWDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui { class AdvanvedViewDialog; }
|
||||
namespace Ui { class AdvancedViewDialog; }
|
||||
class StripsWidget;
|
||||
class BookingsModel;
|
||||
class TimeAssignmentsModel;
|
||||
|
||||
class AdvanvedViewDialog : public QDialog
|
||||
class AdvancedViewDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AdvanvedViewDialog(StripsWidget &stripsWidget);
|
||||
~AdvanvedViewDialog();
|
||||
explicit AdvancedViewDialog(StripsWidget &stripsWidget);
|
||||
~AdvancedViewDialog();
|
||||
|
||||
private Q_SLOTS:
|
||||
void contextMenuBooking(const QPoint &pos);
|
||||
void contextMenuTimeAssignment(const QPoint &pos);
|
||||
|
||||
private:
|
||||
Ui::AdvanvedViewDialog *ui;
|
||||
Ui::AdvancedViewDialog *ui;
|
||||
|
||||
StripsWidget &m_stripsWidget;
|
||||
|
||||
@@ -29,4 +29,4 @@ private:
|
||||
TimeAssignmentsModel *m_timeAssignmentsModel;
|
||||
};
|
||||
|
||||
#endif // ADVANVEDVIEWDIALOG_H
|
||||
#endif // ADVANCEDVIEWDIALOG_H
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AdvanvedViewDialog</class>
|
||||
<widget class="QDialog" name="AdvanvedViewDialog">
|
||||
<class>AdvancedViewDialog</class>
|
||||
<widget class="QDialog" name="AdvancedViewDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -48,7 +48,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>AdvanvedViewDialog</receiver>
|
||||
<receiver>AdvancedViewDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
@@ -64,7 +64,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>AdvanvedViewDialog</receiver>
|
||||
<receiver>AdvancedViewDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
@@ -1,15 +1,34 @@
|
||||
#include "advancedviewplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
#include <QBoxLayout>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "stripswidget.h"
|
||||
|
||||
#include "advancedviewwidget.h"
|
||||
|
||||
AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
Q_INIT_RESOURCE(advancedviewplugin_resources);
|
||||
qDebug() << "called";
|
||||
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(m_translator.load(QLocale(), QStringLiteral("advancedviewplugin"), QStringLiteral("_"), dir))
|
||||
{
|
||||
if(!QCoreApplication::installTranslator(&m_translator))
|
||||
{
|
||||
qWarning() << "could not install translation advancedviewplugin";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "could not load translation advancedviewplugin";
|
||||
}
|
||||
}
|
||||
|
||||
void AdvancedViewPlugin::attachTo(MainWindow &mainWindow)
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#define ADVANCEDVIEWPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
@@ -17,7 +18,10 @@ public:
|
||||
explicit AdvancedViewPlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow);
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
||||
|
||||
#endif // ADVANCEDVIEWPLUGIN_H
|
||||
|
@@ -14,7 +14,7 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += advanvedviewdialog.h \
|
||||
HEADERS += advancedviewdialog.h \
|
||||
advancedviewplugin.h \
|
||||
advancedviewwidget.h \
|
||||
dialogs/bookingdialog.h \
|
||||
@@ -22,7 +22,7 @@ HEADERS += advanvedviewdialog.h \
|
||||
models/bookingsmodel.h \
|
||||
models/timeassignmentsmodel.h
|
||||
|
||||
SOURCES += advanvedviewdialog.cpp \
|
||||
SOURCES += advancedviewdialog.cpp \
|
||||
advancedviewplugin.cpp \
|
||||
advancedviewwidget.cpp \
|
||||
dialogs/bookingdialog.cpp \
|
||||
@@ -30,12 +30,20 @@ SOURCES += advanvedviewdialog.cpp \
|
||||
models/bookingsmodel.cpp \
|
||||
models/timeassignmentsmodel.cpp
|
||||
|
||||
FORMS += advanvedviewdialog.ui \
|
||||
FORMS += advancedviewdialog.ui \
|
||||
dialogs/bookingdialog.ui \
|
||||
dialogs/timeassignmentdialog.ui
|
||||
|
||||
RESOURCES += advancedviewplugin_resources.qrc
|
||||
|
||||
TRANSLATIONS +=
|
||||
TRANSLATIONS += translations/advancedviewplugin_en.ts \
|
||||
translations/advancedviewplugin_de.ts
|
||||
|
||||
OTHER_FILES += advancedviewplugin.json
|
||||
|
||||
include(../../lrelease.pri)
|
||||
|
||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/advancedviewplugin_en.qm \
|
||||
$${OUT_PWD}/translations/advancedviewplugin_de.qm
|
||||
|
||||
include(../copy_translations.pri)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/zeiterfassunglib/plugins/advancedviewplugin">
|
||||
<qresource prefix="/zeiterfassung/plugins/advancedviewplugin">
|
||||
<file>images/advanced-view.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@@ -3,13 +3,14 @@
|
||||
#include <QIcon>
|
||||
|
||||
#include "stripswidget.h"
|
||||
#include "advanvedviewdialog.h"
|
||||
#include "advancedviewdialog.h"
|
||||
|
||||
AdvancedViewWidget::AdvancedViewWidget(StripsWidget &stripsWidget) :
|
||||
QPushButton(&stripsWidget),
|
||||
QToolButton(&stripsWidget),
|
||||
m_stripsWidget(stripsWidget)
|
||||
{
|
||||
setIcon(QIcon(QStringLiteral(":/zeiterfassunglib/plugins/advancedviewplugin/images/advanced-view.png")));
|
||||
setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/advancedviewplugin/images/advanced-view.png")));
|
||||
setText(tr("Advanced view"));
|
||||
|
||||
connect(&stripsWidget, &StripsWidget::dateChanged, this, &AdvancedViewWidget::dateChanged);
|
||||
dateChanged(stripsWidget.date());
|
||||
@@ -24,6 +25,6 @@ void AdvancedViewWidget::dateChanged(const QDate &date)
|
||||
|
||||
void AdvancedViewWidget::pressedSlot()
|
||||
{
|
||||
AdvanvedViewDialog dialog(m_stripsWidget);
|
||||
AdvancedViewDialog dialog(m_stripsWidget);
|
||||
dialog.exec();
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#ifndef ADVANCEDVIEWWIDGET_H
|
||||
#define ADVANCEDVIEWWIDGET_H
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QToolButton>
|
||||
|
||||
class StripsWidget;
|
||||
|
||||
class AdvancedViewWidget : public QPushButton
|
||||
class AdvancedViewWidget : public QToolButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -4,11 +4,9 @@
|
||||
#include <QDialog>
|
||||
#include <QTime>
|
||||
|
||||
#include "zeiterfassunglib_global.h"
|
||||
|
||||
namespace Ui { class BookingDialog; }
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT BookingDialog : public QDialog
|
||||
class BookingDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -4,15 +4,13 @@
|
||||
#include <QDialog>
|
||||
#include <QTime>
|
||||
|
||||
#include "zeiterfassunglib_global.h"
|
||||
|
||||
template <class Key, class T> class QMap;
|
||||
|
||||
class ZeiterfassungSettings;
|
||||
|
||||
namespace Ui { class TimeAssignmentDialog; }
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT TimeAssignmentDialog : public QDialog
|
||||
class TimeAssignmentDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -7,7 +7,7 @@ BookingsModel::BookingsModel(StripsWidget &stripsWidget, QObject *parent) :
|
||||
m_stripsWidget(stripsWidget)
|
||||
{
|
||||
connect(&stripsWidget, &StripsWidget::bookingsChanged, this, &BookingsModel::bookingsChanged);
|
||||
connect(&stripsWidget, &StripsWidget::refreshingBookingsChanged, [=](bool refreshing){ enabledChanged(!refreshing); });
|
||||
connect(&stripsWidget, &StripsWidget::refreshingBookingsChanged, this, &BookingsModel::refreshingChanged);
|
||||
}
|
||||
|
||||
StripsWidget &BookingsModel::stripsWidget() const
|
||||
@@ -86,3 +86,8 @@ void BookingsModel::bookingsChanged()
|
||||
beginResetModel();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void BookingsModel::refreshingChanged(bool refreshing)
|
||||
{
|
||||
Q_EMIT enabledChanged(!refreshing);
|
||||
}
|
||||
|
@@ -4,12 +4,11 @@
|
||||
#include <QAbstractListModel>
|
||||
#include <QVector>
|
||||
|
||||
#include "zeiterfassunglib_global.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
class StripsWidget;
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT BookingsModel : public QAbstractListModel
|
||||
class BookingsModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged)
|
||||
@@ -32,6 +31,7 @@ Q_SIGNALS:
|
||||
|
||||
private Q_SLOTS:
|
||||
void bookingsChanged();
|
||||
void refreshingChanged(bool refreshing);
|
||||
|
||||
private:
|
||||
StripsWidget &m_stripsWidget;
|
||||
|
@@ -7,7 +7,7 @@ TimeAssignmentsModel::TimeAssignmentsModel(StripsWidget &stripsWidget, QObject *
|
||||
m_stripsWidget(stripsWidget)
|
||||
{
|
||||
connect(&stripsWidget, &StripsWidget::timeAssignmentsChanged, this, &TimeAssignmentsModel::timeAssignmentsChanged);
|
||||
connect(&stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, [=](bool refreshing){ enabledChanged(!refreshing); });
|
||||
connect(&stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, this, &TimeAssignmentsModel::refreshingChanged);
|
||||
}
|
||||
|
||||
StripsWidget &TimeAssignmentsModel::stripsWidget() const
|
||||
@@ -90,3 +90,8 @@ void TimeAssignmentsModel::timeAssignmentsChanged()
|
||||
beginResetModel();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void TimeAssignmentsModel::refreshingChanged(bool refreshing)
|
||||
{
|
||||
Q_EMIT enabledChanged(!refreshing);
|
||||
}
|
||||
|
@@ -4,12 +4,11 @@
|
||||
#include <QAbstractListModel>
|
||||
#include <QVector>
|
||||
|
||||
#include "zeiterfassunglib_global.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
class StripsWidget;
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT TimeAssignmentsModel : public QAbstractListModel
|
||||
class TimeAssignmentsModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged)
|
||||
|
240
plugins/advancedviewplugin/translations/advancedviewplugin_de.ts
Normal file
240
plugins/advancedviewplugin/translations/advancedviewplugin_de.ts
Normal file
@@ -0,0 +1,240 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>AdvancedViewDialog</name>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.ui" line="14"/>
|
||||
<source>Advanced view</source>
|
||||
<translation>Erweiterte Anzeige</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="56"/>
|
||||
<source>Create booking</source>
|
||||
<translation>Buchung erstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="57"/>
|
||||
<source>Refresh bookings</source>
|
||||
<translation>Buchungen aktualisieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="83"/>
|
||||
<source>Could not create booking!</source>
|
||||
<translation>Konnte Buchung nicht erstellen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="98"/>
|
||||
<source>Edit booking</source>
|
||||
<translation>Buchung bearbeiten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="99"/>
|
||||
<source>Delete booking</source>
|
||||
<translation>Buchung löschen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="129"/>
|
||||
<source>Could not edit booking!</source>
|
||||
<translation>Konnte Buchung nicht bearbeiten!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="137"/>
|
||||
<source>Do you really want to delete the booking?</source>
|
||||
<translation>Möchten Sie die Buchung wirklich löschen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="149"/>
|
||||
<source>Could not delete booking!</source>
|
||||
<translation>Konnte Buchung nicht löschen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="162"/>
|
||||
<source>Create time assignment</source>
|
||||
<translation>Kontierung erstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="163"/>
|
||||
<source>Refresh time assignments</source>
|
||||
<translation>Kontierungen aktualisieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="191"/>
|
||||
<source>Could not create time assignment!</source>
|
||||
<translation>Konnte Kontierung nicht erstellen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="206"/>
|
||||
<source>Edit time assignment</source>
|
||||
<translation>Kontierung bearbeiten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="207"/>
|
||||
<source>Delete time assignment</source>
|
||||
<translation>Kontierung löschen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="242"/>
|
||||
<source>Could not edit time assignment!</source>
|
||||
<translation>Konnte Kontierung nicht bearbeiten!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="250"/>
|
||||
<source>Do you really want to delete the time assignment?</source>
|
||||
<translation>Möchten Sie die Kontierung wirklich löschen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="264"/>
|
||||
<source>Could not delete time assignment!</source>
|
||||
<translation>Konnte Kontierung nicht löschen!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AdvancedViewWidget</name>
|
||||
<message>
|
||||
<location filename="../advancedviewwidget.cpp" line="13"/>
|
||||
<source>Advanced view</source>
|
||||
<translation>Erweiterte Anzeige</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BookingDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="20"/>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="31"/>
|
||||
<source>Booking</source>
|
||||
<translation>Buchung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="40"/>
|
||||
<source>Time:</source>
|
||||
<translation>Zeit:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="50"/>
|
||||
<source>Timespan:</source>
|
||||
<translation>Zeitspanne:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="60"/>
|
||||
<source>Type:</source>
|
||||
<translation>Typ:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="70"/>
|
||||
<source>Text:</source>
|
||||
<translation>Text:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BookingsModel</name>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="70"/>
|
||||
<source>ID</source>
|
||||
<translation>ID</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="71"/>
|
||||
<source>Time</source>
|
||||
<translation>Zeit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="72"/>
|
||||
<source>Timespan</source>
|
||||
<translation>Zeitspanne</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="73"/>
|
||||
<source>Type</source>
|
||||
<translation>Typ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="74"/>
|
||||
<source>Text</source>
|
||||
<translation>Text</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TimeAssignmentDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="20"/>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="31"/>
|
||||
<source>Time assignment</source>
|
||||
<translation>Kontierung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="40"/>
|
||||
<source>Time:</source>
|
||||
<translation>Zeit:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="50"/>
|
||||
<source>Timespan:</source>
|
||||
<translation>Zeitspanne:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="60"/>
|
||||
<source>Project:</source>
|
||||
<translation>Projekt:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="70"/>
|
||||
<source>Subproject:</source>
|
||||
<translation>Subprojekt:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="77"/>
|
||||
<source>Workpackage:</source>
|
||||
<translation>Arbeitspaket:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="84"/>
|
||||
<source>Text:</source>
|
||||
<translation>Text:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="26"/>
|
||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="35"/>
|
||||
<source>%0 (%1)</source>
|
||||
<translation>%0 (%1)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TimeAssignmentsModel</name>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="72"/>
|
||||
<source>ID</source>
|
||||
<translation>ID</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="73"/>
|
||||
<source>Time</source>
|
||||
<translation>Zeit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="74"/>
|
||||
<source>Timespan</source>
|
||||
<translation>Zeitspanne</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="75"/>
|
||||
<source>Project</source>
|
||||
<translation>Projekt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="76"/>
|
||||
<source>Subproject</source>
|
||||
<translation>Subprojekt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="77"/>
|
||||
<source>Workpackage</source>
|
||||
<translation>Arbeitspaket</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="78"/>
|
||||
<source>Text</source>
|
||||
<translation>Text</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
240
plugins/advancedviewplugin/translations/advancedviewplugin_en.ts
Normal file
240
plugins/advancedviewplugin/translations/advancedviewplugin_en.ts
Normal file
@@ -0,0 +1,240 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>AdvancedViewDialog</name>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.ui" line="14"/>
|
||||
<source>Advanced view</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="56"/>
|
||||
<source>Create booking</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="57"/>
|
||||
<source>Refresh bookings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="83"/>
|
||||
<source>Could not create booking!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="98"/>
|
||||
<source>Edit booking</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="99"/>
|
||||
<source>Delete booking</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="129"/>
|
||||
<source>Could not edit booking!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="137"/>
|
||||
<source>Do you really want to delete the booking?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="149"/>
|
||||
<source>Could not delete booking!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="162"/>
|
||||
<source>Create time assignment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="163"/>
|
||||
<source>Refresh time assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="191"/>
|
||||
<source>Could not create time assignment!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="206"/>
|
||||
<source>Edit time assignment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="207"/>
|
||||
<source>Delete time assignment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="242"/>
|
||||
<source>Could not edit time assignment!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="250"/>
|
||||
<source>Do you really want to delete the time assignment?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../advancedviewdialog.cpp" line="264"/>
|
||||
<source>Could not delete time assignment!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AdvancedViewWidget</name>
|
||||
<message>
|
||||
<location filename="../advancedviewwidget.cpp" line="13"/>
|
||||
<source>Advanced view</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BookingDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="20"/>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="31"/>
|
||||
<source>Booking</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="40"/>
|
||||
<source>Time:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="50"/>
|
||||
<source>Timespan:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="60"/>
|
||||
<source>Type:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="70"/>
|
||||
<source>Text:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BookingsModel</name>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="70"/>
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="71"/>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="72"/>
|
||||
<source>Timespan</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="73"/>
|
||||
<source>Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="74"/>
|
||||
<source>Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TimeAssignmentDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="20"/>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="31"/>
|
||||
<source>Time assignment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="40"/>
|
||||
<source>Time:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="50"/>
|
||||
<source>Timespan:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="60"/>
|
||||
<source>Project:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="70"/>
|
||||
<source>Subproject:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="77"/>
|
||||
<source>Workpackage:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="84"/>
|
||||
<source>Text:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="26"/>
|
||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="35"/>
|
||||
<source>%0 (%1)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TimeAssignmentsModel</name>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="72"/>
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="73"/>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="74"/>
|
||||
<source>Timespan</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="75"/>
|
||||
<source>Project</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="76"/>
|
||||
<source>Subproject</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="77"/>
|
||||
<source>Workpackage</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="78"/>
|
||||
<source>Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
6
plugins/copy_translations.pri
Normal file
6
plugins/copy_translations.pri
Normal file
@@ -0,0 +1,6 @@
|
||||
copy_compiled_translations.input = COMPILED_TRANSLATIONS
|
||||
copy_compiled_translations.output = $${OUT_PWD}/../../bin/translations/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
|
||||
copy_compiled_translations.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
||||
copy_compiled_translations.CONFIG += no_link
|
||||
QMAKE_EXTRA_COMPILERS += copy_compiled_translations
|
||||
PRE_TARGETDEPS += compiler_copy_compiled_translations_make_all
|
BIN
plugins/lunchmealplugin/images/lunch-meal.png
Normal file
BIN
plugins/lunchmealplugin/images/lunch-meal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
51
plugins/lunchmealplugin/lunchmealdialog.cpp
Normal file
51
plugins/lunchmealplugin/lunchmealdialog.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#include "lunchmealdialog.h"
|
||||
#include "ui_lunchmealdialog.h"
|
||||
|
||||
#include <QDate>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkRequest>
|
||||
#include <QUrl>
|
||||
|
||||
#include "stripswidget.h"
|
||||
#include "mainwindow.h"
|
||||
#include "zeiterfassungsettings.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
LunchMealDialog::LunchMealDialog(StripsWidget &stripsWidget) :
|
||||
QDialog(&stripsWidget.mainWindow()),
|
||||
ui(new Ui::LunchMealDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->labelTitle->setText(tr("Lunch meal for %0").arg(stripsWidget.date().toString(tr("dd.MM.yyyy"))));
|
||||
|
||||
const auto &settings = stripsWidget.mainWindow().settings();
|
||||
|
||||
auto url = settings.value(QStringLiteral("LunchMealPlugin/url"),
|
||||
QStringLiteral("https://brunner.ninja/lunch/%0.txt")).toString()
|
||||
.arg(stripsWidget.date().toString(settings.value(QStringLiteral("LunchMealPlugin/dateFormat"),
|
||||
QStringLiteral("yyyy-MM-dd")).toString()));
|
||||
m_reply = std::unique_ptr<QNetworkReply>(stripsWidget.mainWindow().erfassung().manager()->get(QNetworkRequest(QUrl(url))));
|
||||
connect(m_reply.get(), &QNetworkReply::finished, this, &LunchMealDialog::finished);
|
||||
}
|
||||
|
||||
LunchMealDialog::~LunchMealDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void LunchMealDialog::finished()
|
||||
{
|
||||
if(m_reply->error() != QNetworkReply::NoError)
|
||||
{
|
||||
ui->labelLunchMeal->setText(QStringLiteral("<span style=\"color: red;\">%0</span>\n\n%1")
|
||||
.arg(m_reply->errorString())
|
||||
.arg(QString(m_reply->readAll())));
|
||||
goto after;
|
||||
}
|
||||
|
||||
ui->labelLunchMeal->setText(m_reply->readAll());
|
||||
|
||||
after:
|
||||
m_reply = Q_NULLPTR;
|
||||
}
|
29
plugins/lunchmealplugin/lunchmealdialog.h
Normal file
29
plugins/lunchmealplugin/lunchmealdialog.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef LUNCHMEALDIALOG_H
|
||||
#define LUNCHMEALDIALOG_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QDialog>
|
||||
#include <QNetworkReply>
|
||||
|
||||
class StripsWidget;
|
||||
|
||||
namespace Ui { class LunchMealDialog; }
|
||||
|
||||
class LunchMealDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LunchMealDialog(StripsWidget &stripsWidget);
|
||||
~LunchMealDialog();
|
||||
|
||||
private Q_SLOTS:
|
||||
void finished();
|
||||
|
||||
private:
|
||||
Ui::LunchMealDialog *ui;
|
||||
std::unique_ptr<QNetworkReply> m_reply;
|
||||
};
|
||||
|
||||
#endif // LUNCHMEALDIALOG_H
|
88
plugins/lunchmealplugin/lunchmealdialog.ui
Normal file
88
plugins/lunchmealplugin/lunchmealdialog.ui
Normal file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LunchMealDialog</class>
|
||||
<widget class="QDialog" name="LunchMealDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Lunch meal</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelTitle">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Lunch meal for</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelLunchMeal">
|
||||
<property name="text">
|
||||
<string>Loading...</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</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>LunchMealDialog</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>LunchMealDialog</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>
|
@@ -1,9 +1,38 @@
|
||||
#include "lunchmealplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
#include <QBoxLayout>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "stripswidget.h"
|
||||
|
||||
#include "lunchmealwidget.h"
|
||||
|
||||
LunchMealPlugin::LunchMealPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
qDebug() << "called";
|
||||
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(m_translator.load(QLocale(), QStringLiteral("lunchmealplugin"), QStringLiteral("_"), dir))
|
||||
{
|
||||
if(!QCoreApplication::installTranslator(&m_translator))
|
||||
{
|
||||
qWarning() << "could not install translation lunchmealplugin";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "could not load translation lunchmealplugin";
|
||||
}
|
||||
}
|
||||
|
||||
void LunchMealPlugin::attachTo(MainWindow &mainWindow)
|
||||
{
|
||||
for(auto stripsWidget : mainWindow.stripsWidgets())
|
||||
stripsWidget->headerLayout()->addWidget(new LunchMealWidget(*stripsWidget));
|
||||
}
|
||||
|
@@ -2,9 +2,12 @@
|
||||
#define LUNCHMEALPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Q_DECL_EXPORT LunchMealPlugin : public ZeiterfassungPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -15,6 +18,10 @@ public:
|
||||
explicit LunchMealPlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
||||
|
||||
#endif // LUNCHMEALPLUGIN_H
|
||||
|
@@ -14,8 +14,26 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += lunchmealplugin.h
|
||||
HEADERS += lunchmealplugin.h \
|
||||
lunchmealwidget.h \
|
||||
lunchmealdialog.h
|
||||
|
||||
SOURCES += lunchmealplugin.cpp
|
||||
SOURCES += lunchmealplugin.cpp \
|
||||
lunchmealwidget.cpp \
|
||||
lunchmealdialog.cpp
|
||||
|
||||
FORMS += lunchmealdialog.ui
|
||||
|
||||
RESOURCES += lunchmealplugin_resources.qrc
|
||||
|
||||
TRANSLATIONS += translations/lunchmealplugin_en.ts \
|
||||
translations/lunchmealplugin_de.ts
|
||||
|
||||
OTHER_FILES += lunchmealplugin.json
|
||||
|
||||
include(../../lrelease.pri)
|
||||
|
||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/lunchmealplugin_en.qm \
|
||||
$${OUT_PWD}/translations/lunchmealplugin_de.qm
|
||||
|
||||
include(../copy_translations.pri)
|
||||
|
5
plugins/lunchmealplugin/lunchmealplugin_resources.qrc
Normal file
5
plugins/lunchmealplugin/lunchmealplugin_resources.qrc
Normal file
@@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/zeiterfassung/plugins/lunchmealplugin">
|
||||
<file>images/lunch-meal.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
25
plugins/lunchmealplugin/lunchmealwidget.cpp
Normal file
25
plugins/lunchmealplugin/lunchmealwidget.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "lunchmealwidget.h"
|
||||
|
||||
#include <QIcon>
|
||||
|
||||
#include "stripswidget.h"
|
||||
#include "mainwindow.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
#include "lunchmealdialog.h"
|
||||
|
||||
LunchMealWidget::LunchMealWidget(StripsWidget &stripsWidget) :
|
||||
QToolButton(&stripsWidget),
|
||||
m_stripsWidget(stripsWidget)
|
||||
{
|
||||
setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/lunchmealplugin/images/lunch-meal.png")));
|
||||
setText(tr("Lunch meal"));
|
||||
|
||||
connect(this, &QAbstractButton::pressed, this, &LunchMealWidget::pressedSlot);
|
||||
}
|
||||
|
||||
void LunchMealWidget::pressedSlot()
|
||||
{
|
||||
LunchMealDialog dialog(m_stripsWidget);
|
||||
dialog.exec();
|
||||
}
|
21
plugins/lunchmealplugin/lunchmealwidget.h
Normal file
21
plugins/lunchmealplugin/lunchmealwidget.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef LUNCHMEALWIDGET_H
|
||||
#define LUNCHMEALWIDGET_H
|
||||
|
||||
#include <QToolButton>
|
||||
|
||||
class StripsWidget;
|
||||
|
||||
class LunchMealWidget : public QToolButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LunchMealWidget(StripsWidget &stripsWidget);
|
||||
|
||||
private Q_SLOTS:
|
||||
void pressedSlot();
|
||||
|
||||
private:
|
||||
StripsWidget &m_stripsWidget;
|
||||
};
|
||||
|
||||
#endif // LUNCHMEALWIDGET_H
|
35
plugins/lunchmealplugin/translations/lunchmealplugin_de.ts
Normal file
35
plugins/lunchmealplugin/translations/lunchmealplugin_de.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>LunchMealDialog</name>
|
||||
<message>
|
||||
<location filename="../lunchmealdialog.ui" line="14"/>
|
||||
<source>Lunch meal</source>
|
||||
<translation>Mittagsmenü</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lunchmealdialog.ui" line="34"/>
|
||||
<source>Loading...</source>
|
||||
<translation>Lade...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lunchmealdialog.cpp" line="20"/>
|
||||
<source>Lunch meal for %0</source>
|
||||
<translation>Mittagsmenü vom %0</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lunchmealdialog.cpp" line="20"/>
|
||||
<source>dd.MM.yyyy</source>
|
||||
<translation>dd.MM.yyyy</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LunchMealWidget</name>
|
||||
<message>
|
||||
<location filename="../lunchmealwidget.cpp" line="16"/>
|
||||
<source>Lunch meal</source>
|
||||
<translation>Mittagsmenü</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
35
plugins/lunchmealplugin/translations/lunchmealplugin_en.ts
Normal file
35
plugins/lunchmealplugin/translations/lunchmealplugin_en.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>LunchMealDialog</name>
|
||||
<message>
|
||||
<location filename="../lunchmealdialog.ui" line="14"/>
|
||||
<source>Lunch meal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lunchmealdialog.ui" line="34"/>
|
||||
<source>Loading...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lunchmealdialog.cpp" line="20"/>
|
||||
<source>Lunch meal for %0</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../lunchmealdialog.cpp" line="20"/>
|
||||
<source>dd.MM.yyyy</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LunchMealWidget</name>
|
||||
<message>
|
||||
<location filename="../lunchmealwidget.cpp" line="16"/>
|
||||
<source>Lunch meal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@@ -3,4 +3,6 @@ TEMPLATE = subdirs
|
||||
SUBDIRS += advancedviewplugin \
|
||||
lunchmealplugin \
|
||||
presenceplugin \
|
||||
reportsplugin \
|
||||
updaterplugin \
|
||||
weatherplugin
|
||||
|
BIN
plugins/presenceplugin/images/refresh.png
Normal file
BIN
plugins/presenceplugin/images/refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
@@ -1,14 +1,30 @@
|
||||
#include "presenceplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "presencewidget.h"
|
||||
|
||||
PresencePlugin::PresencePlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
qDebug() << "called";
|
||||
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(m_translator.load(QLocale(), QStringLiteral("presenceplugin"), QStringLiteral("_"), dir))
|
||||
{
|
||||
if(!QCoreApplication::installTranslator(&m_translator))
|
||||
{
|
||||
qWarning() << "could not install translation presenceplugin";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "could not load translation presenceplugin";
|
||||
}
|
||||
}
|
||||
|
||||
void PresencePlugin::attachTo(MainWindow &mainWindow)
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#define PRESENCEPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
@@ -17,7 +18,10 @@ public:
|
||||
explicit PresencePlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow);
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
||||
|
||||
#endif // PRESENCEPLUGIN_H
|
||||
|
@@ -15,9 +15,23 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += presenceplugin.h \
|
||||
presencewidget.h
|
||||
presencewidget.h
|
||||
|
||||
SOURCES += presenceplugin.cpp \
|
||||
presencewidget.cpp
|
||||
presencewidget.cpp
|
||||
|
||||
FORMS +=
|
||||
|
||||
RESOURCES += presenceplugin_resources.qrc
|
||||
|
||||
TRANSLATIONS += translations/presenceplugin_en.ts \
|
||||
translations/presenceplugin_de.ts
|
||||
|
||||
OTHER_FILES += presenceplugin.json
|
||||
|
||||
include(../../lrelease.pri)
|
||||
|
||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/presenceplugin_en.qm \
|
||||
$${OUT_PWD}/translations/presenceplugin_de.qm
|
||||
|
||||
include(../copy_translations.pri)
|
||||
|
5
plugins/presenceplugin/presenceplugin_resources.qrc
Normal file
5
plugins/presenceplugin/presenceplugin_resources.qrc
Normal file
@@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/zeiterfassung/plugins/presenceplugin">
|
||||
<file>images/refresh.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <QLabel>
|
||||
#include <QStatusBar>
|
||||
#include <QMenu>
|
||||
#include <QTimer>
|
||||
#include <QMessageBox>
|
||||
#include <QStringBuilder>
|
||||
@@ -13,6 +14,8 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) :
|
||||
QWidget(&mainWindow),
|
||||
m_mainWindow(mainWindow)
|
||||
{
|
||||
connect(&m_mainWindow, &MainWindow::refreshEverything, this, &PresenceWidget::refresh);
|
||||
|
||||
m_labelAvailable = new QLabel(this);
|
||||
m_labelAvailable->setFrameShape(QFrame::Panel);
|
||||
m_labelAvailable->setFrameShadow(QFrame::Sunken);
|
||||
@@ -23,25 +26,24 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) :
|
||||
m_labelNotAvailable->setFrameShadow(QFrame::Sunken);
|
||||
m_mainWindow.statusBar()->addWidget(m_labelNotAvailable);
|
||||
|
||||
m_action = m_mainWindow.menuView()->addAction(QIcon(QStringLiteral(":zeiterfassung/plugins/presenceplugin/images/refresh.png")),
|
||||
tr("Refresh presence"), this, &PresenceWidget::refresh);
|
||||
|
||||
auto timer = new QTimer(this);
|
||||
timer->setInterval(60000);
|
||||
connect(timer, &QTimer::timeout, this, &PresenceWidget::timeout);
|
||||
connect(timer, &QTimer::timeout, this, &PresenceWidget::refresh);
|
||||
timer->start();
|
||||
|
||||
timeout();
|
||||
refresh();
|
||||
}
|
||||
|
||||
void PresenceWidget::timeout()
|
||||
void PresenceWidget::refresh()
|
||||
{
|
||||
if(m_reply)
|
||||
{
|
||||
qWarning() << "last request not finished yet!";
|
||||
return;
|
||||
}
|
||||
|
||||
m_labelAvailable->setText(tr("%0: %1").arg(tr("Available")).arg(tr("???")));
|
||||
m_labelNotAvailable->setText(tr("%0: %1").arg(tr("Not available")).arg(tr("???")));
|
||||
|
||||
m_action->setEnabled(false);
|
||||
|
||||
m_reply = m_mainWindow.erfassung().doGetPresenceStatus();
|
||||
connect(m_reply.get(), &ZeiterfassungReply::finished, this, &PresenceWidget::finished);
|
||||
}
|
||||
@@ -73,5 +75,6 @@ void PresenceWidget::finished()
|
||||
}
|
||||
|
||||
after:
|
||||
m_action->setEnabled(true);
|
||||
m_reply = Q_NULLPTR;
|
||||
}
|
||||
|
@@ -6,17 +6,19 @@
|
||||
#include "replies/getpresencestatusreply.h"
|
||||
|
||||
class QLabel;
|
||||
class QAction;
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class PresenceWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PresenceWidget(MainWindow &mainWindow);
|
||||
|
||||
private Q_SLOTS:
|
||||
void timeout();
|
||||
void refresh();
|
||||
void finished();
|
||||
|
||||
private:
|
||||
@@ -25,6 +27,8 @@ private:
|
||||
QLabel *m_labelAvailable;
|
||||
QLabel *m_labelNotAvailable;
|
||||
|
||||
QAction *m_action;
|
||||
|
||||
std::unique_ptr<GetPresenceStatusReply> m_reply;
|
||||
};
|
||||
|
||||
|
44
plugins/presenceplugin/translations/presenceplugin_de.ts
Normal file
44
plugins/presenceplugin/translations/presenceplugin_de.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>PresenceWidget</name>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="30"/>
|
||||
<source>Refresh presence</source>
|
||||
<translation>Verfügbarkeit aktualisieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="42"/>
|
||||
<location filename="../presencewidget.cpp" line="43"/>
|
||||
<location filename="../presencewidget.cpp" line="73"/>
|
||||
<location filename="../presencewidget.cpp" line="74"/>
|
||||
<source>%0: %1</source>
|
||||
<translation>%0: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="42"/>
|
||||
<location filename="../presencewidget.cpp" line="73"/>
|
||||
<source>Available</source>
|
||||
<translation>Verfügbar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="42"/>
|
||||
<location filename="../presencewidget.cpp" line="43"/>
|
||||
<source>???</source>
|
||||
<translation>???</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="43"/>
|
||||
<location filename="../presencewidget.cpp" line="74"/>
|
||||
<source>Not available</source>
|
||||
<translation>Nicht verfügbar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="55"/>
|
||||
<location filename="../presencewidget.cpp" line="56"/>
|
||||
<source>Could not get presence status!</source>
|
||||
<translation>Konnte Verfügbarkeit nicht laden!</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
44
plugins/presenceplugin/translations/presenceplugin_en.ts
Normal file
44
plugins/presenceplugin/translations/presenceplugin_en.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>PresenceWidget</name>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="30"/>
|
||||
<source>Refresh presence</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="42"/>
|
||||
<location filename="../presencewidget.cpp" line="43"/>
|
||||
<location filename="../presencewidget.cpp" line="73"/>
|
||||
<location filename="../presencewidget.cpp" line="74"/>
|
||||
<source>%0: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="42"/>
|
||||
<location filename="../presencewidget.cpp" line="73"/>
|
||||
<source>Available</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="42"/>
|
||||
<location filename="../presencewidget.cpp" line="43"/>
|
||||
<source>???</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="43"/>
|
||||
<location filename="../presencewidget.cpp" line="74"/>
|
||||
<source>Not available</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../presencewidget.cpp" line="55"/>
|
||||
<location filename="../presencewidget.cpp" line="56"/>
|
||||
<source>Could not get presence status!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
BIN
plugins/reportsplugin/images/refresh.png
Normal file
BIN
plugins/reportsplugin/images/refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
33
plugins/reportsplugin/reportsplugin.cpp
Normal file
33
plugins/reportsplugin/reportsplugin.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "reportsplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
|
||||
#include "reportswidget.h"
|
||||
|
||||
ReportsPlugin::ReportsPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
qDebug() << "called";
|
||||
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(m_translator.load(QLocale(), QStringLiteral("reportsplugin"), QStringLiteral("_"), dir))
|
||||
{
|
||||
if(!QCoreApplication::installTranslator(&m_translator))
|
||||
{
|
||||
qWarning() << "could not install translation reportsplugin";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "could not load translation reportsplugin";
|
||||
}
|
||||
}
|
||||
|
||||
void ReportsPlugin::attachTo(MainWindow &mainWindow)
|
||||
{
|
||||
new ReportsWidget(mainWindow);
|
||||
}
|
27
plugins/reportsplugin/reportsplugin.h
Normal file
27
plugins/reportsplugin/reportsplugin.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef REPORTSPLUGIN_H
|
||||
#define REPORTSPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Q_DECL_EXPORT ReportsPlugin : public ZeiterfassungPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "reportsplugin.json")
|
||||
Q_INTERFACES(ZeiterfassungPlugin)
|
||||
|
||||
public:
|
||||
explicit ReportsPlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
||||
|
||||
#endif // REPORTSPLUGIN_H
|
0
plugins/reportsplugin/reportsplugin.json
Normal file
0
plugins/reportsplugin/reportsplugin.json
Normal file
37
plugins/reportsplugin/reportsplugin.pro
Normal file
37
plugins/reportsplugin/reportsplugin.pro
Normal file
@@ -0,0 +1,37 @@
|
||||
QT += core network gui widgets
|
||||
|
||||
TARGET = reportsplugin
|
||||
TEMPLATE = lib
|
||||
|
||||
CONFIG += shared c++14
|
||||
|
||||
DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung
|
||||
|
||||
LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib
|
||||
|
||||
INCLUDEPATH += $$PWD/../../zeiterfassunglib
|
||||
DEPENDPATH += $$PWD/../../zeiterfassunglib
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += reportsplugin.h \
|
||||
reportswidget.h
|
||||
|
||||
SOURCES += reportsplugin.cpp \
|
||||
reportswidget.cpp
|
||||
|
||||
FORMS +=
|
||||
|
||||
RESOURCES += reportsplugin_resources.qrc
|
||||
|
||||
TRANSLATIONS += translations/reportsplugin_en.ts \
|
||||
translations/reportsplugin_de.ts
|
||||
|
||||
OTHER_FILES += reportsplugin.json
|
||||
|
||||
include(../../lrelease.pri)
|
||||
|
||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/reportsplugin_en.qm \
|
||||
$${OUT_PWD}/translations/reportsplugin_de.qm
|
||||
|
||||
include(../copy_translations.pri)
|
6
plugins/reportsplugin/reportsplugin_resources.qrc
Normal file
6
plugins/reportsplugin/reportsplugin_resources.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/zeiterfassung/plugins/reportsplugin">
|
||||
<file>images/refresh.png</file>
|
||||
<file>images/report.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
148
plugins/reportsplugin/reportswidget.cpp
Normal file
148
plugins/reportsplugin/reportswidget.cpp
Normal file
@@ -0,0 +1,148 @@
|
||||
#include "reportswidget.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QStatusBar>
|
||||
#include <QMenu>
|
||||
#include <QToolBar>
|
||||
#include <QMessageBox>
|
||||
#include <QStringBuilder>
|
||||
#include <QRegularExpression>
|
||||
#include <QTemporaryFile>
|
||||
#include <QDir>
|
||||
#include <QDesktopServices>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
ReportsWidget::ReportsWidget(MainWindow &mainWindow) :
|
||||
QWidget(&mainWindow),
|
||||
m_mainWindow(mainWindow)
|
||||
{
|
||||
connect(&m_mainWindow, &MainWindow::dateChanged, this, &ReportsWidget::dateChanged);
|
||||
connect(&m_mainWindow, &MainWindow::refreshEverything, this, &ReportsWidget::refresh);
|
||||
|
||||
m_labelBalance = new QLabel(this);
|
||||
m_labelBalance->setFrameShape(QFrame::Panel);
|
||||
m_labelBalance->setFrameShadow(QFrame::Sunken);
|
||||
m_mainWindow.statusBar()->addPermanentWidget(m_labelBalance);
|
||||
|
||||
m_labelHolidays = new QLabel(this);
|
||||
m_labelHolidays->setFrameShape(QFrame::Panel);
|
||||
m_labelHolidays->setFrameShadow(QFrame::Sunken);
|
||||
m_mainWindow.statusBar()->addPermanentWidget(m_labelHolidays);
|
||||
|
||||
m_actionRefreshReport = m_mainWindow.menuView()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/refresh.png")),
|
||||
tr("Refresh report"), this, &ReportsWidget::refresh);
|
||||
|
||||
m_actionOpenReport = m_mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/report.png")),
|
||||
tr("Open report"), this, &ReportsWidget::openReport);
|
||||
m_mainWindow.toolBar()->addAction(m_actionOpenReport);
|
||||
|
||||
dateChanged(m_mainWindow.date());
|
||||
}
|
||||
|
||||
void ReportsWidget::dateChanged(const QDate &date)
|
||||
{
|
||||
if(!date.isValid())
|
||||
{
|
||||
qWarning() << "invalid date" << date;
|
||||
return;
|
||||
}
|
||||
|
||||
auto monthBegin = QDate(date.year(), date.month(), 1);
|
||||
if(monthBegin != m_date)
|
||||
{
|
||||
m_date = monthBegin;
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void ReportsWidget::refresh()
|
||||
{
|
||||
if(!m_date.isValid())
|
||||
{
|
||||
qWarning() << "invalid date" << m_date;
|
||||
return;
|
||||
}
|
||||
|
||||
m_actionRefreshReport->setEnabled(false);
|
||||
m_actionOpenReport->setEnabled(false);
|
||||
|
||||
m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("???")));
|
||||
m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("???")));
|
||||
|
||||
m_reply = m_mainWindow.erfassung().doGetReport(m_mainWindow.userInfo().userId, m_date);
|
||||
connect(m_reply.get(), &ZeiterfassungReply::finished, this, &ReportsWidget::finished);
|
||||
}
|
||||
|
||||
void ReportsWidget::finished()
|
||||
{
|
||||
if(!m_reply->success())
|
||||
{
|
||||
m_date = QDate();
|
||||
QMessageBox::warning(this, tr("Could not load report!"), tr("Could not load report!") % "\n\n" % m_reply->message());
|
||||
goto after;
|
||||
}
|
||||
|
||||
{
|
||||
auto content = m_reply->content();
|
||||
|
||||
{
|
||||
static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)"));
|
||||
auto match = regex.match(content);
|
||||
if(match.hasMatch())
|
||||
{
|
||||
auto balance = match.captured(2);
|
||||
if(balance.endsWith(QChar('-')))
|
||||
{
|
||||
balance.chop(1);
|
||||
balance = QChar('-') % balance;
|
||||
}
|
||||
m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("%0h").arg(balance)));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("n/a")));
|
||||
qWarning() << "balance not found in PDF";
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)"));
|
||||
auto match = regex.match(content);
|
||||
if(match.hasMatch())
|
||||
m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(match.captured(2)));
|
||||
else
|
||||
{
|
||||
m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("n/a")));
|
||||
qWarning() << "holidays not found in PDF";
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("reportXXXXXX.pdf")));
|
||||
file.setAutoRemove(false);
|
||||
if(!file.open())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Could not write report!"), tr("Could not write report!") % "\n\n" % file.errorString());
|
||||
goto after;
|
||||
}
|
||||
|
||||
file.write(content);
|
||||
|
||||
m_url = QUrl::fromLocalFile(file.fileName());
|
||||
}
|
||||
}
|
||||
|
||||
m_actionOpenReport->setEnabled(true);
|
||||
|
||||
after:
|
||||
m_actionRefreshReport->setEnabled(true);
|
||||
m_reply = Q_NULLPTR;
|
||||
}
|
||||
|
||||
void ReportsWidget::openReport()
|
||||
{
|
||||
if(!QDesktopServices::openUrl(m_url))
|
||||
QMessageBox::warning(this, tr("Could not launch your default PDF viewer!"), tr("Could not launch your default PDF viewer!"));
|
||||
}
|
43
plugins/reportsplugin/reportswidget.h
Normal file
43
plugins/reportsplugin/reportswidget.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef REPORTSWIDGET_H
|
||||
#define REPORTSWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDate>
|
||||
#include <QUrl>
|
||||
|
||||
#include "replies/getreportreply.h"
|
||||
|
||||
class QLabel;
|
||||
class QAction;
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class ReportsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ReportsWidget(MainWindow &mainWindow);
|
||||
|
||||
private Q_SLOTS:
|
||||
void dateChanged(const QDate &date);
|
||||
void refresh();
|
||||
void finished();
|
||||
void openReport();
|
||||
|
||||
private:
|
||||
MainWindow &m_mainWindow;
|
||||
|
||||
QLabel *m_labelBalance;
|
||||
QLabel *m_labelHolidays;
|
||||
|
||||
QAction *m_actionOpenReport;
|
||||
QAction *m_actionRefreshReport;
|
||||
|
||||
QDate m_date;
|
||||
QUrl m_url;
|
||||
|
||||
std::unique_ptr<GetReportReply> m_reply;
|
||||
};
|
||||
|
||||
#endif // REPORTSWIDGET_H
|
73
plugins/reportsplugin/translations/reportsplugin_de.ts
Normal file
73
plugins/reportsplugin/translations/reportsplugin_de.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>ReportsWidget</name>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="35"/>
|
||||
<source>Refresh report</source>
|
||||
<translation>Auswertung aktualisieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="38"/>
|
||||
<source>Open report</source>
|
||||
<translation>Auswertung öffnen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="71"/>
|
||||
<location filename="../reportswidget.cpp" line="72"/>
|
||||
<location filename="../reportswidget.cpp" line="101"/>
|
||||
<location filename="../reportswidget.cpp" line="105"/>
|
||||
<location filename="../reportswidget.cpp" line="114"/>
|
||||
<location filename="../reportswidget.cpp" line="117"/>
|
||||
<source>%0: %1</source>
|
||||
<translation>%0: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="71"/>
|
||||
<location filename="../reportswidget.cpp" line="101"/>
|
||||
<location filename="../reportswidget.cpp" line="105"/>
|
||||
<source>Balance</source>
|
||||
<translation>Gleitzeit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="71"/>
|
||||
<location filename="../reportswidget.cpp" line="72"/>
|
||||
<source>???</source>
|
||||
<translation>???</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="72"/>
|
||||
<location filename="../reportswidget.cpp" line="114"/>
|
||||
<location filename="../reportswidget.cpp" line="117"/>
|
||||
<source>Holidays</source>
|
||||
<translation>Urlaub</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="83"/>
|
||||
<source>Could not load report!</source>
|
||||
<translation>Konnte Auswertung nicht laden!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="101"/>
|
||||
<source>%0h</source>
|
||||
<translation>%0h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="105"/>
|
||||
<location filename="../reportswidget.cpp" line="117"/>
|
||||
<source>n/a</source>
|
||||
<translation>n/v</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="127"/>
|
||||
<source>Could not write report!</source>
|
||||
<translation>Konnte Auswertung nicht abspeichern!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="147"/>
|
||||
<source>Could not launch your default PDF viewer!</source>
|
||||
<translation>Konnte Standard-PDF-Viewer nicht öffnen!</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
73
plugins/reportsplugin/translations/reportsplugin_en.ts
Normal file
73
plugins/reportsplugin/translations/reportsplugin_en.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>ReportsWidget</name>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="35"/>
|
||||
<source>Refresh report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="38"/>
|
||||
<source>Open report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="71"/>
|
||||
<location filename="../reportswidget.cpp" line="72"/>
|
||||
<location filename="../reportswidget.cpp" line="101"/>
|
||||
<location filename="../reportswidget.cpp" line="105"/>
|
||||
<location filename="../reportswidget.cpp" line="114"/>
|
||||
<location filename="../reportswidget.cpp" line="117"/>
|
||||
<source>%0: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="71"/>
|
||||
<location filename="../reportswidget.cpp" line="101"/>
|
||||
<location filename="../reportswidget.cpp" line="105"/>
|
||||
<source>Balance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="71"/>
|
||||
<location filename="../reportswidget.cpp" line="72"/>
|
||||
<source>???</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="72"/>
|
||||
<location filename="../reportswidget.cpp" line="114"/>
|
||||
<location filename="../reportswidget.cpp" line="117"/>
|
||||
<source>Holidays</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="83"/>
|
||||
<source>Could not load report!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="101"/>
|
||||
<source>%0h</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="105"/>
|
||||
<location filename="../reportswidget.cpp" line="117"/>
|
||||
<source>n/a</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="127"/>
|
||||
<source>Could not write report!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../reportswidget.cpp" line="147"/>
|
||||
<source>Could not launch your default PDF viewer!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
28
plugins/updaterplugin/translations/updaterplugin_de.ts
Normal file
28
plugins/updaterplugin/translations/updaterplugin_de.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>UpdaterDialog</name>
|
||||
<message>
|
||||
<location filename="../updaterdialog.ui" line="14"/>
|
||||
<location filename="../updaterdialog.ui" line="25"/>
|
||||
<source>New update available!</source>
|
||||
<translation>Neues Update verfügbar!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../updaterdialog.ui" line="32"/>
|
||||
<source>There is a new release available to download!</source>
|
||||
<translation>Ein neues Release steht zum Download bereit!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../updaterdialog.ui" line="70"/>
|
||||
<source>Dont show today anymore</source>
|
||||
<translation>Heute nicht mehr anzeigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../updaterdialog.cpp" line="50"/>
|
||||
<source>Could not open default webbrowser!</source>
|
||||
<translation>Konnte Standard-Browser nicht öffnen!</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
28
plugins/updaterplugin/translations/updaterplugin_en.ts
Normal file
28
plugins/updaterplugin/translations/updaterplugin_en.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>UpdaterDialog</name>
|
||||
<message>
|
||||
<location filename="../updaterdialog.ui" line="14"/>
|
||||
<location filename="../updaterdialog.ui" line="25"/>
|
||||
<source>New update available!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../updaterdialog.ui" line="32"/>
|
||||
<source>There is a new release available to download!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../updaterdialog.ui" line="70"/>
|
||||
<source>Dont show today anymore</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../updaterdialog.cpp" line="50"/>
|
||||
<source>Could not open default webbrowser!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@@ -1,5 +1,5 @@
|
||||
#include "updatedialog.h"
|
||||
#include "ui_updatedialog.h"
|
||||
#include "updaterdialog.h"
|
||||
#include "ui_updaterdialog.h"
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkRequest>
|
||||
@@ -14,34 +14,53 @@
|
||||
#include <QDesktopServices>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "zeiterfassungsettings.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
UpdateDialog::UpdateDialog(ZeiterfassungSettings &settings, QNetworkAccessManager *manager, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::UpdateDialog),
|
||||
m_settings(settings)
|
||||
UpdaterDialog::UpdaterDialog(MainWindow &mainWindow) :
|
||||
QDialog(&mainWindow),
|
||||
ui(new Ui::UpdaterDialog),
|
||||
m_mainWindow(mainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &UpdateDialog::submit);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [=](){
|
||||
if(ui->checkBoxDontShow->isChecked())
|
||||
m_settings.setLastUpdateCheck(QDate::currentDate());
|
||||
reject();
|
||||
});
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &UpdaterDialog::acceptedSlot);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &UpdaterDialog::rejectedSlot);
|
||||
|
||||
m_reply = manager->get(QNetworkRequest(QUrl(QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases"))));
|
||||
connect(m_reply, &QNetworkReply::finished, this, &UpdateDialog::finished);
|
||||
auto url = m_mainWindow.settings().value(QStringLiteral("UpdaterPlugin/url"),
|
||||
QUrl(QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases"))).toUrl();
|
||||
m_reply = m_mainWindow.erfassung().manager()->get(QNetworkRequest(url));
|
||||
connect(m_reply, &QNetworkReply::finished, this, &UpdaterDialog::finished);
|
||||
}
|
||||
|
||||
UpdateDialog::~UpdateDialog()
|
||||
UpdaterDialog::~UpdaterDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void UpdateDialog::finished()
|
||||
void UpdaterDialog::acceptedSlot()
|
||||
{
|
||||
if(ui->checkBoxDontShow->isChecked())
|
||||
m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate());
|
||||
|
||||
if(!QDesktopServices::openUrl(m_url))
|
||||
QMessageBox::warning(this, tr("Could not open default webbrowser!"), tr("Could not open default webbrowser!"));
|
||||
|
||||
accept();
|
||||
}
|
||||
|
||||
void UpdaterDialog::rejectedSlot()
|
||||
{
|
||||
if(ui->checkBoxDontShow->isChecked())
|
||||
m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate());
|
||||
|
||||
reject();
|
||||
}
|
||||
|
||||
void UpdaterDialog::finished()
|
||||
{
|
||||
if(m_reply->error() != QNetworkReply::NoError)
|
||||
{
|
||||
@@ -83,18 +102,7 @@ void UpdateDialog::finished()
|
||||
}
|
||||
}
|
||||
|
||||
m_settings.setLastUpdateCheck(QDate::currentDate());
|
||||
m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate());
|
||||
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void UpdateDialog::submit()
|
||||
{
|
||||
if(ui->checkBoxDontShow->isChecked())
|
||||
m_settings.setLastUpdateCheck(QDate::currentDate());
|
||||
|
||||
if(!QDesktopServices::openUrl(m_url))
|
||||
QMessageBox::warning(this, tr("Could not open default webbrowser!"), tr("Could not open default webbrowser!"));
|
||||
|
||||
accept();
|
||||
}
|
33
plugins/updaterplugin/updaterdialog.h
Normal file
33
plugins/updaterplugin/updaterdialog.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef UPDATERDIALOG_H
|
||||
#define UPDATERDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QUrl>
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
namespace Ui { class UpdaterDialog; }
|
||||
class MainWindow;
|
||||
|
||||
class UpdaterDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit UpdaterDialog(MainWindow &parent);
|
||||
~UpdaterDialog();
|
||||
|
||||
private Q_SLOTS:
|
||||
void acceptedSlot();
|
||||
void rejectedSlot();
|
||||
void finished();
|
||||
|
||||
private:
|
||||
Ui::UpdaterDialog *ui;
|
||||
MainWindow &m_mainWindow;
|
||||
QNetworkReply *m_reply;
|
||||
|
||||
QUrl m_url;
|
||||
};
|
||||
|
||||
#endif // UPDATERDIALOG_H
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>UpdateDialog</class>
|
||||
<widget class="QDialog" name="UpdateDialog">
|
||||
<class>UpdaterDialog</class>
|
||||
<widget class="QDialog" name="UpdaterDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
39
plugins/updaterplugin/updaterplugin.cpp
Normal file
39
plugins/updaterplugin/updaterplugin.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "updaterplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "zeiterfassungsettings.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
#include "updaterdialog.h"
|
||||
|
||||
UpdaterPlugin::UpdaterPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
qDebug() << "called";
|
||||
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(m_translator.load(QLocale(), QStringLiteral("updaterplugin"), QStringLiteral("_"), dir))
|
||||
{
|
||||
if(!QCoreApplication::installTranslator(&m_translator))
|
||||
{
|
||||
qWarning() << "could not install translation updaterplugin";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "could not load translation updaterplugin";
|
||||
}
|
||||
}
|
||||
|
||||
void UpdaterPlugin::attachTo(MainWindow &mainWindow)
|
||||
{
|
||||
if(mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate().isNull() ||
|
||||
mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate() < QDate::currentDate())
|
||||
new UpdaterDialog(mainWindow);
|
||||
}
|
27
plugins/updaterplugin/updaterplugin.h
Normal file
27
plugins/updaterplugin/updaterplugin.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef UPDATERPLUGIN_H
|
||||
#define UPDATERPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Q_DECL_EXPORT UpdaterPlugin : public ZeiterfassungPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "updaterplugin.json")
|
||||
Q_INTERFACES(ZeiterfassungPlugin)
|
||||
|
||||
public:
|
||||
explicit UpdaterPlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
||||
|
||||
#endif // UPDATERPLUGIN_H
|
0
plugins/updaterplugin/updaterplugin.json
Normal file
0
plugins/updaterplugin/updaterplugin.json
Normal file
37
plugins/updaterplugin/updaterplugin.pro
Normal file
37
plugins/updaterplugin/updaterplugin.pro
Normal file
@@ -0,0 +1,37 @@
|
||||
QT += core network gui widgets
|
||||
|
||||
TARGET = updaterplugin
|
||||
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 += updaterdialog.h \
|
||||
updaterplugin.h
|
||||
|
||||
SOURCES += updaterdialog.cpp \
|
||||
updaterplugin.cpp
|
||||
|
||||
FORMS += updaterdialog.ui
|
||||
|
||||
RESOURCES +=
|
||||
|
||||
TRANSLATIONS += translations/updaterplugin_en.ts \
|
||||
translations/updaterplugin_de.ts
|
||||
|
||||
OTHER_FILES += updaterplugin.json
|
||||
|
||||
include(../../lrelease.pri)
|
||||
|
||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/updaterplugin_en.qm \
|
||||
$${OUT_PWD}/translations/updaterplugin_de.qm
|
||||
|
||||
include(../copy_translations.pri)
|
32
plugins/weatherplugin/translations/weatherplugin_de.ts
Normal file
32
plugins/weatherplugin/translations/weatherplugin_de.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE">
|
||||
<context>
|
||||
<name>WeatherWidget</name>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="32"/>
|
||||
<source>Loading...</source>
|
||||
<translation>Lade...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="46"/>
|
||||
<source>Request failed</source>
|
||||
<translation>Anfrage fehlgeschlagen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="57"/>
|
||||
<source>Parsing failed</source>
|
||||
<translation>Parsen fehlgeschlagen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="63"/>
|
||||
<source>Not an json obj</source>
|
||||
<translation>Kein json obj</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="86"/>
|
||||
<source>%0 (%1°C)</source>
|
||||
<translation>%0 (%1°C)</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
32
plugins/weatherplugin/translations/weatherplugin_en.ts
Normal file
32
plugins/weatherplugin/translations/weatherplugin_en.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>WeatherWidget</name>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="32"/>
|
||||
<source>Loading...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="46"/>
|
||||
<source>Request failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="57"/>
|
||||
<source>Parsing failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="63"/>
|
||||
<source>Not an json obj</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../weatherwidget.cpp" line="86"/>
|
||||
<source>%0 (%1°C)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@@ -1,9 +1,36 @@
|
||||
#include "weatherplugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QLocale>
|
||||
#include <QStatusBar>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "weatherwidget.h"
|
||||
|
||||
WeatherPlugin::WeatherPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
{
|
||||
qDebug() << "called";
|
||||
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(m_translator.load(QLocale(), QStringLiteral("weatherplugin"), QStringLiteral("_"), dir))
|
||||
{
|
||||
if(!QCoreApplication::installTranslator(&m_translator))
|
||||
{
|
||||
qWarning() << "could not install translation weatherplugin";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "could not load translation weatherplugin";
|
||||
}
|
||||
}
|
||||
|
||||
void WeatherPlugin::attachTo(MainWindow &mainWindow)
|
||||
{
|
||||
mainWindow.statusBar()->addWidget(new WeatherWidget(mainWindow));
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#define WEATHERPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "zeiterfassungplugin.h"
|
||||
|
||||
@@ -15,6 +16,10 @@ public:
|
||||
explicit WeatherPlugin(QObject *parent = Q_NULLPTR);
|
||||
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
||||
|
||||
#endif // WEATHERPLUGIN_H
|
||||
|
@@ -14,8 +14,24 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += weatherplugin.h
|
||||
HEADERS += weatherplugin.h \
|
||||
weatherwidget.h
|
||||
|
||||
SOURCES += weatherplugin.cpp
|
||||
SOURCES += weatherplugin.cpp \
|
||||
weatherwidget.cpp
|
||||
|
||||
FORMS +=
|
||||
|
||||
RESOURCES +=
|
||||
|
||||
TRANSLATIONS += translations/weatherplugin_en.ts \
|
||||
translations/weatherplugin_de.ts
|
||||
|
||||
OTHER_FILES += weatherplugin.json
|
||||
|
||||
include(../../lrelease.pri)
|
||||
|
||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/weatherplugin_en.qm \
|
||||
$${OUT_PWD}/translations/weatherplugin_de.qm
|
||||
|
||||
include(../copy_translations.pri)
|
||||
|
92
plugins/weatherplugin/weatherwidget.cpp
Normal file
92
plugins/weatherplugin/weatherwidget.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
#include "weatherwidget.h"
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkRequest>
|
||||
#include <QUrl>
|
||||
#include <QMessageBox>
|
||||
#include <QStringBuilder>
|
||||
#include <QJsonParseError>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QJsonArray>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "zeiterfassungsettings.h"
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
WeatherWidget::WeatherWidget(MainWindow &mainWindow) :
|
||||
QLabel(&mainWindow),
|
||||
m_mainWindow(mainWindow)
|
||||
{
|
||||
setFrameShape(QFrame::Panel);
|
||||
setFrameShadow(QFrame::Sunken);
|
||||
|
||||
connect(&m_mainWindow, &MainWindow::refreshEverything, this, &WeatherWidget::refresh);
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
void WeatherWidget::refresh()
|
||||
{
|
||||
setText(tr("Loading..."));
|
||||
|
||||
auto url = m_mainWindow.settings().value(QStringLiteral("WeatherPlugin/url"),
|
||||
QStringLiteral("http://api.openweathermap.org/data/2.5/weather?q=Graz,AT&units=metric&APPID=40f6c892c6162680c6c9235169dc9f83")).toString();
|
||||
|
||||
m_reply = std::unique_ptr<QNetworkReply>(m_mainWindow.erfassung().manager()->get(QNetworkRequest(QUrl(url))));
|
||||
connect(m_reply.get(), &QNetworkReply::finished, this, &WeatherWidget::finished);
|
||||
}
|
||||
|
||||
void WeatherWidget::finished()
|
||||
{
|
||||
if(m_reply->error() != QNetworkReply::NoError)
|
||||
{
|
||||
qWarning() << m_reply->errorString();
|
||||
setText(tr("Request failed"));
|
||||
goto after;
|
||||
}
|
||||
|
||||
{
|
||||
QJsonParseError error;
|
||||
|
||||
auto document = QJsonDocument::fromJson(m_reply->readAll(), &error);
|
||||
if(error.error != QJsonParseError::NoError)
|
||||
{
|
||||
qWarning() << error.errorString();
|
||||
setText(tr("Parsing failed"));
|
||||
goto after;
|
||||
}
|
||||
|
||||
if(!document.isObject())
|
||||
{
|
||||
setText(tr("Not an json obj"));
|
||||
goto after;
|
||||
}
|
||||
|
||||
auto obj = document.object();
|
||||
|
||||
if(!obj.contains(QStringLiteral("weather")))
|
||||
{
|
||||
qWarning() << "no weather" << obj;
|
||||
setText("No weater found");
|
||||
goto after;
|
||||
}
|
||||
|
||||
if(!obj.contains(QStringLiteral("main")))
|
||||
{
|
||||
qWarning() << "no main" << obj;
|
||||
setText("No main found");
|
||||
goto after;
|
||||
}
|
||||
|
||||
auto weaterObj = obj.value(QStringLiteral("weather")).toArray();
|
||||
auto mainObj = obj.value(QStringLiteral("main")).toObject();
|
||||
|
||||
setText(tr("%0 (%1°C)").arg(weaterObj.first().toObject().value(QStringLiteral("main")).toString())
|
||||
.arg(mainObj.value(QStringLiteral("temp")).toDouble()));
|
||||
}
|
||||
|
||||
after:
|
||||
m_reply = Q_NULLPTR;
|
||||
}
|
28
plugins/weatherplugin/weatherwidget.h
Normal file
28
plugins/weatherplugin/weatherwidget.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef WEATHERWIDGET_H
|
||||
#define WEATHERWIDGET_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QNetworkReply>
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class WeatherWidget : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WeatherWidget(MainWindow &mainWindow);
|
||||
|
||||
private Q_SLOTS:
|
||||
void refresh();
|
||||
void finished();
|
||||
|
||||
private:
|
||||
MainWindow &m_mainWindow;
|
||||
|
||||
std::unique_ptr<QNetworkReply> m_reply;
|
||||
};
|
||||
|
||||
#endif // WEATHERWIDGET_H
|
@@ -1,6 +1,5 @@
|
||||
#include <QApplication>
|
||||
#include <QTranslator>
|
||||
#include <QEventLoop>
|
||||
#include <QMessageBox>
|
||||
#include <QSplashScreen>
|
||||
#include <QPixmap>
|
||||
@@ -35,14 +34,11 @@ struct {
|
||||
|
||||
QVector<ZeiterfassungPlugin*> plugins;
|
||||
|
||||
bool loadAndInstallTranslator(QTranslator &translator,
|
||||
const QLocale &locale,
|
||||
const QString &filename,
|
||||
const QString &prefix = QString(),
|
||||
const QString &directory = QString(),
|
||||
const QString &suffix = QString())
|
||||
bool loadAndInstallTranslator(QTranslator &translator, const QString &filename)
|
||||
{
|
||||
if(!translator.load(locale, filename, prefix, directory, suffix))
|
||||
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
|
||||
if(!translator.load(QLocale(), filename, QStringLiteral("_"), dir))
|
||||
{
|
||||
qWarning() << "could not load translation" << filename;
|
||||
return false;
|
||||
@@ -80,13 +76,11 @@ bool loadTranslations(QSplashScreen &splashScreen, ZeiterfassungSettings &settin
|
||||
settings.setLanguage(dialog.language());
|
||||
}
|
||||
|
||||
QLocale locale(settings.language(), QLocale::Austria);
|
||||
QLocale::setDefault(locale);
|
||||
QLocale::setDefault(QLocale(settings.language(), QLocale::Austria));
|
||||
|
||||
auto translationsDir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||
loadAndInstallTranslator(translators.qtTranslator, locale, QStringLiteral("qt"), QStringLiteral("_"), translationsDir);
|
||||
loadAndInstallTranslator(translators.zeiterfassungTranslator, locale, QStringLiteral("zeiterfassung"), QStringLiteral("_"), translationsDir);
|
||||
loadAndInstallTranslator(translators.zeiterfassunglibTranslator, locale, QStringLiteral("zeiterfassunglib"), QStringLiteral("_"), translationsDir);
|
||||
loadAndInstallTranslator(translators.qtTranslator, QStringLiteral("qt"));
|
||||
loadAndInstallTranslator(translators.zeiterfassungTranslator, QStringLiteral("zeiterfassung"));
|
||||
loadAndInstallTranslator(translators.zeiterfassunglibTranslator, QStringLiteral("zeiterfassunglib"));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -175,11 +169,7 @@ bool loadLoginPage(QSplashScreen &splashScreen, ZeiterfassungSettings &settings,
|
||||
again:
|
||||
auto reply = erfassung.doLoginPage();
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
QObject::connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(!reply->success())
|
||||
{
|
||||
@@ -222,11 +212,7 @@ bool doAuthentication(QSplashScreen &splashScreen, ZeiterfassungSettings &settin
|
||||
again:
|
||||
auto reply = erfassung.doLogin(settings.username(), settings.password());
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
QObject::connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(!reply->success())
|
||||
{
|
||||
@@ -257,11 +243,7 @@ bool loadUserInfo(QSplashScreen &splashScreen, ZeiterfassungApi &erfassung, GetU
|
||||
{
|
||||
auto reply = erfassung.doUserInfo();
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
QObject::connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(!reply->success())
|
||||
{
|
||||
@@ -291,10 +273,18 @@ bool loadPlugins(QSplashScreen &splashScreen)
|
||||
for(const auto &fileInfo : dir.entryInfoList(QDir::Files))
|
||||
{
|
||||
if(fileInfo.isSymLink())
|
||||
{
|
||||
qWarning() << "skipping" << fileInfo.fileName() << "because symlink";
|
||||
continue; // to skip unix so symlinks
|
||||
}
|
||||
|
||||
if(!QLibrary::isLibrary(fileInfo.filePath()))
|
||||
{
|
||||
qWarning() << "skipping" << fileInfo.fileName() << "because no QLibrary";
|
||||
continue; // to skip windows junk files
|
||||
}
|
||||
|
||||
qDebug() << "loading" << fileInfo.fileName();
|
||||
|
||||
QPluginLoader loader(fileInfo.filePath());
|
||||
if(!loader.load())
|
||||
|
@@ -20,113 +20,113 @@
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="347"/>
|
||||
<location filename="../main.cpp" line="337"/>
|
||||
<source>Loading settings...</source>
|
||||
<translation>Lade Einstellungen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="62"/>
|
||||
<location filename="../main.cpp" line="58"/>
|
||||
<source>Loading translations...</source>
|
||||
<translation>Lade Übersetzungen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="74"/>
|
||||
<location filename="../main.cpp" line="75"/>
|
||||
<location filename="../main.cpp" line="70"/>
|
||||
<location filename="../main.cpp" line="71"/>
|
||||
<source>Invalid language selection!</source>
|
||||
<translation>Ungültige Sprachauswahl!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="76"/>
|
||||
<location filename="../main.cpp" line="72"/>
|
||||
<source>You did not select a valid language!</source>
|
||||
<translation>Sie haben keine gültige Sprachauswahl getroffen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="96"/>
|
||||
<location filename="../main.cpp" line="90"/>
|
||||
<source>Loading theme...</source>
|
||||
<translation>Lade Aussehen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="107"/>
|
||||
<location filename="../main.cpp" line="108"/>
|
||||
<location filename="../main.cpp" line="115"/>
|
||||
<location filename="../main.cpp" line="116"/>
|
||||
<location filename="../main.cpp" line="101"/>
|
||||
<location filename="../main.cpp" line="102"/>
|
||||
<location filename="../main.cpp" line="109"/>
|
||||
<location filename="../main.cpp" line="110"/>
|
||||
<source>Could not load theme!</source>
|
||||
<translation>Konnte Aussehen nicht laden!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="109"/>
|
||||
<location filename="../main.cpp" line="103"/>
|
||||
<source>Theme file does not exist!</source>
|
||||
<translation>Aussehen-Datei existiert nicht!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="173"/>
|
||||
<location filename="../main.cpp" line="167"/>
|
||||
<source>Loading login page...</source>
|
||||
<translation>Lade Login-Seite...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="186"/>
|
||||
<location filename="../main.cpp" line="187"/>
|
||||
<location filename="../main.cpp" line="176"/>
|
||||
<location filename="../main.cpp" line="177"/>
|
||||
<source>Could not access Zeiterfassung!</source>
|
||||
<translation>Konnte Zeiterfassung nicht erreichen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="190"/>
|
||||
<location filename="../main.cpp" line="180"/>
|
||||
<source>Base url</source>
|
||||
<translation>Basis URL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="191"/>
|
||||
<location filename="../main.cpp" line="181"/>
|
||||
<source>Please enter the base url to the Zeiterfassung:</source>
|
||||
<translation>Bitte geben Sie die Basis URL zur Zeiterfassung ein:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="208"/>
|
||||
<location filename="../main.cpp" line="198"/>
|
||||
<source>Authenticating...</source>
|
||||
<translation>Authentifiziere...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="233"/>
|
||||
<location filename="../main.cpp" line="234"/>
|
||||
<location filename="../main.cpp" line="219"/>
|
||||
<location filename="../main.cpp" line="220"/>
|
||||
<source>Could not authenticate with Zeiterfassung!</source>
|
||||
<translation>Konnte nicht mit Zeiterfassung authentifizieren!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="255"/>
|
||||
<location filename="../main.cpp" line="241"/>
|
||||
<source>Getting user information...</source>
|
||||
<translation>Hole Benutzer Information...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="268"/>
|
||||
<location filename="../main.cpp" line="269"/>
|
||||
<location filename="../main.cpp" line="250"/>
|
||||
<location filename="../main.cpp" line="251"/>
|
||||
<source>Could not get user information!</source>
|
||||
<translation>Konnte Benutzer Information nicht holen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="302"/>
|
||||
<location filename="../main.cpp" line="303"/>
|
||||
<location filename="../main.cpp" line="292"/>
|
||||
<location filename="../main.cpp" line="293"/>
|
||||
<source>Could not load plugin %0!</source>
|
||||
<translation>Konnte Plugin %0 nicht laden!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="313"/>
|
||||
<location filename="../main.cpp" line="314"/>
|
||||
<location filename="../main.cpp" line="303"/>
|
||||
<location filename="../main.cpp" line="304"/>
|
||||
<source>Plugin not valid %0!</source>
|
||||
<translation>Plugin %0 nicht gültig!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="129"/>
|
||||
<location filename="../main.cpp" line="123"/>
|
||||
<source>Loading strip layouts...</source>
|
||||
<translation>Lade Streifenlayouts...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="133"/>
|
||||
<location filename="../main.cpp" line="134"/>
|
||||
<location filename="../main.cpp" line="142"/>
|
||||
<location filename="../main.cpp" line="143"/>
|
||||
<location filename="../main.cpp" line="152"/>
|
||||
<location filename="../main.cpp" line="153"/>
|
||||
<location filename="../main.cpp" line="162"/>
|
||||
<location filename="../main.cpp" line="163"/>
|
||||
<location filename="../main.cpp" line="127"/>
|
||||
<location filename="../main.cpp" line="128"/>
|
||||
<location filename="../main.cpp" line="136"/>
|
||||
<location filename="../main.cpp" line="137"/>
|
||||
<location filename="../main.cpp" line="146"/>
|
||||
<location filename="../main.cpp" line="147"/>
|
||||
<location filename="../main.cpp" line="156"/>
|
||||
<location filename="../main.cpp" line="157"/>
|
||||
<source>Could not load strips!</source>
|
||||
<translation>Konnte Streifenlayouts nicht laden!</translation>
|
||||
</message>
|
||||
|
@@ -20,113 +20,113 @@
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="347"/>
|
||||
<location filename="../main.cpp" line="337"/>
|
||||
<source>Loading settings...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="62"/>
|
||||
<location filename="../main.cpp" line="58"/>
|
||||
<source>Loading translations...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="74"/>
|
||||
<location filename="../main.cpp" line="75"/>
|
||||
<location filename="../main.cpp" line="70"/>
|
||||
<location filename="../main.cpp" line="71"/>
|
||||
<source>Invalid language selection!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="76"/>
|
||||
<location filename="../main.cpp" line="72"/>
|
||||
<source>You did not select a valid language!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="96"/>
|
||||
<location filename="../main.cpp" line="90"/>
|
||||
<source>Loading theme...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="107"/>
|
||||
<location filename="../main.cpp" line="108"/>
|
||||
<location filename="../main.cpp" line="115"/>
|
||||
<location filename="../main.cpp" line="116"/>
|
||||
<location filename="../main.cpp" line="101"/>
|
||||
<location filename="../main.cpp" line="102"/>
|
||||
<location filename="../main.cpp" line="109"/>
|
||||
<location filename="../main.cpp" line="110"/>
|
||||
<source>Could not load theme!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="109"/>
|
||||
<location filename="../main.cpp" line="103"/>
|
||||
<source>Theme file does not exist!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="173"/>
|
||||
<location filename="../main.cpp" line="167"/>
|
||||
<source>Loading login page...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="186"/>
|
||||
<location filename="../main.cpp" line="187"/>
|
||||
<location filename="../main.cpp" line="176"/>
|
||||
<location filename="../main.cpp" line="177"/>
|
||||
<source>Could not access Zeiterfassung!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="190"/>
|
||||
<location filename="../main.cpp" line="180"/>
|
||||
<source>Base url</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="191"/>
|
||||
<location filename="../main.cpp" line="181"/>
|
||||
<source>Please enter the base url to the Zeiterfassung:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="208"/>
|
||||
<location filename="../main.cpp" line="198"/>
|
||||
<source>Authenticating...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="233"/>
|
||||
<location filename="../main.cpp" line="234"/>
|
||||
<location filename="../main.cpp" line="219"/>
|
||||
<location filename="../main.cpp" line="220"/>
|
||||
<source>Could not authenticate with Zeiterfassung!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="255"/>
|
||||
<location filename="../main.cpp" line="241"/>
|
||||
<source>Getting user information...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="268"/>
|
||||
<location filename="../main.cpp" line="269"/>
|
||||
<location filename="../main.cpp" line="250"/>
|
||||
<location filename="../main.cpp" line="251"/>
|
||||
<source>Could not get user information!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="302"/>
|
||||
<location filename="../main.cpp" line="303"/>
|
||||
<location filename="../main.cpp" line="292"/>
|
||||
<location filename="../main.cpp" line="293"/>
|
||||
<source>Could not load plugin %0!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="313"/>
|
||||
<location filename="../main.cpp" line="314"/>
|
||||
<location filename="../main.cpp" line="303"/>
|
||||
<location filename="../main.cpp" line="304"/>
|
||||
<source>Plugin not valid %0!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="129"/>
|
||||
<location filename="../main.cpp" line="123"/>
|
||||
<source>Loading strip layouts...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="133"/>
|
||||
<location filename="../main.cpp" line="134"/>
|
||||
<location filename="../main.cpp" line="142"/>
|
||||
<location filename="../main.cpp" line="143"/>
|
||||
<location filename="../main.cpp" line="152"/>
|
||||
<location filename="../main.cpp" line="153"/>
|
||||
<location filename="../main.cpp" line="162"/>
|
||||
<location filename="../main.cpp" line="163"/>
|
||||
<location filename="../main.cpp" line="127"/>
|
||||
<location filename="../main.cpp" line="128"/>
|
||||
<location filename="../main.cpp" line="136"/>
|
||||
<location filename="../main.cpp" line="137"/>
|
||||
<location filename="../main.cpp" line="146"/>
|
||||
<location filename="../main.cpp" line="147"/>
|
||||
<location filename="../main.cpp" line="156"/>
|
||||
<location filename="../main.cpp" line="157"/>
|
||||
<source>Could not load strips!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@@ -1 +1,3 @@
|
||||
#!/bin/bash
|
||||
cd "${0%/*}"
|
||||
LD_LIBRARY_PATH=../lib ./zeiterfassung
|
||||
|
@@ -1,35 +0,0 @@
|
||||
#ifndef UPDATEDIALOG_H
|
||||
#define UPDATEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QUrl>
|
||||
|
||||
#include "zeiterfassunglib_global.h"
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
|
||||
class ZeiterfassungSettings;
|
||||
namespace Ui { class UpdateDialog; }
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT UpdateDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit UpdateDialog(ZeiterfassungSettings &settings, QNetworkAccessManager *manager, QWidget *parent = Q_NULLPTR);
|
||||
~UpdateDialog();
|
||||
|
||||
private Q_SLOTS:
|
||||
void finished();
|
||||
void submit();
|
||||
|
||||
private:
|
||||
Ui::UpdateDialog *ui;
|
||||
ZeiterfassungSettings &m_settings;
|
||||
QNetworkReply *m_reply;
|
||||
|
||||
QUrl m_url;
|
||||
};
|
||||
|
||||
#endif // UPDATEDIALOG_H
|
@@ -7,7 +7,6 @@
|
||||
#include <QTimer>
|
||||
#include <QStringBuilder>
|
||||
#include <QMenu>
|
||||
#include <QEventLoop>
|
||||
#include <QLabel>
|
||||
#include <QDir>
|
||||
#include <QTemporaryFile>
|
||||
@@ -22,9 +21,7 @@
|
||||
#include "stripswidget.h"
|
||||
#include "dialogs/aboutmedialog.h"
|
||||
#include "dialogs/settingsdialog.h"
|
||||
#include "dialogs/updatedialog.h"
|
||||
#include "replies/getprojectsreply.h"
|
||||
#include "replies/getauswertungreply.h"
|
||||
#include "replies/createbookingreply.h"
|
||||
#include "replies/createtimeassignmentreply.h"
|
||||
#include "replies/updatetimeassignmentreply.h"
|
||||
@@ -37,19 +34,10 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
||||
m_erfassung(erfassung),
|
||||
m_userInfo(userInfo),
|
||||
m_stripFactory(stripFactory),
|
||||
m_getProjectsReply(Q_NULLPTR),
|
||||
m_getAuswertungReply(Q_NULLPTR),
|
||||
m_currentStripWidget(Q_NULLPTR)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
for(quint8 i = 0; i < 7; i++)
|
||||
{
|
||||
m_stripsWidgets[i] = new StripsWidget(*this, ui->widgetWeek);
|
||||
connect(m_stripsWidgets[i], &StripsWidget::refreshingChanged, this, &MainWindow::refreshingChanged);
|
||||
ui->layoutWeek->addWidget(m_stripsWidgets[i]);
|
||||
}
|
||||
|
||||
setWindowTitle(tr("Zeiterfassung - %0 (%1)").arg(m_userInfo.text).arg(m_userInfo.email));
|
||||
|
||||
ui->actionQuit->setShortcut(QKeySequence::Quit);
|
||||
@@ -57,9 +45,7 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
||||
connect(ui->actionToday, &QAction::triggered, [=](){ ui->dateEditDate->setDate(QDate::currentDate()); });
|
||||
|
||||
ui->actionRefresh->setShortcut(QKeySequence::Refresh);
|
||||
connect(ui->actionRefresh, &QAction::triggered, this, [=](){ dateChanged(true); });
|
||||
|
||||
connect(ui->actionAuswertung, &QAction::triggered, this, &MainWindow::openAuswertung);
|
||||
connect(ui->actionRefresh, &QAction::triggered, this, &MainWindow::refreshEverything);
|
||||
|
||||
connect(ui->actionAboutMe, &QAction::triggered, [=](){ AboutMeDialog(userInfo, this).exec(); });
|
||||
connect(ui->actionSettings, &QAction::triggered, [=](){ SettingsDialog(m_settings, this).exec(); });
|
||||
@@ -69,7 +55,7 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
||||
connect(ui->actionAboutQt, &QAction::triggered, [=](){ QMessageBox::aboutQt(this); });
|
||||
|
||||
ui->dateEditDate->setDate(QDate::currentDate());
|
||||
connect(ui->dateEditDate, &QDateTimeEdit::dateChanged, this, [=](){ dateChanged(false); });
|
||||
connect(ui->dateEditDate, &QDateTimeEdit::dateChanged, this, &MainWindow::dateChangedSlot);
|
||||
|
||||
connect(ui->pushButtonPrev, &QAbstractButton::pressed, [=](){ ui->dateEditDate->setDate(ui->dateEditDate->date().addDays(-1)); });
|
||||
connect(ui->pushButtonNext, &QAbstractButton::pressed, [=](){ ui->dateEditDate->setDate(ui->dateEditDate->date().addDays(1)); });
|
||||
@@ -90,17 +76,14 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
||||
connect(ui->pushButtonStart, &QAbstractButton::pressed, this, &MainWindow::pushButtonStartPressed);
|
||||
connect(ui->pushButtonEnd, &QAbstractButton::pressed, this, &MainWindow::pushButtonEndPressed);
|
||||
|
||||
ui->statusbar->addPermanentWidget(m_balanceLabel = new QLabel(ui->statusbar));
|
||||
m_balanceLabel->setFrameShape(QFrame::Panel);
|
||||
m_balanceLabel->setFrameShadow(QFrame::Sunken);
|
||||
ui->statusbar->addPermanentWidget(m_holidaysLabel = new QLabel(ui->statusbar));
|
||||
m_holidaysLabel->setFrameShape(QFrame::Panel);
|
||||
m_holidaysLabel->setFrameShadow(QFrame::Sunken);
|
||||
for(quint8 i = 0; i < 7; i++)
|
||||
{
|
||||
m_stripsWidgets[i] = new StripsWidget(*this, ui->widgetWeek);
|
||||
connect(this, &MainWindow::refreshEverything, m_stripsWidgets[i], &StripsWidget::refresh);
|
||||
ui->layoutWeek->addWidget(m_stripsWidgets[i]);
|
||||
}
|
||||
|
||||
dateChanged();
|
||||
|
||||
if(settings.lastUpdateCheck().isNull() || settings.lastUpdateCheck() < QDate::currentDate())
|
||||
new UpdateDialog(settings, erfassung.manager(), this);
|
||||
dateChangedSlot(ui->dateEditDate->date());
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@@ -128,6 +111,11 @@ QMenu *MainWindow::menuAbout() const
|
||||
return ui->menuAbout;
|
||||
}
|
||||
|
||||
QToolBar *MainWindow::toolBar() const
|
||||
{
|
||||
return ui->mainToolBar;
|
||||
}
|
||||
|
||||
ZeiterfassungSettings &MainWindow::settings() const
|
||||
{
|
||||
return m_settings;
|
||||
@@ -148,6 +136,16 @@ StripFactory &MainWindow::stripFactory() const
|
||||
return m_stripFactory;
|
||||
}
|
||||
|
||||
QDate MainWindow::date() const
|
||||
{
|
||||
return ui->dateEditDate->date();
|
||||
}
|
||||
|
||||
void MainWindow::setDate(const QDate &date)
|
||||
{
|
||||
ui->dateEditDate->setDate(date);
|
||||
}
|
||||
|
||||
const QMap<QString, QString> &MainWindow::projects() const
|
||||
{
|
||||
return m_projects;
|
||||
@@ -176,66 +174,6 @@ void MainWindow::getProjectsFinished()
|
||||
m_getProjectsReply = Q_NULLPTR;
|
||||
}
|
||||
|
||||
void MainWindow::getAuswertungFinished()
|
||||
{
|
||||
if(std::none_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget){
|
||||
return stripsWidget->refreshing();
|
||||
}))
|
||||
{
|
||||
ui->actionToday->setEnabled(true);
|
||||
ui->actionRefresh->setEnabled(true);
|
||||
ui->dateEditDate->setReadOnly(false);
|
||||
ui->pushButtonPrev->setEnabled(true);
|
||||
ui->pushButtonNext->setEnabled(true);
|
||||
}
|
||||
|
||||
if(!m_getAuswertungReply->success())
|
||||
{
|
||||
m_auswertungDate = QDate();
|
||||
QMessageBox::warning(this, tr("Could not load Auswertung!"), tr("Could not load Auswertung!") % "\n\n" % m_getAuswertungReply->message());
|
||||
m_getAuswertungReply = Q_NULLPTR;
|
||||
return;
|
||||
}
|
||||
|
||||
ui->actionAuswertung->setEnabled(true);
|
||||
m_auswertung = m_getAuswertungReply->auswertung();
|
||||
|
||||
auto urlaubsAnspruch = tr("n/a");
|
||||
|
||||
{
|
||||
static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)"));
|
||||
auto match = regex.match(m_auswertung);
|
||||
if(match.hasMatch())
|
||||
urlaubsAnspruch = match.captured(2);
|
||||
else
|
||||
qWarning() << "Urlaubsanspruch not found";
|
||||
}
|
||||
|
||||
auto gleitzeit = tr("n/a");
|
||||
|
||||
{
|
||||
static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)"));
|
||||
auto match = regex.match(m_auswertung);
|
||||
if(match.hasMatch())
|
||||
{
|
||||
gleitzeit = match.captured(2);
|
||||
if(gleitzeit.endsWith(QChar('-')))
|
||||
{
|
||||
gleitzeit.chop(1);
|
||||
gleitzeit = QChar('-') % gleitzeit;
|
||||
}
|
||||
gleitzeit = tr("%0h").arg(gleitzeit);
|
||||
}
|
||||
else
|
||||
qWarning() << "Gleitzeit not found";
|
||||
}
|
||||
|
||||
m_balanceLabel->setText(tr("%0: %1").arg(tr("Balance")).arg(gleitzeit));
|
||||
m_holidaysLabel->setText(tr("%0: %1").arg(tr("Holidays")).arg(urlaubsAnspruch));
|
||||
|
||||
m_getAuswertungReply = Q_NULLPTR;
|
||||
}
|
||||
|
||||
void MainWindow::pushButtonStartPressed()
|
||||
{
|
||||
auto bookingsChanged = false;
|
||||
@@ -247,11 +185,7 @@ void MainWindow::pushButtonStartPressed()
|
||||
timeNormalise(ui->timeEditTime->time()), QTime(0, 0),
|
||||
QStringLiteral("K"), QStringLiteral(""));
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(!reply->success())
|
||||
{
|
||||
@@ -277,11 +211,7 @@ void MainWindow::pushButtonStartPressed()
|
||||
timeAssignment.project, timeAssignment.subproject,
|
||||
timeAssignment.workpackage, timeAssignment.text);
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(reply->success())
|
||||
timeAssignmentTime = timeAdd(timeAssignmentTime, timespan);
|
||||
@@ -300,11 +230,7 @@ void MainWindow::pushButtonStartPressed()
|
||||
ui->comboBoxProject->currentData().toString(), ui->comboBoxSubproject->currentText(),
|
||||
ui->comboBoxWorkpackage->currentText(), ui->comboBoxText->currentText());
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(!reply->success())
|
||||
{
|
||||
@@ -324,8 +250,7 @@ void MainWindow::pushButtonStartPressed()
|
||||
if(bookingsChanged)
|
||||
{
|
||||
m_currentStripWidget->refresh();
|
||||
|
||||
refreshAuswertung();
|
||||
//refreshReport();
|
||||
}
|
||||
else
|
||||
m_currentStripWidget->refreshTimeAssignments();
|
||||
@@ -350,11 +275,7 @@ void MainWindow::pushButtonEndPressed()
|
||||
timeAssignment.project, timeAssignment.subproject,
|
||||
timeAssignment.workpackage, timeAssignment.text);
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), SIGNAL(finished()), &eventLoop, SLOT(quit()));
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(!reply->success())
|
||||
{
|
||||
@@ -369,11 +290,7 @@ void MainWindow::pushButtonEndPressed()
|
||||
timeNormalise(ui->timeEditTime->time()), QTime(0, 0),
|
||||
QStringLiteral("G"), QStringLiteral(""));
|
||||
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
reply->waitForFinished();
|
||||
|
||||
if(!reply->success())
|
||||
{
|
||||
@@ -384,7 +301,7 @@ void MainWindow::pushButtonEndPressed()
|
||||
}
|
||||
|
||||
m_currentStripWidget->refresh();
|
||||
refreshAuswertung();
|
||||
//refreshReport();
|
||||
|
||||
ui->actionToday->setEnabled(false);
|
||||
ui->actionRefresh->setEnabled(false);
|
||||
@@ -393,18 +310,17 @@ void MainWindow::pushButtonEndPressed()
|
||||
ui->pushButtonNext->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainWindow::dateChanged(bool force)
|
||||
void MainWindow::dateChangedSlot(const QDate &date)
|
||||
{
|
||||
auto firstDayOfWeek = ui->dateEditDate->date().addDays(-(ui->dateEditDate->date().dayOfWeek() - 1));
|
||||
auto firstDayOfWeek = date.addDays(-(ui->dateEditDate->date().dayOfWeek() - 1));
|
||||
|
||||
for(quint8 i = 0; i < 7; i++)
|
||||
{
|
||||
auto date = firstDayOfWeek.addDays(i);
|
||||
auto weekDay = firstDayOfWeek.addDays(i);
|
||||
|
||||
if(force || m_stripsWidgets[i]->date() != date)
|
||||
m_stripsWidgets[i]->setDate(date);
|
||||
m_stripsWidgets[i]->setDate(weekDay);
|
||||
|
||||
if(date == ui->dateEditDate->date() && (force || m_currentStripWidget != m_stripsWidgets[i]))
|
||||
if(weekDay == date && m_currentStripWidget != m_stripsWidgets[i])
|
||||
{
|
||||
if(m_currentStripWidget)
|
||||
{
|
||||
@@ -425,39 +341,7 @@ void MainWindow::dateChanged(bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if(force || m_auswertungDate != QDate(ui->dateEditDate->date().year(), ui->dateEditDate->date().month(), 1))
|
||||
refreshAuswertung();
|
||||
|
||||
if(std::any_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget) {
|
||||
return stripsWidget->refreshing();
|
||||
}) || m_getAuswertungReply)
|
||||
{
|
||||
ui->actionToday->setEnabled(false);
|
||||
ui->actionRefresh->setEnabled(false);
|
||||
ui->dateEditDate->setReadOnly(true);
|
||||
ui->pushButtonPrev->setEnabled(false);
|
||||
ui->pushButtonNext->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::openAuswertung()
|
||||
{
|
||||
QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("auswertungXXXXXX.pdf")));
|
||||
file.setAutoRemove(false);
|
||||
if(!file.open())
|
||||
{
|
||||
QMessageBox::warning(this, tr("Could not open auswertung!"), tr("Could not open auswertung!") % "\n\n" % file.errorString());
|
||||
return;
|
||||
}
|
||||
|
||||
file.write(m_auswertung);
|
||||
file.close();
|
||||
|
||||
if(!QDesktopServices::openUrl(QUrl::fromLocalFile(file.fileName())))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Could not open auswertung!"), tr("Could not open default PDF viewer!"));
|
||||
return;
|
||||
}
|
||||
Q_EMIT dateChanged(ui->dateEditDate->date());
|
||||
}
|
||||
|
||||
void MainWindow::minimumTimeChanged()
|
||||
@@ -465,24 +349,6 @@ void MainWindow::minimumTimeChanged()
|
||||
ui->timeEditTime->setMinimumTime(m_currentStripWidget->minimumTime());
|
||||
}
|
||||
|
||||
void MainWindow::refreshingChanged()
|
||||
{
|
||||
if(m_getAuswertungReply)
|
||||
return;
|
||||
|
||||
{
|
||||
auto allFinished = std::none_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget){
|
||||
return stripsWidget->refreshing();
|
||||
});
|
||||
|
||||
ui->actionToday->setEnabled(allFinished);
|
||||
ui->actionRefresh->setEnabled(allFinished);
|
||||
ui->dateEditDate->setReadOnly(!allFinished);
|
||||
ui->pushButtonPrev->setEnabled(allFinished);
|
||||
ui->pushButtonNext->setEnabled(allFinished);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::startEnabledChanged()
|
||||
{
|
||||
auto startEnabled = m_currentStripWidget->startEnabled();
|
||||
@@ -512,19 +378,6 @@ void MainWindow::endEnabledChanged()
|
||||
ui->pushButtonEnd->setEnabled(endEnabled);
|
||||
}
|
||||
|
||||
void MainWindow::refreshAuswertung()
|
||||
{
|
||||
m_balanceLabel->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("???")));
|
||||
m_holidaysLabel->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("???")));
|
||||
|
||||
ui->actionAuswertung->setEnabled(false);
|
||||
m_auswertung.clear();
|
||||
|
||||
m_auswertungDate = QDate(ui->dateEditDate->date().year(), ui->dateEditDate->date().month(), 1);
|
||||
m_getAuswertungReply = m_erfassung.doGetAuswertung(m_userInfo.userId, m_auswertungDate);
|
||||
connect(m_getAuswertungReply.get(), &ZeiterfassungReply::finished, this, &MainWindow::getAuswertungFinished);
|
||||
}
|
||||
|
||||
void MainWindow::updateComboboxes()
|
||||
{
|
||||
ui->comboBoxProject->clear();
|
||||
|
@@ -9,9 +9,10 @@
|
||||
#include "zeiterfassunglib_global.h"
|
||||
#include "replies/getuserinforeply.h"
|
||||
#include "replies/getprojectsreply.h"
|
||||
#include "replies/getauswertungreply.h"
|
||||
#include "replies/getpresencestatusreply.h"
|
||||
|
||||
class QMenu;
|
||||
class QToolBar;
|
||||
class QLabel;
|
||||
class QBoxLayout;
|
||||
|
||||
@@ -19,8 +20,6 @@ namespace Ui { class MainWindow; }
|
||||
class ZeiterfassungSettings;
|
||||
class StripFactory;
|
||||
class StripsWidget;
|
||||
class BookingsModel;
|
||||
class TimeAssignmentsModel;
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT MainWindow : public QMainWindow
|
||||
{
|
||||
@@ -35,30 +34,34 @@ public:
|
||||
QMenu *menuView() const;
|
||||
QMenu *menuTools() const;
|
||||
QMenu *menuAbout() const;
|
||||
QToolBar *toolBar() const;
|
||||
|
||||
ZeiterfassungSettings &settings() const;
|
||||
ZeiterfassungApi &erfassung() const;
|
||||
const GetUserInfoReply::UserInfo &userInfo() const;
|
||||
StripFactory &stripFactory() const;
|
||||
|
||||
QDate date() const;
|
||||
void setDate(const QDate &date);
|
||||
|
||||
const QMap<QString, QString> &projects() const;
|
||||
const std::array<StripsWidget*, 7> &stripsWidgets() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void dateChanged(const QDate &date);
|
||||
void refreshEverything();
|
||||
|
||||
private Q_SLOTS:
|
||||
void getProjectsFinished();
|
||||
void getAuswertungFinished();
|
||||
void pushButtonStartPressed();
|
||||
void pushButtonEndPressed();
|
||||
void dateChanged(bool force = false);
|
||||
void openAuswertung();
|
||||
void dateChangedSlot(const QDate &date);
|
||||
|
||||
void minimumTimeChanged();
|
||||
void refreshingChanged();
|
||||
void startEnabledChanged();
|
||||
void endEnabledChanged();
|
||||
|
||||
private:
|
||||
void refreshAuswertung();
|
||||
void updateComboboxes();
|
||||
|
||||
Ui::MainWindow *ui;
|
||||
@@ -68,19 +71,9 @@ private:
|
||||
StripFactory &m_stripFactory;
|
||||
|
||||
std::unique_ptr<GetProjectsReply> m_getProjectsReply;
|
||||
std::unique_ptr<GetAuswertungReply> m_getAuswertungReply;
|
||||
|
||||
BookingsModel *m_bookingsModel;
|
||||
TimeAssignmentsModel *m_timeAssignmentsModel;
|
||||
|
||||
QMap<QString, QString> m_projects;
|
||||
|
||||
QDate m_auswertungDate;
|
||||
QByteArray m_auswertung;
|
||||
|
||||
QLabel *m_balanceLabel;
|
||||
QLabel *m_holidaysLabel;
|
||||
|
||||
std::array<StripsWidget*, 7> m_stripsWidgets;
|
||||
StripsWidget *m_currentStripWidget;
|
||||
};
|
||||
|
@@ -229,7 +229,6 @@
|
||||
<property name="title">
|
||||
<string>&Tools</string>
|
||||
</property>
|
||||
<addaction name="actionAuswertung"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuView"/>
|
||||
@@ -245,8 +244,6 @@
|
||||
</attribute>
|
||||
<addaction name="actionToday"/>
|
||||
<addaction name="actionRefresh"/>
|
||||
<addaction name="actionAuswertung"/>
|
||||
<addaction name="actionSettings"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionQuit">
|
||||
@@ -299,15 +296,6 @@
|
||||
<string>&Refresh everything</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAuswertung">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/zeiterfassunglib/images/auswertung.png</normaloff>:/zeiterfassunglib/images/auswertung.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Auswertung</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSettings">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
|
@@ -1,30 +0,0 @@
|
||||
#ifndef GETAUSWERTUNGREPLY_H
|
||||
#define GETAUSWERTUNGREPLY_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QNetworkReply>
|
||||
#include <QByteArray>
|
||||
|
||||
#include "zeiterfassunglib_global.h"
|
||||
#include "zeiterfassungreply.h"
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT GetAuswertungReply : public ZeiterfassungReply
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GetAuswertungReply(std::unique_ptr<QNetworkReply> &&reply, ZeiterfassungApi *zeiterfassung);
|
||||
|
||||
const QByteArray &auswertung() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void request0Finished();
|
||||
void request1Finished();
|
||||
|
||||
private:
|
||||
std::unique_ptr<QNetworkReply> m_reply;
|
||||
QByteArray m_auswertung;
|
||||
};
|
||||
|
||||
#endif // GETAUSWERTUNGREPLY_H
|
@@ -1,20 +1,20 @@
|
||||
#include "getauswertungreply.h"
|
||||
#include "getreportreply.h"
|
||||
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
GetAuswertungReply::GetAuswertungReply(std::unique_ptr<QNetworkReply> &&reply, ZeiterfassungApi *zeiterfassung) :
|
||||
GetReportReply::GetReportReply(std::unique_ptr<QNetworkReply> &&reply, ZeiterfassungApi *zeiterfassung) :
|
||||
ZeiterfassungReply(zeiterfassung),
|
||||
m_reply(std::move(reply))
|
||||
{
|
||||
connect(m_reply.get(), &QNetworkReply::finished, this, &GetAuswertungReply::request0Finished);
|
||||
connect(m_reply.get(), &QNetworkReply::finished, this, &GetReportReply::request0Finished);
|
||||
}
|
||||
|
||||
const QByteArray &GetAuswertungReply::auswertung() const
|
||||
const QByteArray &GetReportReply::content() const
|
||||
{
|
||||
return m_auswertung;
|
||||
return m_content;
|
||||
}
|
||||
|
||||
void GetAuswertungReply::request0Finished()
|
||||
void GetReportReply::request0Finished()
|
||||
{
|
||||
if(m_reply->error() != QNetworkReply::NoError)
|
||||
{
|
||||
@@ -29,10 +29,10 @@ void GetAuswertungReply::request0Finished()
|
||||
url.setPath(QString(m_reply->readAll()));
|
||||
|
||||
m_reply = std::unique_ptr<QNetworkReply>(zeiterfassung()->manager()->get(QNetworkRequest(url)));
|
||||
connect(m_reply.get(), &QNetworkReply::finished, this, &GetAuswertungReply::request1Finished);
|
||||
connect(m_reply.get(), &QNetworkReply::finished, this, &GetReportReply::request1Finished);
|
||||
}
|
||||
|
||||
void GetAuswertungReply::request1Finished()
|
||||
void GetReportReply::request1Finished()
|
||||
{
|
||||
if(m_reply->error() != QNetworkReply::NoError)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ void GetAuswertungReply::request1Finished()
|
||||
}
|
||||
|
||||
setSuccess(true);
|
||||
m_auswertung = m_reply->readAll();
|
||||
m_content = m_reply->readAll();
|
||||
|
||||
end:
|
||||
m_reply = Q_NULLPTR;
|
30
zeiterfassunglib/replies/getreportreply.h
Normal file
30
zeiterfassunglib/replies/getreportreply.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef GETREPORTREPLY_H
|
||||
#define GETREPORTREPLY_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QNetworkReply>
|
||||
#include <QByteArray>
|
||||
|
||||
#include "zeiterfassunglib_global.h"
|
||||
#include "zeiterfassungreply.h"
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT GetReportReply : public ZeiterfassungReply
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GetReportReply(std::unique_ptr<QNetworkReply> &&reply, ZeiterfassungApi *zeiterfassung);
|
||||
|
||||
const QByteArray &content() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void request0Finished();
|
||||
void request1Finished();
|
||||
|
||||
private:
|
||||
std::unique_ptr<QNetworkReply> m_reply;
|
||||
QByteArray m_content;
|
||||
};
|
||||
|
||||
#endif // GETREPORTREPLY_H
|
@@ -1,5 +1,7 @@
|
||||
#include "zeiterfassungreply.h"
|
||||
|
||||
#include <QEventLoop>
|
||||
|
||||
#include "zeiterfassungapi.h"
|
||||
|
||||
ZeiterfassungReply::ZeiterfassungReply(ZeiterfassungApi *zeiterfassung) :
|
||||
@@ -20,6 +22,13 @@ const QString &ZeiterfassungReply::message() const
|
||||
return m_message;
|
||||
}
|
||||
|
||||
void ZeiterfassungReply::waitForFinished()
|
||||
{
|
||||
QEventLoop eventLoop;
|
||||
connect(this, &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit);
|
||||
eventLoop.exec();
|
||||
}
|
||||
|
||||
ZeiterfassungApi *ZeiterfassungReply::zeiterfassung() const
|
||||
{
|
||||
return m_zeiterfassung;
|
||||
|
@@ -17,6 +17,8 @@ public:
|
||||
bool success() const;
|
||||
const QString &message() const;
|
||||
|
||||
void waitForFinished();
|
||||
|
||||
Q_SIGNALS:
|
||||
void finished();
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/zeiterfassunglib">
|
||||
<file>images/about.png</file>
|
||||
<file>images/auswertung.png</file>
|
||||
<file>images/authentication.png</file>
|
||||
<file>images/help.png</file>
|
||||
<file>images/icon.png</file>
|
||||
|
@@ -23,8 +23,8 @@ StripsWidget::StripsWidget(MainWindow &mainWindow, QWidget *parent) :
|
||||
{
|
||||
auto layout = new QVBoxLayout(this);
|
||||
|
||||
m_headerLayout = new QHBoxLayout(this);
|
||||
m_label = new QLabel(this);
|
||||
m_headerLayout = new QHBoxLayout;
|
||||
m_label = new QLabel;
|
||||
{
|
||||
auto font = m_label->font();
|
||||
font.setBold(true);
|
||||
@@ -33,7 +33,7 @@ StripsWidget::StripsWidget(MainWindow &mainWindow, QWidget *parent) :
|
||||
m_headerLayout->addWidget(m_label, 1);
|
||||
layout->addLayout(m_headerLayout);
|
||||
|
||||
m_stripsLayout = new QVBoxLayout(this);
|
||||
m_stripsLayout = new QVBoxLayout;
|
||||
layout->addLayout(m_stripsLayout);
|
||||
|
||||
layout->addStretch(1);
|
||||
|
@@ -54,63 +54,6 @@
|
||||
<translation>Passwort:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BookingDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="20"/>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="31"/>
|
||||
<source>Booking</source>
|
||||
<translation>Buchung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="40"/>
|
||||
<source>Time:</source>
|
||||
<translation>Zeit:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="50"/>
|
||||
<source>Timespan:</source>
|
||||
<translation>Zeitspanne:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="60"/>
|
||||
<source>Type:</source>
|
||||
<translation>Typ:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="70"/>
|
||||
<source>Text:</source>
|
||||
<translation>Text:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BookingsModel</name>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="99"/>
|
||||
<source>ID</source>
|
||||
<translation>ID</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="100"/>
|
||||
<source>Time</source>
|
||||
<translation>Zeit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="101"/>
|
||||
<source>Timespan</source>
|
||||
<translation>Zeitspanne</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="102"/>
|
||||
<source>Type</source>
|
||||
<translation>Typ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="103"/>
|
||||
<source>Text</source>
|
||||
<translation>Text</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>CreateBookingReply</name>
|
||||
<message>
|
||||
@@ -173,15 +116,6 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GetAuswertungReply</name>
|
||||
<message>
|
||||
<location filename="../replies/getauswertungreply.cpp" line="22"/>
|
||||
<location filename="../replies/getauswertungreply.cpp" line="40"/>
|
||||
<source>Request error occured: %0</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GetBookingsReply</name>
|
||||
<message>
|
||||
@@ -246,6 +180,15 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GetReportReply</name>
|
||||
<message>
|
||||
<location filename="../replies/getreportreply.cpp" line="22"/>
|
||||
<location filename="../replies/getreportreply.cpp" line="40"/>
|
||||
<source>Request error occured: %0</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GetTimeAssignmentsReply</name>
|
||||
<message>
|
||||
@@ -376,8 +319,8 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="143"/>
|
||||
<location filename="../mainwindow.cpp" line="740"/>
|
||||
<location filename="../mainwindow.cpp" line="751"/>
|
||||
<location filename="../mainwindow.cpp" line="366"/>
|
||||
<location filename="../mainwindow.cpp" line="377"/>
|
||||
<source>Start</source>
|
||||
<translation>Kommen</translation>
|
||||
</message>
|
||||
@@ -387,263 +330,117 @@
|
||||
<translation>Gehen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="185"/>
|
||||
<source>Optimized view</source>
|
||||
<translation>Optimierte Anzeige</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="204"/>
|
||||
<source>Advanced view</source>
|
||||
<translation>Erweiterte Anzeige</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="208"/>
|
||||
<source>Bookings</source>
|
||||
<translation>Buchungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="222"/>
|
||||
<source>Time assignments</source>
|
||||
<translation>Kontierungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="250"/>
|
||||
<location filename="../mainwindow.ui" line="206"/>
|
||||
<source>&File</source>
|
||||
<translation>&Datei</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="256"/>
|
||||
<location filename="../mainwindow.ui" line="212"/>
|
||||
<source>&About</source>
|
||||
<translation>&Über</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="267"/>
|
||||
<location filename="../mainwindow.ui" line="223"/>
|
||||
<source>&View</source>
|
||||
<translation>&Ansicht</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="274"/>
|
||||
<location filename="../mainwindow.ui" line="230"/>
|
||||
<source>&Tools</source>
|
||||
<translation>&Werkzeuge</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="302"/>
|
||||
<location filename="../mainwindow.ui" line="255"/>
|
||||
<source>&Quit</source>
|
||||
<translation>&Beenden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="311"/>
|
||||
<location filename="../mainwindow.ui" line="264"/>
|
||||
<source>About &Me</source>
|
||||
<translation>Über &mich</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="320"/>
|
||||
<location filename="../mainwindow.ui" line="273"/>
|
||||
<source>About &zeiterfassung</source>
|
||||
<translation>Über &zeiterfassung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="325"/>
|
||||
<location filename="../mainwindow.ui" line="278"/>
|
||||
<source>About &Qt</source>
|
||||
<translation>Über &Qt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="334"/>
|
||||
<location filename="../mainwindow.ui" line="287"/>
|
||||
<source>&Today</source>
|
||||
<translation>&Heute</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="343"/>
|
||||
<location filename="../mainwindow.ui" line="296"/>
|
||||
<source>&Refresh everything</source>
|
||||
<translation>Alles &neu laden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="352"/>
|
||||
<source>&Auswertung</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="361"/>
|
||||
<location filename="../mainwindow.ui" line="305"/>
|
||||
<source>&Settings</source>
|
||||
<translation>&Einstellungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="370"/>
|
||||
<location filename="../mainwindow.ui" line="314"/>
|
||||
<source>Help</source>
|
||||
<translation>Hilfe</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="63"/>
|
||||
<location filename="../mainwindow.cpp" line="41"/>
|
||||
<source>Zeiterfassung - %0 (%1)</source>
|
||||
<translation>Zeiterfassung - %0 (%1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="689"/>
|
||||
<location filename="../mainwindow.cpp" line="698"/>
|
||||
<source>Could not open auswertung!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="698"/>
|
||||
<source>Could not open default PDF viewer!</source>
|
||||
<translation>Konnte den PDF-Anzeiger nicht öffnen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="94"/>
|
||||
<location filename="../mainwindow.cpp" line="70"/>
|
||||
<source>Subproject</source>
|
||||
<translation>Subprojekt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="95"/>
|
||||
<location filename="../mainwindow.cpp" line="71"/>
|
||||
<source>Workpackage</source>
|
||||
<translation>Arbeitspaket</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="96"/>
|
||||
<location filename="../mainwindow.cpp" line="72"/>
|
||||
<source>Text</source>
|
||||
<translation>Text</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="251"/>
|
||||
<location filename="../mainwindow.cpp" line="252"/>
|
||||
<location filename="../mainwindow.cpp" line="757"/>
|
||||
<location filename="../mainwindow.cpp" line="758"/>
|
||||
<source>%0: %1</source>
|
||||
<translation>%0: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="757"/>
|
||||
<location filename="../mainwindow.cpp" line="758"/>
|
||||
<source>???</source>
|
||||
<translation>???</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="251"/>
|
||||
<location filename="../mainwindow.cpp" line="757"/>
|
||||
<source>Balance</source>
|
||||
<translation>Saldo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="252"/>
|
||||
<location filename="../mainwindow.cpp" line="758"/>
|
||||
<source>Holidays</source>
|
||||
<translation>Urlaubstage</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="191"/>
|
||||
<location filename="../mainwindow.cpp" line="192"/>
|
||||
<location filename="../mainwindow.cpp" line="171"/>
|
||||
<location filename="../mainwindow.cpp" line="172"/>
|
||||
<source>Could not load bookings!</source>
|
||||
<translation>Konnte Buchungen nicht laden!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="213"/>
|
||||
<source>Could not load Auswertung!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="245"/>
|
||||
<source>%0h</source>
|
||||
<translation>%0h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="358"/>
|
||||
<source>Could not delete booking!</source>
|
||||
<translation>Konnte Buchung nicht löschen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="305"/>
|
||||
<source>Edit booking</source>
|
||||
<translation>Buchung bearbeiten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="306"/>
|
||||
<source>Delete booking</source>
|
||||
<translation>Buchung löschen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="334"/>
|
||||
<source>Could not edit booking!</source>
|
||||
<translation>Konnte Buchung nicht bearbeiten!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="264"/>
|
||||
<source>Create booking</source>
|
||||
<translation>Buchung erstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="221"/>
|
||||
<location filename="../mainwindow.cpp" line="232"/>
|
||||
<source>n/a</source>
|
||||
<translation>n/v</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="265"/>
|
||||
<source>Refresh bookings</source>
|
||||
<translation>Buchungen aktualisieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="290"/>
|
||||
<location filename="../mainwindow.cpp" line="495"/>
|
||||
<location filename="../mainwindow.cpp" line="617"/>
|
||||
<location filename="../mainwindow.cpp" line="192"/>
|
||||
<location filename="../mainwindow.cpp" line="297"/>
|
||||
<source>Could not create booking!</source>
|
||||
<translation>Konnte Buchung nicht erstellen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="342"/>
|
||||
<source>Do you really want to delete the booking?</source>
|
||||
<translation>Möchten Sie die Buchung wirklich löschen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="372"/>
|
||||
<source>Refresh time assignments</source>
|
||||
<translation>Kontierungen aktualisieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="412"/>
|
||||
<source>Edit time assignment</source>
|
||||
<translation>Kontierung bearbeiten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="413"/>
|
||||
<source>Delete time assignment</source>
|
||||
<translation>Kontierung löschen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="444"/>
|
||||
<location filename="../mainwindow.cpp" line="527"/>
|
||||
<location filename="../mainwindow.cpp" line="598"/>
|
||||
<location filename="../mainwindow.cpp" line="220"/>
|
||||
<location filename="../mainwindow.cpp" line="282"/>
|
||||
<source>Could not edit time assignment!</source>
|
||||
<translation>Konnte Kontierung nicht bearbeiten!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="452"/>
|
||||
<source>Do you really want to delete the time assignment?</source>
|
||||
<translation>Möchten Sie die Kontierung wirklich löschen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="470"/>
|
||||
<source>Could not delete time assignment!</source>
|
||||
<translation>Konnte Kontierung nicht löschen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="783"/>
|
||||
<location filename="../mainwindow.cpp" line="792"/>
|
||||
<location filename="../mainwindow.cpp" line="396"/>
|
||||
<location filename="../mainwindow.cpp" line="405"/>
|
||||
<source>%0 (%1)</source>
|
||||
<translation>%0 (%1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="371"/>
|
||||
<source>Create time assignment</source>
|
||||
<translation>Kontierung erstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="397"/>
|
||||
<location filename="../mainwindow.cpp" line="548"/>
|
||||
<location filename="../mainwindow.cpp" line="237"/>
|
||||
<source>Could not create time assignment!</source>
|
||||
<translation>Konnte Kontierung nicht erstellen!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="740"/>
|
||||
<location filename="../mainwindow.cpp" line="751"/>
|
||||
<location filename="../mainwindow.cpp" line="366"/>
|
||||
<location filename="../mainwindow.cpp" line="377"/>
|
||||
<source>Switch</source>
|
||||
<translation>Wechseln</translation>
|
||||
</message>
|
||||
@@ -729,109 +526,111 @@
|
||||
<name>StripsWidget</name>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="141"/>
|
||||
<location filename="../stripswidget.cpp" line="159"/>
|
||||
<location filename="../stripswidget.cpp" line="192"/>
|
||||
<source>Loading...</source>
|
||||
<translation>Lade...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="227"/>
|
||||
<location filename="../stripswidget.cpp" line="241"/>
|
||||
<source>Missing booking!</source>
|
||||
<translation>Kontierung fehlend!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="234"/>
|
||||
<location filename="../stripswidget.cpp" line="248"/>
|
||||
<source>Expected start booking, instead got type %0
|
||||
Booking ID: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="243"/>
|
||||
<location filename="../stripswidget.cpp" line="434"/>
|
||||
<location filename="../stripswidget.cpp" line="257"/>
|
||||
<location filename="../stripswidget.cpp" line="448"/>
|
||||
<source>%0: %1</source>
|
||||
<translation>%0: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="243"/>
|
||||
<location filename="../stripswidget.cpp" line="257"/>
|
||||
<source>Break</source>
|
||||
<translation>Pause</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="243"/>
|
||||
<location filename="../stripswidget.cpp" line="365"/>
|
||||
<location filename="../stripswidget.cpp" line="436"/>
|
||||
<location filename="../stripswidget.cpp" line="257"/>
|
||||
<location filename="../stripswidget.cpp" line="379"/>
|
||||
<location filename="../stripswidget.cpp" line="450"/>
|
||||
<source>%0h</source>
|
||||
<translation>%0h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="243"/>
|
||||
<location filename="../stripswidget.cpp" line="436"/>
|
||||
<location filename="../stripswidget.cpp" line="551"/>
|
||||
<location filename="../stripswidget.cpp" line="570"/>
|
||||
<location filename="../stripswidget.cpp" line="589"/>
|
||||
<location filename="../stripswidget.cpp" line="257"/>
|
||||
<location filename="../stripswidget.cpp" line="450"/>
|
||||
<location filename="../stripswidget.cpp" line="565"/>
|
||||
<location filename="../stripswidget.cpp" line="584"/>
|
||||
<location filename="../stripswidget.cpp" line="603"/>
|
||||
<source>HH:mm</source>
|
||||
<translation>HH:mm</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="254"/>
|
||||
<location filename="../stripswidget.cpp" line="268"/>
|
||||
<source>Missing time assignment!</source>
|
||||
<translation>Kontierung fehlend!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="261"/>
|
||||
<location filename="../stripswidget.cpp" line="312"/>
|
||||
<location filename="../stripswidget.cpp" line="375"/>
|
||||
<location filename="../stripswidget.cpp" line="275"/>
|
||||
<location filename="../stripswidget.cpp" line="326"/>
|
||||
<location filename="../stripswidget.cpp" line="389"/>
|
||||
<source>Expected %0 but received %1 in time assignment.
|
||||
Time assignment ID: %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="262"/>
|
||||
<location filename="../stripswidget.cpp" line="263"/>
|
||||
<location filename="../stripswidget.cpp" line="313"/>
|
||||
<location filename="../stripswidget.cpp" line="314"/>
|
||||
<location filename="../stripswidget.cpp" line="365"/>
|
||||
<location filename="../stripswidget.cpp" line="376"/>
|
||||
<location filename="../stripswidget.cpp" line="377"/>
|
||||
<location filename="../stripswidget.cpp" line="417"/>
|
||||
<location filename="../stripswidget.cpp" line="418"/>
|
||||
<location filename="../stripswidget.cpp" line="276"/>
|
||||
<location filename="../stripswidget.cpp" line="277"/>
|
||||
<location filename="../stripswidget.cpp" line="327"/>
|
||||
<location filename="../stripswidget.cpp" line="328"/>
|
||||
<location filename="../stripswidget.cpp" line="379"/>
|
||||
<location filename="../stripswidget.cpp" line="390"/>
|
||||
<location filename="../stripswidget.cpp" line="391"/>
|
||||
<location filename="../stripswidget.cpp" line="431"/>
|
||||
<location filename="../stripswidget.cpp" line="432"/>
|
||||
<source>HH:mm:ss</source>
|
||||
<translation>HH:mm:ss</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="275"/>
|
||||
<location filename="../stripswidget.cpp" line="389"/>
|
||||
<location filename="../stripswidget.cpp" line="289"/>
|
||||
<location filename="../stripswidget.cpp" line="403"/>
|
||||
<source>There is another booking after an unfinished time assignment.
|
||||
Booking ID: %0
|
||||
Time assignment ID: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="283"/>
|
||||
<location filename="../stripswidget.cpp" line="326"/>
|
||||
<location filename="../stripswidget.cpp" line="398"/>
|
||||
<location filename="../stripswidget.cpp" line="297"/>
|
||||
<location filename="../stripswidget.cpp" line="340"/>
|
||||
<location filename="../stripswidget.cpp" line="412"/>
|
||||
<source>There is another time assignment after an unfinished time assignment.
|
||||
Time assignment ID: %0
|
||||
Time assignment ID: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="304"/>
|
||||
<location filename="../stripswidget.cpp" line="318"/>
|
||||
<source>The last time assignment is finished without end booking
|
||||
Time assignment ID: %0</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="349"/>
|
||||
<location filename="../stripswidget.cpp" line="363"/>
|
||||
<source>Expected end booking, instead got type %0
|
||||
Booking ID: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="364"/>
|
||||
<location filename="../stripswidget.cpp" line="378"/>
|
||||
<source>Missing time assignment! Missing: %0</source>
|
||||
<translation>Kontierung fehlend! %0 nicht kontiert</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="435"/>
|
||||
<location filename="../stripswidget.cpp" line="449"/>
|
||||
<source>Assigned time</source>
|
||||
<translation>Kontierte Zeit</translation>
|
||||
</message>
|
||||
@@ -846,14 +645,14 @@ Booking ID: %1</source>
|
||||
<translation>%0 (%1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="416"/>
|
||||
<location filename="../stripswidget.cpp" line="430"/>
|
||||
<source>Time assignment time longer than booking time!
|
||||
Time assignment: %0
|
||||
Booking: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="447"/>
|
||||
<location filename="../stripswidget.cpp" line="461"/>
|
||||
<source>Strip rendering aborted due error.
|
||||
Your bookings and time assignments for this day are in an illegal state!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -899,94 +698,11 @@ Your bookings and time assignments for this day are in an illegal state!</source
|
||||
<translation>Ungültig</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="589"/>
|
||||
<location filename="../stripswidget.cpp" line="603"/>
|
||||
<source>Open</source>
|
||||
<translation>Offen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TimeAssignmentDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="20"/>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="31"/>
|
||||
<source>Time assignment</source>
|
||||
<translation>Kontierung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="40"/>
|
||||
<source>Time:</source>
|
||||
<translation>Zeit:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="50"/>
|
||||
<source>Timespan:</source>
|
||||
<translation>Zeitspanne:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="60"/>
|
||||
<source>Project:</source>
|
||||
<translation>Projekt:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="70"/>
|
||||
<source>Subproject:</source>
|
||||
<translation>Subprojekt:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="77"/>
|
||||
<source>Workpackage:</source>
|
||||
<translation>Arbeitspaket:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="84"/>
|
||||
<source>Text:</source>
|
||||
<translation>Text:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="26"/>
|
||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="35"/>
|
||||
<source>%0 (%1)</source>
|
||||
<translation>%0 (%1)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TimeAssignmentsModel</name>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="101"/>
|
||||
<source>ID</source>
|
||||
<translation>ID</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="102"/>
|
||||
<source>Time</source>
|
||||
<translation>Zeit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="103"/>
|
||||
<source>Timespan</source>
|
||||
<translation>Zeitspanne</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="104"/>
|
||||
<source>Project</source>
|
||||
<translation>Projekt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="105"/>
|
||||
<source>Subproject</source>
|
||||
<translation>Subprojekt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="106"/>
|
||||
<source>Workpackage</source>
|
||||
<translation>Arbeitspaket</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="107"/>
|
||||
<source>Text</source>
|
||||
<translation>Text</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UpdateBookingReply</name>
|
||||
<message>
|
||||
@@ -1010,30 +726,6 @@ Your bookings and time assignments for this day are in an illegal state!</source
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UpdateDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/updatedialog.ui" line="14"/>
|
||||
<location filename="../dialogs/updatedialog.ui" line="25"/>
|
||||
<source>New update available!</source>
|
||||
<translation>Neues Update verfügbar!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/updatedialog.ui" line="32"/>
|
||||
<source>There is a new release available to download!</source>
|
||||
<translation>Es ist ein neues Update verfügbar zum Download!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/updatedialog.ui" line="70"/>
|
||||
<source>Dont show today anymore</source>
|
||||
<translation>Heute nicht mehr anzeigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/updatedialog.cpp" line="97"/>
|
||||
<source>Could not open default webbrowser!</source>
|
||||
<translation>Konnte den Standard-Browser nicht öffnen!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UpdateTimeAssignmentReply</name>
|
||||
<message>
|
||||
|
@@ -54,63 +54,6 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BookingDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="20"/>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="31"/>
|
||||
<source>Booking</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="40"/>
|
||||
<source>Time:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="50"/>
|
||||
<source>Timespan:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="60"/>
|
||||
<source>Type:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/bookingdialog.ui" line="70"/>
|
||||
<source>Text:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>BookingsModel</name>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="99"/>
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="100"/>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="101"/>
|
||||
<source>Timespan</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="102"/>
|
||||
<source>Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/bookingsmodel.cpp" line="103"/>
|
||||
<source>Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>CreateBookingReply</name>
|
||||
<message>
|
||||
@@ -173,15 +116,6 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GetAuswertungReply</name>
|
||||
<message>
|
||||
<location filename="../replies/getauswertungreply.cpp" line="22"/>
|
||||
<location filename="../replies/getauswertungreply.cpp" line="40"/>
|
||||
<source>Request error occured: %0</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GetBookingsReply</name>
|
||||
<message>
|
||||
@@ -246,6 +180,15 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GetReportReply</name>
|
||||
<message>
|
||||
<location filename="../replies/getreportreply.cpp" line="22"/>
|
||||
<location filename="../replies/getreportreply.cpp" line="40"/>
|
||||
<source>Request error occured: %0</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>GetTimeAssignmentsReply</name>
|
||||
<message>
|
||||
@@ -376,8 +319,8 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="143"/>
|
||||
<location filename="../mainwindow.cpp" line="740"/>
|
||||
<location filename="../mainwindow.cpp" line="751"/>
|
||||
<location filename="../mainwindow.cpp" line="366"/>
|
||||
<location filename="../mainwindow.cpp" line="377"/>
|
||||
<source>Start</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -387,263 +330,117 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="185"/>
|
||||
<source>Optimized view</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="204"/>
|
||||
<source>Advanced view</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="208"/>
|
||||
<source>Bookings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="222"/>
|
||||
<source>Time assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="250"/>
|
||||
<location filename="../mainwindow.ui" line="206"/>
|
||||
<source>&File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="256"/>
|
||||
<location filename="../mainwindow.ui" line="212"/>
|
||||
<source>&About</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="267"/>
|
||||
<location filename="../mainwindow.ui" line="223"/>
|
||||
<source>&View</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="274"/>
|
||||
<location filename="../mainwindow.ui" line="230"/>
|
||||
<source>&Tools</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="302"/>
|
||||
<location filename="../mainwindow.ui" line="255"/>
|
||||
<source>&Quit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="311"/>
|
||||
<location filename="../mainwindow.ui" line="264"/>
|
||||
<source>About &Me</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="320"/>
|
||||
<location filename="../mainwindow.ui" line="273"/>
|
||||
<source>About &zeiterfassung</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="325"/>
|
||||
<location filename="../mainwindow.ui" line="278"/>
|
||||
<source>About &Qt</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="334"/>
|
||||
<location filename="../mainwindow.ui" line="287"/>
|
||||
<source>&Today</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="343"/>
|
||||
<location filename="../mainwindow.ui" line="296"/>
|
||||
<source>&Refresh everything</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="352"/>
|
||||
<source>&Auswertung</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="361"/>
|
||||
<location filename="../mainwindow.ui" line="305"/>
|
||||
<source>&Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="370"/>
|
||||
<location filename="../mainwindow.ui" line="314"/>
|
||||
<source>Help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="63"/>
|
||||
<location filename="../mainwindow.cpp" line="41"/>
|
||||
<source>Zeiterfassung - %0 (%1)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="94"/>
|
||||
<location filename="../mainwindow.cpp" line="70"/>
|
||||
<source>Subproject</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="95"/>
|
||||
<location filename="../mainwindow.cpp" line="71"/>
|
||||
<source>Workpackage</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="96"/>
|
||||
<location filename="../mainwindow.cpp" line="72"/>
|
||||
<source>Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="757"/>
|
||||
<location filename="../mainwindow.cpp" line="758"/>
|
||||
<source>???</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="191"/>
|
||||
<location filename="../mainwindow.cpp" line="192"/>
|
||||
<location filename="../mainwindow.cpp" line="171"/>
|
||||
<location filename="../mainwindow.cpp" line="172"/>
|
||||
<source>Could not load bookings!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="213"/>
|
||||
<source>Could not load Auswertung!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="221"/>
|
||||
<location filename="../mainwindow.cpp" line="232"/>
|
||||
<source>n/a</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="245"/>
|
||||
<source>%0h</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="251"/>
|
||||
<location filename="../mainwindow.cpp" line="252"/>
|
||||
<location filename="../mainwindow.cpp" line="757"/>
|
||||
<location filename="../mainwindow.cpp" line="758"/>
|
||||
<source>%0: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="251"/>
|
||||
<location filename="../mainwindow.cpp" line="757"/>
|
||||
<source>Balance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="252"/>
|
||||
<location filename="../mainwindow.cpp" line="758"/>
|
||||
<source>Holidays</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="264"/>
|
||||
<source>Create booking</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="265"/>
|
||||
<source>Refresh bookings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="290"/>
|
||||
<location filename="../mainwindow.cpp" line="495"/>
|
||||
<location filename="../mainwindow.cpp" line="617"/>
|
||||
<location filename="../mainwindow.cpp" line="192"/>
|
||||
<location filename="../mainwindow.cpp" line="297"/>
|
||||
<source>Could not create booking!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="305"/>
|
||||
<source>Edit booking</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="306"/>
|
||||
<source>Delete booking</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="334"/>
|
||||
<source>Could not edit booking!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="342"/>
|
||||
<source>Do you really want to delete the booking?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="358"/>
|
||||
<source>Could not delete booking!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="371"/>
|
||||
<source>Create time assignment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="372"/>
|
||||
<source>Refresh time assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="397"/>
|
||||
<location filename="../mainwindow.cpp" line="548"/>
|
||||
<location filename="../mainwindow.cpp" line="237"/>
|
||||
<source>Could not create time assignment!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="412"/>
|
||||
<source>Edit time assignment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="413"/>
|
||||
<source>Delete time assignment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="444"/>
|
||||
<location filename="../mainwindow.cpp" line="527"/>
|
||||
<location filename="../mainwindow.cpp" line="598"/>
|
||||
<location filename="../mainwindow.cpp" line="220"/>
|
||||
<location filename="../mainwindow.cpp" line="282"/>
|
||||
<source>Could not edit time assignment!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="452"/>
|
||||
<source>Do you really want to delete the time assignment?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="470"/>
|
||||
<source>Could not delete time assignment!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="689"/>
|
||||
<location filename="../mainwindow.cpp" line="698"/>
|
||||
<source>Could not open auswertung!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="698"/>
|
||||
<source>Could not open default PDF viewer!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="740"/>
|
||||
<location filename="../mainwindow.cpp" line="751"/>
|
||||
<location filename="../mainwindow.cpp" line="366"/>
|
||||
<location filename="../mainwindow.cpp" line="377"/>
|
||||
<source>Switch</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="783"/>
|
||||
<location filename="../mainwindow.cpp" line="792"/>
|
||||
<location filename="../mainwindow.cpp" line="396"/>
|
||||
<location filename="../mainwindow.cpp" line="405"/>
|
||||
<source>%0 (%1)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -729,121 +526,123 @@
|
||||
<name>StripsWidget</name>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="141"/>
|
||||
<location filename="../stripswidget.cpp" line="159"/>
|
||||
<location filename="../stripswidget.cpp" line="192"/>
|
||||
<source>Loading...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="227"/>
|
||||
<location filename="../stripswidget.cpp" line="241"/>
|
||||
<source>Missing booking!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="234"/>
|
||||
<location filename="../stripswidget.cpp" line="248"/>
|
||||
<source>Expected start booking, instead got type %0
|
||||
Booking ID: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="243"/>
|
||||
<location filename="../stripswidget.cpp" line="434"/>
|
||||
<location filename="../stripswidget.cpp" line="257"/>
|
||||
<location filename="../stripswidget.cpp" line="448"/>
|
||||
<source>%0: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="243"/>
|
||||
<location filename="../stripswidget.cpp" line="257"/>
|
||||
<source>Break</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="243"/>
|
||||
<location filename="../stripswidget.cpp" line="365"/>
|
||||
<location filename="../stripswidget.cpp" line="436"/>
|
||||
<location filename="../stripswidget.cpp" line="257"/>
|
||||
<location filename="../stripswidget.cpp" line="379"/>
|
||||
<location filename="../stripswidget.cpp" line="450"/>
|
||||
<source>%0h</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="243"/>
|
||||
<location filename="../stripswidget.cpp" line="436"/>
|
||||
<location filename="../stripswidget.cpp" line="551"/>
|
||||
<location filename="../stripswidget.cpp" line="570"/>
|
||||
<location filename="../stripswidget.cpp" line="589"/>
|
||||
<location filename="../stripswidget.cpp" line="257"/>
|
||||
<location filename="../stripswidget.cpp" line="450"/>
|
||||
<location filename="../stripswidget.cpp" line="565"/>
|
||||
<location filename="../stripswidget.cpp" line="584"/>
|
||||
<location filename="../stripswidget.cpp" line="603"/>
|
||||
<source>HH:mm</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="254"/>
|
||||
<location filename="../stripswidget.cpp" line="268"/>
|
||||
<source>Missing time assignment!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="261"/>
|
||||
<location filename="../stripswidget.cpp" line="312"/>
|
||||
<location filename="../stripswidget.cpp" line="375"/>
|
||||
<location filename="../stripswidget.cpp" line="275"/>
|
||||
<location filename="../stripswidget.cpp" line="326"/>
|
||||
<location filename="../stripswidget.cpp" line="389"/>
|
||||
<source>Expected %0 but received %1 in time assignment.
|
||||
Time assignment ID: %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="262"/>
|
||||
<location filename="../stripswidget.cpp" line="263"/>
|
||||
<location filename="../stripswidget.cpp" line="313"/>
|
||||
<location filename="../stripswidget.cpp" line="314"/>
|
||||
<location filename="../stripswidget.cpp" line="365"/>
|
||||
<location filename="../stripswidget.cpp" line="376"/>
|
||||
<location filename="../stripswidget.cpp" line="377"/>
|
||||
<location filename="../stripswidget.cpp" line="417"/>
|
||||
<location filename="../stripswidget.cpp" line="418"/>
|
||||
<location filename="../stripswidget.cpp" line="276"/>
|
||||
<location filename="../stripswidget.cpp" line="277"/>
|
||||
<location filename="../stripswidget.cpp" line="327"/>
|
||||
<location filename="../stripswidget.cpp" line="328"/>
|
||||
<location filename="../stripswidget.cpp" line="379"/>
|
||||
<location filename="../stripswidget.cpp" line="390"/>
|
||||
<location filename="../stripswidget.cpp" line="391"/>
|
||||
<location filename="../stripswidget.cpp" line="431"/>
|
||||
<location filename="../stripswidget.cpp" line="432"/>
|
||||
<source>HH:mm:ss</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="275"/>
|
||||
<location filename="../stripswidget.cpp" line="389"/>
|
||||
<location filename="../stripswidget.cpp" line="289"/>
|
||||
<location filename="../stripswidget.cpp" line="403"/>
|
||||
<source>There is another booking after an unfinished time assignment.
|
||||
Booking ID: %0
|
||||
Time assignment ID: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="283"/>
|
||||
<location filename="../stripswidget.cpp" line="326"/>
|
||||
<location filename="../stripswidget.cpp" line="398"/>
|
||||
<location filename="../stripswidget.cpp" line="297"/>
|
||||
<location filename="../stripswidget.cpp" line="340"/>
|
||||
<location filename="../stripswidget.cpp" line="412"/>
|
||||
<source>There is another time assignment after an unfinished time assignment.
|
||||
Time assignment ID: %0
|
||||
Time assignment ID: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="304"/>
|
||||
<location filename="../stripswidget.cpp" line="318"/>
|
||||
<source>The last time assignment is finished without end booking
|
||||
Time assignment ID: %0</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="349"/>
|
||||
<location filename="../stripswidget.cpp" line="363"/>
|
||||
<source>Expected end booking, instead got type %0
|
||||
Booking ID: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="364"/>
|
||||
<location filename="../stripswidget.cpp" line="378"/>
|
||||
<source>Missing time assignment! Missing: %0</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="416"/>
|
||||
<location filename="../stripswidget.cpp" line="430"/>
|
||||
<source>Time assignment time longer than booking time!
|
||||
Time assignment: %0
|
||||
Booking: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="435"/>
|
||||
<location filename="../stripswidget.cpp" line="449"/>
|
||||
<source>Assigned time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="447"/>
|
||||
<location filename="../stripswidget.cpp" line="461"/>
|
||||
<source>Strip rendering aborted due error.
|
||||
Your bookings and time assignments for this day are in an illegal state!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -899,94 +698,11 @@ Your bookings and time assignments for this day are in an illegal state!</source
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../stripswidget.cpp" line="589"/>
|
||||
<location filename="../stripswidget.cpp" line="603"/>
|
||||
<source>Open</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TimeAssignmentDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="20"/>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="31"/>
|
||||
<source>Time assignment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="40"/>
|
||||
<source>Time:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="50"/>
|
||||
<source>Timespan:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="60"/>
|
||||
<source>Project:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="70"/>
|
||||
<source>Subproject:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="77"/>
|
||||
<source>Workpackage:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.ui" line="84"/>
|
||||
<source>Text:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="26"/>
|
||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="35"/>
|
||||
<source>%0 (%1)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TimeAssignmentsModel</name>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="101"/>
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="102"/>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="103"/>
|
||||
<source>Timespan</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="104"/>
|
||||
<source>Project</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="105"/>
|
||||
<source>Subproject</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="106"/>
|
||||
<source>Workpackage</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../models/timeassignmentsmodel.cpp" line="107"/>
|
||||
<source>Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UpdateBookingReply</name>
|
||||
<message>
|
||||
@@ -1010,30 +726,6 @@ Your bookings and time assignments for this day are in an illegal state!</source
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UpdateDialog</name>
|
||||
<message>
|
||||
<location filename="../dialogs/updatedialog.ui" line="14"/>
|
||||
<location filename="../dialogs/updatedialog.ui" line="25"/>
|
||||
<source>New update available!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/updatedialog.ui" line="32"/>
|
||||
<source>There is a new release available to download!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/updatedialog.ui" line="70"/>
|
||||
<source>Dont show today anymore</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../dialogs/updatedialog.cpp" line="97"/>
|
||||
<source>Could not open default webbrowser!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UpdateTimeAssignmentReply</name>
|
||||
<message>
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#include "replies/createtimeassignmentreply.h"
|
||||
#include "replies/deletebookingreply.h"
|
||||
#include "replies/deletetimeassignmentreply.h"
|
||||
#include "replies/getauswertungreply.h"
|
||||
#include "replies/getreportreply.h"
|
||||
#include "replies/getbookingsreply.h"
|
||||
#include "replies/getpresencestatusreply.h"
|
||||
#include "replies/getprojectsreply.h"
|
||||
@@ -55,8 +55,6 @@ std::unique_ptr<LoginPageReply> ZeiterfassungApi::doLoginPage()
|
||||
|
||||
auto reply = std::unique_ptr<QNetworkReply>(m_manager->get(request));
|
||||
|
||||
qDebug() << reply->parent();
|
||||
|
||||
return std::make_unique<LoginPageReply>(std::move(reply), this);
|
||||
}
|
||||
|
||||
@@ -288,7 +286,7 @@ std::unique_ptr<GetProjectsReply> ZeiterfassungApi::doGetProjects(int userId, co
|
||||
return std::make_unique<GetProjectsReply>(std::move(reply), this);
|
||||
}
|
||||
|
||||
std::unique_ptr<GetAuswertungReply> ZeiterfassungApi::doGetAuswertung(int userId, const QDate &date)
|
||||
std::unique_ptr<GetReportReply> ZeiterfassungApi::doGetReport(int userId, const QDate &date)
|
||||
{
|
||||
QNetworkRequest request(QUrl(QStringLiteral("%0json/auswertung/month?persNr=%1&date=%2")
|
||||
.arg(m_url)
|
||||
@@ -298,7 +296,7 @@ std::unique_ptr<GetAuswertungReply> ZeiterfassungApi::doGetAuswertung(int userId
|
||||
|
||||
auto reply = std::unique_ptr<QNetworkReply>(m_manager->get(request));
|
||||
|
||||
return std::make_unique<GetAuswertungReply>(std::move(reply), this);
|
||||
return std::make_unique<GetReportReply>(std::move(reply), this);
|
||||
}
|
||||
|
||||
std::unique_ptr<GetPresenceStatusReply> ZeiterfassungApi::doGetPresenceStatus()
|
||||
|
@@ -24,7 +24,7 @@ class CreateTimeAssignmentReply;
|
||||
class UpdateTimeAssignmentReply;
|
||||
class DeleteTimeAssignmentReply;
|
||||
class GetProjectsReply;
|
||||
class GetAuswertungReply;
|
||||
class GetReportReply;
|
||||
class GetPresenceStatusReply;
|
||||
|
||||
class ZEITERFASSUNGLIBSHARED_EXPORT ZeiterfassungApi : public QObject
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
std::unique_ptr<DeleteTimeAssignmentReply> doDeleteTimeAssignment(int timeAssignmentId);
|
||||
|
||||
std::unique_ptr<GetProjectsReply> doGetProjects(int userId, const QDate &date);
|
||||
std::unique_ptr<GetAuswertungReply> doGetAuswertung(int userId, const QDate &date);
|
||||
std::unique_ptr<GetReportReply> doGetReport(int userId, const QDate &date);
|
||||
std::unique_ptr<GetPresenceStatusReply> doGetPresenceStatus();
|
||||
|
||||
private:
|
||||
|
@@ -21,12 +21,10 @@ SOURCES += mainwindow.cpp \
|
||||
dialogs/authenticationdialog.cpp \
|
||||
dialogs/languageselectiondialog.cpp \
|
||||
dialogs/settingsdialog.cpp \
|
||||
dialogs/updatedialog.cpp \
|
||||
replies/createbookingreply.cpp \
|
||||
replies/createtimeassignmentreply.cpp \
|
||||
replies/deletebookingreply.cpp \
|
||||
replies/deletetimeassignmentreply.cpp \
|
||||
replies/getauswertungreply.cpp \
|
||||
replies/getbookingsreply.cpp \
|
||||
replies/getpresencestatusreply.cpp \
|
||||
replies/getprojectsreply.cpp \
|
||||
@@ -36,7 +34,8 @@ SOURCES += mainwindow.cpp \
|
||||
replies/updatebookingreply.cpp \
|
||||
replies/updatetimeassignmentreply.cpp \
|
||||
replies/zeiterfassungreply.cpp \
|
||||
replies/getuserinforeply.cpp
|
||||
replies/getuserinforeply.cpp \
|
||||
replies/getreportreply.cpp
|
||||
|
||||
HEADERS += cpp14polyfills.h \
|
||||
mainwindow.h \
|
||||
@@ -51,12 +50,10 @@ HEADERS += cpp14polyfills.h \
|
||||
dialogs/authenticationdialog.h \
|
||||
dialogs/languageselectiondialog.h \
|
||||
dialogs/settingsdialog.h \
|
||||
dialogs/updatedialog.h \
|
||||
replies/createbookingreply.h \
|
||||
replies/createtimeassignmentreply.h \
|
||||
replies/deletebookingreply.h \
|
||||
replies/deletetimeassignmentreply.h \
|
||||
replies/getauswertungreply.h \
|
||||
replies/getbookingsreply.h \
|
||||
replies/getpresencestatusreply.h \
|
||||
replies/getprojectsreply.h \
|
||||
@@ -66,10 +63,10 @@ HEADERS += cpp14polyfills.h \
|
||||
replies/updatebookingreply.h \
|
||||
replies/updatetimeassignmentreply.h \
|
||||
replies/zeiterfassungreply.h \
|
||||
replies/getuserinforeply.h
|
||||
replies/getuserinforeply.h \
|
||||
replies/getreportreply.h
|
||||
|
||||
FORMS += mainwindow.ui \
|
||||
dialogs/updatedialog.ui \
|
||||
dialogs/settingsdialog.ui \
|
||||
dialogs/languageselectiondialog.ui \
|
||||
dialogs/authenticationdialog.ui \
|
||||
|
@@ -132,16 +132,6 @@ void ZeiterfassungSettings::prependText(const QString &text)
|
||||
prependItem(QStringLiteral("texte"), text);
|
||||
}
|
||||
|
||||
QDate ZeiterfassungSettings::lastUpdateCheck() const
|
||||
{
|
||||
return value(QStringLiteral("lastUpdateCheck")).toDate();
|
||||
}
|
||||
|
||||
void ZeiterfassungSettings::setLastUpdateCheck(const QDate &lastUpdateCheck)
|
||||
{
|
||||
setValue(QStringLiteral("lastUpdateCheck"), lastUpdateCheck);
|
||||
}
|
||||
|
||||
QString ZeiterfassungSettings::theme() const
|
||||
{
|
||||
return value(QStringLiteral("theme")).toString();
|
||||
|
@@ -51,9 +51,6 @@ public:
|
||||
void setTexte(const QStringList &texte);
|
||||
void prependText(const QString &text);
|
||||
|
||||
QDate lastUpdateCheck() const;
|
||||
void setLastUpdateCheck(const QDate &lastUpdateCheck);
|
||||
|
||||
QString theme() const;
|
||||
void setTheme(const QString &theme);
|
||||
|
||||
|
Reference in New Issue
Block a user