Devel #56
27
.travis.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
language: cpp
|
||||||
|
os: linux
|
||||||
|
sudo: false
|
||||||
|
dist: trusty
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
- clang
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- qt5
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- mkdir -p qt5
|
||||||
|
- if [ ! -d qt5/.git ] ; then rm qt5 -Rf ; git clone --branch=5.10 git://code.qt.io/qt/qt5.git ; fi
|
||||||
|
- pushd qt5
|
||||||
|
- if [ ! -d qtbase/.git ] ; then perl init-repository --module-subset=qtbase,qtimageformats,qtmultimedia,qttools ; fi
|
||||||
|
- if [ ! -f config.summary ] ; then ./configure -prefix `pwd`/build -opensource -confirm-license -nomake examples -nomake tests ; fi
|
||||||
|
- if [ ! -d build ] ; then make -j2 > /dev/null && make install ; fi
|
||||||
|
- popd
|
||||||
|
|
||||||
|
script:
|
||||||
|
- mkdir -p build
|
||||||
|
- pushd build
|
||||||
|
- ../qt5/build/bin/qmake .. -config release
|
||||||
|
- make -j2
|
||||||
|
- popd
|
13
QtZeiterfassung.pro
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
|
SUBDIRS += plugins \
|
||||||
|
zeiterfassung \
|
||||||
|
zeiterfassungcorelib \
|
||||||
|
zeiterfassungguilib
|
||||||
|
|
||||||
|
plugins.depends += zeiterfassungguilib
|
||||||
|
zeiterfassung.depends += zeiterfassungcorelib zeiterfassungguilib
|
||||||
|
zeiterfassungguilib.depends += zeiterfassungcorelib
|
||||||
|
|
||||||
|
include(installs.pri)
|
||||||
|
win32: include(installs_win32.pri)
|
@@ -1,6 +1,8 @@
|
|||||||
# Zeiterfassung
|
# Zeiterfassung
|
||||||
This tool helps me assigning my working hours to projects at work.
|
This tool helps me assigning my working hours to projects at work.
|
||||||
|
|
||||||
|
[](https://travis-ci.org/0xFEEDC0DE64/QtZeiterfassung)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Building from source
|
## Building from source
|
||||||
@@ -13,11 +15,12 @@ mkdir build_QtZeiterfassung
|
|||||||
cd build_QtZeiterfassung
|
cd build_QtZeiterfassung
|
||||||
qmake ../QtZeiterfassung
|
qmake ../QtZeiterfassung
|
||||||
make
|
make
|
||||||
|
make install # only needed on first build to copy Qt resources
|
||||||
```
|
```
|
||||||
|
|
||||||
## Launching (on unix)
|
## Launching (on unix)
|
||||||
```
|
```
|
||||||
LD_LIBRARY_PATH=../lib ./zeiterfassung # or just use start.sh
|
./zeiterfassung.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## Launching (on win32)
|
## Launching (on win32)
|
||||||
|
14
installs.pri
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
qtTranslationsInstall.path = $${OUT_PWD}/bin/translations
|
||||||
|
qtTranslationsInstall.files = $$[QT_INSTALL_TRANSLATIONS]/qt_en.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtbase_en.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtmultimedia_en.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtquick1_en.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtscript_en.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtxmlpatterns_en.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qt_de.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtbase_de.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtmultimedia_de.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtquick1_de.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtscript_de.qm \
|
||||||
|
$$[QT_INSTALL_TRANSLATIONS]/qtxmlpatterns_de.qm
|
||||||
|
INSTALLS += qtTranslationsInstall
|
28
installs_win32.pri
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
CONFIG(debug, release|debug): DEBUG_SIGN = d
|
||||||
|
|
||||||
|
qtLibsInstall.path = $${OUT_PWD}/bin
|
||||||
|
qtLibsInstall.files = win32/Qt.conf \
|
||||||
|
$$[QT_INSTALL_BINS]/Qt5Core$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_BINS]/Qt5Gui$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_BINS]/Qt5Network$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_BINS]/Qt5Widgets$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_BINS]/libgcc_s_dw2-1.dll \
|
||||||
|
$$[QT_INSTALL_BINS]/libstdc++-6.dll \
|
||||||
|
$$[QT_INSTALL_BINS]/libwinpthread-1.dll
|
||||||
|
INSTALLS += qtLibsInstall
|
||||||
|
|
||||||
|
qtImageFormatsInstall.path = $${OUT_PWD}/bin/plugins/imageformats
|
||||||
|
qtImageFormatsInstall.files = $$[QT_INSTALL_PLUGINS]/imageformats/qgif$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_PLUGINS]/imageformats/qicns$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_PLUGINS]/imageformats/qico$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_PLUGINS]/imageformats/qjpeg$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_PLUGINS]/imageformats/qsvg$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_PLUGINS]/imageformats/qtga$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_PLUGINS]/imageformats/qtiff$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_PLUGINS]/imageformats/qwbmp$${DEBUG_SIGN}.dll \
|
||||||
|
$$[QT_INSTALL_PLUGINS]/imageformats/qwebp$${DEBUG_SIGN}.dll
|
||||||
|
INSTALLS += qtImageFormatsInstall
|
||||||
|
|
||||||
|
qtPlatformsInstall.path = $${OUT_PWD}/bin/plugins/platforms
|
||||||
|
qtPlatformsInstall.files = $$[QT_INSTALL_PLUGINS]/platforms/qwindows$${DEBUG_SIGN}.dll
|
||||||
|
INSTALLS += qtPlatformsInstall
|
@@ -4,8 +4,8 @@ isEmpty(QMAKE_LRELEASE) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lrelease.input = TRANSLATIONS
|
lrelease.input = TRANSLATIONS
|
||||||
lrelease.output = $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm
|
lrelease.output = $${OUT_PWD}/$${PROJECT_ROOT}/bin/translations/${QMAKE_FILE_BASE}.qm
|
||||||
lrelease.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
|
lrelease.commands = $${QMAKE_LRELEASE} ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
|
||||||
lrelease.CONFIG += no_link
|
lrelease.CONFIG += no_link
|
||||||
QMAKE_EXTRA_COMPILERS += lrelease
|
QMAKE_EXTRA_COMPILERS += lrelease
|
||||||
PRE_TARGETDEPS += compiler_lrelease_make_all
|
PRE_TARGETDEPS += compiler_lrelease_make_all
|
||||||
|
34
plugins/absenceplugin/absencedialog.cpp
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#include "absencedialog.h"
|
||||||
|
#include "ui_absencedialog.h"
|
||||||
|
|
||||||
|
#include <QDate>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QStringBuilder>
|
||||||
|
|
||||||
|
#include "absencesmodel.h"
|
||||||
|
|
||||||
|
AbsenceDialog::AbsenceDialog(int userId, const QDate &date, ZeiterfassungApi &erfassung, QWidget *parent) :
|
||||||
|
ZeiterfassungDialog(parent),
|
||||||
|
ui(new Ui::AbsenceDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ui->labelTitle->setText(tr("Absences for %0").arg(date.toString(tr("dd.MM.yyyy"))));
|
||||||
|
|
||||||
|
m_model = new AbsencesModel(userId, date, erfassung, this);
|
||||||
|
connect(m_model, &AbsencesModel::errorOccured, this, &AbsenceDialog::errorOccured);
|
||||||
|
|
||||||
|
ui->treeView->setModel(m_model);
|
||||||
|
ui->treeView->setEnabled(m_model->enabled());
|
||||||
|
connect(m_model, &AbsencesModel::enabledChanged, ui->treeView, &QWidget::setEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
AbsenceDialog::~AbsenceDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbsenceDialog::errorOccured(const QString &message)
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Could not load absences!"), tr("Could not load absences!") % "\n\n" % message);
|
||||||
|
}
|
27
plugins/absenceplugin/absencedialog.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "zeiterfassungdialog.h"
|
||||||
|
|
||||||
|
class QDate;
|
||||||
|
|
||||||
|
class ZeiterfassungApi;
|
||||||
|
|
||||||
|
class AbsencesModel;
|
||||||
|
namespace Ui { class AbsenceDialog; }
|
||||||
|
|
||||||
|
class AbsenceDialog : public ZeiterfassungDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AbsenceDialog(int userId, const QDate &date, ZeiterfassungApi &erfassung, QWidget *parent = 0);
|
||||||
|
~AbsenceDialog();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void errorOccured(const QString &message);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::AbsenceDialog *ui;
|
||||||
|
|
||||||
|
AbsencesModel *m_model;
|
||||||
|
};
|
79
plugins/absenceplugin/absencedialog.ui
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AbsenceDialog</class>
|
||||||
|
<widget class="QDialog" name="AbsenceDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>947</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Absences</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelTitle">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>16</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Absences for</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeView" name="treeView"/>
|
||||||
|
</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>AbsenceDialog</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>AbsenceDialog</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>
|
38
plugins/absenceplugin/absenceplugin.cpp
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#include "absenceplugin.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QBoxLayout>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "stripswidget.h"
|
||||||
|
|
||||||
|
#include "absencewidget.h"
|
||||||
|
|
||||||
|
AbsencePlugin::AbsencePlugin(QObject *parent) :
|
||||||
|
ZeiterfassungPlugin(parent)
|
||||||
|
{
|
||||||
|
qDebug() << "called";
|
||||||
|
|
||||||
|
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||||
|
|
||||||
|
if(m_translator.load(QLocale(), QStringLiteral("absenceplugin"), QStringLiteral("_"), dir))
|
||||||
|
{
|
||||||
|
if(!QCoreApplication::installTranslator(&m_translator))
|
||||||
|
{
|
||||||
|
qWarning() << "could not install translation absenceplugin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning() << "could not load translation absenceplugin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbsencePlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
{
|
||||||
|
for(auto stripsWidget : mainWindow.stripsWidgets())
|
||||||
|
stripsWidget->headerLayout()->addWidget(new AbsenceWidget(*stripsWidget));
|
||||||
|
}
|
24
plugins/absenceplugin/absenceplugin.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
|
#include "zeiterfassungplugin.h"
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
class Q_DECL_EXPORT AbsencePlugin : public ZeiterfassungPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "absenceplugin.json")
|
||||||
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AbsencePlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
// ZeiterfassungPlugin interface
|
||||||
|
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTranslator m_translator;
|
||||||
|
};
|
38
plugins/absenceplugin/absenceplugin.pro
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
QT += core network gui widgets
|
||||||
|
|
||||||
|
TARGET = absenceplugin
|
||||||
|
TEMPLATE = lib
|
||||||
|
|
||||||
|
CONFIG += shared c++14
|
||||||
|
|
||||||
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
|
HEADERS += absencedialog.h \
|
||||||
|
absencesmodel.h \
|
||||||
|
absenceplugin.h \
|
||||||
|
absencewidget.h
|
||||||
|
|
||||||
|
SOURCES += absencedialog.cpp \
|
||||||
|
absencesmodel.cpp \
|
||||||
|
absenceplugin.cpp \
|
||||||
|
absencewidget.cpp
|
||||||
|
|
||||||
|
FORMS += absencedialog.ui
|
||||||
|
|
||||||
|
RESOURCES += absenceplugin_resources.qrc
|
||||||
|
|
||||||
|
TRANSLATIONS += translations/absenceplugin_en.ts \
|
||||||
|
translations/absenceplugin_de.ts
|
||||||
|
|
||||||
|
OTHER_FILES += absenceplugin.json
|
||||||
|
|
||||||
|
include(../../lrelease.pri)
|
5
plugins/absenceplugin/absenceplugin_resources.qrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/zeiterfassung/plugins/absenceplugin">
|
||||||
|
<file>images/absence.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
115
plugins/absenceplugin/absencesmodel.cpp
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
#include "absencesmodel.h"
|
||||||
|
|
||||||
|
#include "zeiterfassungapi.h"
|
||||||
|
|
||||||
|
AbsencesModel::AbsencesModel(int userId, const QDate &date, ZeiterfassungApi &erfassung, QObject *parent) :
|
||||||
|
QAbstractListModel(parent),
|
||||||
|
m_userId(userId),
|
||||||
|
m_erfassung(erfassung)
|
||||||
|
{
|
||||||
|
setDate(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AbsencesModel::enabled() const
|
||||||
|
{
|
||||||
|
return m_reply == Q_NULLPTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int AbsencesModel::rowCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
|
return m_absences.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int AbsencesModel::columnCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
|
return 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant AbsencesModel::data(const QModelIndex &index, int role) const
|
||||||
|
{
|
||||||
|
Q_ASSERT(index.row() < m_absences.count());
|
||||||
|
const auto &absence = m_absences.at(index.row());
|
||||||
|
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
switch(index.column())
|
||||||
|
{
|
||||||
|
case 0: return absence.altRepresentative;
|
||||||
|
case 1: return absence.compositeId;
|
||||||
|
case 2: return absence.end;
|
||||||
|
case 3: return absence.hourCategory;
|
||||||
|
case 4: return absence.openMarking;
|
||||||
|
case 5: return absence.persNr;
|
||||||
|
case 6: return absence.representative;
|
||||||
|
case 7: return absence.start;
|
||||||
|
case 8: return absence.text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant AbsencesModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
|
{
|
||||||
|
switch(orientation)
|
||||||
|
{
|
||||||
|
case Qt::Horizontal:
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
switch(section)
|
||||||
|
{
|
||||||
|
case 0: return tr("altRepresentative");
|
||||||
|
case 1: return tr("compositeId");
|
||||||
|
case 2: return tr("end");
|
||||||
|
case 3: return tr("hourCategory");
|
||||||
|
case 4: return tr("openMarking");
|
||||||
|
case 5: return tr("persNr");
|
||||||
|
case 6: return tr("representative");
|
||||||
|
case 7: return tr("start");
|
||||||
|
case 8: return tr("text");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
qt_noop();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbsencesModel::setDate(const QDate &date)
|
||||||
|
{
|
||||||
|
m_date = date;
|
||||||
|
|
||||||
|
auto oldEnabled = enabled();
|
||||||
|
|
||||||
|
m_reply = m_erfassung.doGetAbsences(m_userId, m_date, m_date);
|
||||||
|
connect(m_reply.get(), &ZeiterfassungReply::finished, this, &AbsencesModel::finished);
|
||||||
|
|
||||||
|
if(oldEnabled != enabled())
|
||||||
|
Q_EMIT enabledChanged(enabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbsencesModel::finished()
|
||||||
|
{
|
||||||
|
if(!m_reply->success())
|
||||||
|
Q_EMIT errorOccured(m_reply->message());
|
||||||
|
|
||||||
|
beginResetModel();
|
||||||
|
m_absences = m_reply->absences();
|
||||||
|
endResetModel();
|
||||||
|
|
||||||
|
auto oldEnabled = enabled();
|
||||||
|
|
||||||
|
m_reply = Q_NULLPTR;
|
||||||
|
|
||||||
|
if(oldEnabled != enabled())
|
||||||
|
Q_EMIT enabledChanged(enabled());
|
||||||
|
}
|
44
plugins/absenceplugin/absencesmodel.h
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <QAbstractListModel>
|
||||||
|
#include <QDate>
|
||||||
|
|
||||||
|
#include "replies/getabsencesreply.h"
|
||||||
|
|
||||||
|
class ZeiterfassungApi;
|
||||||
|
|
||||||
|
class AbsencesModel : public QAbstractListModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AbsencesModel(int userId, const QDate &date, ZeiterfassungApi &erfassung, QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
bool enabled() const;
|
||||||
|
|
||||||
|
// QAbstractItemModel interface
|
||||||
|
int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
|
||||||
|
int columnCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
|
||||||
|
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
|
||||||
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void enabledChanged(bool enabled);
|
||||||
|
void errorOccured(const QString &message);
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void setDate(const QDate &date);
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void finished();
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_userId;
|
||||||
|
QDate m_date;
|
||||||
|
ZeiterfassungApi &m_erfassung;
|
||||||
|
std::unique_ptr<GetAbsencesReply> m_reply;
|
||||||
|
QVector<GetAbsencesReply::Absence> m_absences;
|
||||||
|
};
|
23
plugins/absenceplugin/absencewidget.cpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#include "absencewidget.h"
|
||||||
|
|
||||||
|
#include "stripswidget.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include "absencedialog.h"
|
||||||
|
|
||||||
|
AbsenceWidget::AbsenceWidget(StripsWidget &stripsWidget) :
|
||||||
|
QToolButton(&stripsWidget),
|
||||||
|
m_stripsWidget(stripsWidget)
|
||||||
|
{
|
||||||
|
setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/absenceplugin/images/absence.png")));
|
||||||
|
setText(tr("Absence"));
|
||||||
|
|
||||||
|
connect(this, &QAbstractButton::pressed, this, &AbsenceWidget::pressedSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbsenceWidget::pressedSlot()
|
||||||
|
{
|
||||||
|
AbsenceDialog dialog(m_stripsWidget.mainWindow().userInfo().userId, m_stripsWidget.date(),
|
||||||
|
m_stripsWidget.mainWindow().erfassung(), this);
|
||||||
|
dialog.exec();
|
||||||
|
}
|
19
plugins/absenceplugin/absencewidget.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
|
class StripsWidget;
|
||||||
|
|
||||||
|
class AbsenceWidget : public QToolButton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AbsenceWidget(StripsWidget &stripsWidget);
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void pressedSlot();
|
||||||
|
|
||||||
|
private:
|
||||||
|
StripsWidget &m_stripsWidget;
|
||||||
|
};
|
BIN
plugins/absenceplugin/images/absence.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
83
plugins/absenceplugin/translations/absenceplugin_de.ts
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="de_DE">
|
||||||
|
<context>
|
||||||
|
<name>AbsenceDialog</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencedialog.ui" line="14"/>
|
||||||
|
<source>Absences</source>
|
||||||
|
<translation>Abwesenheiten</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencedialog.cpp" line="22"/>
|
||||||
|
<source>Absences for %0</source>
|
||||||
|
<translation>Abwesenheiten für %0</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencedialog.cpp" line="22"/>
|
||||||
|
<source>dd.MM.yyyy</source>
|
||||||
|
<translation>dd.MM.yyyy</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencedialog.cpp" line="39"/>
|
||||||
|
<source>Could not load absences!</source>
|
||||||
|
<translation>Konnte Abwesenheiten nicht laden!</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>AbsenceWidget</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencewidget.cpp" line="13"/>
|
||||||
|
<source>Absence</source>
|
||||||
|
<translation>Abwesenheit</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>AbsencesModel</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="69"/>
|
||||||
|
<source>altRepresentative</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="70"/>
|
||||||
|
<source>compositeId</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="71"/>
|
||||||
|
<source>end</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="72"/>
|
||||||
|
<source>hourCategory</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="73"/>
|
||||||
|
<source>openMarking</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="74"/>
|
||||||
|
<source>persNr</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="75"/>
|
||||||
|
<source>representative</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="76"/>
|
||||||
|
<source>start</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="77"/>
|
||||||
|
<source>text</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
83
plugins/absenceplugin/translations/absenceplugin_en.ts
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US">
|
||||||
|
<context>
|
||||||
|
<name>AbsenceDialog</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencedialog.ui" line="14"/>
|
||||||
|
<source>Absences</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencedialog.cpp" line="22"/>
|
||||||
|
<source>Absences for %0</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencedialog.cpp" line="22"/>
|
||||||
|
<source>dd.MM.yyyy</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencedialog.cpp" line="39"/>
|
||||||
|
<source>Could not load absences!</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>AbsenceWidget</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencewidget.cpp" line="13"/>
|
||||||
|
<source>Absence</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>AbsencesModel</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="69"/>
|
||||||
|
<source>altRepresentative</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="70"/>
|
||||||
|
<source>compositeId</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="71"/>
|
||||||
|
<source>end</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="72"/>
|
||||||
|
<source>hourCategory</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="73"/>
|
||||||
|
<source>openMarking</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="74"/>
|
||||||
|
<source>persNr</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="75"/>
|
||||||
|
<source>representative</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="76"/>
|
||||||
|
<source>start</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../absencesmodel.cpp" line="77"/>
|
||||||
|
<source>text</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
@@ -21,8 +21,8 @@
|
|||||||
#include "models/bookingsmodel.h"
|
#include "models/bookingsmodel.h"
|
||||||
#include "models/timeassignmentsmodel.h"
|
#include "models/timeassignmentsmodel.h"
|
||||||
|
|
||||||
AdvancedViewDialog::AdvancedViewDialog(StripsWidget &stripsWidget) :
|
AdvancedViewDialog::AdvancedViewDialog(StripsWidget &stripsWidget, QWidget *parent) :
|
||||||
QDialog(&stripsWidget.mainWindow()),
|
ZeiterfassungDialog(parent),
|
||||||
ui(new Ui::AdvancedViewDialog),
|
ui(new Ui::AdvancedViewDialog),
|
||||||
m_stripsWidget(stripsWidget),
|
m_stripsWidget(stripsWidget),
|
||||||
m_bookingsModel(new BookingsModel(stripsWidget, this)),
|
m_bookingsModel(new BookingsModel(stripsWidget, this)),
|
||||||
@@ -54,7 +54,7 @@ void AdvancedViewDialog::contextMenuBooking(const QPoint &pos)
|
|||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
auto createAction = menu.addAction(tr("Create booking"));
|
auto createAction = menu.addAction(tr("Create booking"));
|
||||||
auto refreshAction = menu.addAction(QIcon(QPixmap(QStringLiteral(":/zeiterfassunglib/images/refresh.png"))), tr("Refresh bookings"));
|
auto refreshAction = menu.addAction(QIcon(QPixmap(QStringLiteral(":/zeiterfassungguilib/images/refresh.png"))), tr("Refresh bookings"));
|
||||||
auto selectedAction = menu.exec(ui->bookingsView->viewport()->mapToGlobal(pos));
|
auto selectedAction = menu.exec(ui->bookingsView->viewport()->mapToGlobal(pos));
|
||||||
if(selectedAction == createAction)
|
if(selectedAction == createAction)
|
||||||
{
|
{
|
||||||
@@ -160,7 +160,7 @@ void AdvancedViewDialog::contextMenuTimeAssignment(const QPoint &pos)
|
|||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
auto createAction = menu.addAction(tr("Create time assignment"));
|
auto createAction = menu.addAction(tr("Create time assignment"));
|
||||||
auto refreshAction = menu.addAction(QIcon(QPixmap(QStringLiteral(":/zeiterfassunglib/images/refresh.png"))), tr("Refresh time assignments"));
|
auto refreshAction = menu.addAction(QIcon(QPixmap(QStringLiteral(":/zeiterfassungguilib/images/refresh.png"))), tr("Refresh time assignments"));
|
||||||
auto selectedAction = menu.exec(ui->timeAssignmentsView->viewport()->mapToGlobal(pos));
|
auto selectedAction = menu.exec(ui->timeAssignmentsView->viewport()->mapToGlobal(pos));
|
||||||
if(selectedAction == createAction)
|
if(selectedAction == createAction)
|
||||||
{
|
{
|
||||||
|
@@ -1,19 +1,18 @@
|
|||||||
#ifndef ADVANCEDVIEWDIALOG_H
|
#pragma once
|
||||||
#define ADVANCEDVIEWDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
#include "zeiterfassungdialog.h"
|
||||||
|
|
||||||
namespace Ui { class AdvancedViewDialog; }
|
namespace Ui { class AdvancedViewDialog; }
|
||||||
class StripsWidget;
|
class StripsWidget;
|
||||||
class BookingsModel;
|
class BookingsModel;
|
||||||
class TimeAssignmentsModel;
|
class TimeAssignmentsModel;
|
||||||
|
|
||||||
class AdvancedViewDialog : public QDialog
|
class AdvancedViewDialog : public ZeiterfassungDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AdvancedViewDialog(StripsWidget &stripsWidget);
|
explicit AdvancedViewDialog(StripsWidget &stripsWidget, QWidget *parent = Q_NULLPTR);
|
||||||
~AdvancedViewDialog();
|
~AdvancedViewDialog();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
@@ -28,5 +27,3 @@ private:
|
|||||||
BookingsModel *m_bookingsModel;
|
BookingsModel *m_bookingsModel;
|
||||||
TimeAssignmentsModel *m_timeAssignmentsModel;
|
TimeAssignmentsModel *m_timeAssignmentsModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ADVANCEDVIEWDIALOG_H
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef ADVANCEDVIEWPLUGIN_H
|
#pragma once
|
||||||
#define ADVANCEDVIEWPLUGIN_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -23,5 +22,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
QTranslator m_translator;
|
QTranslator m_translator;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ADVANCEDVIEWPLUGIN_H
|
|
||||||
|
@@ -5,12 +5,14 @@ TEMPLATE = lib
|
|||||||
|
|
||||||
CONFIG += shared c++14
|
CONFIG += shared c++14
|
||||||
|
|
||||||
DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../zeiterfassunglib
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
DEPENDPATH += $$PWD/../../zeiterfassunglib
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
@@ -42,8 +44,3 @@ TRANSLATIONS += translations/advancedviewplugin_en.ts \
|
|||||||
OTHER_FILES += advancedviewplugin.json
|
OTHER_FILES += advancedviewplugin.json
|
||||||
|
|
||||||
include(../../lrelease.pri)
|
include(../../lrelease.pri)
|
||||||
|
|
||||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/advancedviewplugin_en.qm \
|
|
||||||
$${OUT_PWD}/translations/advancedviewplugin_de.qm
|
|
||||||
|
|
||||||
include(../copy_translations.pri)
|
|
||||||
|
@@ -25,6 +25,6 @@ void AdvancedViewWidget::dateChanged(const QDate &date)
|
|||||||
|
|
||||||
void AdvancedViewWidget::pressedSlot()
|
void AdvancedViewWidget::pressedSlot()
|
||||||
{
|
{
|
||||||
AdvancedViewDialog dialog(m_stripsWidget);
|
AdvancedViewDialog dialog(m_stripsWidget, this);
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef ADVANCEDVIEWWIDGET_H
|
#pragma once
|
||||||
#define ADVANCEDVIEWWIDGET_H
|
|
||||||
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
@@ -19,5 +18,3 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
StripsWidget &m_stripsWidget;
|
StripsWidget &m_stripsWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ADVANCEDVIEWWIDGET_H
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#include "ui_bookingdialog.h"
|
#include "ui_bookingdialog.h"
|
||||||
|
|
||||||
BookingDialog::BookingDialog(QWidget *parent) :
|
BookingDialog::BookingDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
ZeiterfassungDialog(parent),
|
||||||
ui(new Ui::BookingDialog)
|
ui(new Ui::BookingDialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
#ifndef BOOKINGDIALOG_H
|
#pragma once
|
||||||
#define BOOKINGDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
|
#include "zeiterfassungdialog.h"
|
||||||
|
|
||||||
namespace Ui { class BookingDialog; }
|
namespace Ui { class BookingDialog; }
|
||||||
|
|
||||||
class BookingDialog : public QDialog
|
class BookingDialog : public ZeiterfassungDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -29,5 +29,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::BookingDialog *ui;
|
Ui::BookingDialog *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BOOKINGDIALOG_H
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
TimeAssignmentDialog::TimeAssignmentDialog(const QMap<QString, QString> &projects, const ZeiterfassungSettings &settings,
|
TimeAssignmentDialog::TimeAssignmentDialog(const QMap<QString, QString> &projects, const ZeiterfassungSettings &settings,
|
||||||
QWidget *parent) :
|
QWidget *parent) :
|
||||||
QDialog(parent),
|
ZeiterfassungDialog(parent),
|
||||||
ui(new Ui::TimeAssignmentDialog)
|
ui(new Ui::TimeAssignmentDialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@@ -1,16 +1,16 @@
|
|||||||
#ifndef TIMEASSIGNMENTDIALOG_H
|
#pragma once
|
||||||
#define TIMEASSIGNMENTDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
|
#include "zeiterfassungdialog.h"
|
||||||
|
|
||||||
template <class Key, class T> class QMap;
|
template <class Key, class T> class QMap;
|
||||||
|
|
||||||
class ZeiterfassungSettings;
|
class ZeiterfassungSettings;
|
||||||
|
|
||||||
namespace Ui { class TimeAssignmentDialog; }
|
namespace Ui { class TimeAssignmentDialog; }
|
||||||
|
|
||||||
class TimeAssignmentDialog : public QDialog
|
class TimeAssignmentDialog : public ZeiterfassungDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -40,5 +40,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::TimeAssignmentDialog *ui;
|
Ui::TimeAssignmentDialog *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TIMEASSIGNMENTDIALOG_H
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef BOOKINGSMODEL_H
|
#pragma once
|
||||||
#define BOOKINGSMODEL_H
|
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
@@ -36,5 +35,3 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
StripsWidget &m_stripsWidget;
|
StripsWidget &m_stripsWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BOOKINGSMODEL_H
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef TIMEASSIGNMENTSMODEL_H
|
#pragma once
|
||||||
#define TIMEASSIGNMENTSMODEL_H
|
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
@@ -37,5 +36,3 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
StripsWidget &m_stripsWidget;
|
StripsWidget &m_stripsWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TIMEASSIGNMENTSMODEL_H
|
|
||||||
|
@@ -9,82 +9,82 @@
|
|||||||
<translation>Erweiterte Anzeige</translation>
|
<translation>Erweiterte Anzeige</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="56"/>
|
<location filename="../advancedviewdialog.cpp" line="62"/>
|
||||||
<source>Create booking</source>
|
<source>Create booking</source>
|
||||||
<translation>Buchung erstellen</translation>
|
<translation>Buchung erstellen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="57"/>
|
<location filename="../advancedviewdialog.cpp" line="63"/>
|
||||||
<source>Refresh bookings</source>
|
<source>Refresh bookings</source>
|
||||||
<translation>Buchungen aktualisieren</translation>
|
<translation>Buchungen aktualisieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="83"/>
|
<location filename="../advancedviewdialog.cpp" line="89"/>
|
||||||
<source>Could not create booking!</source>
|
<source>Could not create booking!</source>
|
||||||
<translation>Konnte Buchung nicht erstellen!</translation>
|
<translation>Konnte Buchung nicht erstellen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="98"/>
|
<location filename="../advancedviewdialog.cpp" line="104"/>
|
||||||
<source>Edit booking</source>
|
<source>Edit booking</source>
|
||||||
<translation>Buchung bearbeiten</translation>
|
<translation>Buchung bearbeiten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="99"/>
|
<location filename="../advancedviewdialog.cpp" line="105"/>
|
||||||
<source>Delete booking</source>
|
<source>Delete booking</source>
|
||||||
<translation>Buchung löschen</translation>
|
<translation>Buchung löschen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="129"/>
|
<location filename="../advancedviewdialog.cpp" line="135"/>
|
||||||
<source>Could not edit booking!</source>
|
<source>Could not edit booking!</source>
|
||||||
<translation>Konnte Buchung nicht bearbeiten!</translation>
|
<translation>Konnte Buchung nicht bearbeiten!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="137"/>
|
<location filename="../advancedviewdialog.cpp" line="143"/>
|
||||||
<source>Do you really want to delete the booking?</source>
|
<source>Do you really want to delete the booking?</source>
|
||||||
<translation>Möchten Sie die Buchung wirklich löschen?</translation>
|
<translation>Möchten Sie die Buchung wirklich löschen?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="149"/>
|
<location filename="../advancedviewdialog.cpp" line="155"/>
|
||||||
<source>Could not delete booking!</source>
|
<source>Could not delete booking!</source>
|
||||||
<translation>Konnte Buchung nicht löschen!</translation>
|
<translation>Konnte Buchung nicht löschen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="162"/>
|
<location filename="../advancedviewdialog.cpp" line="168"/>
|
||||||
<source>Create time assignment</source>
|
<source>Create time assignment</source>
|
||||||
<translation>Kontierung erstellen</translation>
|
<translation>Kontierung erstellen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="163"/>
|
<location filename="../advancedviewdialog.cpp" line="169"/>
|
||||||
<source>Refresh time assignments</source>
|
<source>Refresh time assignments</source>
|
||||||
<translation>Kontierungen aktualisieren</translation>
|
<translation>Kontierungen aktualisieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="191"/>
|
<location filename="../advancedviewdialog.cpp" line="197"/>
|
||||||
<source>Could not create time assignment!</source>
|
<source>Could not create time assignment!</source>
|
||||||
<translation>Konnte Kontierung nicht erstellen!</translation>
|
<translation>Konnte Kontierung nicht erstellen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="206"/>
|
<location filename="../advancedviewdialog.cpp" line="212"/>
|
||||||
<source>Edit time assignment</source>
|
<source>Edit time assignment</source>
|
||||||
<translation>Kontierung bearbeiten</translation>
|
<translation>Kontierung bearbeiten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="207"/>
|
<location filename="../advancedviewdialog.cpp" line="213"/>
|
||||||
<source>Delete time assignment</source>
|
<source>Delete time assignment</source>
|
||||||
<translation>Kontierung löschen</translation>
|
<translation>Kontierung löschen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="242"/>
|
<location filename="../advancedviewdialog.cpp" line="248"/>
|
||||||
<source>Could not edit time assignment!</source>
|
<source>Could not edit time assignment!</source>
|
||||||
<translation>Konnte Kontierung nicht bearbeiten!</translation>
|
<translation>Konnte Kontierung nicht bearbeiten!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="250"/>
|
<location filename="../advancedviewdialog.cpp" line="256"/>
|
||||||
<source>Do you really want to delete the time assignment?</source>
|
<source>Do you really want to delete the time assignment?</source>
|
||||||
<translation>Möchten Sie die Kontierung wirklich löschen?</translation>
|
<translation>Möchten Sie die Kontierung wirklich löschen?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="264"/>
|
<location filename="../advancedviewdialog.cpp" line="270"/>
|
||||||
<source>Could not delete time assignment!</source>
|
<source>Could not delete time assignment!</source>
|
||||||
<translation>Konnte Kontierung nicht löschen!</translation>
|
<translation>Konnte Kontierung nicht löschen!</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -193,8 +193,8 @@
|
|||||||
<translation>Text:</translation>
|
<translation>Text:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="26"/>
|
<location filename="../dialogs/timeassignmentdialog.cpp" line="32"/>
|
||||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="35"/>
|
<location filename="../dialogs/timeassignmentdialog.cpp" line="41"/>
|
||||||
<source>%0 (%1)</source>
|
<source>%0 (%1)</source>
|
||||||
<translation>%0 (%1)</translation>
|
<translation>%0 (%1)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -9,82 +9,82 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="56"/>
|
<location filename="../advancedviewdialog.cpp" line="62"/>
|
||||||
<source>Create booking</source>
|
<source>Create booking</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="57"/>
|
<location filename="../advancedviewdialog.cpp" line="63"/>
|
||||||
<source>Refresh bookings</source>
|
<source>Refresh bookings</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="83"/>
|
<location filename="../advancedviewdialog.cpp" line="89"/>
|
||||||
<source>Could not create booking!</source>
|
<source>Could not create booking!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="98"/>
|
<location filename="../advancedviewdialog.cpp" line="104"/>
|
||||||
<source>Edit booking</source>
|
<source>Edit booking</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="99"/>
|
<location filename="../advancedviewdialog.cpp" line="105"/>
|
||||||
<source>Delete booking</source>
|
<source>Delete booking</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="129"/>
|
<location filename="../advancedviewdialog.cpp" line="135"/>
|
||||||
<source>Could not edit booking!</source>
|
<source>Could not edit booking!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="137"/>
|
<location filename="../advancedviewdialog.cpp" line="143"/>
|
||||||
<source>Do you really want to delete the booking?</source>
|
<source>Do you really want to delete the booking?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="149"/>
|
<location filename="../advancedviewdialog.cpp" line="155"/>
|
||||||
<source>Could not delete booking!</source>
|
<source>Could not delete booking!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="162"/>
|
<location filename="../advancedviewdialog.cpp" line="168"/>
|
||||||
<source>Create time assignment</source>
|
<source>Create time assignment</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="163"/>
|
<location filename="../advancedviewdialog.cpp" line="169"/>
|
||||||
<source>Refresh time assignments</source>
|
<source>Refresh time assignments</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="191"/>
|
<location filename="../advancedviewdialog.cpp" line="197"/>
|
||||||
<source>Could not create time assignment!</source>
|
<source>Could not create time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="206"/>
|
<location filename="../advancedviewdialog.cpp" line="212"/>
|
||||||
<source>Edit time assignment</source>
|
<source>Edit time assignment</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="207"/>
|
<location filename="../advancedviewdialog.cpp" line="213"/>
|
||||||
<source>Delete time assignment</source>
|
<source>Delete time assignment</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="242"/>
|
<location filename="../advancedviewdialog.cpp" line="248"/>
|
||||||
<source>Could not edit time assignment!</source>
|
<source>Could not edit time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="250"/>
|
<location filename="../advancedviewdialog.cpp" line="256"/>
|
||||||
<source>Do you really want to delete the time assignment?</source>
|
<source>Do you really want to delete the time assignment?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../advancedviewdialog.cpp" line="264"/>
|
<location filename="../advancedviewdialog.cpp" line="270"/>
|
||||||
<source>Could not delete time assignment!</source>
|
<source>Could not delete time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -193,8 +193,8 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="26"/>
|
<location filename="../dialogs/timeassignmentdialog.cpp" line="32"/>
|
||||||
<location filename="../dialogs/timeassignmentdialog.cpp" line="35"/>
|
<location filename="../dialogs/timeassignmentdialog.cpp" line="41"/>
|
||||||
<source>%0 (%1)</source>
|
<source>%0 (%1)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
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
|
|
61
plugins/devtoolsplugin/devtoolsplugin.cpp
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
#include "devtoolsplugin.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include "logmodel.h"
|
||||||
|
#include "logdialog.h"
|
||||||
|
|
||||||
|
std::shared_ptr<LogModel> model;
|
||||||
|
QtMessageHandler previousHandler;
|
||||||
|
|
||||||
|
void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message)
|
||||||
|
{
|
||||||
|
previousHandler(type, context, message);
|
||||||
|
|
||||||
|
model->log(type, context.file, context.line, context.function, context.category, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerMessageHandler()
|
||||||
|
{
|
||||||
|
model = std::make_shared<LogModel>();
|
||||||
|
previousHandler = qInstallMessageHandler(myMessageHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_COREAPP_STARTUP_FUNCTION(registerMessageHandler)
|
||||||
|
|
||||||
|
DevToolsPlugin::DevToolsPlugin(QObject *parent) :
|
||||||
|
ZeiterfassungPlugin(parent)
|
||||||
|
{
|
||||||
|
qDebug() << "called";
|
||||||
|
|
||||||
|
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||||
|
|
||||||
|
if(m_translator.load(QLocale(), QStringLiteral("devtoolsplugin"), QStringLiteral("_"), dir))
|
||||||
|
{
|
||||||
|
if(!QCoreApplication::installTranslator(&m_translator))
|
||||||
|
{
|
||||||
|
qWarning() << "could not install translation devtoolsplugin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning() << "could not load translation devtoolsplugin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DevToolsPlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
{
|
||||||
|
auto dialog = new LogDialog(&mainWindow);
|
||||||
|
dialog->setModel(model.get());
|
||||||
|
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/devtoolsplugin/images/dev-tools.png")),
|
||||||
|
tr("Show log"), dialog, &QWidget::show);
|
||||||
|
}
|
22
plugins/devtoolsplugin/devtoolsplugin.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
|
#include "zeiterfassungplugin.h"
|
||||||
|
|
||||||
|
class Q_DECL_EXPORT DevToolsPlugin : public ZeiterfassungPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "devtoolsplugin.json")
|
||||||
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit DevToolsPlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
// ZeiterfassungPlugin interface
|
||||||
|
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTranslator m_translator;
|
||||||
|
};
|
0
plugins/devtoolsplugin/devtoolsplugin.json
Normal file
36
plugins/devtoolsplugin/devtoolsplugin.pro
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
QT += core network gui widgets
|
||||||
|
|
||||||
|
TARGET = devtoolsplugin
|
||||||
|
TEMPLATE = lib
|
||||||
|
|
||||||
|
CONFIG += shared c++14
|
||||||
|
|
||||||
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
|
HEADERS += devtoolsplugin.h \
|
||||||
|
logdialog.h \
|
||||||
|
logmodel.h
|
||||||
|
|
||||||
|
SOURCES += devtoolsplugin.cpp \
|
||||||
|
logdialog.cpp \
|
||||||
|
logmodel.cpp
|
||||||
|
|
||||||
|
FORMS += logdialog.ui
|
||||||
|
|
||||||
|
RESOURCES += devtoolsplugin_resources.qrc
|
||||||
|
|
||||||
|
TRANSLATIONS += translations/devtoolsplugin_en.ts \
|
||||||
|
translations/devtoolsplugin_de.ts
|
||||||
|
|
||||||
|
OTHER_FILES += devtoolsplugin.json
|
||||||
|
|
||||||
|
include(../../lrelease.pri)
|
5
plugins/devtoolsplugin/devtoolsplugin_resources.qrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/zeiterfassung/plugins/devtoolsplugin">
|
||||||
|
<file>images/dev-tools.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
BIN
plugins/devtoolsplugin/images/dev-tools.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
19
plugins/devtoolsplugin/logdialog.cpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#include "logdialog.h"
|
||||||
|
#include "ui_logdialog.h"
|
||||||
|
|
||||||
|
LogDialog::LogDialog(QWidget *parent) :
|
||||||
|
ZeiterfassungDialog(parent),
|
||||||
|
ui(new Ui::LogDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
LogDialog::~LogDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogDialog::setModel(QAbstractItemModel *model)
|
||||||
|
{
|
||||||
|
ui->treeView->setModel(model);
|
||||||
|
}
|
21
plugins/devtoolsplugin/logdialog.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "zeiterfassungdialog.h"
|
||||||
|
|
||||||
|
class QAbstractItemModel;
|
||||||
|
|
||||||
|
namespace Ui { class LogDialog; }
|
||||||
|
|
||||||
|
class LogDialog : public ZeiterfassungDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit LogDialog(QWidget *parent = Q_NULLPTR);
|
||||||
|
~LogDialog();
|
||||||
|
|
||||||
|
void setModel(QAbstractItemModel *model);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::LogDialog *ui;
|
||||||
|
};
|
67
plugins/devtoolsplugin/logdialog.ui
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>LogDialog</class>
|
||||||
|
<widget class="QDialog" name="LogDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>694</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Log</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeView" name="treeView"/>
|
||||||
|
</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>LogDialog</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>LogDialog</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>
|
80
plugins/devtoolsplugin/logmodel.cpp
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
#include "logmodel.h"
|
||||||
|
|
||||||
|
LogModel::LogModel(QObject *parent) :
|
||||||
|
QAbstractListModel(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogModel::log(QtMsgType type, const char *fileName, int lineNumber, const char *functionName, const char *categoryName, const QString &message)
|
||||||
|
{
|
||||||
|
beginInsertRows(QModelIndex(), m_entries.count(), m_entries.count());
|
||||||
|
m_entries.append(Entry { QDateTime::currentDateTime(), type, fileName, lineNumber, functionName, categoryName, message });
|
||||||
|
endInsertRows();
|
||||||
|
}
|
||||||
|
|
||||||
|
int LogModel::rowCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
return m_entries.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int LogModel::columnCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant LogModel::data(const QModelIndex &index, int role) const
|
||||||
|
{
|
||||||
|
Q_ASSERT(index.row() < m_entries.count());
|
||||||
|
const auto &entry = m_entries.at(index.row());
|
||||||
|
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
switch(index.column())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
switch(entry.type)
|
||||||
|
{
|
||||||
|
case QtDebugMsg: return tr("Debug");
|
||||||
|
case QtWarningMsg: return tr("Warning");
|
||||||
|
case QtCriticalMsg: return tr("Critical");
|
||||||
|
case QtFatalMsg: return tr("Fatal");
|
||||||
|
case QtInfoMsg: return tr("Info");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1: return entry.dateTime.toString(QStringLiteral("dd.MM.yyyy HH:mm:ss.zzz"));
|
||||||
|
case 2: return entry.functionName;
|
||||||
|
case 3: return entry.message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant LogModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
|
{
|
||||||
|
switch(orientation)
|
||||||
|
{
|
||||||
|
case Qt::Horizontal:
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
switch(section)
|
||||||
|
{
|
||||||
|
case 0: return tr("Type");
|
||||||
|
case 1: return tr("Timestamp");
|
||||||
|
case 2: return tr("Function");
|
||||||
|
case 3: return tr("Message");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
qt_noop();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
36
plugins/devtoolsplugin/logmodel.h
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QAbstractListModel>
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <qlogging.h>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
class LogModel : public QAbstractListModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit LogModel(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
void log(QtMsgType type, const char *fileName, int lineNumber, const char *functionName, const char *categoryName, const QString &message);
|
||||||
|
|
||||||
|
// QAbstractItemModel interface
|
||||||
|
int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
|
||||||
|
int columnCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
|
||||||
|
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
|
||||||
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct Entry
|
||||||
|
{
|
||||||
|
QDateTime dateTime;
|
||||||
|
QtMsgType type;
|
||||||
|
const char *fileName;
|
||||||
|
int lineNumber;
|
||||||
|
const char *functionName;
|
||||||
|
const char *categoryName;
|
||||||
|
QString message;
|
||||||
|
};
|
||||||
|
|
||||||
|
QList<Entry> m_entries;
|
||||||
|
};
|
57
plugins/devtoolsplugin/translations/devtoolsplugin_de.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="de_DE">
|
||||||
|
<context>
|
||||||
|
<name>DevToolsPlugin</name>
|
||||||
|
<message>
|
||||||
|
<source>Show log</source>
|
||||||
|
<translation>Log anzeigen</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>LogDialog</name>
|
||||||
|
<message>
|
||||||
|
<source>Log</source>
|
||||||
|
<translation>Log</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>LogModel</name>
|
||||||
|
<message>
|
||||||
|
<source>Type</source>
|
||||||
|
<translation>Typ</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Timestamp</source>
|
||||||
|
<translation>Zeitpunkt</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Function</source>
|
||||||
|
<translation>Funktion</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Message</source>
|
||||||
|
<translation>Nachricht</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Debug</source>
|
||||||
|
<translation>Debug</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Warning</source>
|
||||||
|
<translation>Warnung</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Critical</source>
|
||||||
|
<translation>Kritisch</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Fatal</source>
|
||||||
|
<translation>Fatal</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Info</source>
|
||||||
|
<translation>Info</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
57
plugins/devtoolsplugin/translations/devtoolsplugin_en.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US">
|
||||||
|
<context>
|
||||||
|
<name>DevToolsPlugin</name>
|
||||||
|
<message>
|
||||||
|
<source>Show log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>LogDialog</name>
|
||||||
|
<message>
|
||||||
|
<source>Log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>LogModel</name>
|
||||||
|
<message>
|
||||||
|
<source>Type</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Timestamp</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Function</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Debug</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Warning</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Critical</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Fatal</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Info</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
@@ -2,50 +2,18 @@
|
|||||||
#include "ui_lunchmealdialog.h"
|
#include "ui_lunchmealdialog.h"
|
||||||
|
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QNetworkAccessManager>
|
|
||||||
#include <QNetworkRequest>
|
|
||||||
#include <QUrl>
|
|
||||||
|
|
||||||
#include "stripswidget.h"
|
LunchMealDialog::LunchMealDialog(const QDate &date, const QString &content, QWidget *parent) :
|
||||||
#include "mainwindow.h"
|
ZeiterfassungDialog(parent),
|
||||||
#include "zeiterfassungsettings.h"
|
|
||||||
#include "zeiterfassungapi.h"
|
|
||||||
|
|
||||||
LunchMealDialog::LunchMealDialog(StripsWidget &stripsWidget) :
|
|
||||||
QDialog(&stripsWidget.mainWindow()),
|
|
||||||
ui(new Ui::LunchMealDialog)
|
ui(new Ui::LunchMealDialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->labelTitle->setText(tr("Lunch meal for %0").arg(stripsWidget.date().toString(tr("dd.MM.yyyy"))));
|
ui->labelTitle->setText(tr("Lunch meal for %0").arg(date.toString(tr("dd.MM.yyyy"))));
|
||||||
|
ui->labelLunchMeal->setText(content);
|
||||||
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()
|
LunchMealDialog::~LunchMealDialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
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;
|
|
||||||
}
|
|
||||||
|
@@ -1,29 +1,21 @@
|
|||||||
#ifndef LUNCHMEALDIALOG_H
|
#pragma once
|
||||||
#define LUNCHMEALDIALOG_H
|
|
||||||
|
|
||||||
#include <memory>
|
#include "zeiterfassungdialog.h"
|
||||||
|
|
||||||
#include <QDialog>
|
class QDate;
|
||||||
#include <QNetworkReply>
|
|
||||||
|
|
||||||
class StripsWidget;
|
class StripsWidget;
|
||||||
|
|
||||||
namespace Ui { class LunchMealDialog; }
|
namespace Ui { class LunchMealDialog; }
|
||||||
|
|
||||||
class LunchMealDialog : public QDialog
|
class LunchMealDialog : public ZeiterfassungDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LunchMealDialog(StripsWidget &stripsWidget);
|
explicit LunchMealDialog(const QDate &date, const QString &content, QWidget *parent = Q_NULLPTR);
|
||||||
~LunchMealDialog();
|
~LunchMealDialog();
|
||||||
|
|
||||||
private Q_SLOTS:
|
|
||||||
void finished();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::LunchMealDialog *ui;
|
Ui::LunchMealDialog *ui;
|
||||||
std::unique_ptr<QNetworkReply> m_reply;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUNCHMEALDIALOG_H
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef LUNCHMEALPLUGIN_H
|
#pragma once
|
||||||
#define LUNCHMEALPLUGIN_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -23,5 +22,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
QTranslator m_translator;
|
QTranslator m_translator;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUNCHMEALPLUGIN_H
|
|
||||||
|
@@ -5,22 +5,24 @@ TEMPLATE = lib
|
|||||||
|
|
||||||
CONFIG += shared c++14
|
CONFIG += shared c++14
|
||||||
|
|
||||||
DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../zeiterfassunglib
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
DEPENDPATH += $$PWD/../../zeiterfassunglib
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
HEADERS += lunchmealplugin.h \
|
HEADERS += lunchmealdialog.h \
|
||||||
lunchmealwidget.h \
|
lunchmealplugin.h \
|
||||||
lunchmealdialog.h
|
lunchmealwidget.h
|
||||||
|
|
||||||
SOURCES += lunchmealplugin.cpp \
|
SOURCES += lunchmealdialog.cpp \
|
||||||
lunchmealwidget.cpp \
|
lunchmealplugin.cpp \
|
||||||
lunchmealdialog.cpp
|
lunchmealwidget.cpp
|
||||||
|
|
||||||
FORMS += lunchmealdialog.ui
|
FORMS += lunchmealdialog.ui
|
||||||
|
|
||||||
@@ -32,8 +34,3 @@ TRANSLATIONS += translations/lunchmealplugin_en.ts \
|
|||||||
OTHER_FILES += lunchmealplugin.json
|
OTHER_FILES += lunchmealplugin.json
|
||||||
|
|
||||||
include(../../lrelease.pri)
|
include(../../lrelease.pri)
|
||||||
|
|
||||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/lunchmealplugin_en.qm \
|
|
||||||
$${OUT_PWD}/translations/lunchmealplugin_de.qm
|
|
||||||
|
|
||||||
include(../copy_translations.pri)
|
|
||||||
|
@@ -1,9 +1,15 @@
|
|||||||
#include "lunchmealwidget.h"
|
#include "lunchmealwidget.h"
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
#include <QNetworkRequest>
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QStringBuilder>
|
||||||
|
|
||||||
#include "stripswidget.h"
|
#include "stripswidget.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "zeiterfassungsettings.h"
|
||||||
#include "zeiterfassungapi.h"
|
#include "zeiterfassungapi.h"
|
||||||
|
|
||||||
#include "lunchmealdialog.h"
|
#include "lunchmealdialog.h"
|
||||||
@@ -16,10 +22,48 @@ LunchMealWidget::LunchMealWidget(StripsWidget &stripsWidget) :
|
|||||||
setText(tr("Lunch meal"));
|
setText(tr("Lunch meal"));
|
||||||
|
|
||||||
connect(this, &QAbstractButton::pressed, this, &LunchMealWidget::pressedSlot);
|
connect(this, &QAbstractButton::pressed, this, &LunchMealWidget::pressedSlot);
|
||||||
|
|
||||||
|
connect(&m_stripsWidget, &StripsWidget::dateChanged, this, &LunchMealWidget::dateChanged);
|
||||||
|
dateChanged(m_stripsWidget.date());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LunchMealWidget::pressedSlot()
|
void LunchMealWidget::pressedSlot()
|
||||||
{
|
{
|
||||||
LunchMealDialog dialog(m_stripsWidget);
|
LunchMealDialog dialog(m_stripsWidget.date(), m_content, this);
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LunchMealWidget::dateChanged(const QDate &date)
|
||||||
|
{
|
||||||
|
setEnabled(false);
|
||||||
|
setVisible(false);
|
||||||
|
|
||||||
|
const auto &settings = m_stripsWidget.mainWindow().settings();
|
||||||
|
|
||||||
|
auto url = settings.value(QStringLiteral("LunchMealPlugin/url"),
|
||||||
|
QStringLiteral("https://brunner.ninja/lunch/%0.txt")).toString()
|
||||||
|
.arg(date.toString(settings.value(QStringLiteral("LunchMealPlugin/dateFormat"), QStringLiteral("yyyy-MM-dd")).toString()));
|
||||||
|
m_reply = std::unique_ptr<QNetworkReply>(m_stripsWidget.mainWindow().erfassung().manager()->get(QNetworkRequest(QUrl(url))));
|
||||||
|
connect(m_reply.get(), &QNetworkReply::finished, this, &LunchMealWidget::finished);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LunchMealWidget::finished()
|
||||||
|
{
|
||||||
|
if(m_reply->error() != QNetworkReply::NoError &&
|
||||||
|
m_reply->error() != QNetworkReply::ContentNotFoundError)
|
||||||
|
{
|
||||||
|
QMessageBox::warning(&m_stripsWidget.mainWindow(), tr("Could not load lunch meal!"),
|
||||||
|
tr("Could not load lunch meal!") % "\n\n" % m_reply->errorString());
|
||||||
|
goto after;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_reply->error() == QNetworkReply::NoError)
|
||||||
|
{
|
||||||
|
setEnabled(true);
|
||||||
|
setVisible(true);
|
||||||
|
m_content = m_reply->readAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
after:
|
||||||
|
m_reply = Q_NULLPTR;
|
||||||
|
}
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
#ifndef LUNCHMEALWIDGET_H
|
#pragma once
|
||||||
#define LUNCHMEALWIDGET_H
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
|
||||||
class StripsWidget;
|
class StripsWidget;
|
||||||
|
|
||||||
@@ -13,9 +15,11 @@ public:
|
|||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void pressedSlot();
|
void pressedSlot();
|
||||||
|
void dateChanged(const QDate &date);
|
||||||
|
void finished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StripsWidget &m_stripsWidget;
|
StripsWidget &m_stripsWidget;
|
||||||
|
std::unique_ptr<QNetworkReply> m_reply;
|
||||||
|
QString m_content;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LUNCHMEALWIDGET_H
|
|
||||||
|
@@ -14,12 +14,12 @@
|
|||||||
<translation>Lade...</translation>
|
<translation>Lade...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../lunchmealdialog.cpp" line="20"/>
|
<location filename="../lunchmealdialog.cpp" line="18"/>
|
||||||
<source>Lunch meal for %0</source>
|
<source>Lunch meal for %0</source>
|
||||||
<translation>Mittagsmenü vom %0</translation>
|
<translation>Mittagsmenü vom %0</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../lunchmealdialog.cpp" line="20"/>
|
<location filename="../lunchmealdialog.cpp" line="18"/>
|
||||||
<source>dd.MM.yyyy</source>
|
<source>dd.MM.yyyy</source>
|
||||||
<translation>dd.MM.yyyy</translation>
|
<translation>dd.MM.yyyy</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -27,9 +27,15 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>LunchMealWidget</name>
|
<name>LunchMealWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../lunchmealwidget.cpp" line="16"/>
|
<location filename="../lunchmealwidget.cpp" line="22"/>
|
||||||
<source>Lunch meal</source>
|
<source>Lunch meal</source>
|
||||||
<translation>Mittagsmenü</translation>
|
<translation>Mittagsmenü</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../lunchmealwidget.cpp" line="57"/>
|
||||||
|
<location filename="../lunchmealwidget.cpp" line="58"/>
|
||||||
|
<source>Could not load lunch meal!</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
@@ -14,12 +14,12 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../lunchmealdialog.cpp" line="20"/>
|
<location filename="../lunchmealdialog.cpp" line="18"/>
|
||||||
<source>Lunch meal for %0</source>
|
<source>Lunch meal for %0</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../lunchmealdialog.cpp" line="20"/>
|
<location filename="../lunchmealdialog.cpp" line="18"/>
|
||||||
<source>dd.MM.yyyy</source>
|
<source>dd.MM.yyyy</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -27,9 +27,15 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>LunchMealWidget</name>
|
<name>LunchMealWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../lunchmealwidget.cpp" line="16"/>
|
<location filename="../lunchmealwidget.cpp" line="22"/>
|
||||||
<source>Lunch meal</source>
|
<source>Lunch meal</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../lunchmealwidget.cpp" line="57"/>
|
||||||
|
<location filename="../lunchmealwidget.cpp" line="58"/>
|
||||||
|
<source>Could not load lunch meal!</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
@@ -1,8 +1,12 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
SUBDIRS += advancedviewplugin \
|
SUBDIRS += absenceplugin \
|
||||||
|
advancedviewplugin \
|
||||||
|
devtoolsplugin \
|
||||||
lunchmealplugin \
|
lunchmealplugin \
|
||||||
|
profileplugin \
|
||||||
presenceplugin \
|
presenceplugin \
|
||||||
reportsplugin \
|
reportsplugin \
|
||||||
updaterplugin \
|
updaterplugin \
|
||||||
weatherplugin
|
weatherplugin \
|
||||||
|
webradioplugin
|
||||||
|
BIN
plugins/presenceplugin/images/not-present.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
plugins/presenceplugin/images/present.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
@@ -4,6 +4,9 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
#include <QStatusBar>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include "presencewidget.h"
|
#include "presencewidget.h"
|
||||||
|
|
||||||
@@ -29,5 +32,5 @@ PresencePlugin::PresencePlugin(QObject *parent) :
|
|||||||
|
|
||||||
void PresencePlugin::attachTo(MainWindow &mainWindow)
|
void PresencePlugin::attachTo(MainWindow &mainWindow)
|
||||||
{
|
{
|
||||||
new PresenceWidget(mainWindow);
|
mainWindow.statusBar()->addWidget(new PresenceWidget(mainWindow));
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef PRESENCEPLUGIN_H
|
#pragma once
|
||||||
#define PRESENCEPLUGIN_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -23,5 +22,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
QTranslator m_translator;
|
QTranslator m_translator;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PRESENCEPLUGIN_H
|
|
||||||
|
@@ -5,12 +5,14 @@ TEMPLATE = lib
|
|||||||
|
|
||||||
CONFIG += shared c++14
|
CONFIG += shared c++14
|
||||||
|
|
||||||
DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../zeiterfassunglib
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
DEPENDPATH += $$PWD/../../zeiterfassunglib
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
@@ -30,8 +32,3 @@ TRANSLATIONS += translations/presenceplugin_en.ts \
|
|||||||
OTHER_FILES += presenceplugin.json
|
OTHER_FILES += presenceplugin.json
|
||||||
|
|
||||||
include(../../lrelease.pri)
|
include(../../lrelease.pri)
|
||||||
|
|
||||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/presenceplugin_en.qm \
|
|
||||||
$${OUT_PWD}/translations/presenceplugin_de.qm
|
|
||||||
|
|
||||||
include(../copy_translations.pri)
|
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/zeiterfassung/plugins/presenceplugin">
|
<qresource prefix="/zeiterfassung/plugins/presenceplugin">
|
||||||
|
<file>images/not-present.png</file>
|
||||||
|
<file>images/present.png</file>
|
||||||
<file>images/refresh.png</file>
|
<file>images/refresh.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@@ -1,33 +1,30 @@
|
|||||||
#include "presencewidget.h"
|
#include "presencewidget.h"
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QStatusBar>
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
#include <QStatusBar>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "zeiterfassungapi.h"
|
#include "zeiterfassungapi.h"
|
||||||
|
|
||||||
PresenceWidget::PresenceWidget(MainWindow &mainWindow) :
|
PresenceWidget::PresenceWidget(MainWindow &mainWindow) :
|
||||||
QWidget(&mainWindow),
|
QPushButton(&mainWindow),
|
||||||
m_mainWindow(mainWindow)
|
m_mainWindow(mainWindow)
|
||||||
{
|
{
|
||||||
connect(&m_mainWindow, &MainWindow::refreshEverything, this, &PresenceWidget::refresh);
|
connect(&m_mainWindow, &MainWindow::refreshEverything, this, &PresenceWidget::refresh);
|
||||||
|
|
||||||
m_labelAvailable = new QLabel(this);
|
m_menu = new QMenu(this);
|
||||||
m_labelAvailable->setFrameShape(QFrame::Panel);
|
setMenu(m_menu);
|
||||||
m_labelAvailable->setFrameShadow(QFrame::Sunken);
|
|
||||||
m_mainWindow.statusBar()->addWidget(m_labelAvailable);
|
|
||||||
|
|
||||||
m_labelNotAvailable = new QLabel(this);
|
m_action = new QAction(QIcon(QStringLiteral(":zeiterfassung/plugins/presenceplugin/images/refresh.png")),
|
||||||
m_labelNotAvailable->setFrameShape(QFrame::Panel);
|
tr("Refresh presence"), this);
|
||||||
m_labelNotAvailable->setFrameShadow(QFrame::Sunken);
|
connect(m_action, &QAction::triggered, this, &PresenceWidget::refresh);
|
||||||
m_mainWindow.statusBar()->addWidget(m_labelNotAvailable);
|
m_mainWindow.menuView()->addAction(m_action);
|
||||||
|
|
||||||
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);
|
auto timer = new QTimer(this);
|
||||||
timer->setInterval(60000);
|
timer->setInterval(60000);
|
||||||
@@ -39,8 +36,8 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) :
|
|||||||
|
|
||||||
void PresenceWidget::refresh()
|
void PresenceWidget::refresh()
|
||||||
{
|
{
|
||||||
m_labelAvailable->setText(tr("%0: %1").arg(tr("Available")).arg(tr("???")));
|
setText(tr("%0 available, %1 not available").arg(tr("???")).arg(tr("???")));
|
||||||
m_labelNotAvailable->setText(tr("%0: %1").arg(tr("Not available")).arg(tr("???")));
|
m_menu->clear();
|
||||||
|
|
||||||
m_action->setEnabled(false);
|
m_action->setEnabled(false);
|
||||||
|
|
||||||
@@ -58,20 +55,29 @@ void PresenceWidget::finished()
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int available = 0,
|
int present = 0,
|
||||||
notAvailable = 0;
|
notPresent = 0;
|
||||||
|
|
||||||
for(const auto &status : m_reply->presenceStatuses())
|
for(const auto &status : m_reply->presenceStatuses())
|
||||||
{
|
{
|
||||||
|
QIcon icon;
|
||||||
if(status.presence == QStringLiteral("J"))
|
if(status.presence == QStringLiteral("J"))
|
||||||
available++;
|
{
|
||||||
|
present++;
|
||||||
|
icon = QIcon(QStringLiteral(":zeiterfassung/plugins/presenceplugin/images/present.png"));
|
||||||
|
}
|
||||||
else if(status.presence == QStringLiteral("N"))
|
else if(status.presence == QStringLiteral("N"))
|
||||||
notAvailable++;
|
{
|
||||||
|
notPresent++;
|
||||||
|
icon = QIcon(QStringLiteral(":zeiterfassung/plugins/presenceplugin/images/not-present.png"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
qWarning() << "unknown presence" << status.firstName << status.lastName << status.presence;
|
qCritical() << "unknown presence" << status.firstName << status.lastName << status.presence;
|
||||||
|
|
||||||
|
m_menu->addAction(icon, tr("%0 %1").arg(status.firstName).arg(status.lastName));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_labelAvailable->setText(tr("%0: %1").arg(tr("Available")).arg(available));
|
setText(tr("%0 available, %1 not available").arg(present).arg(notPresent));
|
||||||
m_labelNotAvailable->setText(tr("%0: %1").arg(tr("Not available")).arg(notAvailable));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
after:
|
after:
|
||||||
|
@@ -1,16 +1,15 @@
|
|||||||
#ifndef PRESENCEWIDGET_H
|
#pragma once
|
||||||
#define PRESENCEWIDGET_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QPushButton>
|
||||||
|
|
||||||
#include "replies/getpresencestatusreply.h"
|
#include "replies/getpresencestatusreply.h"
|
||||||
|
|
||||||
class QLabel;
|
class QMenu;
|
||||||
class QAction;
|
class QAction;
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
||||||
class PresenceWidget : public QWidget
|
class PresenceWidget : public QPushButton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -24,12 +23,8 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
MainWindow &m_mainWindow;
|
MainWindow &m_mainWindow;
|
||||||
|
|
||||||
QLabel *m_labelAvailable;
|
QMenu *m_menu;
|
||||||
QLabel *m_labelNotAvailable;
|
|
||||||
|
|
||||||
QAction *m_action;
|
QAction *m_action;
|
||||||
|
|
||||||
std::unique_ptr<GetPresenceStatusReply> m_reply;
|
std::unique_ptr<GetPresenceStatusReply> m_reply;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PRESENCEWIDGET_H
|
|
||||||
|
@@ -4,41 +4,31 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>PresenceWidget</name>
|
<name>PresenceWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../presencewidget.cpp" line="30"/>
|
<location filename="../presencewidget.cpp" line="24"/>
|
||||||
<source>Refresh presence</source>
|
<source>Refresh presence</source>
|
||||||
<translation>Verfügbarkeit aktualisieren</translation>
|
<translation>Verfügbarkeit aktualisieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../presencewidget.cpp" line="42"/>
|
<location filename="../presencewidget.cpp" line="38"/>
|
||||||
<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>
|
<source>???</source>
|
||||||
<translation>???</translation>
|
<translation>???</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../presencewidget.cpp" line="43"/>
|
<location filename="../presencewidget.cpp" line="38"/>
|
||||||
<location filename="../presencewidget.cpp" line="74"/>
|
<location filename="../presencewidget.cpp" line="79"/>
|
||||||
<source>Not available</source>
|
<source>%0 available, %1 not available</source>
|
||||||
<translation>Nicht verfügbar</translation>
|
<translation>%0 verfügbar, %1 nicht verfügbar</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../presencewidget.cpp" line="55"/>
|
<location filename="../presencewidget.cpp" line="51"/>
|
||||||
<location filename="../presencewidget.cpp" line="56"/>
|
<location filename="../presencewidget.cpp" line="52"/>
|
||||||
<source>Could not get presence status!</source>
|
<source>Could not get presence status!</source>
|
||||||
<translation>Konnte Verfügbarkeit nicht laden!</translation>
|
<translation>Konnte Verfügbarkeit nicht laden!</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../presencewidget.cpp" line="76"/>
|
||||||
|
<source>%0 %1</source>
|
||||||
|
<translation>%0 %1</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
@@ -4,41 +4,31 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>PresenceWidget</name>
|
<name>PresenceWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../presencewidget.cpp" line="30"/>
|
<location filename="../presencewidget.cpp" line="24"/>
|
||||||
<source>Refresh presence</source>
|
<source>Refresh presence</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../presencewidget.cpp" line="42"/>
|
<location filename="../presencewidget.cpp" line="38"/>
|
||||||
<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>
|
<source>???</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../presencewidget.cpp" line="43"/>
|
<location filename="../presencewidget.cpp" line="38"/>
|
||||||
<location filename="../presencewidget.cpp" line="74"/>
|
<location filename="../presencewidget.cpp" line="79"/>
|
||||||
<source>Not available</source>
|
<source>%0 available, %1 not available</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../presencewidget.cpp" line="55"/>
|
<location filename="../presencewidget.cpp" line="51"/>
|
||||||
<location filename="../presencewidget.cpp" line="56"/>
|
<location filename="../presencewidget.cpp" line="52"/>
|
||||||
<source>Could not get presence status!</source>
|
<source>Could not get presence status!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../presencewidget.cpp" line="76"/>
|
||||||
|
<source>%0 %1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
32
plugins/profileplugin/profiledialog.cpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#include "profiledialog.h"
|
||||||
|
#include "ui_profiledialog.h"
|
||||||
|
|
||||||
|
ProfileDialog::ProfileDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget *parent) :
|
||||||
|
ZeiterfassungDialog(parent),
|
||||||
|
ui(new Ui::ProfileDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ui->spinBoxUserId->setValue(userInfo.userId);
|
||||||
|
ui->lineEditEmail->setText(userInfo.email);
|
||||||
|
ui->lineEditLongUsername->setText(userInfo.longUsername);
|
||||||
|
ui->lineEditText->setText(userInfo.text);
|
||||||
|
ui->lineEditUsername->setText(userInfo.username);
|
||||||
|
ui->lineEditStreet->setText(userInfo.street);
|
||||||
|
ui->lineEditCity->setText(userInfo.city);
|
||||||
|
ui->lineEditEmployedSince->setText(userInfo.employedSince.toString(tr("dd.MM.yyyy")));
|
||||||
|
ui->lineEditEmployedTill->setText(userInfo.employedTill.toString(tr("dd.MM.yyyy")));
|
||||||
|
ui->lineEditPlaceOfBirth->setText(userInfo.placeOfBirth);
|
||||||
|
ui->lineEditZipcode->setText(userInfo.zipcode);
|
||||||
|
ui->lineEditReligion->setText(userInfo.religion);
|
||||||
|
ui->lineEditDepartment->setText(userInfo.department);
|
||||||
|
ui->lineEditVerwendgr->setText(userInfo.verwendgr);
|
||||||
|
ui->lineEditTaetig->setText(userInfo.taetig);
|
||||||
|
ui->lineEditArbverh->setText(userInfo.arbverh);
|
||||||
|
ui->lineEditBetriebsnr->setText(userInfo.betriebsnr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ProfileDialog::~ProfileDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
18
plugins/profileplugin/profiledialog.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "zeiterfassungdialog.h"
|
||||||
|
#include "replies/getuserinforeply.h"
|
||||||
|
|
||||||
|
namespace Ui { class ProfileDialog; }
|
||||||
|
|
||||||
|
class ProfileDialog : public ZeiterfassungDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ProfileDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget *parent = Q_NULLPTR);
|
||||||
|
~ProfileDialog();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ProfileDialog *ui;
|
||||||
|
};
|
320
plugins/profileplugin/profiledialog.ui
Normal file
@@ -0,0 +1,320 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ProfileDialog</class>
|
||||||
|
<widget class="QDialog" name="ProfileDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>454</width>
|
||||||
|
<height>281</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Profile</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
|
||||||
|
<item>
|
||||||
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>420</width>
|
||||||
|
<height>540</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelUserId">
|
||||||
|
<property name="text">
|
||||||
|
<string>User-ID:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>spinBoxUserId</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelEmail">
|
||||||
|
<property name="text">
|
||||||
|
<string>E-Mail:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lineEditEmail</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="labelLongUsername">
|
||||||
|
<property name="text">
|
||||||
|
<string>Long username:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lineEditLongUsername</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="labelText">
|
||||||
|
<property name="text">
|
||||||
|
<string>Text:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lineEditText</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="labelUsername">
|
||||||
|
<property name="text">
|
||||||
|
<string>Username:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lineEditUsername</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QSpinBox" name="spinBoxUserId">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>16777215</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditEmail">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditLongUsername">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditText">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditUsername">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="labelStreet">
|
||||||
|
<property name="text">
|
||||||
|
<string>Street:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="labelCity">
|
||||||
|
<property name="text">
|
||||||
|
<string>City:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QLabel" name="labelEmployedSince">
|
||||||
|
<property name="text">
|
||||||
|
<string>Employed since:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0">
|
||||||
|
<widget class="QLabel" name="labelEmployedTill">
|
||||||
|
<property name="text">
|
||||||
|
<string>Employed till:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QLabel" name="labelPlaceOfBirth">
|
||||||
|
<property name="text">
|
||||||
|
<string>Place of birth:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0">
|
||||||
|
<widget class="QLabel" name="labelZipcode">
|
||||||
|
<property name="text">
|
||||||
|
<string>Zipcode:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="0">
|
||||||
|
<widget class="QLabel" name="labelReligion">
|
||||||
|
<property name="text">
|
||||||
|
<string>Religion:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="0">
|
||||||
|
<widget class="QLabel" name="labelDepartment">
|
||||||
|
<property name="text">
|
||||||
|
<string>Department:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="13" column="0">
|
||||||
|
<widget class="QLabel" name="labelVerwendgr">
|
||||||
|
<property name="text">
|
||||||
|
<string>Verwendgr:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="14" column="0">
|
||||||
|
<widget class="QLabel" name="labelTaetig">
|
||||||
|
<property name="text">
|
||||||
|
<string>Taetig:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="15" column="0">
|
||||||
|
<widget class="QLabel" name="labelArbverh">
|
||||||
|
<property name="text">
|
||||||
|
<string>Arbverh:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="16" column="0">
|
||||||
|
<widget class="QLabel" name="labelBetriebsnr">
|
||||||
|
<property name="text">
|
||||||
|
<string>Betriebsnr:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditStreet">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditCity">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditEmployedSince">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditEmployedTill">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditPlaceOfBirth">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditZipcode">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditReligion">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditDepartment">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="13" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditVerwendgr">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="14" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditTaetig">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="15" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditArbverh">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="16" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditBetriebsnr">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>ProfileDialog</receiver>
|
||||||
|
<slot>close()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>226</x>
|
||||||
|
<y>5</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>226</x>
|
||||||
|
<y>0</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
39
plugins/profileplugin/profileplugin.cpp
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#include "profileplugin.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include "profiledialog.h"
|
||||||
|
|
||||||
|
ProfilePlugin::ProfilePlugin(QObject *parent) :
|
||||||
|
ZeiterfassungPlugin(parent)
|
||||||
|
{
|
||||||
|
qDebug() << "called";
|
||||||
|
|
||||||
|
static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations"));
|
||||||
|
|
||||||
|
if(m_translator.load(QLocale(), QStringLiteral("profileplugin"), QStringLiteral("_"), dir))
|
||||||
|
{
|
||||||
|
if(!QCoreApplication::installTranslator(&m_translator))
|
||||||
|
{
|
||||||
|
qWarning() << "could not install translation profileplugin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning() << "could not load translation profileplugin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProfilePlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
{
|
||||||
|
auto dialog = new ProfileDialog(mainWindow.userInfo(), &mainWindow);
|
||||||
|
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/profileplugin/images/profile.png")),
|
||||||
|
tr("My profile"), dialog, &QDialog::open);
|
||||||
|
}
|
24
plugins/profileplugin/profileplugin.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
|
#include "zeiterfassungplugin.h"
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
class Q_DECL_EXPORT ProfilePlugin : public ZeiterfassungPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "profileplugin.json")
|
||||||
|
Q_INTERFACES(ZeiterfassungPlugin)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ProfilePlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
// ZeiterfassungPlugin interface
|
||||||
|
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTranslator m_translator;
|
||||||
|
};
|
0
plugins/profileplugin/profileplugin.json
Normal file
34
plugins/profileplugin/profileplugin.pro
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
QT += core network gui widgets
|
||||||
|
|
||||||
|
TARGET = profileplugin
|
||||||
|
TEMPLATE = lib
|
||||||
|
|
||||||
|
CONFIG += shared c++14
|
||||||
|
|
||||||
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
|
HEADERS += profiledialog.h \
|
||||||
|
profileplugin.h
|
||||||
|
|
||||||
|
SOURCES += profiledialog.cpp \
|
||||||
|
profileplugin.cpp
|
||||||
|
|
||||||
|
FORMS += profiledialog.ui
|
||||||
|
|
||||||
|
RESOURCES += profileplugin_resources.qrc
|
||||||
|
|
||||||
|
TRANSLATIONS += translations/profileplugin_en.ts \
|
||||||
|
translations/profileplugin_de.ts
|
||||||
|
|
||||||
|
OTHER_FILES += profileplugin.json
|
||||||
|
|
||||||
|
include(../../lrelease.pri)
|
5
plugins/profileplugin/profileplugin_resources.qrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/zeiterfassung/plugins/profileplugin">
|
||||||
|
<file>images/profile.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
111
plugins/profileplugin/translations/profileplugin_de.ts
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="de_DE">
|
||||||
|
<context>
|
||||||
|
<name>ProfileDialog</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="14"/>
|
||||||
|
<source>Profile</source>
|
||||||
|
<translation>Profil</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="35"/>
|
||||||
|
<source>User-ID:</source>
|
||||||
|
<translation>Benutzer-ID:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="45"/>
|
||||||
|
<source>E-Mail:</source>
|
||||||
|
<translation>E-Mail:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="55"/>
|
||||||
|
<source>Long username:</source>
|
||||||
|
<translation>Langer Benutzername:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="65"/>
|
||||||
|
<source>Text:</source>
|
||||||
|
<translation>Text:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="75"/>
|
||||||
|
<source>Username:</source>
|
||||||
|
<translation>Benutzername:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="123"/>
|
||||||
|
<source>Street:</source>
|
||||||
|
<translation>Straße:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="130"/>
|
||||||
|
<source>City:</source>
|
||||||
|
<translation>Stadt:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="137"/>
|
||||||
|
<source>Employed since:</source>
|
||||||
|
<translation>Angestellt seit:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="144"/>
|
||||||
|
<source>Employed till:</source>
|
||||||
|
<translation>Angestellt bis:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="151"/>
|
||||||
|
<source>Place of birth:</source>
|
||||||
|
<translation>Geburtsort:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="158"/>
|
||||||
|
<source>Zipcode:</source>
|
||||||
|
<translation>Postleitzahl:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="165"/>
|
||||||
|
<source>Religion:</source>
|
||||||
|
<translation>Religion:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="172"/>
|
||||||
|
<source>Department:</source>
|
||||||
|
<translation>Abteilung:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="179"/>
|
||||||
|
<source>Verwendgr:</source>
|
||||||
|
<translation>Verwendgr:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="186"/>
|
||||||
|
<source>Taetig:</source>
|
||||||
|
<translation>Taetig:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="193"/>
|
||||||
|
<source>Arbverh:</source>
|
||||||
|
<translation>Arbverh:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="200"/>
|
||||||
|
<source>Betriebsnr:</source>
|
||||||
|
<translation>Betriebsnr:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.cpp" line="23"/>
|
||||||
|
<location filename="../profiledialog.cpp" line="24"/>
|
||||||
|
<source>dd.MM.yyyy</source>
|
||||||
|
<translation>dd.MM.yyyy</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>ProfilePlugin</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../profileplugin.cpp" line="38"/>
|
||||||
|
<source>My profile</source>
|
||||||
|
<translation>Mein Profil</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
111
plugins/profileplugin/translations/profileplugin_en.ts
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US">
|
||||||
|
<context>
|
||||||
|
<name>ProfileDialog</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="14"/>
|
||||||
|
<source>Profile</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="35"/>
|
||||||
|
<source>User-ID:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="45"/>
|
||||||
|
<source>E-Mail:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="55"/>
|
||||||
|
<source>Long username:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="65"/>
|
||||||
|
<source>Text:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="75"/>
|
||||||
|
<source>Username:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="123"/>
|
||||||
|
<source>Street:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="130"/>
|
||||||
|
<source>City:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="137"/>
|
||||||
|
<source>Employed since:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="144"/>
|
||||||
|
<source>Employed till:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="151"/>
|
||||||
|
<source>Place of birth:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="158"/>
|
||||||
|
<source>Zipcode:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="165"/>
|
||||||
|
<source>Religion:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="172"/>
|
||||||
|
<source>Department:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="179"/>
|
||||||
|
<source>Verwendgr:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="186"/>
|
||||||
|
<source>Taetig:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="193"/>
|
||||||
|
<source>Arbverh:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.ui" line="200"/>
|
||||||
|
<source>Betriebsnr:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../profiledialog.cpp" line="23"/>
|
||||||
|
<location filename="../profiledialog.cpp" line="24"/>
|
||||||
|
<source>dd.MM.yyyy</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>ProfilePlugin</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../profileplugin.cpp" line="38"/>
|
||||||
|
<source>My profile</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
@@ -4,6 +4,9 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
#include <QStatusBar>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include "reportswidget.h"
|
#include "reportswidget.h"
|
||||||
|
|
||||||
@@ -29,5 +32,5 @@ ReportsPlugin::ReportsPlugin(QObject *parent) :
|
|||||||
|
|
||||||
void ReportsPlugin::attachTo(MainWindow &mainWindow)
|
void ReportsPlugin::attachTo(MainWindow &mainWindow)
|
||||||
{
|
{
|
||||||
new ReportsWidget(mainWindow);
|
mainWindow.statusBar()->addPermanentWidget(new ReportsWidget(mainWindow));
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef REPORTSPLUGIN_H
|
#pragma once
|
||||||
#define REPORTSPLUGIN_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -23,5 +22,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
QTranslator m_translator;
|
QTranslator m_translator;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // REPORTSPLUGIN_H
|
|
||||||
|
@@ -5,20 +5,22 @@ TEMPLATE = lib
|
|||||||
|
|
||||||
CONFIG += shared c++14
|
CONFIG += shared c++14
|
||||||
|
|
||||||
DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../zeiterfassunglib
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
DEPENDPATH += $$PWD/../../zeiterfassunglib
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
HEADERS += reportsplugin.h \
|
HEADERS += reportsplugin.h \
|
||||||
reportswidget.h
|
reportswidget.h
|
||||||
|
|
||||||
SOURCES += reportsplugin.cpp \
|
SOURCES += reportsplugin.cpp \
|
||||||
reportswidget.cpp
|
reportswidget.cpp
|
||||||
|
|
||||||
FORMS +=
|
FORMS +=
|
||||||
|
|
||||||
@@ -30,8 +32,3 @@ TRANSLATIONS += translations/reportsplugin_en.ts \
|
|||||||
OTHER_FILES += reportsplugin.json
|
OTHER_FILES += reportsplugin.json
|
||||||
|
|
||||||
include(../../lrelease.pri)
|
include(../../lrelease.pri)
|
||||||
|
|
||||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/reportsplugin_en.qm \
|
|
||||||
$${OUT_PWD}/translations/reportsplugin_de.qm
|
|
||||||
|
|
||||||
include(../copy_translations.pri)
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
#include "reportswidget.h"
|
#include "reportswidget.h"
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QDebug>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QTemporaryFile>
|
#include <QTemporaryFile>
|
||||||
@@ -15,27 +15,25 @@
|
|||||||
#include "zeiterfassungapi.h"
|
#include "zeiterfassungapi.h"
|
||||||
|
|
||||||
ReportsWidget::ReportsWidget(MainWindow &mainWindow) :
|
ReportsWidget::ReportsWidget(MainWindow &mainWindow) :
|
||||||
QWidget(&mainWindow),
|
QLabel(&mainWindow),
|
||||||
m_mainWindow(mainWindow)
|
m_mainWindow(mainWindow)
|
||||||
{
|
{
|
||||||
connect(&m_mainWindow, &MainWindow::dateChanged, this, &ReportsWidget::dateChanged);
|
connect(&m_mainWindow, &MainWindow::dateChanged, this, &ReportsWidget::dateChanged);
|
||||||
connect(&m_mainWindow, &MainWindow::refreshEverything, this, &ReportsWidget::refresh);
|
connect(&m_mainWindow, &MainWindow::refreshEverything, this, &ReportsWidget::refresh);
|
||||||
|
|
||||||
m_labelBalance = new QLabel(this);
|
setFrameShape(QFrame::Panel);
|
||||||
m_labelBalance->setFrameShape(QFrame::Panel);
|
setFrameShadow(QFrame::Sunken);
|
||||||
m_labelBalance->setFrameShadow(QFrame::Sunken);
|
|
||||||
m_mainWindow.statusBar()->addPermanentWidget(m_labelBalance);
|
|
||||||
|
|
||||||
m_labelHolidays = new QLabel(this);
|
m_actionRefreshReport = new QAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/refresh.png")),
|
||||||
m_labelHolidays->setFrameShape(QFrame::Panel);
|
tr("Refresh report"), this);
|
||||||
m_labelHolidays->setFrameShadow(QFrame::Sunken);
|
connect(m_actionRefreshReport, &QAction::triggered, this, &ReportsWidget::refresh);
|
||||||
m_mainWindow.statusBar()->addPermanentWidget(m_labelHolidays);
|
m_mainWindow.menuView()->addAction(m_actionRefreshReport);
|
||||||
|
|
||||||
m_actionRefreshReport = m_mainWindow.menuView()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/refresh.png")),
|
m_actionOpenReport = new QAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/report.png")),
|
||||||
tr("Refresh report"), this, &ReportsWidget::refresh);
|
tr("Open report"), this);
|
||||||
|
connect(m_actionOpenReport, &QAction::triggered, this, &ReportsWidget::openReport);
|
||||||
|
m_mainWindow.menuTools()->addAction(m_actionOpenReport);
|
||||||
|
|
||||||
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);
|
m_mainWindow.toolBar()->addAction(m_actionOpenReport);
|
||||||
|
|
||||||
dateChanged(m_mainWindow.date());
|
dateChanged(m_mainWindow.date());
|
||||||
@@ -65,12 +63,11 @@ void ReportsWidget::refresh()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setText(tr("Balance: %0, Holidays: %1").arg(tr("???")).arg(tr("???")));
|
||||||
|
|
||||||
m_actionRefreshReport->setEnabled(false);
|
m_actionRefreshReport->setEnabled(false);
|
||||||
m_actionOpenReport->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);
|
m_reply = m_mainWindow.erfassung().doGetReport(m_mainWindow.userInfo().userId, m_date);
|
||||||
connect(m_reply.get(), &ZeiterfassungReply::finished, this, &ReportsWidget::finished);
|
connect(m_reply.get(), &ZeiterfassungReply::finished, this, &ReportsWidget::finished);
|
||||||
}
|
}
|
||||||
@@ -87,38 +84,43 @@ void ReportsWidget::finished()
|
|||||||
{
|
{
|
||||||
auto content = m_reply->content();
|
auto content = m_reply->content();
|
||||||
|
|
||||||
|
QString balance;
|
||||||
|
|
||||||
{
|
{
|
||||||
static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)"));
|
static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)"));
|
||||||
auto match = regex.match(content);
|
auto match = regex.match(content);
|
||||||
if(match.hasMatch())
|
if(match.hasMatch())
|
||||||
{
|
{
|
||||||
auto balance = match.captured(2);
|
balance = match.captured(2);
|
||||||
if(balance.endsWith(QChar('-')))
|
if(balance.endsWith(QChar('-')))
|
||||||
{
|
{
|
||||||
balance.chop(1);
|
balance.chop(1);
|
||||||
balance = QChar('-') % balance;
|
balance = QChar('-') % balance;
|
||||||
}
|
}
|
||||||
m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("%0h").arg(balance)));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("n/a")));
|
balance = tr("n/a");
|
||||||
qWarning() << "balance not found in PDF";
|
qWarning() << "balance not found in PDF";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString holidays;
|
||||||
|
|
||||||
{
|
{
|
||||||
static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)"));
|
static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +(\\-?[0-9]+\\.[0-9]+) +(\\-?[0-9]+\\.[0-9]+)"));
|
||||||
auto match = regex.match(content);
|
auto match = regex.match(content);
|
||||||
if(match.hasMatch())
|
if(match.hasMatch())
|
||||||
m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(match.captured(2)));
|
holidays = match.captured(2);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("n/a")));
|
holidays = tr("n/a");
|
||||||
qWarning() << "holidays not found in PDF";
|
qWarning() << "holidays not found in PDF";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setText(tr("Balance: %0, Holidays: %1").arg(balance).arg(holidays));
|
||||||
|
|
||||||
{
|
{
|
||||||
QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("reportXXXXXX.pdf")));
|
QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("reportXXXXXX.pdf")));
|
||||||
file.setAutoRemove(false);
|
file.setAutoRemove(false);
|
||||||
|
@@ -1,18 +1,16 @@
|
|||||||
#ifndef REPORTSWIDGET_H
|
#pragma once
|
||||||
#define REPORTSWIDGET_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QLabel>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include "replies/getreportreply.h"
|
#include "replies/getreportreply.h"
|
||||||
|
|
||||||
class QLabel;
|
|
||||||
class QAction;
|
class QAction;
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
||||||
class ReportsWidget : public QWidget
|
class ReportsWidget : public QLabel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -28,9 +26,6 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
MainWindow &m_mainWindow;
|
MainWindow &m_mainWindow;
|
||||||
|
|
||||||
QLabel *m_labelBalance;
|
|
||||||
QLabel *m_labelHolidays;
|
|
||||||
|
|
||||||
QAction *m_actionOpenReport;
|
QAction *m_actionOpenReport;
|
||||||
QAction *m_actionRefreshReport;
|
QAction *m_actionRefreshReport;
|
||||||
|
|
||||||
@@ -39,5 +34,3 @@ private:
|
|||||||
|
|
||||||
std::unique_ptr<GetReportReply> m_reply;
|
std::unique_ptr<GetReportReply> m_reply;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // REPORTSWIDGET_H
|
|
||||||
|
@@ -4,68 +4,44 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>ReportsWidget</name>
|
<name>ReportsWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="35"/>
|
<location filename="../reportswidget.cpp" line="27"/>
|
||||||
<source>Refresh report</source>
|
<source>Refresh report</source>
|
||||||
<translation>Auswertung aktualisieren</translation>
|
<translation>Auswertung aktualisieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="38"/>
|
<location filename="../reportswidget.cpp" line="32"/>
|
||||||
<source>Open report</source>
|
<source>Open report</source>
|
||||||
<translation>Auswertung öffnen</translation>
|
<translation>Auswertung öffnen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="71"/>
|
<location filename="../reportswidget.cpp" line="65"/>
|
||||||
<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>
|
<source>???</source>
|
||||||
<translation>???</translation>
|
<translation>???</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="72"/>
|
<location filename="../reportswidget.cpp" line="65"/>
|
||||||
<location filename="../reportswidget.cpp" line="114"/>
|
<location filename="../reportswidget.cpp" line="121"/>
|
||||||
<location filename="../reportswidget.cpp" line="117"/>
|
<source>Balance: %0, Holidays: %1</source>
|
||||||
<source>Holidays</source>
|
<translation>Gleitzeit: %0, Urlaub: %1</translation>
|
||||||
<translation>Urlaub</translation>
|
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="83"/>
|
<location filename="../reportswidget.cpp" line="79"/>
|
||||||
<source>Could not load report!</source>
|
<source>Could not load report!</source>
|
||||||
<translation>Konnte Auswertung nicht laden!</translation>
|
<translation>Konnte Auswertung nicht laden!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="101"/>
|
<location filename="../reportswidget.cpp" line="102"/>
|
||||||
<source>%0h</source>
|
<location filename="../reportswidget.cpp" line="116"/>
|
||||||
<translation>%0h</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../reportswidget.cpp" line="105"/>
|
|
||||||
<location filename="../reportswidget.cpp" line="117"/>
|
|
||||||
<source>n/a</source>
|
<source>n/a</source>
|
||||||
<translation>n/v</translation>
|
<translation>n/v</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="127"/>
|
<location filename="../reportswidget.cpp" line="128"/>
|
||||||
<source>Could not write report!</source>
|
<source>Could not write report!</source>
|
||||||
<translation>Konnte Auswertung nicht abspeichern!</translation>
|
<translation>Konnte Auswertung nicht abspeichern!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="147"/>
|
<location filename="../reportswidget.cpp" line="148"/>
|
||||||
<source>Could not launch your default PDF viewer!</source>
|
<source>Could not launch your default PDF viewer!</source>
|
||||||
<translation>Konnte Standard-PDF-Viewer nicht öffnen!</translation>
|
<translation>Konnte Standard-PDF-Viewer nicht öffnen!</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -4,68 +4,44 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>ReportsWidget</name>
|
<name>ReportsWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="35"/>
|
<location filename="../reportswidget.cpp" line="27"/>
|
||||||
<source>Refresh report</source>
|
<source>Refresh report</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="38"/>
|
<location filename="../reportswidget.cpp" line="32"/>
|
||||||
<source>Open report</source>
|
<source>Open report</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="71"/>
|
<location filename="../reportswidget.cpp" line="65"/>
|
||||||
<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>
|
<source>???</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="72"/>
|
<location filename="../reportswidget.cpp" line="65"/>
|
||||||
<location filename="../reportswidget.cpp" line="114"/>
|
<location filename="../reportswidget.cpp" line="121"/>
|
||||||
<location filename="../reportswidget.cpp" line="117"/>
|
<source>Balance: %0, Holidays: %1</source>
|
||||||
<source>Holidays</source>
|
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="83"/>
|
<location filename="../reportswidget.cpp" line="79"/>
|
||||||
<source>Could not load report!</source>
|
<source>Could not load report!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="101"/>
|
<location filename="../reportswidget.cpp" line="102"/>
|
||||||
<source>%0h</source>
|
<location filename="../reportswidget.cpp" line="116"/>
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../reportswidget.cpp" line="105"/>
|
|
||||||
<location filename="../reportswidget.cpp" line="117"/>
|
|
||||||
<source>n/a</source>
|
<source>n/a</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="127"/>
|
<location filename="../reportswidget.cpp" line="128"/>
|
||||||
<source>Could not write report!</source>
|
<source>Could not write report!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../reportswidget.cpp" line="147"/>
|
<location filename="../reportswidget.cpp" line="148"/>
|
||||||
<source>Could not launch your default PDF viewer!</source>
|
<source>Could not launch your default PDF viewer!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
<translation>Heute nicht mehr anzeigen</translation>
|
<translation>Heute nicht mehr anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../updaterdialog.cpp" line="50"/>
|
<location filename="../updaterdialog.cpp" line="56"/>
|
||||||
<source>Could not open default webbrowser!</source>
|
<source>Could not open default webbrowser!</source>
|
||||||
<translation>Konnte Standard-Browser nicht öffnen!</translation>
|
<translation>Konnte Standard-Browser nicht öffnen!</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../updaterdialog.cpp" line="50"/>
|
<location filename="../updaterdialog.cpp" line="56"/>
|
||||||
<source>Could not open default webbrowser!</source>
|
<source>Could not open default webbrowser!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
#include "zeiterfassungapi.h"
|
#include "zeiterfassungapi.h"
|
||||||
|
|
||||||
UpdaterDialog::UpdaterDialog(MainWindow &mainWindow) :
|
UpdaterDialog::UpdaterDialog(MainWindow &mainWindow) :
|
||||||
QDialog(&mainWindow),
|
ZeiterfassungDialog(&mainWindow),
|
||||||
ui(new Ui::UpdaterDialog),
|
ui(new Ui::UpdaterDialog),
|
||||||
m_mainWindow(mainWindow)
|
m_mainWindow(mainWindow)
|
||||||
{
|
{
|
||||||
@@ -31,8 +31,8 @@ UpdaterDialog::UpdaterDialog(MainWindow &mainWindow) :
|
|||||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &UpdaterDialog::rejectedSlot);
|
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &UpdaterDialog::rejectedSlot);
|
||||||
|
|
||||||
auto url = m_mainWindow.settings().value(QStringLiteral("UpdaterPlugin/url"),
|
auto url = m_mainWindow.settings().value(QStringLiteral("UpdaterPlugin/url"),
|
||||||
QUrl(QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases"))).toUrl();
|
QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases")).toString();
|
||||||
m_reply = m_mainWindow.erfassung().manager()->get(QNetworkRequest(url));
|
m_reply = m_mainWindow.erfassung().manager()->get(QNetworkRequest(QUrl(url)));
|
||||||
connect(m_reply, &QNetworkReply::finished, this, &UpdaterDialog::finished);
|
connect(m_reply, &QNetworkReply::finished, this, &UpdaterDialog::finished);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,15 +1,15 @@
|
|||||||
#ifndef UPDATERDIALOG_H
|
#pragma once
|
||||||
#define UPDATERDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
|
#include "zeiterfassungdialog.h"
|
||||||
|
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
||||||
|
|
||||||
namespace Ui { class UpdaterDialog; }
|
namespace Ui { class UpdaterDialog; }
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
||||||
class UpdaterDialog : public QDialog
|
class UpdaterDialog : public ZeiterfassungDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -29,5 +29,3 @@ private:
|
|||||||
|
|
||||||
QUrl m_url;
|
QUrl m_url;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UPDATERDIALOG_H
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef UPDATERPLUGIN_H
|
#pragma once
|
||||||
#define UPDATERPLUGIN_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -23,5 +22,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
QTranslator m_translator;
|
QTranslator m_translator;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UPDATERPLUGIN_H
|
|
||||||
|
@@ -5,12 +5,14 @@ TEMPLATE = lib
|
|||||||
|
|
||||||
CONFIG += shared c++14
|
CONFIG += shared c++14
|
||||||
|
|
||||||
DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../zeiterfassunglib
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
DEPENDPATH += $$PWD/../../zeiterfassunglib
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
@@ -30,8 +32,3 @@ TRANSLATIONS += translations/updaterplugin_en.ts \
|
|||||||
OTHER_FILES += updaterplugin.json
|
OTHER_FILES += updaterplugin.json
|
||||||
|
|
||||||
include(../../lrelease.pri)
|
include(../../lrelease.pri)
|
||||||
|
|
||||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/updaterplugin_en.qm \
|
|
||||||
$${OUT_PWD}/translations/updaterplugin_de.qm
|
|
||||||
|
|
||||||
include(../copy_translations.pri)
|
|
||||||
|
@@ -23,6 +23,16 @@
|
|||||||
<source>Not an json obj</source>
|
<source>Not an json obj</source>
|
||||||
<translation>Kein json obj</translation>
|
<translation>Kein json obj</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../weatherwidget.cpp" line="72"/>
|
||||||
|
<source>No weather found</source>
|
||||||
|
<translation>Kein weather gefunden</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../weatherwidget.cpp" line="79"/>
|
||||||
|
<source>No main found</source>
|
||||||
|
<translation>Kein main gefunden</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../weatherwidget.cpp" line="86"/>
|
<location filename="../weatherwidget.cpp" line="86"/>
|
||||||
<source>%0 (%1°C)</source>
|
<source>%0 (%1°C)</source>
|
||||||
|
@@ -23,6 +23,16 @@
|
|||||||
<source>Not an json obj</source>
|
<source>Not an json obj</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../weatherwidget.cpp" line="72"/>
|
||||||
|
<source>No weather found</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../weatherwidget.cpp" line="79"/>
|
||||||
|
<source>No main found</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../weatherwidget.cpp" line="86"/>
|
<location filename="../weatherwidget.cpp" line="86"/>
|
||||||
<source>%0 (%1°C)</source>
|
<source>%0 (%1°C)</source>
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef WEATHERPLUGIN_H
|
#pragma once
|
||||||
#define WEATHERPLUGIN_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -21,5 +20,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
QTranslator m_translator;
|
QTranslator m_translator;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WEATHERPLUGIN_H
|
|
||||||
|
@@ -5,12 +5,14 @@ TEMPLATE = lib
|
|||||||
|
|
||||||
CONFIG += shared c++14
|
CONFIG += shared c++14
|
||||||
|
|
||||||
DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib
|
DESTDIR = $${OUT_PWD}/$${PROJECT_ROOT}/bin/plugins/zeiterfassung
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../zeiterfassunglib
|
LIBS += -L$${OUT_PWD}/$${PROJECT_ROOT}/bin -lzeiterfassungcorelib -lzeiterfassungguilib
|
||||||
DEPENDPATH += $$PWD/../../zeiterfassunglib
|
|
||||||
|
INCLUDEPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}/zeiterfassungguilib
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
@@ -30,8 +32,3 @@ TRANSLATIONS += translations/weatherplugin_en.ts \
|
|||||||
OTHER_FILES += weatherplugin.json
|
OTHER_FILES += weatherplugin.json
|
||||||
|
|
||||||
include(../../lrelease.pri)
|
include(../../lrelease.pri)
|
||||||
|
|
||||||
COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/weatherplugin_en.qm \
|
|
||||||
$${OUT_PWD}/translations/weatherplugin_de.qm
|
|
||||||
|
|
||||||
include(../copy_translations.pri)
|
|
||||||
|
@@ -3,8 +3,7 @@
|
|||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QMessageBox>
|
#include <QDebug>
|
||||||
#include <QStringBuilder>
|
|
||||||
#include <QJsonParseError>
|
#include <QJsonParseError>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
@@ -69,14 +68,14 @@ void WeatherWidget::finished()
|
|||||||
if(!obj.contains(QStringLiteral("weather")))
|
if(!obj.contains(QStringLiteral("weather")))
|
||||||
{
|
{
|
||||||
qWarning() << "no weather" << obj;
|
qWarning() << "no weather" << obj;
|
||||||
setText("No weater found");
|
setText(tr("No weather found"));
|
||||||
goto after;
|
goto after;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!obj.contains(QStringLiteral("main")))
|
if(!obj.contains(QStringLiteral("main")))
|
||||||
{
|
{
|
||||||
qWarning() << "no main" << obj;
|
qWarning() << "no main" << obj;
|
||||||
setText("No main found");
|
setText(tr("No main found"));
|
||||||
goto after;
|
goto after;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef WEATHERWIDGET_H
|
#pragma once
|
||||||
#define WEATHERWIDGET_H
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -24,5 +23,3 @@ private:
|
|||||||
|
|
||||||
std::unique_ptr<QNetworkReply> m_reply;
|
std::unique_ptr<QNetworkReply> m_reply;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WEATHERWIDGET_H
|
|
||||||
|
BIN
plugins/webradioplugin/images/web-radio.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
101
plugins/webradioplugin/translations/webradioplugin_de.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="de_DE">
|
||||||
|
<context>
|
||||||
|
<name>WebRadioDialog</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.ui" line="14"/>
|
||||||
|
<source>Radio</source>
|
||||||
|
<translation>Radio</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.ui" line="31"/>
|
||||||
|
<source>Play</source>
|
||||||
|
<translation>Abspielen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.ui" line="44"/>
|
||||||
|
<source>Pause</source>
|
||||||
|
<translation>Pause</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.ui" line="57"/>
|
||||||
|
<source>Stop</source>
|
||||||
|
<translation>Stop</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="75"/>
|
||||||
|
<source>Stopped</source>
|
||||||
|
<translation>Gestoppt</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="76"/>
|
||||||
|
<source>Playing</source>
|
||||||
|
<translation>Wird abgespielt</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="77"/>
|
||||||
|
<source>Paused</source>
|
||||||
|
<translation>Pausiert</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="80"/>
|
||||||
|
<location filename="../webradiodialog.cpp" line="99"/>
|
||||||
|
<source>Unknown</source>
|
||||||
|
<translation>Unbekannt</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="88"/>
|
||||||
|
<source>Unknown media</source>
|
||||||
|
<translation>Unbekanntes Medium</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="89"/>
|
||||||
|
<source>No media</source>
|
||||||
|
<translation>Kein Medium</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="90"/>
|
||||||
|
<source>Loading media...</source>
|
||||||
|
<translation>Lade Medium...</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="91"/>
|
||||||
|
<source>Loaded media</source>
|
||||||
|
<translation>Medium geladen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="92"/>
|
||||||
|
<source>Stalled media</source>
|
||||||
|
<translation>Medium angehalten</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="93"/>
|
||||||
|
<source>Buffering media</source>
|
||||||
|
<translation>Puffere Medium</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="94"/>
|
||||||
|
<source>Buffered media</source>
|
||||||
|
<translation>Medium gepuffert</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="95"/>
|
||||||
|
<source>End of media</source>
|
||||||
|
<translation>Ende des Mediums</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradiodialog.cpp" line="96"/>
|
||||||
|
<source>Invalid media</source>
|
||||||
|
<translation>Ungültiges Medium</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>WebRadioPlugin</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../webradioplugin.cpp" line="38"/>
|
||||||
|
<source>Play webradio</source>
|
||||||
|
<translation>Webradio spielen</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|