From 0636dfc221611aaf2c68a3ff3e3a3e2c06ce9edb Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 18 Dec 2017 21:59:30 +0100 Subject: [PATCH 01/21] Implemented waitForFinished() (fixes #28) --- .../advancedviewplugin/advanvedviewdialog.cpp | 37 +++---------------- zeiterfassung/main.cpp | 19 ++-------- zeiterfassunglib/mainwindow.cpp | 31 +++------------- .../replies/zeiterfassungreply.cpp | 9 +++++ zeiterfassunglib/replies/zeiterfassungreply.h | 2 + 5 files changed, 25 insertions(+), 73 deletions(-) diff --git a/plugins/advancedviewplugin/advanvedviewdialog.cpp b/plugins/advancedviewplugin/advanvedviewdialog.cpp index bcc77a9..9a5f2de 100644 --- a/plugins/advancedviewplugin/advanvedviewdialog.cpp +++ b/plugins/advancedviewplugin/advanvedviewdialog.cpp @@ -3,7 +3,6 @@ #include #include -#include #include #include @@ -73,11 +72,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos) dialog.getText() ); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(reply->success()) { @@ -123,11 +118,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos) dialog.getText() ); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(reply->success()) { @@ -150,11 +141,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos) { auto reply = m_stripsWidget.mainWindow().erfassung().doDeleteBooking(booking.id); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(reply->success()) m_stripsWidget.refreshBookings(); @@ -193,11 +180,7 @@ void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos) dialog.getText() ); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(reply->success()) { @@ -248,11 +231,7 @@ void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos) dialog.getText() ); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(reply->success()) { @@ -275,11 +254,7 @@ void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos) { auto reply = m_stripsWidget.mainWindow().erfassung().doDeleteTimeAssignment(timeAssignment.id); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(reply->success()) { diff --git a/zeiterfassung/main.cpp b/zeiterfassung/main.cpp index f06aea9..788078b 100755 --- a/zeiterfassung/main.cpp +++ b/zeiterfassung/main.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -175,11 +174,7 @@ bool loadLoginPage(QSplashScreen &splashScreen, ZeiterfassungSettings &settings, again: auto reply = erfassung.doLoginPage(); - { - QEventLoop eventLoop; - QObject::connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(!reply->success()) { @@ -222,11 +217,7 @@ bool doAuthentication(QSplashScreen &splashScreen, ZeiterfassungSettings &settin again: auto reply = erfassung.doLogin(settings.username(), settings.password()); - { - QEventLoop eventLoop; - QObject::connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(!reply->success()) { @@ -257,11 +248,7 @@ bool loadUserInfo(QSplashScreen &splashScreen, ZeiterfassungApi &erfassung, GetU { auto reply = erfassung.doUserInfo(); - { - QEventLoop eventLoop; - QObject::connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(!reply->success()) { diff --git a/zeiterfassunglib/mainwindow.cpp b/zeiterfassunglib/mainwindow.cpp index 6c3e90d..a298dbc 100644 --- a/zeiterfassunglib/mainwindow.cpp +++ b/zeiterfassunglib/mainwindow.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -247,11 +246,7 @@ void MainWindow::pushButtonStartPressed() timeNormalise(ui->timeEditTime->time()), QTime(0, 0), QStringLiteral("K"), QStringLiteral("")); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(!reply->success()) { @@ -277,11 +272,7 @@ void MainWindow::pushButtonStartPressed() timeAssignment.project, timeAssignment.subproject, timeAssignment.workpackage, timeAssignment.text); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(reply->success()) timeAssignmentTime = timeAdd(timeAssignmentTime, timespan); @@ -300,11 +291,7 @@ void MainWindow::pushButtonStartPressed() ui->comboBoxProject->currentData().toString(), ui->comboBoxSubproject->currentText(), ui->comboBoxWorkpackage->currentText(), ui->comboBoxText->currentText()); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(!reply->success()) { @@ -350,11 +337,7 @@ void MainWindow::pushButtonEndPressed() timeAssignment.project, timeAssignment.subproject, timeAssignment.workpackage, timeAssignment.text); - { - QEventLoop eventLoop; - connect(reply.get(), SIGNAL(finished()), &eventLoop, SLOT(quit())); - eventLoop.exec(); - } + reply->waitForFinished(); if(!reply->success()) { @@ -369,11 +352,7 @@ void MainWindow::pushButtonEndPressed() timeNormalise(ui->timeEditTime->time()), QTime(0, 0), QStringLiteral("G"), QStringLiteral("")); - { - QEventLoop eventLoop; - connect(reply.get(), &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); - eventLoop.exec(); - } + reply->waitForFinished(); if(!reply->success()) { diff --git a/zeiterfassunglib/replies/zeiterfassungreply.cpp b/zeiterfassunglib/replies/zeiterfassungreply.cpp index 0e59b3a..6784956 100644 --- a/zeiterfassunglib/replies/zeiterfassungreply.cpp +++ b/zeiterfassunglib/replies/zeiterfassungreply.cpp @@ -1,5 +1,7 @@ #include "zeiterfassungreply.h" +#include + #include "zeiterfassungapi.h" ZeiterfassungReply::ZeiterfassungReply(ZeiterfassungApi *zeiterfassung) : @@ -20,6 +22,13 @@ const QString &ZeiterfassungReply::message() const return m_message; } +void ZeiterfassungReply::waitForFinished() +{ + QEventLoop eventLoop; + connect(this, &ZeiterfassungReply::finished, &eventLoop, &QEventLoop::quit); + eventLoop.exec(); +} + ZeiterfassungApi *ZeiterfassungReply::zeiterfassung() const { return m_zeiterfassung; diff --git a/zeiterfassunglib/replies/zeiterfassungreply.h b/zeiterfassunglib/replies/zeiterfassungreply.h index 6ac1b68..05187e3 100644 --- a/zeiterfassunglib/replies/zeiterfassungreply.h +++ b/zeiterfassunglib/replies/zeiterfassungreply.h @@ -17,6 +17,8 @@ public: bool success() const; const QString &message() const; + void waitForFinished(); + Q_SIGNALS: void finished(); -- 2.50.1 From 28237ed97feb41ca8671dd1bba50efebe3aa2186 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 18 Dec 2017 22:18:24 +0100 Subject: [PATCH 02/21] Added updaterplugin --- .../advancedviewplugin/advancedviewplugin.cpp | 2 ++ plugins/lunchmealplugin/lunchmealplugin.cpp | 2 +- plugins/plugins.pro | 1 + plugins/updaterplugin/updaterplugin.cpp | 14 ++++++++++ plugins/updaterplugin/updaterplugin.h | 23 ++++++++++++++++ plugins/updaterplugin/updaterplugin.json | 0 plugins/updaterplugin/updaterplugin.pro | 27 +++++++++++++++++++ plugins/weatherplugin/weatherplugin.cpp | 2 +- zeiterfassung/main.cpp | 8 ++++++ zeiterfassunglib/stripswidget.cpp | 6 ++--- zeiterfassunglib/zeiterfassungapi.cpp | 2 -- 11 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 plugins/updaterplugin/updaterplugin.cpp create mode 100644 plugins/updaterplugin/updaterplugin.h create mode 100644 plugins/updaterplugin/updaterplugin.json create mode 100644 plugins/updaterplugin/updaterplugin.pro diff --git a/plugins/advancedviewplugin/advancedviewplugin.cpp b/plugins/advancedviewplugin/advancedviewplugin.cpp index e4124ba..12a241a 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.cpp +++ b/plugins/advancedviewplugin/advancedviewplugin.cpp @@ -1,5 +1,6 @@ #include "advancedviewplugin.h" +#include #include #include "mainwindow.h" @@ -9,6 +10,7 @@ AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { + qDebug() << "called"; Q_INIT_RESOURCE(advancedviewplugin_resources); } diff --git a/plugins/lunchmealplugin/lunchmealplugin.cpp b/plugins/lunchmealplugin/lunchmealplugin.cpp index e1b1b92..ce70c4e 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.cpp +++ b/plugins/lunchmealplugin/lunchmealplugin.cpp @@ -5,5 +5,5 @@ LunchMealPlugin::LunchMealPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { - + qDebug() << "called"; } diff --git a/plugins/plugins.pro b/plugins/plugins.pro index e062acc..ceae520 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -3,4 +3,5 @@ TEMPLATE = subdirs SUBDIRS += advancedviewplugin \ lunchmealplugin \ presenceplugin \ + updaterplugin \ weatherplugin diff --git a/plugins/updaterplugin/updaterplugin.cpp b/plugins/updaterplugin/updaterplugin.cpp new file mode 100644 index 0000000..a19a90e --- /dev/null +++ b/plugins/updaterplugin/updaterplugin.cpp @@ -0,0 +1,14 @@ +#include "updaterplugin.h" + +#include + +UpdaterPlugin::UpdaterPlugin(QObject *parent) : + ZeiterfassungPlugin(parent) +{ + qDebug() << "called"; +} + +void UpdaterPlugin::attachTo(MainWindow &mainWindow) +{ + +} diff --git a/plugins/updaterplugin/updaterplugin.h b/plugins/updaterplugin/updaterplugin.h new file mode 100644 index 0000000..99d5c17 --- /dev/null +++ b/plugins/updaterplugin/updaterplugin.h @@ -0,0 +1,23 @@ +#ifndef UPDATERPLUGIN_H +#define UPDATERPLUGIN_H + +#include + +#include "zeiterfassungplugin.h" + +class MainWindow; + +class Q_DECL_EXPORT UpdaterPlugin : public ZeiterfassungPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "updaterplugin.json") + Q_INTERFACES(ZeiterfassungPlugin) + +public: + explicit UpdaterPlugin(QObject *parent = Q_NULLPTR); + + // ZeiterfassungPlugin interface + void attachTo(MainWindow &mainWindow); +}; + +#endif // UPDATERPLUGIN_H diff --git a/plugins/updaterplugin/updaterplugin.json b/plugins/updaterplugin/updaterplugin.json new file mode 100644 index 0000000..e69de29 diff --git a/plugins/updaterplugin/updaterplugin.pro b/plugins/updaterplugin/updaterplugin.pro new file mode 100644 index 0000000..ea8097d --- /dev/null +++ b/plugins/updaterplugin/updaterplugin.pro @@ -0,0 +1,27 @@ +QT += core network gui widgets + +TARGET = advancedviewplugin +TEMPLATE = lib + +CONFIG += shared c++14 + +DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung + +LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib + +INCLUDEPATH += $$PWD/../../zeiterfassunglib +DEPENDPATH += $$PWD/../../zeiterfassunglib + +DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT + +HEADERS += updaterplugin.h + +SOURCES += updaterplugin.cpp + +FORMS += + +RESOURCES += + +TRANSLATIONS += + +OTHER_FILES += updaterplugin.json diff --git a/plugins/weatherplugin/weatherplugin.cpp b/plugins/weatherplugin/weatherplugin.cpp index 0be043f..c30cc4c 100644 --- a/plugins/weatherplugin/weatherplugin.cpp +++ b/plugins/weatherplugin/weatherplugin.cpp @@ -5,5 +5,5 @@ WeatherPlugin::WeatherPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { - + qDebug() << "called"; } diff --git a/zeiterfassung/main.cpp b/zeiterfassung/main.cpp index 788078b..61d015d 100755 --- a/zeiterfassung/main.cpp +++ b/zeiterfassung/main.cpp @@ -278,10 +278,18 @@ bool loadPlugins(QSplashScreen &splashScreen) for(const auto &fileInfo : dir.entryInfoList(QDir::Files)) { if(fileInfo.isSymLink()) + { + qWarning() << "skipping" << fileInfo.fileName() << "because symlink"; continue; // to skip unix so symlinks + } if(!QLibrary::isLibrary(fileInfo.filePath())) + { + qWarning() << "skipping" << fileInfo.fileName() << "because no QLibrary"; continue; // to skip windows junk files + } + + qDebug() << "loading" << fileInfo.fileName(); QPluginLoader loader(fileInfo.filePath()); if(!loader.load()) diff --git a/zeiterfassunglib/stripswidget.cpp b/zeiterfassunglib/stripswidget.cpp index 07814bc..34f41a8 100644 --- a/zeiterfassunglib/stripswidget.cpp +++ b/zeiterfassunglib/stripswidget.cpp @@ -23,8 +23,8 @@ StripsWidget::StripsWidget(MainWindow &mainWindow, QWidget *parent) : { auto layout = new QVBoxLayout(this); - m_headerLayout = new QHBoxLayout(this); - m_label = new QLabel(this); + m_headerLayout = new QHBoxLayout; + m_label = new QLabel; { auto font = m_label->font(); font.setBold(true); @@ -33,7 +33,7 @@ StripsWidget::StripsWidget(MainWindow &mainWindow, QWidget *parent) : m_headerLayout->addWidget(m_label, 1); layout->addLayout(m_headerLayout); - m_stripsLayout = new QVBoxLayout(this); + m_stripsLayout = new QVBoxLayout; layout->addLayout(m_stripsLayout); layout->addStretch(1); diff --git a/zeiterfassunglib/zeiterfassungapi.cpp b/zeiterfassunglib/zeiterfassungapi.cpp index 84bebfa..1d62a58 100644 --- a/zeiterfassunglib/zeiterfassungapi.cpp +++ b/zeiterfassunglib/zeiterfassungapi.cpp @@ -55,8 +55,6 @@ std::unique_ptr ZeiterfassungApi::doLoginPage() auto reply = std::unique_ptr(m_manager->get(request)); - qDebug() << reply->parent(); - return std::make_unique(std::move(reply), this); } -- 2.50.1 From a6e0f5169fd3af3ed7dc9527b8b16dae039cf6ab Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 18 Dec 2017 22:39:10 +0100 Subject: [PATCH 03/21] Moved Updater functionality into plugin --- .../advancedviewplugin/advancedviewplugin.h | 2 +- plugins/presenceplugin/presenceplugin.h | 2 +- .../updaterplugin/updaterdialog.cpp | 51 ++++++++++--------- plugins/updaterplugin/updaterdialog.h | 33 ++++++++++++ .../updaterplugin/updaterdialog.ui | 4 +- plugins/updaterplugin/updaterplugin.cpp | 10 ++++ plugins/updaterplugin/updaterplugin.h | 2 +- plugins/updaterplugin/updaterplugin.pro | 10 ++-- zeiterfassunglib/dialogs/updatedialog.h | 35 ------------- zeiterfassunglib/mainwindow.cpp | 4 -- zeiterfassunglib/zeiterfassunglib.pro | 3 -- zeiterfassunglib/zeiterfassungsettings.cpp | 10 ---- zeiterfassunglib/zeiterfassungsettings.h | 3 -- 13 files changed, 81 insertions(+), 88 deletions(-) rename zeiterfassunglib/dialogs/updatedialog.cpp => plugins/updaterplugin/updaterdialog.cpp (56%) create mode 100644 plugins/updaterplugin/updaterdialog.h rename zeiterfassunglib/dialogs/updatedialog.ui => plugins/updaterplugin/updaterdialog.ui (96%) delete mode 100644 zeiterfassunglib/dialogs/updatedialog.h diff --git a/plugins/advancedviewplugin/advancedviewplugin.h b/plugins/advancedviewplugin/advancedviewplugin.h index e4a08e8..02bfc66 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.h +++ b/plugins/advancedviewplugin/advancedviewplugin.h @@ -17,7 +17,7 @@ public: explicit AdvancedViewPlugin(QObject *parent = Q_NULLPTR); // ZeiterfassungPlugin interface - void attachTo(MainWindow &mainWindow); + void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; }; #endif // ADVANCEDVIEWPLUGIN_H diff --git a/plugins/presenceplugin/presenceplugin.h b/plugins/presenceplugin/presenceplugin.h index 362c0f1..acee4b7 100644 --- a/plugins/presenceplugin/presenceplugin.h +++ b/plugins/presenceplugin/presenceplugin.h @@ -17,7 +17,7 @@ public: explicit PresencePlugin(QObject *parent = Q_NULLPTR); // ZeiterfassungPlugin interface - void attachTo(MainWindow &mainWindow); + void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; }; #endif // PRESENCEPLUGIN_H diff --git a/zeiterfassunglib/dialogs/updatedialog.cpp b/plugins/updaterplugin/updaterdialog.cpp similarity index 56% rename from zeiterfassunglib/dialogs/updatedialog.cpp rename to plugins/updaterplugin/updaterdialog.cpp index e47fc81..3d4c560 100644 --- a/zeiterfassunglib/dialogs/updatedialog.cpp +++ b/plugins/updaterplugin/updaterdialog.cpp @@ -1,5 +1,5 @@ -#include "updatedialog.h" -#include "ui_updatedialog.h" +#include "updaterdialog.h" +#include "ui_updaterdialog.h" #include #include @@ -14,34 +14,48 @@ #include #include +#include "mainwindow.h" #include "zeiterfassungsettings.h" +#include "zeiterfassungapi.h" -UpdateDialog::UpdateDialog(ZeiterfassungSettings &settings, QNetworkAccessManager *manager, QWidget *parent) : - QDialog(parent), - ui(new Ui::UpdateDialog), - m_settings(settings) +UpdaterDialog::UpdaterDialog(MainWindow &mainWindow) : + QDialog(&mainWindow), + ui(new Ui::UpdaterDialog), + m_mainWindow(mainWindow) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose); - connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &UpdateDialog::submit); + connect(ui->buttonBox, &QDialogButtonBox::accepted, this, [=]() { + if(ui->checkBoxDontShow->isChecked()) + m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate()); + + if(!QDesktopServices::openUrl(m_url)) + QMessageBox::warning(this, tr("Could not open default webbrowser!"), tr("Could not open default webbrowser!")); + + accept(); + }); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [=](){ if(ui->checkBoxDontShow->isChecked()) - m_settings.setLastUpdateCheck(QDate::currentDate()); + m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate()); + reject(); }); - m_reply = manager->get(QNetworkRequest(QUrl(QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases")))); - connect(m_reply, &QNetworkReply::finished, this, &UpdateDialog::finished); + auto url = m_mainWindow.settings().value(QStringLiteral("UpdaterPlugin/url"), + QUrl(QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases"))).toUrl(); + m_reply = m_mainWindow.erfassung().manager()->get(QNetworkRequest(url)); + connect(m_reply, &QNetworkReply::finished, this, &UpdaterDialog::finished); } -UpdateDialog::~UpdateDialog() +UpdaterDialog::~UpdaterDialog() { delete ui; } -void UpdateDialog::finished() +void UpdaterDialog::finished() { if(m_reply->error() != QNetworkReply::NoError) { @@ -83,18 +97,7 @@ void UpdateDialog::finished() } } - m_settings.setLastUpdateCheck(QDate::currentDate()); + m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate()); deleteLater(); } - -void UpdateDialog::submit() -{ - if(ui->checkBoxDontShow->isChecked()) - m_settings.setLastUpdateCheck(QDate::currentDate()); - - if(!QDesktopServices::openUrl(m_url)) - QMessageBox::warning(this, tr("Could not open default webbrowser!"), tr("Could not open default webbrowser!")); - - accept(); -} diff --git a/plugins/updaterplugin/updaterdialog.h b/plugins/updaterplugin/updaterdialog.h new file mode 100644 index 0000000..ba41f6e --- /dev/null +++ b/plugins/updaterplugin/updaterdialog.h @@ -0,0 +1,33 @@ +#ifndef UPDATERDIALOG_H +#define UPDATERDIALOG_H + +#include +#include + +#include "zeiterfassunglib_global.h" + +class QNetworkReply; + +namespace Ui { class UpdaterDialog; } +class MainWindow; + +class ZEITERFASSUNGLIBSHARED_EXPORT UpdaterDialog : public QDialog +{ + Q_OBJECT + +public: + explicit UpdaterDialog(MainWindow &parent); + ~UpdaterDialog(); + +private Q_SLOTS: + void finished(); + +private: + Ui::UpdaterDialog *ui; + MainWindow &m_mainWindow; + QNetworkReply *m_reply; + + QUrl m_url; +}; + +#endif // UPDATERDIALOG_H diff --git a/zeiterfassunglib/dialogs/updatedialog.ui b/plugins/updaterplugin/updaterdialog.ui similarity index 96% rename from zeiterfassunglib/dialogs/updatedialog.ui rename to plugins/updaterplugin/updaterdialog.ui index c0841db..8d8f8d3 100644 --- a/zeiterfassunglib/dialogs/updatedialog.ui +++ b/plugins/updaterplugin/updaterdialog.ui @@ -1,7 +1,7 @@ - UpdateDialog - + UpdaterDialog + 0 diff --git a/plugins/updaterplugin/updaterplugin.cpp b/plugins/updaterplugin/updaterplugin.cpp index a19a90e..24b5f51 100644 --- a/plugins/updaterplugin/updaterplugin.cpp +++ b/plugins/updaterplugin/updaterplugin.cpp @@ -2,6 +2,12 @@ #include +#include "mainwindow.h" +#include "zeiterfassungsettings.h" +#include "zeiterfassungapi.h" + +#include "updaterdialog.h" + UpdaterPlugin::UpdaterPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { @@ -10,5 +16,9 @@ UpdaterPlugin::UpdaterPlugin(QObject *parent) : void UpdaterPlugin::attachTo(MainWindow &mainWindow) { + qDebug() << "called"; + if(mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate().isNull() || + mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate() < QDate::currentDate()) + new UpdaterDialog(mainWindow); } diff --git a/plugins/updaterplugin/updaterplugin.h b/plugins/updaterplugin/updaterplugin.h index 99d5c17..6ebf16b 100644 --- a/plugins/updaterplugin/updaterplugin.h +++ b/plugins/updaterplugin/updaterplugin.h @@ -17,7 +17,7 @@ public: explicit UpdaterPlugin(QObject *parent = Q_NULLPTR); // ZeiterfassungPlugin interface - void attachTo(MainWindow &mainWindow); + void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; }; #endif // UPDATERPLUGIN_H diff --git a/plugins/updaterplugin/updaterplugin.pro b/plugins/updaterplugin/updaterplugin.pro index ea8097d..d7fa50f 100644 --- a/plugins/updaterplugin/updaterplugin.pro +++ b/plugins/updaterplugin/updaterplugin.pro @@ -1,6 +1,6 @@ QT += core network gui widgets -TARGET = advancedviewplugin +TARGET = updaterplugin TEMPLATE = lib CONFIG += shared c++14 @@ -14,11 +14,13 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT -HEADERS += updaterplugin.h +HEADERS += updaterdialog.h \ + updaterplugin.h -SOURCES += updaterplugin.cpp +SOURCES += updaterdialog.cpp \ + updaterplugin.cpp -FORMS += +FORMS += updaterdialog.ui RESOURCES += diff --git a/zeiterfassunglib/dialogs/updatedialog.h b/zeiterfassunglib/dialogs/updatedialog.h deleted file mode 100644 index d2a9c08..0000000 --- a/zeiterfassunglib/dialogs/updatedialog.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef UPDATEDIALOG_H -#define UPDATEDIALOG_H - -#include -#include - -#include "zeiterfassunglib_global.h" - -class QNetworkAccessManager; -class QNetworkReply; - -class ZeiterfassungSettings; -namespace Ui { class UpdateDialog; } - -class ZEITERFASSUNGLIBSHARED_EXPORT UpdateDialog : public QDialog -{ - Q_OBJECT - -public: - explicit UpdateDialog(ZeiterfassungSettings &settings, QNetworkAccessManager *manager, QWidget *parent = Q_NULLPTR); - ~UpdateDialog(); - -private Q_SLOTS: - void finished(); - void submit(); - -private: - Ui::UpdateDialog *ui; - ZeiterfassungSettings &m_settings; - QNetworkReply *m_reply; - - QUrl m_url; -}; - -#endif // UPDATEDIALOG_H diff --git a/zeiterfassunglib/mainwindow.cpp b/zeiterfassunglib/mainwindow.cpp index a298dbc..9d52cd9 100644 --- a/zeiterfassunglib/mainwindow.cpp +++ b/zeiterfassunglib/mainwindow.cpp @@ -21,7 +21,6 @@ #include "stripswidget.h" #include "dialogs/aboutmedialog.h" #include "dialogs/settingsdialog.h" -#include "dialogs/updatedialog.h" #include "replies/getprojectsreply.h" #include "replies/getauswertungreply.h" #include "replies/createbookingreply.h" @@ -97,9 +96,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass m_holidaysLabel->setFrameShadow(QFrame::Sunken); dateChanged(); - - if(settings.lastUpdateCheck().isNull() || settings.lastUpdateCheck() < QDate::currentDate()) - new UpdateDialog(settings, erfassung.manager(), this); } MainWindow::~MainWindow() diff --git a/zeiterfassunglib/zeiterfassunglib.pro b/zeiterfassunglib/zeiterfassunglib.pro index 62c40c9..0c77d71 100644 --- a/zeiterfassunglib/zeiterfassunglib.pro +++ b/zeiterfassunglib/zeiterfassunglib.pro @@ -21,7 +21,6 @@ SOURCES += mainwindow.cpp \ dialogs/authenticationdialog.cpp \ dialogs/languageselectiondialog.cpp \ dialogs/settingsdialog.cpp \ - dialogs/updatedialog.cpp \ replies/createbookingreply.cpp \ replies/createtimeassignmentreply.cpp \ replies/deletebookingreply.cpp \ @@ -51,7 +50,6 @@ HEADERS += cpp14polyfills.h \ dialogs/authenticationdialog.h \ dialogs/languageselectiondialog.h \ dialogs/settingsdialog.h \ - dialogs/updatedialog.h \ replies/createbookingreply.h \ replies/createtimeassignmentreply.h \ replies/deletebookingreply.h \ @@ -69,7 +67,6 @@ HEADERS += cpp14polyfills.h \ replies/getuserinforeply.h FORMS += mainwindow.ui \ - dialogs/updatedialog.ui \ dialogs/settingsdialog.ui \ dialogs/languageselectiondialog.ui \ dialogs/authenticationdialog.ui \ diff --git a/zeiterfassunglib/zeiterfassungsettings.cpp b/zeiterfassunglib/zeiterfassungsettings.cpp index 6f98a2f..18149be 100644 --- a/zeiterfassunglib/zeiterfassungsettings.cpp +++ b/zeiterfassunglib/zeiterfassungsettings.cpp @@ -132,16 +132,6 @@ void ZeiterfassungSettings::prependText(const QString &text) prependItem(QStringLiteral("texte"), text); } -QDate ZeiterfassungSettings::lastUpdateCheck() const -{ - return value(QStringLiteral("lastUpdateCheck")).toDate(); -} - -void ZeiterfassungSettings::setLastUpdateCheck(const QDate &lastUpdateCheck) -{ - setValue(QStringLiteral("lastUpdateCheck"), lastUpdateCheck); -} - QString ZeiterfassungSettings::theme() const { return value(QStringLiteral("theme")).toString(); diff --git a/zeiterfassunglib/zeiterfassungsettings.h b/zeiterfassunglib/zeiterfassungsettings.h index 952cbdb..0a56adf 100644 --- a/zeiterfassunglib/zeiterfassungsettings.h +++ b/zeiterfassunglib/zeiterfassungsettings.h @@ -51,9 +51,6 @@ public: void setTexte(const QStringList &texte); void prependText(const QString &text); - QDate lastUpdateCheck() const; - void setLastUpdateCheck(const QDate &lastUpdateCheck); - QString theme() const; void setTheme(const QString &theme); -- 2.50.1 From ab263c73f69e75216c8f647234394e8b00503f5b Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 18 Dec 2017 23:09:45 +0100 Subject: [PATCH 04/21] Fixed crash with lambas in connections of deleted objects --- .../models/bookingsmodel.cpp | 7 +++- .../advancedviewplugin/models/bookingsmodel.h | 1 + .../models/timeassignmentsmodel.cpp | 7 +++- plugins/updaterplugin/updaterdialog.cpp | 37 +++++++++++-------- plugins/updaterplugin/updaterdialog.h | 2 + plugins/updaterplugin/updaterplugin.cpp | 2 - zeiterfassunglib/mainwindow.h | 5 --- 7 files changed, 36 insertions(+), 25 deletions(-) diff --git a/plugins/advancedviewplugin/models/bookingsmodel.cpp b/plugins/advancedviewplugin/models/bookingsmodel.cpp index 14ece31..4c59657 100644 --- a/plugins/advancedviewplugin/models/bookingsmodel.cpp +++ b/plugins/advancedviewplugin/models/bookingsmodel.cpp @@ -7,7 +7,7 @@ BookingsModel::BookingsModel(StripsWidget &stripsWidget, QObject *parent) : m_stripsWidget(stripsWidget) { connect(&stripsWidget, &StripsWidget::bookingsChanged, this, &BookingsModel::bookingsChanged); - connect(&stripsWidget, &StripsWidget::refreshingBookingsChanged, [=](bool refreshing){ enabledChanged(!refreshing); }); + connect(&stripsWidget, &StripsWidget::refreshingBookingsChanged, this, &BookingsModel::refreshingChanged); } StripsWidget &BookingsModel::stripsWidget() const @@ -86,3 +86,8 @@ void BookingsModel::bookingsChanged() beginResetModel(); endResetModel(); } + +void BookingsModel::refreshingChanged(bool refreshing) +{ + Q_EMIT enabledChanged(!refreshing); +} diff --git a/plugins/advancedviewplugin/models/bookingsmodel.h b/plugins/advancedviewplugin/models/bookingsmodel.h index 0c02b3e..9156d0e 100644 --- a/plugins/advancedviewplugin/models/bookingsmodel.h +++ b/plugins/advancedviewplugin/models/bookingsmodel.h @@ -32,6 +32,7 @@ Q_SIGNALS: private Q_SLOTS: void bookingsChanged(); + void refreshingChanged(bool refreshing); private: StripsWidget &m_stripsWidget; diff --git a/plugins/advancedviewplugin/models/timeassignmentsmodel.cpp b/plugins/advancedviewplugin/models/timeassignmentsmodel.cpp index b33930b..73a1a70 100644 --- a/plugins/advancedviewplugin/models/timeassignmentsmodel.cpp +++ b/plugins/advancedviewplugin/models/timeassignmentsmodel.cpp @@ -7,7 +7,7 @@ TimeAssignmentsModel::TimeAssignmentsModel(StripsWidget &stripsWidget, QObject * m_stripsWidget(stripsWidget) { connect(&stripsWidget, &StripsWidget::timeAssignmentsChanged, this, &TimeAssignmentsModel::timeAssignmentsChanged); - connect(&stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, [=](bool refreshing){ enabledChanged(!refreshing); }); + connect(&stripsWidget, &StripsWidget::refreshingTimeAssignmentsChanged, this, &TimeAssignmentsModel::refreshingChanged); } StripsWidget &TimeAssignmentsModel::stripsWidget() const @@ -90,3 +90,8 @@ void TimeAssignmentsModel::timeAssignmentsChanged() beginResetModel(); endResetModel(); } + +void TimeAssignmentsModel::refreshingChanged(bool refreshing) +{ + Q_EMIT enabledChanged(!refreshing); +} diff --git a/plugins/updaterplugin/updaterdialog.cpp b/plugins/updaterplugin/updaterdialog.cpp index 3d4c560..55f5bdb 100644 --- a/plugins/updaterplugin/updaterdialog.cpp +++ b/plugins/updaterplugin/updaterdialog.cpp @@ -27,22 +27,8 @@ UpdaterDialog::UpdaterDialog(MainWindow &mainWindow) : setAttribute(Qt::WA_DeleteOnClose); - connect(ui->buttonBox, &QDialogButtonBox::accepted, this, [=]() { - if(ui->checkBoxDontShow->isChecked()) - m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate()); - - if(!QDesktopServices::openUrl(m_url)) - QMessageBox::warning(this, tr("Could not open default webbrowser!"), tr("Could not open default webbrowser!")); - - accept(); - }); - - connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [=](){ - if(ui->checkBoxDontShow->isChecked()) - m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate()); - - reject(); - }); + connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &UpdaterDialog::acceptedSlot); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &UpdaterDialog::rejectedSlot); auto url = m_mainWindow.settings().value(QStringLiteral("UpdaterPlugin/url"), QUrl(QStringLiteral("https://api.github.com/repos/0xFEEDC0DE64/QtZeiterfassung/releases"))).toUrl(); @@ -55,6 +41,25 @@ UpdaterDialog::~UpdaterDialog() delete ui; } +void UpdaterDialog::acceptedSlot() +{ + if(ui->checkBoxDontShow->isChecked()) + m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate()); + + if(!QDesktopServices::openUrl(m_url)) + QMessageBox::warning(this, tr("Could not open default webbrowser!"), tr("Could not open default webbrowser!")); + + accept(); +} + +void UpdaterDialog::rejectedSlot() +{ + if(ui->checkBoxDontShow->isChecked()) + m_mainWindow.settings().setValue(QStringLiteral("UpdaterPlugin/lastUpdateCheck"), QDate::currentDate()); + + reject(); +} + void UpdaterDialog::finished() { if(m_reply->error() != QNetworkReply::NoError) diff --git a/plugins/updaterplugin/updaterdialog.h b/plugins/updaterplugin/updaterdialog.h index ba41f6e..9626d05 100644 --- a/plugins/updaterplugin/updaterdialog.h +++ b/plugins/updaterplugin/updaterdialog.h @@ -20,6 +20,8 @@ public: ~UpdaterDialog(); private Q_SLOTS: + void acceptedSlot(); + void rejectedSlot(); void finished(); private: diff --git a/plugins/updaterplugin/updaterplugin.cpp b/plugins/updaterplugin/updaterplugin.cpp index 24b5f51..13ad888 100644 --- a/plugins/updaterplugin/updaterplugin.cpp +++ b/plugins/updaterplugin/updaterplugin.cpp @@ -16,8 +16,6 @@ UpdaterPlugin::UpdaterPlugin(QObject *parent) : void UpdaterPlugin::attachTo(MainWindow &mainWindow) { - qDebug() << "called"; - if(mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate().isNull() || mainWindow.settings().value(QStringLiteral("UpdaterPlugin/lastUpdateCheck")).toDate() < QDate::currentDate()) new UpdaterDialog(mainWindow); diff --git a/zeiterfassunglib/mainwindow.h b/zeiterfassunglib/mainwindow.h index c74ae2a..6f30f71 100644 --- a/zeiterfassunglib/mainwindow.h +++ b/zeiterfassunglib/mainwindow.h @@ -19,8 +19,6 @@ namespace Ui { class MainWindow; } class ZeiterfassungSettings; class StripFactory; class StripsWidget; -class BookingsModel; -class TimeAssignmentsModel; class ZEITERFASSUNGLIBSHARED_EXPORT MainWindow : public QMainWindow { @@ -70,9 +68,6 @@ private: std::unique_ptr m_getProjectsReply; std::unique_ptr m_getAuswertungReply; - BookingsModel *m_bookingsModel; - TimeAssignmentsModel *m_timeAssignmentsModel; - QMap m_projects; QDate m_auswertungDate; -- 2.50.1 From 5d4928fddf2ebd7f4de920f62bf16ae5a9b42313 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 18 Dec 2017 23:10:36 +0100 Subject: [PATCH 05/21] Added reportsplugin --- plugins/plugins.pro | 1 + plugins/reportsplugin/reportsplugin.cpp | 13 ++++++++++++ plugins/reportsplugin/reportsplugin.h | 23 ++++++++++++++++++++ plugins/reportsplugin/reportsplugin.json | 0 plugins/reportsplugin/reportsplugin.pro | 27 ++++++++++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 plugins/reportsplugin/reportsplugin.cpp create mode 100644 plugins/reportsplugin/reportsplugin.h create mode 100644 plugins/reportsplugin/reportsplugin.json create mode 100644 plugins/reportsplugin/reportsplugin.pro diff --git a/plugins/plugins.pro b/plugins/plugins.pro index ceae520..f8c26c3 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -3,5 +3,6 @@ TEMPLATE = subdirs SUBDIRS += advancedviewplugin \ lunchmealplugin \ presenceplugin \ + reportsplugin \ updaterplugin \ weatherplugin diff --git a/plugins/reportsplugin/reportsplugin.cpp b/plugins/reportsplugin/reportsplugin.cpp new file mode 100644 index 0000000..b8ddf29 --- /dev/null +++ b/plugins/reportsplugin/reportsplugin.cpp @@ -0,0 +1,13 @@ +#include "reportsplugin.h" + +#include + +ReportsPlugin::ReportsPlugin(QObject *parent) : + ZeiterfassungPlugin(parent) +{ + qDebug() << "called"; +} + +void ReportsPlugin::attachTo(MainWindow &mainWindow) +{ +} diff --git a/plugins/reportsplugin/reportsplugin.h b/plugins/reportsplugin/reportsplugin.h new file mode 100644 index 0000000..782caa2 --- /dev/null +++ b/plugins/reportsplugin/reportsplugin.h @@ -0,0 +1,23 @@ +#ifndef REPORTSPLUGIN_H +#define REPORTSPLUGIN_H + +#include + +#include "zeiterfassungplugin.h" + +class MainWindow; + +class Q_DECL_EXPORT ReportsPlugin : public ZeiterfassungPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "reportsplugin.json") + Q_INTERFACES(ZeiterfassungPlugin) + +public: + explicit ReportsPlugin(QObject *parent = Q_NULLPTR); + + // ZeiterfassungPlugin interface + void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; +}; + +#endif // REPORTSPLUGIN_H diff --git a/plugins/reportsplugin/reportsplugin.json b/plugins/reportsplugin/reportsplugin.json new file mode 100644 index 0000000..e69de29 diff --git a/plugins/reportsplugin/reportsplugin.pro b/plugins/reportsplugin/reportsplugin.pro new file mode 100644 index 0000000..4673528 --- /dev/null +++ b/plugins/reportsplugin/reportsplugin.pro @@ -0,0 +1,27 @@ +QT += core network gui widgets + +TARGET = reportsplugin +TEMPLATE = lib + +CONFIG += shared c++14 + +DESTDIR = $${OUT_PWD}/../../bin/plugins/zeiterfassung + +LIBS += -L$$OUT_PWD/../../lib -lzeiterfassunglib + +INCLUDEPATH += $$PWD/../../zeiterfassunglib +DEPENDPATH += $$PWD/../../zeiterfassunglib + +DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT + +HEADERS += reportsplugin.h + +SOURCES += reportsplugin.cpp + +FORMS += + +RESOURCES += + +TRANSLATIONS += + +OTHER_FILES += reportsplugin.json -- 2.50.1 From 27bc7eca807eae50fc5cd6fd95c40fbb5d4c94db Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 18 Dec 2017 23:21:39 +0100 Subject: [PATCH 06/21] Added menu entry for presence plugin --- plugins/presenceplugin/presencewidget.cpp | 12 ++++++------ plugins/presenceplugin/presencewidget.h | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/presenceplugin/presencewidget.cpp b/plugins/presenceplugin/presencewidget.cpp index 05d6223..c56eba6 100644 --- a/plugins/presenceplugin/presencewidget.cpp +++ b/plugins/presenceplugin/presencewidget.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -23,6 +24,8 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) : m_labelNotAvailable->setFrameShadow(QFrame::Sunken); m_mainWindow.statusBar()->addWidget(m_labelNotAvailable); + m_action = m_mainWindow.menuView()->addAction(tr("Refresh presence"), this, &PresenceWidget::timeout); + auto timer = new QTimer(this); timer->setInterval(60000); connect(timer, &QTimer::timeout, this, &PresenceWidget::timeout); @@ -33,15 +36,11 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) : void PresenceWidget::timeout() { - if(m_reply) - { - qWarning() << "last request not finished yet!"; - return; - } - m_labelAvailable->setText(tr("%0: %1").arg(tr("Available")).arg(tr("???"))); m_labelNotAvailable->setText(tr("%0: %1").arg(tr("Not available")).arg(tr("???"))); + m_action->setEnabled(false); + m_reply = m_mainWindow.erfassung().doGetPresenceStatus(); connect(m_reply.get(), &ZeiterfassungReply::finished, this, &PresenceWidget::finished); } @@ -73,5 +72,6 @@ void PresenceWidget::finished() } after: + m_action->setEnabled(true); m_reply = Q_NULLPTR; } diff --git a/plugins/presenceplugin/presencewidget.h b/plugins/presenceplugin/presencewidget.h index 2c1e578..b01b179 100644 --- a/plugins/presenceplugin/presencewidget.h +++ b/plugins/presenceplugin/presencewidget.h @@ -6,6 +6,7 @@ #include "replies/getpresencestatusreply.h" class QLabel; +class QAction; class MainWindow; @@ -25,6 +26,8 @@ private: QLabel *m_labelAvailable; QLabel *m_labelNotAvailable; + QAction *m_action; + std::unique_ptr m_reply; }; -- 2.50.1 From a0472c8c51d65754b4b4c6543b8928a5e6565c31 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 18 Dec 2017 23:26:26 +0100 Subject: [PATCH 07/21] Fixed typo --- ...edviewdialog.cpp => advancedviewdialog.cpp} | 18 +++++++++--------- ...vanvedviewdialog.h => advancedviewdialog.h} | 16 ++++++++-------- ...nvedviewdialog.ui => advancedviewdialog.ui} | 8 ++++---- .../advancedviewplugin/advancedviewplugin.pro | 6 +++--- .../advancedviewplugin/advancedviewwidget.cpp | 4 ++-- 5 files changed, 26 insertions(+), 26 deletions(-) rename plugins/advancedviewplugin/{advanvedviewdialog.cpp => advancedviewdialog.cpp} (95%) rename plugins/advancedviewplugin/{advanvedviewdialog.h => advancedviewdialog.h} (55%) rename plugins/advancedviewplugin/{advanvedviewdialog.ui => advancedviewdialog.ui} (91%) diff --git a/plugins/advancedviewplugin/advanvedviewdialog.cpp b/plugins/advancedviewplugin/advancedviewdialog.cpp similarity index 95% rename from plugins/advancedviewplugin/advanvedviewdialog.cpp rename to plugins/advancedviewplugin/advancedviewdialog.cpp index 9a5f2de..cc3680f 100644 --- a/plugins/advancedviewplugin/advanvedviewdialog.cpp +++ b/plugins/advancedviewplugin/advancedviewdialog.cpp @@ -1,5 +1,5 @@ -#include "advanvedviewdialog.h" -#include "ui_advanvedviewdialog.h" +#include "advancedviewdialog.h" +#include "ui_advancedviewdialog.h" #include #include @@ -21,9 +21,9 @@ #include "models/bookingsmodel.h" #include "models/timeassignmentsmodel.h" -AdvanvedViewDialog::AdvanvedViewDialog(StripsWidget &stripsWidget) : +AdvancedViewDialog::AdvancedViewDialog(StripsWidget &stripsWidget) : QDialog(&stripsWidget.mainWindow()), - ui(new Ui::AdvanvedViewDialog), + ui(new Ui::AdvancedViewDialog), m_stripsWidget(stripsWidget), m_bookingsModel(new BookingsModel(stripsWidget, this)), m_timeAssignmentsModel(new TimeAssignmentsModel(stripsWidget, this)) @@ -33,20 +33,20 @@ AdvanvedViewDialog::AdvanvedViewDialog(StripsWidget &stripsWidget) : ui->bookingsView->setModel(m_bookingsModel); ui->bookingsView->setEnabled(m_bookingsModel->enabled()); connect(m_bookingsModel, &BookingsModel::enabledChanged, ui->bookingsView, &QWidget::setEnabled); - connect(ui->bookingsView, &QWidget::customContextMenuRequested, this, &AdvanvedViewDialog::contextMenuBooking); + connect(ui->bookingsView, &QWidget::customContextMenuRequested, this, &AdvancedViewDialog::contextMenuBooking); ui->timeAssignmentsView->setModel(m_timeAssignmentsModel); ui->timeAssignmentsView->setEnabled(m_timeAssignmentsModel->enabled()); connect(m_timeAssignmentsModel, &TimeAssignmentsModel::enabledChanged, ui->timeAssignmentsView, &QWidget::setEnabled); - connect(ui->timeAssignmentsView, &QWidget::customContextMenuRequested, this, &AdvanvedViewDialog::contextMenuTimeAssignment); + connect(ui->timeAssignmentsView, &QWidget::customContextMenuRequested, this, &AdvancedViewDialog::contextMenuTimeAssignment); } -AdvanvedViewDialog::~AdvanvedViewDialog() +AdvancedViewDialog::~AdvancedViewDialog() { delete ui; } -void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos) +void AdvancedViewDialog::contextMenuBooking(const QPoint &pos) { auto index = ui->bookingsView->indexAt(pos); @@ -152,7 +152,7 @@ void AdvanvedViewDialog::contextMenuBooking(const QPoint &pos) } } -void AdvanvedViewDialog::contextMenuTimeAssignment(const QPoint &pos) +void AdvancedViewDialog::contextMenuTimeAssignment(const QPoint &pos) { auto index = ui->timeAssignmentsView->indexAt(pos); diff --git a/plugins/advancedviewplugin/advanvedviewdialog.h b/plugins/advancedviewplugin/advancedviewdialog.h similarity index 55% rename from plugins/advancedviewplugin/advanvedviewdialog.h rename to plugins/advancedviewplugin/advancedviewdialog.h index 4423716..b35068b 100644 --- a/plugins/advancedviewplugin/advanvedviewdialog.h +++ b/plugins/advancedviewplugin/advancedviewdialog.h @@ -1,27 +1,27 @@ -#ifndef ADVANVEDVIEWDIALOG_H -#define ADVANVEDVIEWDIALOG_H +#ifndef ADVANCEDVIEWDIALOG_H +#define ADVANCEDVIEWDIALOG_H #include -namespace Ui { class AdvanvedViewDialog; } +namespace Ui { class AdvancedViewDialog; } class StripsWidget; class BookingsModel; class TimeAssignmentsModel; -class AdvanvedViewDialog : public QDialog +class AdvancedViewDialog : public QDialog { Q_OBJECT public: - explicit AdvanvedViewDialog(StripsWidget &stripsWidget); - ~AdvanvedViewDialog(); + explicit AdvancedViewDialog(StripsWidget &stripsWidget); + ~AdvancedViewDialog(); private Q_SLOTS: void contextMenuBooking(const QPoint &pos); void contextMenuTimeAssignment(const QPoint &pos); private: - Ui::AdvanvedViewDialog *ui; + Ui::AdvancedViewDialog *ui; StripsWidget &m_stripsWidget; @@ -29,4 +29,4 @@ private: TimeAssignmentsModel *m_timeAssignmentsModel; }; -#endif // ADVANVEDVIEWDIALOG_H +#endif // ADVANCEDVIEWDIALOG_H diff --git a/plugins/advancedviewplugin/advanvedviewdialog.ui b/plugins/advancedviewplugin/advancedviewdialog.ui similarity index 91% rename from plugins/advancedviewplugin/advanvedviewdialog.ui rename to plugins/advancedviewplugin/advancedviewdialog.ui index 0ad8f3f..0d87750 100644 --- a/plugins/advancedviewplugin/advanvedviewdialog.ui +++ b/plugins/advancedviewplugin/advancedviewdialog.ui @@ -1,7 +1,7 @@ - AdvanvedViewDialog - + AdvancedViewDialog + 0 @@ -48,7 +48,7 @@ buttonBox accepted() - AdvanvedViewDialog + AdvancedViewDialog accept() @@ -64,7 +64,7 @@ buttonBox rejected() - AdvanvedViewDialog + AdvancedViewDialog reject() diff --git a/plugins/advancedviewplugin/advancedviewplugin.pro b/plugins/advancedviewplugin/advancedviewplugin.pro index a4436d6..3a024ee 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.pro +++ b/plugins/advancedviewplugin/advancedviewplugin.pro @@ -14,7 +14,7 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT -HEADERS += advanvedviewdialog.h \ +HEADERS += advancedviewdialog.h \ advancedviewplugin.h \ advancedviewwidget.h \ dialogs/bookingdialog.h \ @@ -22,7 +22,7 @@ HEADERS += advanvedviewdialog.h \ models/bookingsmodel.h \ models/timeassignmentsmodel.h -SOURCES += advanvedviewdialog.cpp \ +SOURCES += advancedviewdialog.cpp \ advancedviewplugin.cpp \ advancedviewwidget.cpp \ dialogs/bookingdialog.cpp \ @@ -30,7 +30,7 @@ SOURCES += advanvedviewdialog.cpp \ models/bookingsmodel.cpp \ models/timeassignmentsmodel.cpp -FORMS += advanvedviewdialog.ui \ +FORMS += advancedviewdialog.ui \ dialogs/bookingdialog.ui \ dialogs/timeassignmentdialog.ui diff --git a/plugins/advancedviewplugin/advancedviewwidget.cpp b/plugins/advancedviewplugin/advancedviewwidget.cpp index a48699c..adcaa38 100644 --- a/plugins/advancedviewplugin/advancedviewwidget.cpp +++ b/plugins/advancedviewplugin/advancedviewwidget.cpp @@ -3,7 +3,7 @@ #include #include "stripswidget.h" -#include "advanvedviewdialog.h" +#include "advancedviewdialog.h" AdvancedViewWidget::AdvancedViewWidget(StripsWidget &stripsWidget) : QPushButton(&stripsWidget), @@ -24,6 +24,6 @@ void AdvancedViewWidget::dateChanged(const QDate &date) void AdvancedViewWidget::pressedSlot() { - AdvanvedViewDialog dialog(m_stripsWidget); + AdvancedViewDialog dialog(m_stripsWidget); dialog.exec(); } -- 2.50.1 From 7e5a636868a8abd43b35f281465d3f0cd20f9197 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 18 Dec 2017 23:33:42 +0100 Subject: [PATCH 08/21] Added icon to refresh action in presenceplugin --- .../advancedviewplugin/advancedviewplugin.cpp | 1 - .../advancedviewplugin_resources.qrc | 2 +- .../advancedviewplugin/advancedviewwidget.cpp | 2 +- plugins/presenceplugin/images/refresh.png | Bin 0 -> 6914 bytes plugins/presenceplugin/presenceplugin.pro | 10 ++++++++-- .../presenceplugin/presenceplugin_resources.qrc | 5 +++++ plugins/presenceplugin/presencewidget.cpp | 3 ++- 7 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 plugins/presenceplugin/images/refresh.png create mode 100644 plugins/presenceplugin/presenceplugin_resources.qrc diff --git a/plugins/advancedviewplugin/advancedviewplugin.cpp b/plugins/advancedviewplugin/advancedviewplugin.cpp index 12a241a..6ce9d44 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.cpp +++ b/plugins/advancedviewplugin/advancedviewplugin.cpp @@ -11,7 +11,6 @@ AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; - Q_INIT_RESOURCE(advancedviewplugin_resources); } void AdvancedViewPlugin::attachTo(MainWindow &mainWindow) diff --git a/plugins/advancedviewplugin/advancedviewplugin_resources.qrc b/plugins/advancedviewplugin/advancedviewplugin_resources.qrc index c0cfae7..6b72660 100644 --- a/plugins/advancedviewplugin/advancedviewplugin_resources.qrc +++ b/plugins/advancedviewplugin/advancedviewplugin_resources.qrc @@ -1,5 +1,5 @@ - + images/advanced-view.png diff --git a/plugins/advancedviewplugin/advancedviewwidget.cpp b/plugins/advancedviewplugin/advancedviewwidget.cpp index adcaa38..15eb880 100644 --- a/plugins/advancedviewplugin/advancedviewwidget.cpp +++ b/plugins/advancedviewplugin/advancedviewwidget.cpp @@ -9,7 +9,7 @@ AdvancedViewWidget::AdvancedViewWidget(StripsWidget &stripsWidget) : QPushButton(&stripsWidget), m_stripsWidget(stripsWidget) { - setIcon(QIcon(QStringLiteral(":/zeiterfassunglib/plugins/advancedviewplugin/images/advanced-view.png"))); + setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/advancedviewplugin/images/advanced-view.png"))); connect(&stripsWidget, &StripsWidget::dateChanged, this, &AdvancedViewWidget::dateChanged); dateChanged(stripsWidget.date()); diff --git a/plugins/presenceplugin/images/refresh.png b/plugins/presenceplugin/images/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..f3585b74a877cd7716fb55a1c7392c87164095ac GIT binary patch literal 6914 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hE5oB~f~#Qr zA_Iwb3!aIs8=Ey*jD%)gowfVw-B%C4RkRzw+j~7KzV1!&@_Evn|0=@QM*W^w{Lb!m z?f&o5*9soY|EaqFm3}~|OG|(K_s8FE{MqQ0G&wD0k(+kz(v7{^N=lB-*G^hR3U>8z z=Ox~~vFqUS{GVHx1%6)T`xyS|%Pm<`E?pn(tX`8x$DX;}+OcZtwskq7(X)@QN`CFW zdU5jNs~5di-}35_c$s#$W}p51v)|I6Kl}Z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_NKpUKt)$D_G%mBqijr zs!`V&iOMI9hd;eAHZEcNd70zC=)=<*>OZ7DJYZeCi-SpQy?bN$qegXuKgnShs2|krky`C)kr*PtBGpr+{}%d@~XBH zn}0V>w)ybEk#By+`Ckj}yZzvo_$Q|NI9t5;8LQl<|I7|61S*(M$wy}A$*m7xZoXDB z^=_Nk)vbcfg2!ue57byKkbeGUa+6M>i01+i8$I3@kBtWdPAX?r`e^%0N?(!44)^SL zDf#x)=KmX+_CB2pFVjDBl`Ge*jBWrhFo6DuA>HSUosSh;*fg;U79o1Mkpw>I9eY_?xj!k;?F;?Cn28}&ZV zZPcD)-}524C7;=z@zi1V`!$J&>p#{#`&gDB^J0=xj^YQkDbfvdH*VGUe7qviS1Ee+ zu_aSGG|XHkIx;?Ia(yTHMRu>FV|_r&ot=H*a~b8Nnf_}Ynq2bo62re&M2GWuQ8eV{r(~v8LNyrb8XATeSXvnySs5EZG-!3lW-%}@ zq=TH~lbM{FSDea_QBqQ1rLPaRE3+&$IX^cyKd)FXzbIWl2co1{KdDl;I8onN&p=-x zzes@?9X{>>KKe#_hWgR{HpwtILYzk+6hu6>-eh24kOa9gI6tkVJh3R1p}f3YFEcN@ zI61K(738$p?`)(P7#M^hib{);QyKg#D$`T*6g-pj^NQa{tb4)0z@Uzhjt>p;fq4~V fSUy;_ZYD@I$Uyz~=BrMF=CV9p{an^LB{Ts5FplN% literal 0 HcmV?d00001 diff --git a/plugins/presenceplugin/presenceplugin.pro b/plugins/presenceplugin/presenceplugin.pro index 7767bfe..961ea39 100644 --- a/plugins/presenceplugin/presenceplugin.pro +++ b/plugins/presenceplugin/presenceplugin.pro @@ -15,9 +15,15 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT HEADERS += presenceplugin.h \ - presencewidget.h + presencewidget.h SOURCES += presenceplugin.cpp \ - presencewidget.cpp + presencewidget.cpp + +FORMS += + +RESOURCES += presenceplugin_resources.qrc + +TRANSLATIONS += OTHER_FILES += presenceplugin.json diff --git a/plugins/presenceplugin/presenceplugin_resources.qrc b/plugins/presenceplugin/presenceplugin_resources.qrc new file mode 100644 index 0000000..9eca07d --- /dev/null +++ b/plugins/presenceplugin/presenceplugin_resources.qrc @@ -0,0 +1,5 @@ + + + images/refresh.png + + diff --git a/plugins/presenceplugin/presencewidget.cpp b/plugins/presenceplugin/presencewidget.cpp index c56eba6..35d19f1 100644 --- a/plugins/presenceplugin/presencewidget.cpp +++ b/plugins/presenceplugin/presencewidget.cpp @@ -24,7 +24,8 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) : m_labelNotAvailable->setFrameShadow(QFrame::Sunken); m_mainWindow.statusBar()->addWidget(m_labelNotAvailable); - m_action = m_mainWindow.menuView()->addAction(tr("Refresh presence"), this, &PresenceWidget::timeout); + m_action = m_mainWindow.menuView()->addAction(QIcon(QStringLiteral(":zeiterfassung/plugins/presenceplugin/images/refresh.png")), + tr("Refresh presence"), this, &PresenceWidget::timeout); auto timer = new QTimer(this); timer->setInterval(60000); -- 2.50.1 From a14a1088307f469fbc4b5e21f1bcbe15d808af70 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 00:12:41 +0100 Subject: [PATCH 09/21] Moved report functionality into plugin --- plugins/presenceplugin/presenceplugin.cpp | 1 - plugins/presenceplugin/presencewidget.h | 1 + plugins/reportsplugin/images/refresh.png | Bin 0 -> 6914 bytes .../reportsplugin/images/report.png | Bin plugins/reportsplugin/reportsplugin.cpp | 3 + plugins/reportsplugin/reportsplugin.pro | 8 +- .../reportsplugin/reportsplugin_resources.qrc | 6 + plugins/reportsplugin/reportswidget.cpp | 145 ++++++++++++++++++ plugins/reportsplugin/reportswidget.h | 43 ++++++ zeiterfassunglib/mainwindow.cpp | 128 ++-------------- zeiterfassunglib/mainwindow.h | 16 +- zeiterfassunglib/mainwindow.ui | 12 -- zeiterfassunglib/resources.qrc | 1 - 13 files changed, 221 insertions(+), 143 deletions(-) create mode 100644 plugins/reportsplugin/images/refresh.png rename zeiterfassunglib/images/auswertung.png => plugins/reportsplugin/images/report.png (100%) create mode 100644 plugins/reportsplugin/reportsplugin_resources.qrc create mode 100644 plugins/reportsplugin/reportswidget.cpp create mode 100644 plugins/reportsplugin/reportswidget.h diff --git a/plugins/presenceplugin/presenceplugin.cpp b/plugins/presenceplugin/presenceplugin.cpp index 0560bb6..790c36e 100644 --- a/plugins/presenceplugin/presenceplugin.cpp +++ b/plugins/presenceplugin/presenceplugin.cpp @@ -2,7 +2,6 @@ #include -#include "mainwindow.h" #include "presencewidget.h" PresencePlugin::PresencePlugin(QObject *parent) : diff --git a/plugins/presenceplugin/presencewidget.h b/plugins/presenceplugin/presencewidget.h index b01b179..90d2433 100644 --- a/plugins/presenceplugin/presencewidget.h +++ b/plugins/presenceplugin/presencewidget.h @@ -13,6 +13,7 @@ class MainWindow; class PresenceWidget : public QWidget { Q_OBJECT + public: explicit PresenceWidget(MainWindow &mainWindow); diff --git a/plugins/reportsplugin/images/refresh.png b/plugins/reportsplugin/images/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..f3585b74a877cd7716fb55a1c7392c87164095ac GIT binary patch literal 6914 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hE5oB~f~#Qr zA_Iwb3!aIs8=Ey*jD%)gowfVw-B%C4RkRzw+j~7KzV1!&@_Evn|0=@QM*W^w{Lb!m z?f&o5*9soY|EaqFm3}~|OG|(K_s8FE{MqQ0G&wD0k(+kz(v7{^N=lB-*G^hR3U>8z z=Ox~~vFqUS{GVHx1%6)T`xyS|%Pm<`E?pn(tX`8x$DX;}+OcZtwskq7(X)@QN`CFW zdU5jNs~5di-}35_c$s#$W}p51v)|I6Kl}Z;{Tch`-(qas{w1Hz9sav$fBM3R8NI%5 z{Qo=`*8df;Sp2Q0JeyF0!)EgrZw<2YUb+8$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qegXuKgnShs2|krky`C)kr*PtBGpr+{}%d@~XBH zn}0V>w)ybEk#By+`Ckj}yZzvo_$Q|NI9t5;8LQl<|I7|61S*(M$wy}A$*m7xZoXDB z^=_Nk)vbcfg2!ue57byKkbeGUa+6M>i01+i8$I3@kBtWdPAX?r`e^%0N?(!44)^SL zDf#x)=KmX+_CB2pFVjDBl`Ge*jBWrhFo6DuA>HSUosSh;*fg;U79o1Mkpw>I9eY_?xj!k;?F;?Cn28}&ZV zZPcD)-}524C7;=z@zi1V`!$J&>p#{#`&gDB^J0=xj^YQkDbfvdH*VGUe7qviS1Ee+ zu_aSGG|XHkIx;?Ia(yTHMRu>FV|_r&ot=H*a~b8Nnf_}Ynq2bo62re&M2GWuQ8eV{r(~v8LNyrb8XATeSXvnySs5EZG-!3lW-%}@ zq=TH~lbM{FSDea_QBqQ1rLPaRE3+&$IX^cyKd)FXzbIWl2co1{KdDl;I8onN&p=-x zzes@?9X{>>KKe#_hWgR{HpwtILYzk+6hu6>-eh24kOa9gI6tkVJh3R1p}f3YFEcN@ zI61K(738$p?`)(P7#M^hib{);QyKg#D$`T*6g-pj^NQa{tb4)0z@Uzhjt>p;fq4~V fSUy;_ZYD@I$Uyz~=BrMF=CV9p{an^LB{Ts5FplN% literal 0 HcmV?d00001 diff --git a/zeiterfassunglib/images/auswertung.png b/plugins/reportsplugin/images/report.png similarity index 100% rename from zeiterfassunglib/images/auswertung.png rename to plugins/reportsplugin/images/report.png diff --git a/plugins/reportsplugin/reportsplugin.cpp b/plugins/reportsplugin/reportsplugin.cpp index b8ddf29..ea8d0fa 100644 --- a/plugins/reportsplugin/reportsplugin.cpp +++ b/plugins/reportsplugin/reportsplugin.cpp @@ -2,6 +2,8 @@ #include +#include "reportswidget.h" + ReportsPlugin::ReportsPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { @@ -10,4 +12,5 @@ ReportsPlugin::ReportsPlugin(QObject *parent) : void ReportsPlugin::attachTo(MainWindow &mainWindow) { + new ReportsWidget(mainWindow); } diff --git a/plugins/reportsplugin/reportsplugin.pro b/plugins/reportsplugin/reportsplugin.pro index 4673528..a299f62 100644 --- a/plugins/reportsplugin/reportsplugin.pro +++ b/plugins/reportsplugin/reportsplugin.pro @@ -14,13 +14,15 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT -HEADERS += reportsplugin.h +HEADERS += reportsplugin.h \ + reportswidget.h -SOURCES += reportsplugin.cpp +SOURCES += reportsplugin.cpp \ + reportswidget.cpp FORMS += -RESOURCES += +RESOURCES += reportsplugin_resources.qrc TRANSLATIONS += diff --git a/plugins/reportsplugin/reportsplugin_resources.qrc b/plugins/reportsplugin/reportsplugin_resources.qrc new file mode 100644 index 0000000..acd4367 --- /dev/null +++ b/plugins/reportsplugin/reportsplugin_resources.qrc @@ -0,0 +1,6 @@ + + + images/refresh.png + images/report.png + + diff --git a/plugins/reportsplugin/reportswidget.cpp b/plugins/reportsplugin/reportswidget.cpp new file mode 100644 index 0000000..ad045e3 --- /dev/null +++ b/plugins/reportsplugin/reportswidget.cpp @@ -0,0 +1,145 @@ +#include "reportswidget.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mainwindow.h" +#include "zeiterfassungapi.h" + +ReportsWidget::ReportsWidget(MainWindow &mainWindow) : + QWidget(&mainWindow), + m_mainWindow(mainWindow) +{ + m_labelBalance = new QLabel(this); + m_labelBalance->setFrameShape(QFrame::Panel); + m_labelBalance->setFrameShadow(QFrame::Sunken); + m_mainWindow.statusBar()->addPermanentWidget(m_labelBalance); + + m_labelHolidays = new QLabel(this); + m_labelHolidays->setFrameShape(QFrame::Panel); + m_labelHolidays->setFrameShadow(QFrame::Sunken); + m_mainWindow.statusBar()->addPermanentWidget(m_labelHolidays); + + m_actionRefreshReport = m_mainWindow.menuView()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/refresh.png")), + tr("Refresh report"), this, &ReportsWidget::refresh); + + m_actionOpenReport = m_mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/reportsplugin/images/report.png")), + tr("Open report"), this, &ReportsWidget::openReport); + m_mainWindow.toolBar()->addAction(m_actionOpenReport); + + dateChanged(m_mainWindow.date()); +} + +void ReportsWidget::dateChanged(const QDate &date) +{ + if(!date.isValid()) + { + qWarning() << "invalid date" << date; + return; + } + + auto monthBegin = QDate(date.year(), date.month(), 1); + if(monthBegin != m_date) + { + m_date = monthBegin; + refresh(); + } +} + +void ReportsWidget::refresh() +{ + if(!m_date.isValid()) + { + qWarning() << "invalid date" << m_date; + return; + } + + m_actionRefreshReport->setEnabled(false); + m_actionOpenReport->setEnabled(false); + + m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("???"))); + m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("???"))); + + m_reply = m_mainWindow.erfassung().doGetAuswertung(m_mainWindow.userInfo().userId, m_date); + connect(m_reply.get(), &ZeiterfassungReply::finished, this, &ReportsWidget::finished); +} + +void ReportsWidget::finished() +{ + if(!m_reply->success()) + { + m_date = QDate(); + QMessageBox::warning(this, tr("Could not load report!"), tr("Could not load report!") % "\n\n" % m_reply->message()); + goto after; + } + + { + auto content = m_reply->auswertung(); + + { + static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)")); + auto match = regex.match(content); + if(match.hasMatch()) + { + auto balance = match.captured(2); + if(balance.endsWith(QChar('-'))) + { + balance.chop(1); + balance = QChar('-') % balance; + } + m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("%0h").arg(balance))); + } + else + { + m_labelBalance->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("n/a"))); + qWarning() << "balance not found in PDF"; + } + } + + { + static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)")); + auto match = regex.match(content); + if(match.hasMatch()) + m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(match.captured(2))); + else + { + m_labelHolidays->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("n/a"))); + qWarning() << "holidays not found in PDF"; + } + } + + { + QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("auswertungXXXXXX.pdf"))); + file.setAutoRemove(false); + if(!file.open()) + { + QMessageBox::warning(this, tr("Could not write report!"), tr("Could not write report!") % "\n\n" % file.errorString()); + goto after; + } + + file.write(content); + + m_url = QUrl::fromLocalFile(file.fileName()); + } + } + + m_actionOpenReport->setEnabled(true); + + after: + m_actionRefreshReport->setEnabled(true); + m_reply = Q_NULLPTR; +} + +void ReportsWidget::openReport() +{ + if(!QDesktopServices::openUrl(m_url)) + QMessageBox::warning(this, tr("Could not launch your default PDF viewer!"), tr("Could not launch your default PDF viewer!")); +} diff --git a/plugins/reportsplugin/reportswidget.h b/plugins/reportsplugin/reportswidget.h new file mode 100644 index 0000000..bfe59c2 --- /dev/null +++ b/plugins/reportsplugin/reportswidget.h @@ -0,0 +1,43 @@ +#ifndef REPORTSWIDGET_H +#define REPORTSWIDGET_H + +#include +#include +#include + +#include "replies/getauswertungreply.h" + +class QLabel; +class QAction; + +class MainWindow; + +class ReportsWidget : public QWidget +{ + Q_OBJECT + +public: + explicit ReportsWidget(MainWindow &mainWindow); + +private Q_SLOTS: + void dateChanged(const QDate &date); + void refresh(); + void finished(); + void openReport(); + +private: + MainWindow &m_mainWindow; + + QLabel *m_labelBalance; + QLabel *m_labelHolidays; + + QAction *m_actionOpenReport; + QAction *m_actionRefreshReport; + + QDate m_date; + QUrl m_url; + + std::unique_ptr m_reply; +}; + +#endif // REPORTSWIDGET_H diff --git a/zeiterfassunglib/mainwindow.cpp b/zeiterfassunglib/mainwindow.cpp index 9d52cd9..b4612ed 100644 --- a/zeiterfassunglib/mainwindow.cpp +++ b/zeiterfassunglib/mainwindow.cpp @@ -22,7 +22,6 @@ #include "dialogs/aboutmedialog.h" #include "dialogs/settingsdialog.h" #include "replies/getprojectsreply.h" -#include "replies/getauswertungreply.h" #include "replies/createbookingreply.h" #include "replies/createtimeassignmentreply.h" #include "replies/updatetimeassignmentreply.h" @@ -35,8 +34,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass m_erfassung(erfassung), m_userInfo(userInfo), m_stripFactory(stripFactory), - m_getProjectsReply(Q_NULLPTR), - m_getAuswertungReply(Q_NULLPTR), m_currentStripWidget(Q_NULLPTR) { ui->setupUi(this); @@ -57,8 +54,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass ui->actionRefresh->setShortcut(QKeySequence::Refresh); connect(ui->actionRefresh, &QAction::triggered, this, [=](){ dateChanged(true); }); - connect(ui->actionAuswertung, &QAction::triggered, this, &MainWindow::openAuswertung); - connect(ui->actionAboutMe, &QAction::triggered, [=](){ AboutMeDialog(userInfo, this).exec(); }); connect(ui->actionSettings, &QAction::triggered, [=](){ SettingsDialog(m_settings, this).exec(); }); @@ -88,13 +83,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass connect(ui->pushButtonStart, &QAbstractButton::pressed, this, &MainWindow::pushButtonStartPressed); connect(ui->pushButtonEnd, &QAbstractButton::pressed, this, &MainWindow::pushButtonEndPressed); - ui->statusbar->addPermanentWidget(m_balanceLabel = new QLabel(ui->statusbar)); - m_balanceLabel->setFrameShape(QFrame::Panel); - m_balanceLabel->setFrameShadow(QFrame::Sunken); - ui->statusbar->addPermanentWidget(m_holidaysLabel = new QLabel(ui->statusbar)); - m_holidaysLabel->setFrameShape(QFrame::Panel); - m_holidaysLabel->setFrameShadow(QFrame::Sunken); - dateChanged(); } @@ -123,6 +111,11 @@ QMenu *MainWindow::menuAbout() const return ui->menuAbout; } +QToolBar *MainWindow::toolBar() const +{ + return ui->mainToolBar; +} + ZeiterfassungSettings &MainWindow::settings() const { return m_settings; @@ -143,6 +136,11 @@ StripFactory &MainWindow::stripFactory() const return m_stripFactory; } +QDate MainWindow::date() const +{ + return ui->dateEditDate->date(); +} + const QMap &MainWindow::projects() const { return m_projects; @@ -171,66 +169,6 @@ void MainWindow::getProjectsFinished() m_getProjectsReply = Q_NULLPTR; } -void MainWindow::getAuswertungFinished() -{ - if(std::none_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget){ - return stripsWidget->refreshing(); - })) - { - ui->actionToday->setEnabled(true); - ui->actionRefresh->setEnabled(true); - ui->dateEditDate->setReadOnly(false); - ui->pushButtonPrev->setEnabled(true); - ui->pushButtonNext->setEnabled(true); - } - - if(!m_getAuswertungReply->success()) - { - m_auswertungDate = QDate(); - QMessageBox::warning(this, tr("Could not load Auswertung!"), tr("Could not load Auswertung!") % "\n\n" % m_getAuswertungReply->message()); - m_getAuswertungReply = Q_NULLPTR; - return; - } - - ui->actionAuswertung->setEnabled(true); - m_auswertung = m_getAuswertungReply->auswertung(); - - auto urlaubsAnspruch = tr("n/a"); - - { - static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)")); - auto match = regex.match(m_auswertung); - if(match.hasMatch()) - urlaubsAnspruch = match.captured(2); - else - qWarning() << "Urlaubsanspruch not found"; - } - - auto gleitzeit = tr("n/a"); - - { - static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)")); - auto match = regex.match(m_auswertung); - if(match.hasMatch()) - { - gleitzeit = match.captured(2); - if(gleitzeit.endsWith(QChar('-'))) - { - gleitzeit.chop(1); - gleitzeit = QChar('-') % gleitzeit; - } - gleitzeit = tr("%0h").arg(gleitzeit); - } - else - qWarning() << "Gleitzeit not found"; - } - - m_balanceLabel->setText(tr("%0: %1").arg(tr("Balance")).arg(gleitzeit)); - m_holidaysLabel->setText(tr("%0: %1").arg(tr("Holidays")).arg(urlaubsAnspruch)); - - m_getAuswertungReply = Q_NULLPTR; -} - void MainWindow::pushButtonStartPressed() { auto bookingsChanged = false; @@ -307,8 +245,7 @@ void MainWindow::pushButtonStartPressed() if(bookingsChanged) { m_currentStripWidget->refresh(); - - refreshAuswertung(); + //refreshAuswertung(); } else m_currentStripWidget->refreshTimeAssignments(); @@ -359,7 +296,7 @@ void MainWindow::pushButtonEndPressed() } m_currentStripWidget->refresh(); - refreshAuswertung(); + //refreshAuswertung(); ui->actionToday->setEnabled(false); ui->actionRefresh->setEnabled(false); @@ -400,12 +337,9 @@ void MainWindow::dateChanged(bool force) } } - if(force || m_auswertungDate != QDate(ui->dateEditDate->date().year(), ui->dateEditDate->date().month(), 1)) - refreshAuswertung(); - if(std::any_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget) { return stripsWidget->refreshing(); - }) || m_getAuswertungReply) + })) { ui->actionToday->setEnabled(false); ui->actionRefresh->setEnabled(false); @@ -415,26 +349,6 @@ void MainWindow::dateChanged(bool force) } } -void MainWindow::openAuswertung() -{ - QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("auswertungXXXXXX.pdf"))); - file.setAutoRemove(false); - if(!file.open()) - { - QMessageBox::warning(this, tr("Could not open auswertung!"), tr("Could not open auswertung!") % "\n\n" % file.errorString()); - return; - } - - file.write(m_auswertung); - file.close(); - - if(!QDesktopServices::openUrl(QUrl::fromLocalFile(file.fileName()))) - { - QMessageBox::warning(this, tr("Could not open auswertung!"), tr("Could not open default PDF viewer!")); - return; - } -} - void MainWindow::minimumTimeChanged() { ui->timeEditTime->setMinimumTime(m_currentStripWidget->minimumTime()); @@ -442,9 +356,6 @@ void MainWindow::minimumTimeChanged() void MainWindow::refreshingChanged() { - if(m_getAuswertungReply) - return; - { auto allFinished = std::none_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget){ return stripsWidget->refreshing(); @@ -487,19 +398,6 @@ void MainWindow::endEnabledChanged() ui->pushButtonEnd->setEnabled(endEnabled); } -void MainWindow::refreshAuswertung() -{ - m_balanceLabel->setText(tr("%0: %1").arg(tr("Balance")).arg(tr("???"))); - m_holidaysLabel->setText(tr("%0: %1").arg(tr("Holidays")).arg(tr("???"))); - - ui->actionAuswertung->setEnabled(false); - m_auswertung.clear(); - - m_auswertungDate = QDate(ui->dateEditDate->date().year(), ui->dateEditDate->date().month(), 1); - m_getAuswertungReply = m_erfassung.doGetAuswertung(m_userInfo.userId, m_auswertungDate); - connect(m_getAuswertungReply.get(), &ZeiterfassungReply::finished, this, &MainWindow::getAuswertungFinished); -} - void MainWindow::updateComboboxes() { ui->comboBoxProject->clear(); diff --git a/zeiterfassunglib/mainwindow.h b/zeiterfassunglib/mainwindow.h index 6f30f71..a49ae98 100644 --- a/zeiterfassunglib/mainwindow.h +++ b/zeiterfassunglib/mainwindow.h @@ -9,9 +9,10 @@ #include "zeiterfassunglib_global.h" #include "replies/getuserinforeply.h" #include "replies/getprojectsreply.h" -#include "replies/getauswertungreply.h" #include "replies/getpresencestatusreply.h" +class QMenu; +class QToolBar; class QLabel; class QBoxLayout; @@ -33,22 +34,23 @@ public: QMenu *menuView() const; QMenu *menuTools() const; QMenu *menuAbout() const; + QToolBar *toolBar() const; ZeiterfassungSettings &settings() const; ZeiterfassungApi &erfassung() const; const GetUserInfoReply::UserInfo &userInfo() const; StripFactory &stripFactory() const; + QDate date() const; + const QMap &projects() const; const std::array &stripsWidgets() const; private Q_SLOTS: void getProjectsFinished(); - void getAuswertungFinished(); void pushButtonStartPressed(); void pushButtonEndPressed(); void dateChanged(bool force = false); - void openAuswertung(); void minimumTimeChanged(); void refreshingChanged(); @@ -56,7 +58,6 @@ private Q_SLOTS: void endEnabledChanged(); private: - void refreshAuswertung(); void updateComboboxes(); Ui::MainWindow *ui; @@ -66,16 +67,9 @@ private: StripFactory &m_stripFactory; std::unique_ptr m_getProjectsReply; - std::unique_ptr m_getAuswertungReply; QMap m_projects; - QDate m_auswertungDate; - QByteArray m_auswertung; - - QLabel *m_balanceLabel; - QLabel *m_holidaysLabel; - std::array m_stripsWidgets; StripsWidget *m_currentStripWidget; }; diff --git a/zeiterfassunglib/mainwindow.ui b/zeiterfassunglib/mainwindow.ui index 9bfdf0b..ebc7280 100644 --- a/zeiterfassunglib/mainwindow.ui +++ b/zeiterfassunglib/mainwindow.ui @@ -229,7 +229,6 @@ &Tools - @@ -245,8 +244,6 @@ - - @@ -299,15 +296,6 @@ &Refresh everything - - - - :/zeiterfassunglib/images/auswertung.png:/zeiterfassunglib/images/auswertung.png - - - &Auswertung - - diff --git a/zeiterfassunglib/resources.qrc b/zeiterfassunglib/resources.qrc index 13f4b93..252e452 100644 --- a/zeiterfassunglib/resources.qrc +++ b/zeiterfassunglib/resources.qrc @@ -1,7 +1,6 @@ images/about.png - images/auswertung.png images/authentication.png images/help.png images/icon.png -- 2.50.1 From c2911664cf1d839cb615320a72959de59ab74e2d Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 00:17:48 +0100 Subject: [PATCH 10/21] Replaced auswertung with report #13 --- plugins/reportsplugin/reportswidget.cpp | 6 ++-- plugins/reportsplugin/reportswidget.h | 4 +-- zeiterfassunglib/mainwindow.cpp | 4 +-- zeiterfassunglib/replies/getauswertungreply.h | 30 ------------------- ...auswertungreply.cpp => getreportreply.cpp} | 18 +++++------ zeiterfassunglib/replies/getreportreply.h | 30 +++++++++++++++++++ zeiterfassunglib/zeiterfassungapi.cpp | 6 ++-- zeiterfassunglib/zeiterfassungapi.h | 4 +-- zeiterfassunglib/zeiterfassunglib.pro | 8 ++--- 9 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 zeiterfassunglib/replies/getauswertungreply.h rename zeiterfassunglib/replies/{getauswertungreply.cpp => getreportreply.cpp} (59%) create mode 100644 zeiterfassunglib/replies/getreportreply.h diff --git a/plugins/reportsplugin/reportswidget.cpp b/plugins/reportsplugin/reportswidget.cpp index ad045e3..c448ca5 100644 --- a/plugins/reportsplugin/reportswidget.cpp +++ b/plugins/reportsplugin/reportswidget.cpp @@ -68,7 +68,7 @@ void ReportsWidget::refresh() 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().doGetAuswertung(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); } @@ -82,7 +82,7 @@ void ReportsWidget::finished() } { - auto content = m_reply->auswertung(); + auto content = m_reply->content(); { static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)")); @@ -117,7 +117,7 @@ void ReportsWidget::finished() } { - QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("auswertungXXXXXX.pdf"))); + QTemporaryFile file(QDir::temp().absoluteFilePath(QStringLiteral("reportXXXXXX.pdf"))); file.setAutoRemove(false); if(!file.open()) { diff --git a/plugins/reportsplugin/reportswidget.h b/plugins/reportsplugin/reportswidget.h index bfe59c2..9adcfe7 100644 --- a/plugins/reportsplugin/reportswidget.h +++ b/plugins/reportsplugin/reportswidget.h @@ -5,7 +5,7 @@ #include #include -#include "replies/getauswertungreply.h" +#include "replies/getreportreply.h" class QLabel; class QAction; @@ -37,7 +37,7 @@ private: QDate m_date; QUrl m_url; - std::unique_ptr m_reply; + std::unique_ptr m_reply; }; #endif // REPORTSWIDGET_H diff --git a/zeiterfassunglib/mainwindow.cpp b/zeiterfassunglib/mainwindow.cpp index b4612ed..b3908d7 100644 --- a/zeiterfassunglib/mainwindow.cpp +++ b/zeiterfassunglib/mainwindow.cpp @@ -245,7 +245,7 @@ void MainWindow::pushButtonStartPressed() if(bookingsChanged) { m_currentStripWidget->refresh(); - //refreshAuswertung(); + //refreshReport(); } else m_currentStripWidget->refreshTimeAssignments(); @@ -296,7 +296,7 @@ void MainWindow::pushButtonEndPressed() } m_currentStripWidget->refresh(); - //refreshAuswertung(); + //refreshReport(); ui->actionToday->setEnabled(false); ui->actionRefresh->setEnabled(false); diff --git a/zeiterfassunglib/replies/getauswertungreply.h b/zeiterfassunglib/replies/getauswertungreply.h deleted file mode 100644 index c39e93e..0000000 --- a/zeiterfassunglib/replies/getauswertungreply.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef GETAUSWERTUNGREPLY_H -#define GETAUSWERTUNGREPLY_H - -#include - -#include -#include - -#include "zeiterfassunglib_global.h" -#include "zeiterfassungreply.h" - -class ZEITERFASSUNGLIBSHARED_EXPORT GetAuswertungReply : public ZeiterfassungReply -{ - Q_OBJECT - -public: - GetAuswertungReply(std::unique_ptr &&reply, ZeiterfassungApi *zeiterfassung); - - const QByteArray &auswertung() const; - -private Q_SLOTS: - void request0Finished(); - void request1Finished(); - -private: - std::unique_ptr m_reply; - QByteArray m_auswertung; -}; - -#endif // GETAUSWERTUNGREPLY_H diff --git a/zeiterfassunglib/replies/getauswertungreply.cpp b/zeiterfassunglib/replies/getreportreply.cpp similarity index 59% rename from zeiterfassunglib/replies/getauswertungreply.cpp rename to zeiterfassunglib/replies/getreportreply.cpp index 3a2e0bd..b63f91f 100644 --- a/zeiterfassunglib/replies/getauswertungreply.cpp +++ b/zeiterfassunglib/replies/getreportreply.cpp @@ -1,20 +1,20 @@ -#include "getauswertungreply.h" +#include "getreportreply.h" #include "zeiterfassungapi.h" -GetAuswertungReply::GetAuswertungReply(std::unique_ptr &&reply, ZeiterfassungApi *zeiterfassung) : +GetReportReply::GetReportReply(std::unique_ptr &&reply, ZeiterfassungApi *zeiterfassung) : ZeiterfassungReply(zeiterfassung), m_reply(std::move(reply)) { - connect(m_reply.get(), &QNetworkReply::finished, this, &GetAuswertungReply::request0Finished); + connect(m_reply.get(), &QNetworkReply::finished, this, &GetReportReply::request0Finished); } -const QByteArray &GetAuswertungReply::auswertung() const +const QByteArray &GetReportReply::content() const { - return m_auswertung; + return m_content; } -void GetAuswertungReply::request0Finished() +void GetReportReply::request0Finished() { if(m_reply->error() != QNetworkReply::NoError) { @@ -29,10 +29,10 @@ void GetAuswertungReply::request0Finished() url.setPath(QString(m_reply->readAll())); m_reply = std::unique_ptr(zeiterfassung()->manager()->get(QNetworkRequest(url))); - connect(m_reply.get(), &QNetworkReply::finished, this, &GetAuswertungReply::request1Finished); + connect(m_reply.get(), &QNetworkReply::finished, this, &GetReportReply::request1Finished); } -void GetAuswertungReply::request1Finished() +void GetReportReply::request1Finished() { if(m_reply->error() != QNetworkReply::NoError) { @@ -42,7 +42,7 @@ void GetAuswertungReply::request1Finished() } setSuccess(true); - m_auswertung = m_reply->readAll(); + m_content = m_reply->readAll(); end: m_reply = Q_NULLPTR; diff --git a/zeiterfassunglib/replies/getreportreply.h b/zeiterfassunglib/replies/getreportreply.h new file mode 100644 index 0000000..1590681 --- /dev/null +++ b/zeiterfassunglib/replies/getreportreply.h @@ -0,0 +1,30 @@ +#ifndef GETREPORTREPLY_H +#define GETREPORTREPLY_H + +#include + +#include +#include + +#include "zeiterfassunglib_global.h" +#include "zeiterfassungreply.h" + +class ZEITERFASSUNGLIBSHARED_EXPORT GetReportReply : public ZeiterfassungReply +{ + Q_OBJECT + +public: + GetReportReply(std::unique_ptr &&reply, ZeiterfassungApi *zeiterfassung); + + const QByteArray &content() const; + +private Q_SLOTS: + void request0Finished(); + void request1Finished(); + +private: + std::unique_ptr m_reply; + QByteArray m_content; +}; + +#endif // GETREPORTREPLY_H diff --git a/zeiterfassunglib/zeiterfassungapi.cpp b/zeiterfassunglib/zeiterfassungapi.cpp index 1d62a58..ffdfa24 100644 --- a/zeiterfassunglib/zeiterfassungapi.cpp +++ b/zeiterfassunglib/zeiterfassungapi.cpp @@ -13,7 +13,7 @@ #include "replies/createtimeassignmentreply.h" #include "replies/deletebookingreply.h" #include "replies/deletetimeassignmentreply.h" -#include "replies/getauswertungreply.h" +#include "replies/getreportreply.h" #include "replies/getbookingsreply.h" #include "replies/getpresencestatusreply.h" #include "replies/getprojectsreply.h" @@ -286,7 +286,7 @@ std::unique_ptr ZeiterfassungApi::doGetProjects(int userId, co return std::make_unique(std::move(reply), this); } -std::unique_ptr ZeiterfassungApi::doGetAuswertung(int userId, const QDate &date) +std::unique_ptr ZeiterfassungApi::doGetReport(int userId, const QDate &date) { QNetworkRequest request(QUrl(QStringLiteral("%0json/auswertung/month?persNr=%1&date=%2") .arg(m_url) @@ -296,7 +296,7 @@ std::unique_ptr ZeiterfassungApi::doGetAuswertung(int userId auto reply = std::unique_ptr(m_manager->get(request)); - return std::make_unique(std::move(reply), this); + return std::make_unique(std::move(reply), this); } std::unique_ptr ZeiterfassungApi::doGetPresenceStatus() diff --git a/zeiterfassunglib/zeiterfassungapi.h b/zeiterfassunglib/zeiterfassungapi.h index ff1f3b7..e978094 100644 --- a/zeiterfassunglib/zeiterfassungapi.h +++ b/zeiterfassunglib/zeiterfassungapi.h @@ -24,7 +24,7 @@ class CreateTimeAssignmentReply; class UpdateTimeAssignmentReply; class DeleteTimeAssignmentReply; class GetProjectsReply; -class GetAuswertungReply; +class GetReportReply; class GetPresenceStatusReply; class ZEITERFASSUNGLIBSHARED_EXPORT ZeiterfassungApi : public QObject @@ -62,7 +62,7 @@ public: std::unique_ptr doDeleteTimeAssignment(int timeAssignmentId); std::unique_ptr doGetProjects(int userId, const QDate &date); - std::unique_ptr doGetAuswertung(int userId, const QDate &date); + std::unique_ptr doGetReport(int userId, const QDate &date); std::unique_ptr doGetPresenceStatus(); private: diff --git a/zeiterfassunglib/zeiterfassunglib.pro b/zeiterfassunglib/zeiterfassunglib.pro index 0c77d71..e58e448 100644 --- a/zeiterfassunglib/zeiterfassunglib.pro +++ b/zeiterfassunglib/zeiterfassunglib.pro @@ -25,7 +25,6 @@ SOURCES += mainwindow.cpp \ replies/createtimeassignmentreply.cpp \ replies/deletebookingreply.cpp \ replies/deletetimeassignmentreply.cpp \ - replies/getauswertungreply.cpp \ replies/getbookingsreply.cpp \ replies/getpresencestatusreply.cpp \ replies/getprojectsreply.cpp \ @@ -35,7 +34,8 @@ SOURCES += mainwindow.cpp \ replies/updatebookingreply.cpp \ replies/updatetimeassignmentreply.cpp \ replies/zeiterfassungreply.cpp \ - replies/getuserinforeply.cpp + replies/getuserinforeply.cpp \ + replies/getreportreply.cpp HEADERS += cpp14polyfills.h \ mainwindow.h \ @@ -54,7 +54,6 @@ HEADERS += cpp14polyfills.h \ replies/createtimeassignmentreply.h \ replies/deletebookingreply.h \ replies/deletetimeassignmentreply.h \ - replies/getauswertungreply.h \ replies/getbookingsreply.h \ replies/getpresencestatusreply.h \ replies/getprojectsreply.h \ @@ -64,7 +63,8 @@ HEADERS += cpp14polyfills.h \ replies/updatebookingreply.h \ replies/updatetimeassignmentreply.h \ replies/zeiterfassungreply.h \ - replies/getuserinforeply.h + replies/getuserinforeply.h \ + replies/getreportreply.h FORMS += mainwindow.ui \ dialogs/settingsdialog.ui \ -- 2.50.1 From 39277b79bb457f2fecaa518ecc591f6e507e884e Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 00:20:20 +0100 Subject: [PATCH 11/21] Fixed start script with different working directory --- zeiterfassung/unix/start.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zeiterfassung/unix/start.sh b/zeiterfassung/unix/start.sh index 59aa5f8..b3c1ca6 100755 --- a/zeiterfassung/unix/start.sh +++ b/zeiterfassung/unix/start.sh @@ -1 +1,3 @@ +#!/bin/bash +cd "${0%/*}" LD_LIBRARY_PATH=../lib ./zeiterfassung -- 2.50.1 From e8a60daade9f1776fa574bf8fb5d6fbcf4701000 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 18:52:48 +0100 Subject: [PATCH 12/21] Added toolButton for lunchmealplugin --- .../advancedviewplugin/advancedviewplugin.cpp | 1 + .../advancedviewplugin/advancedviewwidget.cpp | 3 ++- .../advancedviewplugin/advancedviewwidget.h | 4 ++-- plugins/lunchmealplugin/images/lunch-meal.png | Bin 0 -> 3497 bytes plugins/lunchmealplugin/lunchmealplugin.cpp | 12 ++++++++++ plugins/lunchmealplugin/lunchmealplugin.h | 3 +++ plugins/lunchmealplugin/lunchmealplugin.pro | 12 ++++++++-- .../lunchmealplugin_resources.qrc | 5 ++++ plugins/lunchmealplugin/lunchmealwidget.cpp | 22 ++++++++++++++++++ plugins/lunchmealplugin/lunchmealwidget.h | 21 +++++++++++++++++ 10 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 plugins/lunchmealplugin/images/lunch-meal.png create mode 100644 plugins/lunchmealplugin/lunchmealplugin_resources.qrc create mode 100644 plugins/lunchmealplugin/lunchmealwidget.cpp create mode 100644 plugins/lunchmealplugin/lunchmealwidget.h diff --git a/plugins/advancedviewplugin/advancedviewplugin.cpp b/plugins/advancedviewplugin/advancedviewplugin.cpp index 6ce9d44..c1ad9ad 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.cpp +++ b/plugins/advancedviewplugin/advancedviewplugin.cpp @@ -5,6 +5,7 @@ #include "mainwindow.h" #include "stripswidget.h" + #include "advancedviewwidget.h" AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) : diff --git a/plugins/advancedviewplugin/advancedviewwidget.cpp b/plugins/advancedviewplugin/advancedviewwidget.cpp index 15eb880..1c9c56d 100644 --- a/plugins/advancedviewplugin/advancedviewwidget.cpp +++ b/plugins/advancedviewplugin/advancedviewwidget.cpp @@ -6,10 +6,11 @@ #include "advancedviewdialog.h" AdvancedViewWidget::AdvancedViewWidget(StripsWidget &stripsWidget) : - QPushButton(&stripsWidget), + QToolButton(&stripsWidget), m_stripsWidget(stripsWidget) { setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/advancedviewplugin/images/advanced-view.png"))); + setText(tr("Advanced view")); connect(&stripsWidget, &StripsWidget::dateChanged, this, &AdvancedViewWidget::dateChanged); dateChanged(stripsWidget.date()); diff --git a/plugins/advancedviewplugin/advancedviewwidget.h b/plugins/advancedviewplugin/advancedviewwidget.h index cb3bcd9..52bff81 100644 --- a/plugins/advancedviewplugin/advancedviewwidget.h +++ b/plugins/advancedviewplugin/advancedviewwidget.h @@ -1,11 +1,11 @@ #ifndef ADVANCEDVIEWWIDGET_H #define ADVANCEDVIEWWIDGET_H -#include +#include class StripsWidget; -class AdvancedViewWidget : public QPushButton +class AdvancedViewWidget : public QToolButton { Q_OBJECT diff --git a/plugins/lunchmealplugin/images/lunch-meal.png b/plugins/lunchmealplugin/images/lunch-meal.png new file mode 100644 index 0000000000000000000000000000000000000000..7c83e542a10588e518a59d8020b36ee35effab45 GIT binary patch literal 3497 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hEil8qLj2xRhDA zLG$gFnVHrt$9PrpqMRDV?(ii#%{X#wf=TNcgVcnmH^;VIHez1loDn50WZfyOT9$Kj zn)ut(x3}Lf%K!i4rLE_+%a@Zp&6eKZzvT0|z59#Lzn@cmzNp?w^QgY@me;xmz8?Fp z{a}}E<@_CrQ}n0h@LLq!u8R4|FzZ%hlIjJfC5@*KXo{TQ`1(kHVy5}hqu~b@Mw>5K zsou!Xl*IOKGsjnr@AE7+?QrT%{wPwA;V!WDOQb+O=Z`(hIXg_8b696E7UZ7bb6R!% zceRYY!z=zxzn_bXx$h{{>0_FAzl^`D`M@nM-76g0Rtf^MPrbio@WHI7%>PRRQ`7N+ z?)bFwvYFxc9un-=U?BN_`#%S&iof*nGe=ad>fzs{rjEl3A>tp zYCkwJEp5tAmagAgCdLeFXDilSb~^EF;f%I>lP5^e^r)3xDEHu=u>J09FQ2b#sC7#I ze663kpRq7sEceWv`=;f^^K~bMFW4{qCTZrPhJ2;k`Dx!TUX)VKPRir5__A92!k71r zHv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5fBHF}ixtbGOxEq!Yc?!X=8>P3 z*Ki?VU2jqD6BFsVP03P^b_QLvi245_W0lrrn++cFJ{%M8$A5SCT5-H_<<@OG9XXFY zcj8aow?$(9Wt~^*#xIvA@y^nd7w@u9oVT@z^?rxVl%4gBuB#I~?Ph7c>CcbP0l+XkK`;(-! literal 0 HcmV?d00001 diff --git a/plugins/lunchmealplugin/lunchmealplugin.cpp b/plugins/lunchmealplugin/lunchmealplugin.cpp index ce70c4e..209428e 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.cpp +++ b/plugins/lunchmealplugin/lunchmealplugin.cpp @@ -1,9 +1,21 @@ #include "lunchmealplugin.h" #include +#include + +#include "mainwindow.h" +#include "stripswidget.h" + +#include "lunchmealwidget.h" LunchMealPlugin::LunchMealPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; } + +void LunchMealPlugin::attachTo(MainWindow &mainWindow) +{ + for(auto stripsWidget : mainWindow.stripsWidgets()) + stripsWidget->headerLayout()->addWidget(new LunchMealWidget(*stripsWidget)); +} diff --git a/plugins/lunchmealplugin/lunchmealplugin.h b/plugins/lunchmealplugin/lunchmealplugin.h index c5626a8..3c8f524 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.h +++ b/plugins/lunchmealplugin/lunchmealplugin.h @@ -5,6 +5,8 @@ #include "zeiterfassungplugin.h" +class MainWindow; + class Q_DECL_EXPORT LunchMealPlugin : public ZeiterfassungPlugin { Q_OBJECT @@ -15,6 +17,7 @@ public: explicit LunchMealPlugin(QObject *parent = Q_NULLPTR); // ZeiterfassungPlugin interface + void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; }; #endif // LUNCHMEALPLUGIN_H diff --git a/plugins/lunchmealplugin/lunchmealplugin.pro b/plugins/lunchmealplugin/lunchmealplugin.pro index d0dd373..e57c562 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.pro +++ b/plugins/lunchmealplugin/lunchmealplugin.pro @@ -14,8 +14,16 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT -HEADERS += lunchmealplugin.h +HEADERS += lunchmealplugin.h \ + lunchmealwidget.h -SOURCES += lunchmealplugin.cpp +SOURCES += lunchmealplugin.cpp \ + lunchmealwidget.cpp + +FORMS += + +RESOURCES += lunchmealplugin_resources.qrc + +TRANSLATIONS += OTHER_FILES += lunchmealplugin.json diff --git a/plugins/lunchmealplugin/lunchmealplugin_resources.qrc b/plugins/lunchmealplugin/lunchmealplugin_resources.qrc new file mode 100644 index 0000000..ca3c14e --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealplugin_resources.qrc @@ -0,0 +1,5 @@ + + + images/lunch-meal.png + + diff --git a/plugins/lunchmealplugin/lunchmealwidget.cpp b/plugins/lunchmealplugin/lunchmealwidget.cpp new file mode 100644 index 0000000..1d5f1b2 --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealwidget.cpp @@ -0,0 +1,22 @@ +#include "lunchmealwidget.h" + +#include + +#include "stripswidget.h" +#include "mainwindow.h" +#include "zeiterfassungapi.h" + +LunchMealWidget::LunchMealWidget(StripsWidget &stripsWidget) : + QToolButton(&stripsWidget), + m_stripsWidget(stripsWidget) +{ + setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/lunchmealplugin/images/lunch-meal.png"))); + setText(tr("Lunch meal")); + + connect(this, &QAbstractButton::pressed, this, &LunchMealWidget::pressedSlot); +} + +void LunchMealWidget::pressedSlot() +{ + +} diff --git a/plugins/lunchmealplugin/lunchmealwidget.h b/plugins/lunchmealplugin/lunchmealwidget.h new file mode 100644 index 0000000..a609ab9 --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealwidget.h @@ -0,0 +1,21 @@ +#ifndef LUNCHMEALWIDGET_H +#define LUNCHMEALWIDGET_H + +#include + +class StripsWidget; + +class LunchMealWidget : public QToolButton +{ + Q_OBJECT +public: + explicit LunchMealWidget(StripsWidget &stripsWidget); + +private Q_SLOTS: + void pressedSlot(); + +private: + StripsWidget &m_stripsWidget; +}; + +#endif // LUNCHMEALWIDGET_H -- 2.50.1 From 804015b6e8a2b8c1c993db9056e9e2576b4b7682 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 18:59:49 +0100 Subject: [PATCH 13/21] Added LunchMealDialog --- plugins/lunchmealplugin/lunchmealdialog.cpp | 17 ++++ plugins/lunchmealplugin/lunchmealdialog.h | 22 ++++++ plugins/lunchmealplugin/lunchmealdialog.ui | 88 +++++++++++++++++++++ plugins/lunchmealplugin/lunchmealplugin.pro | 9 ++- plugins/lunchmealplugin/lunchmealwidget.cpp | 5 +- 5 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 plugins/lunchmealplugin/lunchmealdialog.cpp create mode 100644 plugins/lunchmealplugin/lunchmealdialog.h create mode 100644 plugins/lunchmealplugin/lunchmealdialog.ui diff --git a/plugins/lunchmealplugin/lunchmealdialog.cpp b/plugins/lunchmealplugin/lunchmealdialog.cpp new file mode 100644 index 0000000..b4f2bc6 --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealdialog.cpp @@ -0,0 +1,17 @@ +#include "lunchmealdialog.h" +#include "ui_lunchmealdialog.h" + +#include "stripswidget.h" +#include "mainwindow.h" + +LunchMealDialog::LunchMealDialog(StripsWidget &stripsWidget) : + QDialog(&stripsWidget.mainWindow()), + ui(new Ui::LunchMealDialog) +{ + ui->setupUi(this); +} + +LunchMealDialog::~LunchMealDialog() +{ + delete ui; +} diff --git a/plugins/lunchmealplugin/lunchmealdialog.h b/plugins/lunchmealplugin/lunchmealdialog.h new file mode 100644 index 0000000..c5a2aff --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealdialog.h @@ -0,0 +1,22 @@ +#ifndef LUNCHMEALDIALOG_H +#define LUNCHMEALDIALOG_H + +#include + +class StripsWidget; + +namespace Ui { class LunchMealDialog; } + +class LunchMealDialog : public QDialog +{ + Q_OBJECT + +public: + explicit LunchMealDialog(StripsWidget &stripsWidget); + ~LunchMealDialog(); + +private: + Ui::LunchMealDialog *ui; +}; + +#endif // LUNCHMEALDIALOG_H diff --git a/plugins/lunchmealplugin/lunchmealdialog.ui b/plugins/lunchmealplugin/lunchmealdialog.ui new file mode 100644 index 0000000..de5ebfe --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealdialog.ui @@ -0,0 +1,88 @@ + + + LunchMealDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + + 16 + 75 + true + + + + Lunch meal for + + + + + + + TextLabel + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + buttonBox + accepted() + LunchMealDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + LunchMealDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/plugins/lunchmealplugin/lunchmealplugin.pro b/plugins/lunchmealplugin/lunchmealplugin.pro index e57c562..62d9852 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.pro +++ b/plugins/lunchmealplugin/lunchmealplugin.pro @@ -15,12 +15,15 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT HEADERS += lunchmealplugin.h \ - lunchmealwidget.h + lunchmealwidget.h \ + lunchmealdialog.h SOURCES += lunchmealplugin.cpp \ - lunchmealwidget.cpp + lunchmealwidget.cpp \ + lunchmealdialog.cpp -FORMS += +FORMS += \ + lunchmealdialog.ui RESOURCES += lunchmealplugin_resources.qrc diff --git a/plugins/lunchmealplugin/lunchmealwidget.cpp b/plugins/lunchmealplugin/lunchmealwidget.cpp index 1d5f1b2..eacaaf6 100644 --- a/plugins/lunchmealplugin/lunchmealwidget.cpp +++ b/plugins/lunchmealplugin/lunchmealwidget.cpp @@ -6,6 +6,8 @@ #include "mainwindow.h" #include "zeiterfassungapi.h" +#include "lunchmealdialog.h" + LunchMealWidget::LunchMealWidget(StripsWidget &stripsWidget) : QToolButton(&stripsWidget), m_stripsWidget(stripsWidget) @@ -18,5 +20,6 @@ LunchMealWidget::LunchMealWidget(StripsWidget &stripsWidget) : void LunchMealWidget::pressedSlot() { - + LunchMealDialog dialog(m_stripsWidget); + dialog.exec(); } -- 2.50.1 From 2adef36be541d6fb8cc8bb71d7ee5f2f19a2b9ac Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 20:11:29 +0100 Subject: [PATCH 14/21] Implemented LunchMealDialog --- plugins/lunchmealplugin/lunchmealdialog.cpp | 34 +++++++++++++++++++++ plugins/lunchmealplugin/lunchmealdialog.h | 7 +++++ plugins/lunchmealplugin/lunchmealdialog.ui | 2 +- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/plugins/lunchmealplugin/lunchmealdialog.cpp b/plugins/lunchmealplugin/lunchmealdialog.cpp index b4f2bc6..a61dd57 100644 --- a/plugins/lunchmealplugin/lunchmealdialog.cpp +++ b/plugins/lunchmealplugin/lunchmealdialog.cpp @@ -1,17 +1,51 @@ #include "lunchmealdialog.h" #include "ui_lunchmealdialog.h" +#include +#include +#include +#include + #include "stripswidget.h" #include "mainwindow.h" +#include "zeiterfassungsettings.h" +#include "zeiterfassungapi.h" LunchMealDialog::LunchMealDialog(StripsWidget &stripsWidget) : QDialog(&stripsWidget.mainWindow()), ui(new Ui::LunchMealDialog) { ui->setupUi(this); + + ui->labelTitle->setText(tr("Lunch meal for %0").arg(stripsWidget.date().toString(tr("dd.MM.yyyy")))); + + const auto &settings = stripsWidget.mainWindow().settings(); + + auto url = settings.value(QStringLiteral("LunchMealPlugin/url"), + QStringLiteral("https://brunner.ninja/lunch/%0.txt")).toString() + .arg(stripsWidget.date().toString(settings.value(QStringLiteral("LunchMealPlugin/dateFormat"), + QStringLiteral("yyyy-MM-dd")).toString())); + m_reply = std::unique_ptr(stripsWidget.mainWindow().erfassung().manager()->get(QNetworkRequest(QUrl(url)))); + connect(m_reply.get(), &QNetworkReply::finished, this, &LunchMealDialog::finished); } LunchMealDialog::~LunchMealDialog() { delete ui; } + +void LunchMealDialog::finished() +{ + if(m_reply->error() != QNetworkReply::NoError) + { + ui->labelLunchMeal->setText(QStringLiteral("%0\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; +} diff --git a/plugins/lunchmealplugin/lunchmealdialog.h b/plugins/lunchmealplugin/lunchmealdialog.h index c5a2aff..9345fcf 100644 --- a/plugins/lunchmealplugin/lunchmealdialog.h +++ b/plugins/lunchmealplugin/lunchmealdialog.h @@ -1,7 +1,10 @@ #ifndef LUNCHMEALDIALOG_H #define LUNCHMEALDIALOG_H +#include + #include +#include class StripsWidget; @@ -15,8 +18,12 @@ public: explicit LunchMealDialog(StripsWidget &stripsWidget); ~LunchMealDialog(); +private Q_SLOTS: + void finished(); + private: Ui::LunchMealDialog *ui; + std::unique_ptr m_reply; }; #endif // LUNCHMEALDIALOG_H diff --git a/plugins/lunchmealplugin/lunchmealdialog.ui b/plugins/lunchmealplugin/lunchmealdialog.ui index de5ebfe..065c46b 100644 --- a/plugins/lunchmealplugin/lunchmealdialog.ui +++ b/plugins/lunchmealplugin/lunchmealdialog.ui @@ -31,7 +31,7 @@ - TextLabel + Loading... Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop -- 2.50.1 From 68909a15f92aaf4dc4e4d0a6ebcee6a15b6de87b Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 21:20:16 +0100 Subject: [PATCH 15/21] Fixed #31 and #35 --- plugins/presenceplugin/presencewidget.cpp | 10 ++-- plugins/presenceplugin/presencewidget.h | 2 +- plugins/reportsplugin/reportswidget.cpp | 3 ++ zeiterfassunglib/mainwindow.cpp | 62 ++++++++--------------- zeiterfassunglib/mainwindow.h | 8 ++- 5 files changed, 37 insertions(+), 48 deletions(-) diff --git a/plugins/presenceplugin/presencewidget.cpp b/plugins/presenceplugin/presencewidget.cpp index 35d19f1..cbcbca6 100644 --- a/plugins/presenceplugin/presencewidget.cpp +++ b/plugins/presenceplugin/presencewidget.cpp @@ -14,6 +14,8 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) : QWidget(&mainWindow), m_mainWindow(mainWindow) { + connect(&m_mainWindow, &MainWindow::refreshEverything, this, &PresenceWidget::refresh); + m_labelAvailable = new QLabel(this); m_labelAvailable->setFrameShape(QFrame::Panel); m_labelAvailable->setFrameShadow(QFrame::Sunken); @@ -25,17 +27,17 @@ PresenceWidget::PresenceWidget(MainWindow &mainWindow) : m_mainWindow.statusBar()->addWidget(m_labelNotAvailable); m_action = m_mainWindow.menuView()->addAction(QIcon(QStringLiteral(":zeiterfassung/plugins/presenceplugin/images/refresh.png")), - tr("Refresh presence"), this, &PresenceWidget::timeout); + tr("Refresh presence"), this, &PresenceWidget::refresh); auto timer = new QTimer(this); timer->setInterval(60000); - connect(timer, &QTimer::timeout, this, &PresenceWidget::timeout); + connect(timer, &QTimer::timeout, this, &PresenceWidget::refresh); timer->start(); - timeout(); + refresh(); } -void PresenceWidget::timeout() +void PresenceWidget::refresh() { m_labelAvailable->setText(tr("%0: %1").arg(tr("Available")).arg(tr("???"))); m_labelNotAvailable->setText(tr("%0: %1").arg(tr("Not available")).arg(tr("???"))); diff --git a/plugins/presenceplugin/presencewidget.h b/plugins/presenceplugin/presencewidget.h index 90d2433..ce7f6dc 100644 --- a/plugins/presenceplugin/presencewidget.h +++ b/plugins/presenceplugin/presencewidget.h @@ -18,7 +18,7 @@ public: explicit PresenceWidget(MainWindow &mainWindow); private Q_SLOTS: - void timeout(); + void refresh(); void finished(); private: diff --git a/plugins/reportsplugin/reportswidget.cpp b/plugins/reportsplugin/reportswidget.cpp index c448ca5..1aded66 100644 --- a/plugins/reportsplugin/reportswidget.cpp +++ b/plugins/reportsplugin/reportswidget.cpp @@ -18,6 +18,9 @@ ReportsWidget::ReportsWidget(MainWindow &mainWindow) : QWidget(&mainWindow), m_mainWindow(mainWindow) { + connect(&m_mainWindow, &MainWindow::dateChanged, this, &ReportsWidget::dateChanged); + connect(&m_mainWindow, &MainWindow::refreshEverything, this, &ReportsWidget::refresh); + m_labelBalance = new QLabel(this); m_labelBalance->setFrameShape(QFrame::Panel); m_labelBalance->setFrameShadow(QFrame::Sunken); diff --git a/zeiterfassunglib/mainwindow.cpp b/zeiterfassunglib/mainwindow.cpp index b3908d7..29abb46 100644 --- a/zeiterfassunglib/mainwindow.cpp +++ b/zeiterfassunglib/mainwindow.cpp @@ -38,13 +38,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass { ui->setupUi(this); - for(quint8 i = 0; i < 7; i++) - { - m_stripsWidgets[i] = new StripsWidget(*this, ui->widgetWeek); - connect(m_stripsWidgets[i], &StripsWidget::refreshingChanged, this, &MainWindow::refreshingChanged); - ui->layoutWeek->addWidget(m_stripsWidgets[i]); - } - setWindowTitle(tr("Zeiterfassung - %0 (%1)").arg(m_userInfo.text).arg(m_userInfo.email)); ui->actionQuit->setShortcut(QKeySequence::Quit); @@ -52,7 +45,7 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass connect(ui->actionToday, &QAction::triggered, [=](){ ui->dateEditDate->setDate(QDate::currentDate()); }); ui->actionRefresh->setShortcut(QKeySequence::Refresh); - connect(ui->actionRefresh, &QAction::triggered, this, [=](){ dateChanged(true); }); + connect(ui->actionRefresh, &QAction::triggered, this, &MainWindow::refreshEverything); connect(ui->actionAboutMe, &QAction::triggered, [=](){ AboutMeDialog(userInfo, this).exec(); }); connect(ui->actionSettings, &QAction::triggered, [=](){ SettingsDialog(m_settings, this).exec(); }); @@ -62,7 +55,7 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass connect(ui->actionAboutQt, &QAction::triggered, [=](){ QMessageBox::aboutQt(this); }); ui->dateEditDate->setDate(QDate::currentDate()); - connect(ui->dateEditDate, &QDateTimeEdit::dateChanged, this, [=](){ dateChanged(false); }); + connect(ui->dateEditDate, &QDateTimeEdit::dateChanged, this, &MainWindow::dateChangedSlot); connect(ui->pushButtonPrev, &QAbstractButton::pressed, [=](){ ui->dateEditDate->setDate(ui->dateEditDate->date().addDays(-1)); }); connect(ui->pushButtonNext, &QAbstractButton::pressed, [=](){ ui->dateEditDate->setDate(ui->dateEditDate->date().addDays(1)); }); @@ -83,7 +76,14 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass connect(ui->pushButtonStart, &QAbstractButton::pressed, this, &MainWindow::pushButtonStartPressed); connect(ui->pushButtonEnd, &QAbstractButton::pressed, this, &MainWindow::pushButtonEndPressed); - dateChanged(); + for(quint8 i = 0; i < 7; i++) + { + m_stripsWidgets[i] = new StripsWidget(*this, ui->widgetWeek); + connect(this, &MainWindow::refreshEverything, m_stripsWidgets[i], &StripsWidget::refresh); + ui->layoutWeek->addWidget(m_stripsWidgets[i]); + } + + dateChangedSlot(ui->dateEditDate->date()); } MainWindow::~MainWindow() @@ -141,6 +141,11 @@ QDate MainWindow::date() const return ui->dateEditDate->date(); } +void MainWindow::setDate(const QDate &date) +{ + ui->dateEditDate->setDate(date); +} + const QMap &MainWindow::projects() const { return m_projects; @@ -305,18 +310,17 @@ void MainWindow::pushButtonEndPressed() ui->pushButtonNext->setEnabled(false); } -void MainWindow::dateChanged(bool force) +void MainWindow::dateChangedSlot(const QDate &date) { - auto firstDayOfWeek = ui->dateEditDate->date().addDays(-(ui->dateEditDate->date().dayOfWeek() - 1)); + auto firstDayOfWeek = date.addDays(-(ui->dateEditDate->date().dayOfWeek() - 1)); for(quint8 i = 0; i < 7; i++) { - auto date = firstDayOfWeek.addDays(i); + auto weekDay = firstDayOfWeek.addDays(i); - if(force || m_stripsWidgets[i]->date() != date) - m_stripsWidgets[i]->setDate(date); + m_stripsWidgets[i]->setDate(weekDay); - if(date == ui->dateEditDate->date() && (force || m_currentStripWidget != m_stripsWidgets[i])) + if(weekDay == date && m_currentStripWidget != m_stripsWidgets[i]) { if(m_currentStripWidget) { @@ -337,16 +341,7 @@ void MainWindow::dateChanged(bool force) } } - if(std::any_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget) { - return stripsWidget->refreshing(); - })) - { - ui->actionToday->setEnabled(false); - ui->actionRefresh->setEnabled(false); - ui->dateEditDate->setReadOnly(true); - ui->pushButtonPrev->setEnabled(false); - ui->pushButtonNext->setEnabled(false); - } + Q_EMIT dateChanged(ui->dateEditDate->date()); } void MainWindow::minimumTimeChanged() @@ -354,21 +349,6 @@ void MainWindow::minimumTimeChanged() ui->timeEditTime->setMinimumTime(m_currentStripWidget->minimumTime()); } -void MainWindow::refreshingChanged() -{ - { - auto allFinished = std::none_of(std::begin(m_stripsWidgets), std::end(m_stripsWidgets), [](StripsWidget *stripsWidget){ - return stripsWidget->refreshing(); - }); - - ui->actionToday->setEnabled(allFinished); - ui->actionRefresh->setEnabled(allFinished); - ui->dateEditDate->setReadOnly(!allFinished); - ui->pushButtonPrev->setEnabled(allFinished); - ui->pushButtonNext->setEnabled(allFinished); - } -} - void MainWindow::startEnabledChanged() { auto startEnabled = m_currentStripWidget->startEnabled(); diff --git a/zeiterfassunglib/mainwindow.h b/zeiterfassunglib/mainwindow.h index a49ae98..b9d88de 100644 --- a/zeiterfassunglib/mainwindow.h +++ b/zeiterfassunglib/mainwindow.h @@ -42,18 +42,22 @@ public: StripFactory &stripFactory() const; QDate date() const; + void setDate(const QDate &date); const QMap &projects() const; const std::array &stripsWidgets() const; +Q_SIGNALS: + void dateChanged(const QDate &date); + void refreshEverything(); + private Q_SLOTS: void getProjectsFinished(); void pushButtonStartPressed(); void pushButtonEndPressed(); - void dateChanged(bool force = false); + void dateChangedSlot(const QDate &date); void minimumTimeChanged(); - void refreshingChanged(); void startEnabledChanged(); void endEnabledChanged(); -- 2.50.1 From 602ec861270583d24abd3190ce1f76cf8a8fad96 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 21:34:44 +0100 Subject: [PATCH 16/21] Added WeatherWidget --- plugins/weatherplugin/weatherplugin.cpp | 10 ++++++++++ plugins/weatherplugin/weatherplugin.h | 1 + plugins/weatherplugin/weatherplugin.pro | 6 ++++-- plugins/weatherplugin/weatherwidget.cpp | 10 ++++++++++ plugins/weatherplugin/weatherwidget.h | 19 +++++++++++++++++++ 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 plugins/weatherplugin/weatherwidget.cpp create mode 100644 plugins/weatherplugin/weatherwidget.h diff --git a/plugins/weatherplugin/weatherplugin.cpp b/plugins/weatherplugin/weatherplugin.cpp index c30cc4c..674d9fb 100644 --- a/plugins/weatherplugin/weatherplugin.cpp +++ b/plugins/weatherplugin/weatherplugin.cpp @@ -1,9 +1,19 @@ #include "weatherplugin.h" #include +#include + +#include "mainwindow.h" + +#include "weatherwidget.h" WeatherPlugin::WeatherPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; } + +void WeatherPlugin::attachTo(MainWindow &mainWindow) +{ + mainWindow.statusBar()->addWidget(new WeatherWidget(mainWindow)); +} diff --git a/plugins/weatherplugin/weatherplugin.h b/plugins/weatherplugin/weatherplugin.h index f8abc9b..11ba9b0 100644 --- a/plugins/weatherplugin/weatherplugin.h +++ b/plugins/weatherplugin/weatherplugin.h @@ -15,6 +15,7 @@ public: explicit WeatherPlugin(QObject *parent = Q_NULLPTR); // ZeiterfassungPlugin interface + void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; }; #endif // WEATHERPLUGIN_H diff --git a/plugins/weatherplugin/weatherplugin.pro b/plugins/weatherplugin/weatherplugin.pro index b67c6dd..3a9d5a9 100644 --- a/plugins/weatherplugin/weatherplugin.pro +++ b/plugins/weatherplugin/weatherplugin.pro @@ -14,8 +14,10 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT -HEADERS += weatherplugin.h +HEADERS += weatherplugin.h \ + weatherwidget.h -SOURCES += weatherplugin.cpp +SOURCES += weatherplugin.cpp \ + weatherwidget.cpp OTHER_FILES += weatherplugin.json diff --git a/plugins/weatherplugin/weatherwidget.cpp b/plugins/weatherplugin/weatherwidget.cpp new file mode 100644 index 0000000..b055298 --- /dev/null +++ b/plugins/weatherplugin/weatherwidget.cpp @@ -0,0 +1,10 @@ +#include "weatherwidget.h" + +#include "mainwindow.h" + +WeatherWidget::WeatherWidget(MainWindow &mainWindow) : + QLabel(&mainWindow), + m_mainWindow(mainWindow) +{ + setText(tr("Weather")); +} diff --git a/plugins/weatherplugin/weatherwidget.h b/plugins/weatherplugin/weatherwidget.h new file mode 100644 index 0000000..e04b530 --- /dev/null +++ b/plugins/weatherplugin/weatherwidget.h @@ -0,0 +1,19 @@ +#ifndef WEATHERWIDGET_H +#define WEATHERWIDGET_H + +#include + +class MainWindow; + +class WeatherWidget : public QLabel +{ + Q_OBJECT + +public: + explicit WeatherWidget(MainWindow &mainWindow); + +private: + MainWindow &m_mainWindow; +}; + +#endif // WEATHERWIDGET_H -- 2.50.1 From 0f51884018f4abff4c23c1ec27303eb99a8d621a Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 22:01:06 +0100 Subject: [PATCH 17/21] Implemented WeatherWidget with API --- plugins/weatherplugin/weatherwidget.cpp | 84 ++++++++++++++++++++++++- plugins/weatherplugin/weatherwidget.h | 9 +++ 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/plugins/weatherplugin/weatherwidget.cpp b/plugins/weatherplugin/weatherwidget.cpp index b055298..76efa1a 100644 --- a/plugins/weatherplugin/weatherwidget.cpp +++ b/plugins/weatherplugin/weatherwidget.cpp @@ -1,10 +1,92 @@ #include "weatherwidget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "mainwindow.h" +#include "zeiterfassungsettings.h" +#include "zeiterfassungapi.h" WeatherWidget::WeatherWidget(MainWindow &mainWindow) : QLabel(&mainWindow), m_mainWindow(mainWindow) { - setText(tr("Weather")); + setFrameShape(QFrame::Panel); + setFrameShadow(QFrame::Sunken); + + connect(&m_mainWindow, &MainWindow::refreshEverything, this, &WeatherWidget::refresh); + + refresh(); +} + +void WeatherWidget::refresh() +{ + setText(tr("Loading...")); + + auto url = m_mainWindow.settings().value(QStringLiteral("WeatherPlugin/url"), + QStringLiteral("http://api.openweathermap.org/data/2.5/weather?q=Graz,AT&units=metric&APPID=40f6c892c6162680c6c9235169dc9f83")).toString(); + + m_reply = std::unique_ptr(m_mainWindow.erfassung().manager()->get(QNetworkRequest(QUrl(url)))); + connect(m_reply.get(), &QNetworkReply::finished, this, &WeatherWidget::finished); +} + +void WeatherWidget::finished() +{ + if(m_reply->error() != QNetworkReply::NoError) + { + qWarning() << m_reply->errorString(); + setText(tr("Request failed")); + goto after; + } + + { + QJsonParseError error; + + auto document = QJsonDocument::fromJson(m_reply->readAll(), &error); + if(error.error != QJsonParseError::NoError) + { + qWarning() << error.errorString(); + setText(tr("Parsing failed")); + goto after; + } + + if(!document.isObject()) + { + setText(tr("Not an json obj")); + goto after; + } + + auto obj = document.object(); + + if(!obj.contains(QStringLiteral("weather"))) + { + qWarning() << "no weather" << obj; + setText("No weater found"); + goto after; + } + + if(!obj.contains(QStringLiteral("main"))) + { + qWarning() << "no main" << obj; + setText("No main found"); + goto after; + } + + auto weaterObj = obj.value(QStringLiteral("weather")).toArray(); + auto mainObj = obj.value(QStringLiteral("main")).toObject(); + + setText(tr("%0 (%1°C)").arg(weaterObj.first().toObject().value(QStringLiteral("main")).toString()) + .arg(mainObj.value(QStringLiteral("temp")).toDouble())); + } + + after: + m_reply = Q_NULLPTR; } diff --git a/plugins/weatherplugin/weatherwidget.h b/plugins/weatherplugin/weatherwidget.h index e04b530..17532c5 100644 --- a/plugins/weatherplugin/weatherwidget.h +++ b/plugins/weatherplugin/weatherwidget.h @@ -1,7 +1,10 @@ #ifndef WEATHERWIDGET_H #define WEATHERWIDGET_H +#include + #include +#include class MainWindow; @@ -12,8 +15,14 @@ class WeatherWidget : public QLabel public: explicit WeatherWidget(MainWindow &mainWindow); +private Q_SLOTS: + void refresh(); + void finished(); + private: MainWindow &m_mainWindow; + + std::unique_ptr m_reply; }; #endif // WEATHERWIDGET_H -- 2.50.1 From b72a95cc77d2b61a07df65cf4d001fd4b73f0b19 Mon Sep 17 00:00:00 2001 From: Daniel Brunner <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 22:49:04 +0100 Subject: [PATCH 18/21] Removed export macro in plugins --- plugins/advancedviewplugin/dialogs/bookingdialog.h | 4 +--- plugins/advancedviewplugin/dialogs/timeassignmentdialog.h | 4 +--- plugins/advancedviewplugin/models/bookingsmodel.h | 3 +-- plugins/advancedviewplugin/models/timeassignmentsmodel.h | 3 +-- plugins/updaterplugin/updaterdialog.h | 4 +--- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/plugins/advancedviewplugin/dialogs/bookingdialog.h b/plugins/advancedviewplugin/dialogs/bookingdialog.h index 67a95e7..4a308f2 100644 --- a/plugins/advancedviewplugin/dialogs/bookingdialog.h +++ b/plugins/advancedviewplugin/dialogs/bookingdialog.h @@ -4,11 +4,9 @@ #include #include -#include "zeiterfassunglib_global.h" - namespace Ui { class BookingDialog; } -class ZEITERFASSUNGLIBSHARED_EXPORT BookingDialog : public QDialog +class BookingDialog : public QDialog { Q_OBJECT diff --git a/plugins/advancedviewplugin/dialogs/timeassignmentdialog.h b/plugins/advancedviewplugin/dialogs/timeassignmentdialog.h index 160b057..a8d253c 100644 --- a/plugins/advancedviewplugin/dialogs/timeassignmentdialog.h +++ b/plugins/advancedviewplugin/dialogs/timeassignmentdialog.h @@ -4,15 +4,13 @@ #include #include -#include "zeiterfassunglib_global.h" - template class QMap; class ZeiterfassungSettings; namespace Ui { class TimeAssignmentDialog; } -class ZEITERFASSUNGLIBSHARED_EXPORT TimeAssignmentDialog : public QDialog +class TimeAssignmentDialog : public QDialog { Q_OBJECT diff --git a/plugins/advancedviewplugin/models/bookingsmodel.h b/plugins/advancedviewplugin/models/bookingsmodel.h index 9156d0e..ced2306 100644 --- a/plugins/advancedviewplugin/models/bookingsmodel.h +++ b/plugins/advancedviewplugin/models/bookingsmodel.h @@ -4,12 +4,11 @@ #include #include -#include "zeiterfassunglib_global.h" #include "zeiterfassungapi.h" class StripsWidget; -class ZEITERFASSUNGLIBSHARED_EXPORT BookingsModel : public QAbstractListModel +class BookingsModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged) diff --git a/plugins/advancedviewplugin/models/timeassignmentsmodel.h b/plugins/advancedviewplugin/models/timeassignmentsmodel.h index b4bb8f3..05ffc55 100644 --- a/plugins/advancedviewplugin/models/timeassignmentsmodel.h +++ b/plugins/advancedviewplugin/models/timeassignmentsmodel.h @@ -4,12 +4,11 @@ #include #include -#include "zeiterfassunglib_global.h" #include "zeiterfassungapi.h" class StripsWidget; -class ZEITERFASSUNGLIBSHARED_EXPORT TimeAssignmentsModel : public QAbstractListModel +class TimeAssignmentsModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged) diff --git a/plugins/updaterplugin/updaterdialog.h b/plugins/updaterplugin/updaterdialog.h index 9626d05..c714506 100644 --- a/plugins/updaterplugin/updaterdialog.h +++ b/plugins/updaterplugin/updaterdialog.h @@ -4,14 +4,12 @@ #include #include -#include "zeiterfassunglib_global.h" - class QNetworkReply; namespace Ui { class UpdaterDialog; } class MainWindow; -class ZEITERFASSUNGLIBSHARED_EXPORT UpdaterDialog : public QDialog +class UpdaterDialog : public QDialog { Q_OBJECT -- 2.50.1 From 64d0612207c7cad65709ad795948b43698d992a0 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 23:04:47 +0100 Subject: [PATCH 19/21] Added and updated translations --- .../advancedviewplugin/advancedviewplugin.pro | 5 +- .../translations/advancedviewplugin_de.ts | 240 +++++++++ .../translations/advancedviewplugin_en.ts | 240 +++++++++ plugins/lunchmealplugin/lunchmealplugin.pro | 12 +- .../translations/lunchmealplugin_de.ts | 35 ++ .../translations/lunchmealplugin_en.ts | 35 ++ plugins/presenceplugin/presenceplugin.pro | 5 +- .../translations/presenceplugin_de.ts | 44 ++ .../translations/presenceplugin_en.ts | 44 ++ plugins/reportsplugin/reportsplugin.pro | 5 +- .../translations/reportsplugin_de.ts | 73 +++ .../translations/reportsplugin_en.ts | 73 +++ .../translations/updaterplugin_de.ts | 28 ++ .../translations/updaterplugin_en.ts | 28 ++ plugins/updaterplugin/updaterplugin.pro | 5 +- .../translations/weatherplugin_de.ts | 32 ++ .../translations/weatherplugin_en.ts | 32 ++ plugins/weatherplugin/weatherplugin.pro | 13 +- .../translations/zeiterfassung_de.ts | 56 +-- .../translations/zeiterfassung_en.ts | 56 +-- .../translations/zeiterfassunglib_de.ts | 464 +++--------------- .../translations/zeiterfassunglib_en.ts | 464 +++--------------- 22 files changed, 1150 insertions(+), 839 deletions(-) create mode 100644 plugins/advancedviewplugin/translations/advancedviewplugin_de.ts create mode 100644 plugins/advancedviewplugin/translations/advancedviewplugin_en.ts create mode 100644 plugins/lunchmealplugin/translations/lunchmealplugin_de.ts create mode 100644 plugins/lunchmealplugin/translations/lunchmealplugin_en.ts create mode 100644 plugins/presenceplugin/translations/presenceplugin_de.ts create mode 100644 plugins/presenceplugin/translations/presenceplugin_en.ts create mode 100644 plugins/reportsplugin/translations/reportsplugin_de.ts create mode 100644 plugins/reportsplugin/translations/reportsplugin_en.ts create mode 100644 plugins/updaterplugin/translations/updaterplugin_de.ts create mode 100644 plugins/updaterplugin/translations/updaterplugin_en.ts create mode 100644 plugins/weatherplugin/translations/weatherplugin_de.ts create mode 100644 plugins/weatherplugin/translations/weatherplugin_en.ts diff --git a/plugins/advancedviewplugin/advancedviewplugin.pro b/plugins/advancedviewplugin/advancedviewplugin.pro index 3a024ee..5d31425 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.pro +++ b/plugins/advancedviewplugin/advancedviewplugin.pro @@ -36,6 +36,9 @@ FORMS += advancedviewdialog.ui \ RESOURCES += advancedviewplugin_resources.qrc -TRANSLATIONS += +TRANSLATIONS += translations/advancedviewplugin_en.ts \ + translations/advancedviewplugin_de.ts OTHER_FILES += advancedviewplugin.json + +include(../../lrelease.pri) diff --git a/plugins/advancedviewplugin/translations/advancedviewplugin_de.ts b/plugins/advancedviewplugin/translations/advancedviewplugin_de.ts new file mode 100644 index 0000000..b68cae8 --- /dev/null +++ b/plugins/advancedviewplugin/translations/advancedviewplugin_de.ts @@ -0,0 +1,240 @@ + + + + + AdvancedViewDialog + + + Advanced view + Erweiterte Anzeige + + + + Create booking + Buchung erstellen + + + + Refresh bookings + Buchungen aktualisieren + + + + Could not create booking! + Konnte Buchung nicht erstellen! + + + + Edit booking + Buchung bearbeiten + + + + Delete booking + Buchung löschen + + + + Could not edit booking! + Konnte Buchung nicht bearbeiten! + + + + Do you really want to delete the booking? + Möchten Sie die Buchung wirklich löschen? + + + + Could not delete booking! + Konnte Buchung nicht löschen! + + + + Create time assignment + Kontierung erstellen + + + + Refresh time assignments + Kontierungen aktualisieren + + + + Could not create time assignment! + Konnte Kontierung nicht erstellen! + + + + Edit time assignment + Kontierung bearbeiten + + + + Delete time assignment + Kontierung löschen + + + + Could not edit time assignment! + Konnte Kontierung nicht bearbeiten! + + + + Do you really want to delete the time assignment? + Möchten Sie die Kontierung wirklich löschen? + + + + Could not delete time assignment! + Konnte Kontierung nicht löschen! + + + + AdvancedViewWidget + + + Advanced view + Erweiterte Anzeige + + + + BookingDialog + + + + Booking + Buchung + + + + Time: + Zeit: + + + + Timespan: + Zeitspanne: + + + + Type: + Typ: + + + + Text: + Text: + + + + BookingsModel + + + ID + ID + + + + Time + Zeit + + + + Timespan + Zeitspanne + + + + Type + Typ + + + + Text + Text + + + + TimeAssignmentDialog + + + + Time assignment + Kontierung + + + + Time: + Zeit: + + + + Timespan: + Zeitspanne: + + + + Project: + Projekt: + + + + Subproject: + Subprojekt: + + + + Workpackage: + Arbeitspaket: + + + + Text: + Text: + + + + + %0 (%1) + %0 (%1) + + + + TimeAssignmentsModel + + + ID + ID + + + + Time + Zeit + + + + Timespan + Zeitspanne + + + + Project + Projekt + + + + Subproject + Subprojekt + + + + Workpackage + Arbeitspaket + + + + Text + Text + + + diff --git a/plugins/advancedviewplugin/translations/advancedviewplugin_en.ts b/plugins/advancedviewplugin/translations/advancedviewplugin_en.ts new file mode 100644 index 0000000..80acdaf --- /dev/null +++ b/plugins/advancedviewplugin/translations/advancedviewplugin_en.ts @@ -0,0 +1,240 @@ + + + + + AdvancedViewDialog + + + Advanced view + + + + + Create booking + + + + + Refresh bookings + + + + + Could not create booking! + + + + + Edit booking + + + + + Delete booking + + + + + Could not edit booking! + + + + + Do you really want to delete the booking? + + + + + Could not delete booking! + + + + + Create time assignment + + + + + Refresh time assignments + + + + + Could not create time assignment! + + + + + Edit time assignment + + + + + Delete time assignment + + + + + Could not edit time assignment! + + + + + Do you really want to delete the time assignment? + + + + + Could not delete time assignment! + + + + + AdvancedViewWidget + + + Advanced view + + + + + BookingDialog + + + + Booking + + + + + Time: + + + + + Timespan: + + + + + Type: + + + + + Text: + + + + + BookingsModel + + + ID + + + + + Time + + + + + Timespan + + + + + Type + + + + + Text + + + + + TimeAssignmentDialog + + + + Time assignment + + + + + Time: + + + + + Timespan: + + + + + Project: + + + + + Subproject: + + + + + Workpackage: + + + + + Text: + + + + + + %0 (%1) + + + + + TimeAssignmentsModel + + + ID + + + + + Time + + + + + Timespan + + + + + Project + + + + + Subproject + + + + + Workpackage + + + + + Text + + + + diff --git a/plugins/lunchmealplugin/lunchmealplugin.pro b/plugins/lunchmealplugin/lunchmealplugin.pro index 62d9852..8115f97 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.pro +++ b/plugins/lunchmealplugin/lunchmealplugin.pro @@ -16,17 +16,19 @@ DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSA HEADERS += lunchmealplugin.h \ lunchmealwidget.h \ - lunchmealdialog.h + lunchmealdialog.h SOURCES += lunchmealplugin.cpp \ lunchmealwidget.cpp \ - lunchmealdialog.cpp + lunchmealdialog.cpp -FORMS += \ - lunchmealdialog.ui +FORMS += lunchmealdialog.ui RESOURCES += lunchmealplugin_resources.qrc -TRANSLATIONS += +TRANSLATIONS += translations/lunchmealplugin_en.ts \ + translations/lunchmealplugin_de.ts OTHER_FILES += lunchmealplugin.json + +include(../../lrelease.pri) diff --git a/plugins/lunchmealplugin/translations/lunchmealplugin_de.ts b/plugins/lunchmealplugin/translations/lunchmealplugin_de.ts new file mode 100644 index 0000000..bc1d61f --- /dev/null +++ b/plugins/lunchmealplugin/translations/lunchmealplugin_de.ts @@ -0,0 +1,35 @@ + + + + + LunchMealDialog + + + Dialog + + + + + Loading... + Lade... + + + + Lunch meal for %0 + Mittagsmenü vom %0 + + + + dd.MM.yyyy + dd.MM.yyyy + + + + LunchMealWidget + + + Lunch meal + Mittagsmenü + + + diff --git a/plugins/lunchmealplugin/translations/lunchmealplugin_en.ts b/plugins/lunchmealplugin/translations/lunchmealplugin_en.ts new file mode 100644 index 0000000..6243a5d --- /dev/null +++ b/plugins/lunchmealplugin/translations/lunchmealplugin_en.ts @@ -0,0 +1,35 @@ + + + + + LunchMealDialog + + + Dialog + + + + + Loading... + + + + + Lunch meal for %0 + + + + + dd.MM.yyyy + + + + + LunchMealWidget + + + Lunch meal + + + + diff --git a/plugins/presenceplugin/presenceplugin.pro b/plugins/presenceplugin/presenceplugin.pro index 961ea39..3eef5d3 100644 --- a/plugins/presenceplugin/presenceplugin.pro +++ b/plugins/presenceplugin/presenceplugin.pro @@ -24,6 +24,9 @@ FORMS += RESOURCES += presenceplugin_resources.qrc -TRANSLATIONS += +TRANSLATIONS += translations/presenceplugin_en.ts \ + translations/presenceplugin_de.ts OTHER_FILES += presenceplugin.json + +include(../../lrelease.pri) diff --git a/plugins/presenceplugin/translations/presenceplugin_de.ts b/plugins/presenceplugin/translations/presenceplugin_de.ts new file mode 100644 index 0000000..6f9be17 --- /dev/null +++ b/plugins/presenceplugin/translations/presenceplugin_de.ts @@ -0,0 +1,44 @@ + + + + + PresenceWidget + + + Refresh presence + Verfügbarkeit aktualisieren + + + + + + + %0: %1 + %0: %1 + + + + + Available + Verfügbar + + + + + ??? + ??? + + + + + Not available + Nicht verfügbar + + + + + Could not get presence status! + Konnte Verfügbarkeit nicht laden! + + + diff --git a/plugins/presenceplugin/translations/presenceplugin_en.ts b/plugins/presenceplugin/translations/presenceplugin_en.ts new file mode 100644 index 0000000..924bcb5 --- /dev/null +++ b/plugins/presenceplugin/translations/presenceplugin_en.ts @@ -0,0 +1,44 @@ + + + + + PresenceWidget + + + Refresh presence + + + + + + + + %0: %1 + + + + + + Available + + + + + + ??? + + + + + + Not available + + + + + + Could not get presence status! + + + + diff --git a/plugins/reportsplugin/reportsplugin.pro b/plugins/reportsplugin/reportsplugin.pro index a299f62..19d8c78 100644 --- a/plugins/reportsplugin/reportsplugin.pro +++ b/plugins/reportsplugin/reportsplugin.pro @@ -24,6 +24,9 @@ FORMS += RESOURCES += reportsplugin_resources.qrc -TRANSLATIONS += +TRANSLATIONS += translations/reportsplugin_en.ts \ + translations/reportsplugin_de.ts OTHER_FILES += reportsplugin.json + +include(../../lrelease.pri) diff --git a/plugins/reportsplugin/translations/reportsplugin_de.ts b/plugins/reportsplugin/translations/reportsplugin_de.ts new file mode 100644 index 0000000..fdca085 --- /dev/null +++ b/plugins/reportsplugin/translations/reportsplugin_de.ts @@ -0,0 +1,73 @@ + + + + + ReportsWidget + + + Refresh report + Auswertung aktualisieren + + + + Open report + Auswertung öffnen + + + + + + + + + %0: %1 + %0: %1 + + + + + + Balance + Gleitzeit + + + + + ??? + ??? + + + + + + Holidays + Urlaub + + + + Could not load report! + Konnte Auswertung nicht laden! + + + + %0h + %0h + + + + + n/a + n/v + + + + Could not write report! + Konnte Auswertung nicht abspeichern! + + + + Could not launch your default PDF viewer! + Konnte Standard-PDF-Viewer nicht öffnen! + + + diff --git a/plugins/reportsplugin/translations/reportsplugin_en.ts b/plugins/reportsplugin/translations/reportsplugin_en.ts new file mode 100644 index 0000000..03ce2d6 --- /dev/null +++ b/plugins/reportsplugin/translations/reportsplugin_en.ts @@ -0,0 +1,73 @@ + + + + + ReportsWidget + + + Refresh report + + + + + Open report + + + + + + + + + + %0: %1 + + + + + + + Balance + + + + + + ??? + + + + + + + Holidays + + + + + Could not load report! + + + + + %0h + + + + + + n/a + + + + + Could not write report! + + + + + Could not launch your default PDF viewer! + + + + diff --git a/plugins/updaterplugin/translations/updaterplugin_de.ts b/plugins/updaterplugin/translations/updaterplugin_de.ts new file mode 100644 index 0000000..0fd56e0 --- /dev/null +++ b/plugins/updaterplugin/translations/updaterplugin_de.ts @@ -0,0 +1,28 @@ + + + + + UpdaterDialog + + + + New update available! + Neues Update verfügbar! + + + + There is a new release available to download! + Ein neues Release steht zum Download bereit! + + + + Dont show today anymore + Heute nicht mehr anzeigen + + + + Could not open default webbrowser! + Konnte Standard-Browser nicht öffnen! + + + diff --git a/plugins/updaterplugin/translations/updaterplugin_en.ts b/plugins/updaterplugin/translations/updaterplugin_en.ts new file mode 100644 index 0000000..fd1099e --- /dev/null +++ b/plugins/updaterplugin/translations/updaterplugin_en.ts @@ -0,0 +1,28 @@ + + + + + UpdaterDialog + + + + New update available! + + + + + There is a new release available to download! + + + + + Dont show today anymore + + + + + Could not open default webbrowser! + + + + diff --git a/plugins/updaterplugin/updaterplugin.pro b/plugins/updaterplugin/updaterplugin.pro index d7fa50f..1671d2a 100644 --- a/plugins/updaterplugin/updaterplugin.pro +++ b/plugins/updaterplugin/updaterplugin.pro @@ -24,6 +24,9 @@ FORMS += updaterdialog.ui RESOURCES += -TRANSLATIONS += +TRANSLATIONS += translations/updaterplugin_en.ts \ + translations/updaterplugin_de.ts OTHER_FILES += updaterplugin.json + +include(../../lrelease.pri) diff --git a/plugins/weatherplugin/translations/weatherplugin_de.ts b/plugins/weatherplugin/translations/weatherplugin_de.ts new file mode 100644 index 0000000..40f7555 --- /dev/null +++ b/plugins/weatherplugin/translations/weatherplugin_de.ts @@ -0,0 +1,32 @@ + + + + + WeatherWidget + + + Loading... + Lade... + + + + Request failed + Anfrage fehlgeschlagen + + + + Parsing failed + Parsen fehlgeschlagen + + + + Not an json obj + Kein json obj + + + + %0 (%1°C) + %0 (%1°C) + + + diff --git a/plugins/weatherplugin/translations/weatherplugin_en.ts b/plugins/weatherplugin/translations/weatherplugin_en.ts new file mode 100644 index 0000000..c4bb548 --- /dev/null +++ b/plugins/weatherplugin/translations/weatherplugin_en.ts @@ -0,0 +1,32 @@ + + + + + WeatherWidget + + + Loading... + + + + + Request failed + + + + + Parsing failed + + + + + Not an json obj + + + + + %0 (%1°C) + + + + diff --git a/plugins/weatherplugin/weatherplugin.pro b/plugins/weatherplugin/weatherplugin.pro index 3a9d5a9..5391064 100644 --- a/plugins/weatherplugin/weatherplugin.pro +++ b/plugins/weatherplugin/weatherplugin.pro @@ -15,9 +15,18 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT HEADERS += weatherplugin.h \ - weatherwidget.h + weatherwidget.h SOURCES += weatherplugin.cpp \ - weatherwidget.cpp + weatherwidget.cpp + +FORMS += + +RESOURCES += + +TRANSLATIONS += translations/weatherplugin_en.ts \ + translations/weatherplugin_de.ts OTHER_FILES += weatherplugin.json + +include(../../lrelease.pri) diff --git a/zeiterfassung/translations/zeiterfassung_de.ts b/zeiterfassung/translations/zeiterfassung_de.ts index 9206edb..d5a9396 100644 --- a/zeiterfassung/translations/zeiterfassung_de.ts +++ b/zeiterfassung/translations/zeiterfassung_de.ts @@ -20,113 +20,113 @@ main - + Loading settings... Lade Einstellungen... - + Loading translations... Lade Übersetzungen... + - Invalid language selection! Ungültige Sprachauswahl! - + You did not select a valid language! Sie haben keine gültige Sprachauswahl getroffen! - + Loading theme... Lade Aussehen... + - + - Could not load theme! Konnte Aussehen nicht laden! - + Theme file does not exist! Aussehen-Datei existiert nicht! - + Loading login page... Lade Login-Seite... - - + + Could not access Zeiterfassung! Konnte Zeiterfassung nicht erreichen! - + Base url Basis URL - + Please enter the base url to the Zeiterfassung: Bitte geben Sie die Basis URL zur Zeiterfassung ein: - + Authenticating... Authentifiziere... - - + + Could not authenticate with Zeiterfassung! Konnte nicht mit Zeiterfassung authentifizieren! - + Getting user information... Hole Benutzer Information... - - + + Could not get user information! Konnte Benutzer Information nicht holen! - - + + Could not load plugin %0! Konnte Plugin %0 nicht laden! - - + + Plugin not valid %0! Plugin %0 nicht gültig! - + Loading strip layouts... Lade Streifenlayouts... + - + - + - + - Could not load strips! Konnte Streifenlayouts nicht laden! diff --git a/zeiterfassung/translations/zeiterfassung_en.ts b/zeiterfassung/translations/zeiterfassung_en.ts index 81507c1..7ec7843 100644 --- a/zeiterfassung/translations/zeiterfassung_en.ts +++ b/zeiterfassung/translations/zeiterfassung_en.ts @@ -20,113 +20,113 @@ main - + Loading settings... - + Loading translations... + - Invalid language selection! - + You did not select a valid language! - + Loading theme... + - + - Could not load theme! - + Theme file does not exist! - + Loading login page... - - + + Could not access Zeiterfassung! - + Base url - + Please enter the base url to the Zeiterfassung: - + Authenticating... - - + + Could not authenticate with Zeiterfassung! - + Getting user information... - - + + Could not get user information! - - + + Could not load plugin %0! - - + + Plugin not valid %0! - + Loading strip layouts... + - + - + - + - Could not load strips! diff --git a/zeiterfassunglib/translations/zeiterfassunglib_de.ts b/zeiterfassunglib/translations/zeiterfassunglib_de.ts index bbace03..873a88d 100644 --- a/zeiterfassunglib/translations/zeiterfassunglib_de.ts +++ b/zeiterfassunglib/translations/zeiterfassunglib_de.ts @@ -54,63 +54,6 @@ Passwort: - - BookingDialog - - - - Booking - Buchung - - - - Time: - Zeit: - - - - Timespan: - Zeitspanne: - - - - Type: - Typ: - - - - Text: - Text: - - - - BookingsModel - - - ID - ID - - - - Time - Zeit - - - - Timespan - Zeitspanne - - - - Type - Typ - - - - Text - Text - - CreateBookingReply @@ -173,15 +116,6 @@ - - GetAuswertungReply - - - - Request error occured: %0 - - - GetBookingsReply @@ -246,6 +180,15 @@ + + GetReportReply + + + + Request error occured: %0 + + + GetTimeAssignmentsReply @@ -376,8 +319,8 @@ - - + + Start Kommen @@ -387,263 +330,117 @@ Gehen - - Optimized view - Optimierte Anzeige - - - - Advanced view - Erweiterte Anzeige - - - - Bookings - Buchungen - - - - Time assignments - Kontierungen - - - + &File &Datei - + &About &Über - + &View &Ansicht - + &Tools &Werkzeuge - + &Quit &Beenden - + About &Me Über &mich - + About &zeiterfassung Über &zeiterfassung - + About &Qt Über &Qt - + &Today &Heute - + &Refresh everything Alles &neu laden - - &Auswertung - - - - + &Settings &Einstellungen - + Help Hilfe - + Zeiterfassung - %0 (%1) Zeiterfassung - %0 (%1) - - - Could not open auswertung! - - - - - Could not open default PDF viewer! - Konnte den PDF-Anzeiger nicht öffnen! - - - + Subproject Subprojekt - + Workpackage Arbeitspaket - + Text Text - - - - - %0: %1 - %0: %1 - - - - - ??? - ??? - - - - - Balance - Saldo - - - - - Holidays - Urlaubstage - - - - + + Could not load bookings! Konnte Buchungen nicht laden! - - Could not load Auswertung! - - - - - %0h - %0h - - - - Could not delete booking! - Konnte Buchung nicht löschen! - - - - Edit booking - Buchung bearbeiten - - - - Delete booking - Buchung löschen - - - - Could not edit booking! - Konnte Buchung nicht bearbeiten! - - - - Create booking - Buchung erstellen - - - - - n/a - n/v - - - - Refresh bookings - Buchungen aktualisieren - - - - - + + Could not create booking! Konnte Buchung nicht erstellen! - - Do you really want to delete the booking? - Möchten Sie die Buchung wirklich löschen? - - - - Refresh time assignments - Kontierungen aktualisieren - - - - Edit time assignment - Kontierung bearbeiten - - - - Delete time assignment - Kontierung löschen - - - - - + + Could not edit time assignment! Konnte Kontierung nicht bearbeiten! - - Do you really want to delete the time assignment? - Möchten Sie die Kontierung wirklich löschen? - - - - Could not delete time assignment! - Konnte Kontierung nicht löschen! - - - - + + %0 (%1) %0 (%1) - - Create time assignment - Kontierung erstellen - - - - + Could not create time assignment! Konnte Kontierung nicht erstellen! - - + + Switch Wechseln @@ -729,109 +526,111 @@ StripsWidget + + Loading... Lade... - + Missing booking! Kontierung fehlend! - + Expected start booking, instead got type %0 Booking ID: %1 - - + + %0: %1 %0: %1 - + Break Pause - - - + + + %0h %0h - - - - - + + + + + HH:mm HH:mm - + Missing time assignment! Kontierung fehlend! - - - + + + Expected %0 but received %1 in time assignment. Time assignment ID: %2 - - - - - - - - - + + + + + + + + + HH:mm:ss HH:mm:ss - - + + There is another booking after an unfinished time assignment. Booking ID: %0 Time assignment ID: %1 - - - + + + There is another time assignment after an unfinished time assignment. Time assignment ID: %0 Time assignment ID: %1 - + The last time assignment is finished without end booking Time assignment ID: %0 - + Expected end booking, instead got type %0 Booking ID: %1 - + Missing time assignment! Missing: %0 Kontierung fehlend! %0 nicht kontiert - + Assigned time Kontierte Zeit @@ -846,14 +645,14 @@ Booking ID: %1 %0 (%1) - + Time assignment time longer than booking time! Time assignment: %0 Booking: %1 - + Strip rendering aborted due error. Your bookings and time assignments for this day are in an illegal state! @@ -899,94 +698,11 @@ Your bookings and time assignments for this day are in an illegal state!Ungültig - + Open Offen - - TimeAssignmentDialog - - - - Time assignment - Kontierung - - - - Time: - Zeit: - - - - Timespan: - Zeitspanne: - - - - Project: - Projekt: - - - - Subproject: - Subprojekt: - - - - Workpackage: - Arbeitspaket: - - - - Text: - Text: - - - - - %0 (%1) - %0 (%1) - - - - TimeAssignmentsModel - - - ID - ID - - - - Time - Zeit - - - - Timespan - Zeitspanne - - - - Project - Projekt - - - - Subproject - Subprojekt - - - - Workpackage - Arbeitspaket - - - - Text - Text - - UpdateBookingReply @@ -1010,30 +726,6 @@ Your bookings and time assignments for this day are in an illegal state! - - UpdateDialog - - - - New update available! - Neues Update verfügbar! - - - - There is a new release available to download! - Es ist ein neues Update verfügbar zum Download! - - - - Dont show today anymore - Heute nicht mehr anzeigen - - - - Could not open default webbrowser! - Konnte den Standard-Browser nicht öffnen! - - UpdateTimeAssignmentReply diff --git a/zeiterfassunglib/translations/zeiterfassunglib_en.ts b/zeiterfassunglib/translations/zeiterfassunglib_en.ts index c58d108..2e4ce17 100644 --- a/zeiterfassunglib/translations/zeiterfassunglib_en.ts +++ b/zeiterfassunglib/translations/zeiterfassunglib_en.ts @@ -54,63 +54,6 @@ - - BookingDialog - - - - Booking - - - - - Time: - - - - - Timespan: - - - - - Type: - - - - - Text: - - - - - BookingsModel - - - ID - - - - - Time - - - - - Timespan - - - - - Type - - - - - Text - - - CreateBookingReply @@ -173,15 +116,6 @@ - - GetAuswertungReply - - - - Request error occured: %0 - - - GetBookingsReply @@ -246,6 +180,15 @@ + + GetReportReply + + + + Request error occured: %0 + + + GetTimeAssignmentsReply @@ -376,8 +319,8 @@ - - + + Start @@ -387,263 +330,117 @@ - - Optimized view - - - - - Advanced view - - - - - Bookings - - - - - Time assignments - - - - + &File - + &About - + &View - + &Tools - + &Quit - + About &Me - + About &zeiterfassung - + About &Qt - + &Today - + &Refresh everything - - &Auswertung - - - - + &Settings - + Help - + Zeiterfassung - %0 (%1) - + Subproject - + Workpackage - + Text - - - ??? - - - - - + + Could not load bookings! - - Could not load Auswertung! - - - - - - n/a - - - - - %0h - - - - - - - - %0: %1 - - - - - - Balance - - - - - - Holidays - - - - - Create booking - - - - - Refresh bookings - - - - - - + + Could not create booking! - - Edit booking - - - - - Delete booking - - - - - Could not edit booking! - - - - - Do you really want to delete the booking? - - - - - Could not delete booking! - - - - - Create time assignment - - - - - Refresh time assignments - - - - - + Could not create time assignment! - - Edit time assignment - - - - - Delete time assignment - - - - - - + + Could not edit time assignment! - - Do you really want to delete the time assignment? - - - - - Could not delete time assignment! - - - - - - Could not open auswertung! - - - - - Could not open default PDF viewer! - - - - - + + Switch - - + + %0 (%1) @@ -729,121 +526,123 @@ StripsWidget + + Loading... - + Missing booking! - + Expected start booking, instead got type %0 Booking ID: %1 - - + + %0: %1 - + Break - - - + + + %0h - - - - - + + + + + HH:mm - + Missing time assignment! - - - + + + Expected %0 but received %1 in time assignment. Time assignment ID: %2 - - - - - - - - - + + + + + + + + + HH:mm:ss - - + + There is another booking after an unfinished time assignment. Booking ID: %0 Time assignment ID: %1 - - - + + + There is another time assignment after an unfinished time assignment. Time assignment ID: %0 Time assignment ID: %1 - + The last time assignment is finished without end booking Time assignment ID: %0 - + Expected end booking, instead got type %0 Booking ID: %1 - + Missing time assignment! Missing: %0 - + Time assignment time longer than booking time! Time assignment: %0 Booking: %1 - + Assigned time - + Strip rendering aborted due error. Your bookings and time assignments for this day are in an illegal state! @@ -899,94 +698,11 @@ Your bookings and time assignments for this day are in an illegal state! - + Open - - TimeAssignmentDialog - - - - Time assignment - - - - - Time: - - - - - Timespan: - - - - - Project: - - - - - Subproject: - - - - - Workpackage: - - - - - Text: - - - - - - %0 (%1) - - - - - TimeAssignmentsModel - - - ID - - - - - Time - - - - - Timespan - - - - - Project - - - - - Subproject - - - - - Workpackage - - - - - Text - - - UpdateBookingReply @@ -1010,30 +726,6 @@ Your bookings and time assignments for this day are in an illegal state! - - UpdateDialog - - - - New update available! - - - - - There is a new release available to download! - - - - - Dont show today anymore - - - - - Could not open default webbrowser! - - - UpdateTimeAssignmentReply -- 2.50.1 From 2c32b928bf86716a4362d8361538f858105f5be4 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 23:54:58 +0100 Subject: [PATCH 20/21] Plugins now load their translations --- .../advancedviewplugin/advancedviewplugin.cpp | 17 +++++++++++++++ .../advancedviewplugin/advancedviewplugin.h | 4 ++++ .../advancedviewplugin/advancedviewplugin.pro | 5 +++++ plugins/copy_translations.pri | 6 ++++++ plugins/lunchmealplugin/lunchmealplugin.cpp | 17 +++++++++++++++ plugins/lunchmealplugin/lunchmealplugin.h | 4 ++++ plugins/lunchmealplugin/lunchmealplugin.pro | 5 +++++ plugins/presenceplugin/presenceplugin.cpp | 17 +++++++++++++++ plugins/presenceplugin/presenceplugin.h | 4 ++++ plugins/presenceplugin/presenceplugin.pro | 5 +++++ plugins/reportsplugin/reportsplugin.cpp | 17 +++++++++++++++ plugins/reportsplugin/reportsplugin.h | 4 ++++ plugins/reportsplugin/reportsplugin.pro | 5 +++++ plugins/updaterplugin/updaterplugin.cpp | 17 +++++++++++++++ plugins/updaterplugin/updaterplugin.h | 4 ++++ plugins/updaterplugin/updaterplugin.pro | 5 +++++ plugins/weatherplugin/weatherplugin.cpp | 17 +++++++++++++++ plugins/weatherplugin/weatherplugin.h | 4 ++++ plugins/weatherplugin/weatherplugin.pro | 5 +++++ zeiterfassung/main.cpp | 21 +++++++------------ 20 files changed, 170 insertions(+), 13 deletions(-) create mode 100644 plugins/copy_translations.pri diff --git a/plugins/advancedviewplugin/advancedviewplugin.cpp b/plugins/advancedviewplugin/advancedviewplugin.cpp index c1ad9ad..3b3f308 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.cpp +++ b/plugins/advancedviewplugin/advancedviewplugin.cpp @@ -1,6 +1,9 @@ #include "advancedviewplugin.h" #include +#include +#include +#include #include #include "mainwindow.h" @@ -12,6 +15,20 @@ AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("advancedviewplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation advancedviewplugin"; + } + } + else + { + qWarning() << "could not load translation advancedviewplugin"; + } } void AdvancedViewPlugin::attachTo(MainWindow &mainWindow) diff --git a/plugins/advancedviewplugin/advancedviewplugin.h b/plugins/advancedviewplugin/advancedviewplugin.h index 02bfc66..73a4052 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.h +++ b/plugins/advancedviewplugin/advancedviewplugin.h @@ -2,6 +2,7 @@ #define ADVANCEDVIEWPLUGIN_H #include +#include #include "zeiterfassungplugin.h" @@ -18,6 +19,9 @@ public: // ZeiterfassungPlugin interface void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; + +private: + QTranslator m_translator; }; #endif // ADVANCEDVIEWPLUGIN_H diff --git a/plugins/advancedviewplugin/advancedviewplugin.pro b/plugins/advancedviewplugin/advancedviewplugin.pro index 5d31425..3f522ca 100644 --- a/plugins/advancedviewplugin/advancedviewplugin.pro +++ b/plugins/advancedviewplugin/advancedviewplugin.pro @@ -42,3 +42,8 @@ TRANSLATIONS += translations/advancedviewplugin_en.ts \ OTHER_FILES += advancedviewplugin.json include(../../lrelease.pri) + +COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/advancedviewplugin_en.qm \ + $${OUT_PWD}/translations/advancedviewplugin_de.qm + +include(../copy_translations.pri) diff --git a/plugins/copy_translations.pri b/plugins/copy_translations.pri new file mode 100644 index 0000000..966c686 --- /dev/null +++ b/plugins/copy_translations.pri @@ -0,0 +1,6 @@ +copy_compiled_translations.input = COMPILED_TRANSLATIONS +copy_compiled_translations.output = $${OUT_PWD}/../../bin/translations/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy_compiled_translations.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy_compiled_translations.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy_compiled_translations +PRE_TARGETDEPS += compiler_copy_compiled_translations_make_all diff --git a/plugins/lunchmealplugin/lunchmealplugin.cpp b/plugins/lunchmealplugin/lunchmealplugin.cpp index 209428e..0379d21 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.cpp +++ b/plugins/lunchmealplugin/lunchmealplugin.cpp @@ -1,6 +1,9 @@ #include "lunchmealplugin.h" #include +#include +#include +#include #include #include "mainwindow.h" @@ -12,6 +15,20 @@ LunchMealPlugin::LunchMealPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("lunchmealplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation lunchmealplugin"; + } + } + else + { + qWarning() << "could not load translation lunchmealplugin"; + } } void LunchMealPlugin::attachTo(MainWindow &mainWindow) diff --git a/plugins/lunchmealplugin/lunchmealplugin.h b/plugins/lunchmealplugin/lunchmealplugin.h index 3c8f524..f2a0f7c 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.h +++ b/plugins/lunchmealplugin/lunchmealplugin.h @@ -2,6 +2,7 @@ #define LUNCHMEALPLUGIN_H #include +#include #include "zeiterfassungplugin.h" @@ -18,6 +19,9 @@ public: // ZeiterfassungPlugin interface void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; + +private: + QTranslator m_translator; }; #endif // LUNCHMEALPLUGIN_H diff --git a/plugins/lunchmealplugin/lunchmealplugin.pro b/plugins/lunchmealplugin/lunchmealplugin.pro index 8115f97..c3debe5 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.pro +++ b/plugins/lunchmealplugin/lunchmealplugin.pro @@ -32,3 +32,8 @@ TRANSLATIONS += translations/lunchmealplugin_en.ts \ OTHER_FILES += lunchmealplugin.json include(../../lrelease.pri) + +COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/lunchmealplugin_en.qm \ + $${OUT_PWD}/translations/lunchmealplugin_de.qm + +include(../copy_translations.pri) diff --git a/plugins/presenceplugin/presenceplugin.cpp b/plugins/presenceplugin/presenceplugin.cpp index 790c36e..3e5e64d 100644 --- a/plugins/presenceplugin/presenceplugin.cpp +++ b/plugins/presenceplugin/presenceplugin.cpp @@ -1,6 +1,9 @@ #include "presenceplugin.h" #include +#include +#include +#include #include "presencewidget.h" @@ -8,6 +11,20 @@ PresencePlugin::PresencePlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("presenceplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation presenceplugin"; + } + } + else + { + qWarning() << "could not load translation presenceplugin"; + } } void PresencePlugin::attachTo(MainWindow &mainWindow) diff --git a/plugins/presenceplugin/presenceplugin.h b/plugins/presenceplugin/presenceplugin.h index acee4b7..2fc9f87 100644 --- a/plugins/presenceplugin/presenceplugin.h +++ b/plugins/presenceplugin/presenceplugin.h @@ -2,6 +2,7 @@ #define PRESENCEPLUGIN_H #include +#include #include "zeiterfassungplugin.h" @@ -18,6 +19,9 @@ public: // ZeiterfassungPlugin interface void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; + +private: + QTranslator m_translator; }; #endif // PRESENCEPLUGIN_H diff --git a/plugins/presenceplugin/presenceplugin.pro b/plugins/presenceplugin/presenceplugin.pro index 3eef5d3..e3e1d82 100644 --- a/plugins/presenceplugin/presenceplugin.pro +++ b/plugins/presenceplugin/presenceplugin.pro @@ -30,3 +30,8 @@ TRANSLATIONS += translations/presenceplugin_en.ts \ OTHER_FILES += presenceplugin.json include(../../lrelease.pri) + +COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/presenceplugin_en.qm \ + $${OUT_PWD}/translations/presenceplugin_de.qm + +include(../copy_translations.pri) diff --git a/plugins/reportsplugin/reportsplugin.cpp b/plugins/reportsplugin/reportsplugin.cpp index ea8d0fa..ce4dec0 100644 --- a/plugins/reportsplugin/reportsplugin.cpp +++ b/plugins/reportsplugin/reportsplugin.cpp @@ -1,6 +1,9 @@ #include "reportsplugin.h" #include +#include +#include +#include #include "reportswidget.h" @@ -8,6 +11,20 @@ ReportsPlugin::ReportsPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("reportsplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation reportsplugin"; + } + } + else + { + qWarning() << "could not load translation reportsplugin"; + } } void ReportsPlugin::attachTo(MainWindow &mainWindow) diff --git a/plugins/reportsplugin/reportsplugin.h b/plugins/reportsplugin/reportsplugin.h index 782caa2..469ac83 100644 --- a/plugins/reportsplugin/reportsplugin.h +++ b/plugins/reportsplugin/reportsplugin.h @@ -2,6 +2,7 @@ #define REPORTSPLUGIN_H #include +#include #include "zeiterfassungplugin.h" @@ -18,6 +19,9 @@ public: // ZeiterfassungPlugin interface void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; + +private: + QTranslator m_translator; }; #endif // REPORTSPLUGIN_H diff --git a/plugins/reportsplugin/reportsplugin.pro b/plugins/reportsplugin/reportsplugin.pro index 19d8c78..e5fcadf 100644 --- a/plugins/reportsplugin/reportsplugin.pro +++ b/plugins/reportsplugin/reportsplugin.pro @@ -30,3 +30,8 @@ TRANSLATIONS += translations/reportsplugin_en.ts \ OTHER_FILES += reportsplugin.json include(../../lrelease.pri) + +COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/reportsplugin_en.qm \ + $${OUT_PWD}/translations/reportsplugin_de.qm + +include(../copy_translations.pri) diff --git a/plugins/updaterplugin/updaterplugin.cpp b/plugins/updaterplugin/updaterplugin.cpp index 13ad888..c38ace3 100644 --- a/plugins/updaterplugin/updaterplugin.cpp +++ b/plugins/updaterplugin/updaterplugin.cpp @@ -1,6 +1,9 @@ #include "updaterplugin.h" #include +#include +#include +#include #include "mainwindow.h" #include "zeiterfassungsettings.h" @@ -12,6 +15,20 @@ UpdaterPlugin::UpdaterPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("updaterplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation updaterplugin"; + } + } + else + { + qWarning() << "could not load translation updaterplugin"; + } } void UpdaterPlugin::attachTo(MainWindow &mainWindow) diff --git a/plugins/updaterplugin/updaterplugin.h b/plugins/updaterplugin/updaterplugin.h index 6ebf16b..51311b2 100644 --- a/plugins/updaterplugin/updaterplugin.h +++ b/plugins/updaterplugin/updaterplugin.h @@ -2,6 +2,7 @@ #define UPDATERPLUGIN_H #include +#include #include "zeiterfassungplugin.h" @@ -18,6 +19,9 @@ public: // ZeiterfassungPlugin interface void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; + +private: + QTranslator m_translator; }; #endif // UPDATERPLUGIN_H diff --git a/plugins/updaterplugin/updaterplugin.pro b/plugins/updaterplugin/updaterplugin.pro index 1671d2a..0e6f1ce 100644 --- a/plugins/updaterplugin/updaterplugin.pro +++ b/plugins/updaterplugin/updaterplugin.pro @@ -30,3 +30,8 @@ TRANSLATIONS += translations/updaterplugin_en.ts \ OTHER_FILES += updaterplugin.json include(../../lrelease.pri) + +COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/updaterplugin_en.qm \ + $${OUT_PWD}/translations/updaterplugin_de.qm + +include(../copy_translations.pri) diff --git a/plugins/weatherplugin/weatherplugin.cpp b/plugins/weatherplugin/weatherplugin.cpp index 674d9fb..b308b11 100644 --- a/plugins/weatherplugin/weatherplugin.cpp +++ b/plugins/weatherplugin/weatherplugin.cpp @@ -1,6 +1,9 @@ #include "weatherplugin.h" #include +#include +#include +#include #include #include "mainwindow.h" @@ -11,6 +14,20 @@ WeatherPlugin::WeatherPlugin(QObject *parent) : ZeiterfassungPlugin(parent) { qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("weatherplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation weatherplugin"; + } + } + else + { + qWarning() << "could not load translation weatherplugin"; + } } void WeatherPlugin::attachTo(MainWindow &mainWindow) diff --git a/plugins/weatherplugin/weatherplugin.h b/plugins/weatherplugin/weatherplugin.h index 11ba9b0..c4dc84f 100644 --- a/plugins/weatherplugin/weatherplugin.h +++ b/plugins/weatherplugin/weatherplugin.h @@ -2,6 +2,7 @@ #define WEATHERPLUGIN_H #include +#include #include "zeiterfassungplugin.h" @@ -16,6 +17,9 @@ public: // ZeiterfassungPlugin interface void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; + +private: + QTranslator m_translator; }; #endif // WEATHERPLUGIN_H diff --git a/plugins/weatherplugin/weatherplugin.pro b/plugins/weatherplugin/weatherplugin.pro index 5391064..43118e3 100644 --- a/plugins/weatherplugin/weatherplugin.pro +++ b/plugins/weatherplugin/weatherplugin.pro @@ -30,3 +30,8 @@ TRANSLATIONS += translations/weatherplugin_en.ts \ OTHER_FILES += weatherplugin.json include(../../lrelease.pri) + +COMPILED_TRANSLATIONS += $${OUT_PWD}/translations/weatherplugin_en.qm \ + $${OUT_PWD}/translations/weatherplugin_de.qm + +include(../copy_translations.pri) diff --git a/zeiterfassung/main.cpp b/zeiterfassung/main.cpp index 61d015d..6bff758 100755 --- a/zeiterfassung/main.cpp +++ b/zeiterfassung/main.cpp @@ -34,14 +34,11 @@ struct { QVector plugins; -bool loadAndInstallTranslator(QTranslator &translator, - const QLocale &locale, - const QString &filename, - const QString &prefix = QString(), - const QString &directory = QString(), - const QString &suffix = QString()) +bool loadAndInstallTranslator(QTranslator &translator, const QString &filename) { - if(!translator.load(locale, filename, prefix, directory, suffix)) + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(!translator.load(QLocale(), filename, QStringLiteral("_"), dir)) { qWarning() << "could not load translation" << filename; return false; @@ -79,13 +76,11 @@ bool loadTranslations(QSplashScreen &splashScreen, ZeiterfassungSettings &settin settings.setLanguage(dialog.language()); } - QLocale locale(settings.language(), QLocale::Austria); - QLocale::setDefault(locale); + QLocale::setDefault(QLocale(settings.language(), QLocale::Austria)); - auto translationsDir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); - loadAndInstallTranslator(translators.qtTranslator, locale, QStringLiteral("qt"), QStringLiteral("_"), translationsDir); - loadAndInstallTranslator(translators.zeiterfassungTranslator, locale, QStringLiteral("zeiterfassung"), QStringLiteral("_"), translationsDir); - loadAndInstallTranslator(translators.zeiterfassunglibTranslator, locale, QStringLiteral("zeiterfassunglib"), QStringLiteral("_"), translationsDir); + loadAndInstallTranslator(translators.qtTranslator, QStringLiteral("qt")); + loadAndInstallTranslator(translators.zeiterfassungTranslator, QStringLiteral("zeiterfassung")); + loadAndInstallTranslator(translators.zeiterfassunglibTranslator, QStringLiteral("zeiterfassunglib")); return true; } -- 2.50.1 From 1a34305a5a96fdd67b5235504ab182e81bc9d499 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Wed, 20 Dec 2017 00:08:34 +0100 Subject: [PATCH 21/21] Updated translations --- plugins/lunchmealplugin/lunchmealdialog.ui | 2 +- .../translations/lunchmealplugin_de.ts | 4 +- .../translations/lunchmealplugin_en.ts | 2 +- .../translations/zeiterfassung_de.ts | 70 +++++++++---------- .../translations/zeiterfassung_en.ts | 70 +++++++++---------- 5 files changed, 74 insertions(+), 74 deletions(-) diff --git a/plugins/lunchmealplugin/lunchmealdialog.ui b/plugins/lunchmealplugin/lunchmealdialog.ui index 065c46b..ab5ffa7 100644 --- a/plugins/lunchmealplugin/lunchmealdialog.ui +++ b/plugins/lunchmealplugin/lunchmealdialog.ui @@ -11,7 +11,7 @@ - Dialog + Lunch meal diff --git a/plugins/lunchmealplugin/translations/lunchmealplugin_de.ts b/plugins/lunchmealplugin/translations/lunchmealplugin_de.ts index bc1d61f..0a13bcc 100644 --- a/plugins/lunchmealplugin/translations/lunchmealplugin_de.ts +++ b/plugins/lunchmealplugin/translations/lunchmealplugin_de.ts @@ -5,8 +5,8 @@ LunchMealDialog - Dialog - + Lunch meal + Mittagsmenü diff --git a/plugins/lunchmealplugin/translations/lunchmealplugin_en.ts b/plugins/lunchmealplugin/translations/lunchmealplugin_en.ts index 6243a5d..ac807ce 100644 --- a/plugins/lunchmealplugin/translations/lunchmealplugin_en.ts +++ b/plugins/lunchmealplugin/translations/lunchmealplugin_en.ts @@ -5,7 +5,7 @@ LunchMealDialog - Dialog + Lunch meal diff --git a/zeiterfassung/translations/zeiterfassung_de.ts b/zeiterfassung/translations/zeiterfassung_de.ts index d5a9396..777228f 100644 --- a/zeiterfassung/translations/zeiterfassung_de.ts +++ b/zeiterfassung/translations/zeiterfassung_de.ts @@ -20,113 +20,113 @@ main - + Loading settings... Lade Einstellungen... - + Loading translations... Lade Übersetzungen... - - + + Invalid language selection! Ungültige Sprachauswahl! - + You did not select a valid language! Sie haben keine gültige Sprachauswahl getroffen! - + Loading theme... Lade Aussehen... - - - - + + + + Could not load theme! Konnte Aussehen nicht laden! - + Theme file does not exist! Aussehen-Datei existiert nicht! - + Loading login page... Lade Login-Seite... - - + + Could not access Zeiterfassung! Konnte Zeiterfassung nicht erreichen! - + Base url Basis URL - + Please enter the base url to the Zeiterfassung: Bitte geben Sie die Basis URL zur Zeiterfassung ein: - + Authenticating... Authentifiziere... - - + + Could not authenticate with Zeiterfassung! Konnte nicht mit Zeiterfassung authentifizieren! - + Getting user information... Hole Benutzer Information... - - + + Could not get user information! Konnte Benutzer Information nicht holen! - - + + Could not load plugin %0! Konnte Plugin %0 nicht laden! - - + + Plugin not valid %0! Plugin %0 nicht gültig! - + Loading strip layouts... Lade Streifenlayouts... - - - - - - - - + + + + + + + + Could not load strips! Konnte Streifenlayouts nicht laden! diff --git a/zeiterfassung/translations/zeiterfassung_en.ts b/zeiterfassung/translations/zeiterfassung_en.ts index 7ec7843..0229025 100644 --- a/zeiterfassung/translations/zeiterfassung_en.ts +++ b/zeiterfassung/translations/zeiterfassung_en.ts @@ -20,113 +20,113 @@ main - + Loading settings... - + Loading translations... - - + + Invalid language selection! - + You did not select a valid language! - + Loading theme... - - - - + + + + Could not load theme! - + Theme file does not exist! - + Loading login page... - - + + Could not access Zeiterfassung! - + Base url - + Please enter the base url to the Zeiterfassung: - + Authenticating... - - + + Could not authenticate with Zeiterfassung! - + Getting user information... - - + + Could not get user information! - - + + Could not load plugin %0! - - + + Plugin not valid %0! - + Loading strip layouts... - - - - - - - - + + + + + + + + Could not load strips! -- 2.50.1