Added updaterplugin
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "advancedviewplugin.h"
|
#include "advancedviewplugin.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
@@ -9,6 +10,7 @@
|
|||||||
AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) :
|
AdvancedViewPlugin::AdvancedViewPlugin(QObject *parent) :
|
||||||
ZeiterfassungPlugin(parent)
|
ZeiterfassungPlugin(parent)
|
||||||
{
|
{
|
||||||
|
qDebug() << "called";
|
||||||
Q_INIT_RESOURCE(advancedviewplugin_resources);
|
Q_INIT_RESOURCE(advancedviewplugin_resources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,5 +5,5 @@
|
|||||||
LunchMealPlugin::LunchMealPlugin(QObject *parent) :
|
LunchMealPlugin::LunchMealPlugin(QObject *parent) :
|
||||||
ZeiterfassungPlugin(parent)
|
ZeiterfassungPlugin(parent)
|
||||||
{
|
{
|
||||||
|
qDebug() << "called";
|
||||||
}
|
}
|
||||||
|
@@ -3,4 +3,5 @@ TEMPLATE = subdirs
|
|||||||
SUBDIRS += advancedviewplugin \
|
SUBDIRS += advancedviewplugin \
|
||||||
lunchmealplugin \
|
lunchmealplugin \
|
||||||
presenceplugin \
|
presenceplugin \
|
||||||
|
updaterplugin \
|
||||||
weatherplugin
|
weatherplugin
|
||||||
|
14
plugins/updaterplugin/updaterplugin.cpp
Normal file
14
plugins/updaterplugin/updaterplugin.cpp
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include "updaterplugin.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
UpdaterPlugin::UpdaterPlugin(QObject *parent) :
|
||||||
|
ZeiterfassungPlugin(parent)
|
||||||
|
{
|
||||||
|
qDebug() << "called";
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdaterPlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
23
plugins/updaterplugin/updaterplugin.h
Normal file
23
plugins/updaterplugin/updaterplugin.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef UPDATERPLUGIN_H
|
||||||
|
#define UPDATERPLUGIN_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
#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
|
0
plugins/updaterplugin/updaterplugin.json
Normal file
0
plugins/updaterplugin/updaterplugin.json
Normal file
27
plugins/updaterplugin/updaterplugin.pro
Normal file
27
plugins/updaterplugin/updaterplugin.pro
Normal file
@@ -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
|
@@ -5,5 +5,5 @@
|
|||||||
WeatherPlugin::WeatherPlugin(QObject *parent) :
|
WeatherPlugin::WeatherPlugin(QObject *parent) :
|
||||||
ZeiterfassungPlugin(parent)
|
ZeiterfassungPlugin(parent)
|
||||||
{
|
{
|
||||||
|
qDebug() << "called";
|
||||||
}
|
}
|
||||||
|
@@ -278,10 +278,18 @@ bool loadPlugins(QSplashScreen &splashScreen)
|
|||||||
for(const auto &fileInfo : dir.entryInfoList(QDir::Files))
|
for(const auto &fileInfo : dir.entryInfoList(QDir::Files))
|
||||||
{
|
{
|
||||||
if(fileInfo.isSymLink())
|
if(fileInfo.isSymLink())
|
||||||
|
{
|
||||||
|
qWarning() << "skipping" << fileInfo.fileName() << "because symlink";
|
||||||
continue; // to skip unix so symlinks
|
continue; // to skip unix so symlinks
|
||||||
|
}
|
||||||
|
|
||||||
if(!QLibrary::isLibrary(fileInfo.filePath()))
|
if(!QLibrary::isLibrary(fileInfo.filePath()))
|
||||||
|
{
|
||||||
|
qWarning() << "skipping" << fileInfo.fileName() << "because no QLibrary";
|
||||||
continue; // to skip windows junk files
|
continue; // to skip windows junk files
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << "loading" << fileInfo.fileName();
|
||||||
|
|
||||||
QPluginLoader loader(fileInfo.filePath());
|
QPluginLoader loader(fileInfo.filePath());
|
||||||
if(!loader.load())
|
if(!loader.load())
|
||||||
|
@@ -23,8 +23,8 @@ StripsWidget::StripsWidget(MainWindow &mainWindow, QWidget *parent) :
|
|||||||
{
|
{
|
||||||
auto layout = new QVBoxLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
m_headerLayout = new QHBoxLayout(this);
|
m_headerLayout = new QHBoxLayout;
|
||||||
m_label = new QLabel(this);
|
m_label = new QLabel;
|
||||||
{
|
{
|
||||||
auto font = m_label->font();
|
auto font = m_label->font();
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
@@ -33,7 +33,7 @@ StripsWidget::StripsWidget(MainWindow &mainWindow, QWidget *parent) :
|
|||||||
m_headerLayout->addWidget(m_label, 1);
|
m_headerLayout->addWidget(m_label, 1);
|
||||||
layout->addLayout(m_headerLayout);
|
layout->addLayout(m_headerLayout);
|
||||||
|
|
||||||
m_stripsLayout = new QVBoxLayout(this);
|
m_stripsLayout = new QVBoxLayout;
|
||||||
layout->addLayout(m_stripsLayout);
|
layout->addLayout(m_stripsLayout);
|
||||||
|
|
||||||
layout->addStretch(1);
|
layout->addStretch(1);
|
||||||
|
@@ -55,8 +55,6 @@ std::unique_ptr<LoginPageReply> ZeiterfassungApi::doLoginPage()
|
|||||||
|
|
||||||
auto reply = std::unique_ptr<QNetworkReply>(m_manager->get(request));
|
auto reply = std::unique_ptr<QNetworkReply>(m_manager->get(request));
|
||||||
|
|
||||||
qDebug() << reply->parent();
|
|
||||||
|
|
||||||
return std::make_unique<LoginPageReply>(std::move(reply), this);
|
return std::make_unique<LoginPageReply>(std::move(reply), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user