Added WeatherSettings
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include "weatherwidget.h"
|
#include "weatherwidget.h"
|
||||||
|
#include "weathersettings.h"
|
||||||
|
|
||||||
WeatherPlugin::WeatherPlugin(QObject *parent) :
|
WeatherPlugin::WeatherPlugin(QObject *parent) :
|
||||||
ZeiterfassungPlugin(parent)
|
ZeiterfassungPlugin(parent)
|
||||||
@@ -34,3 +35,8 @@ void WeatherPlugin::attachTo(MainWindow &mainWindow)
|
|||||||
{
|
{
|
||||||
mainWindow.statusBar()->addWidget(new WeatherWidget(mainWindow));
|
mainWindow.statusBar()->addWidget(new WeatherWidget(mainWindow));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsWidget *WeatherPlugin::settingsWidget(QWidget *parent)
|
||||||
|
{
|
||||||
|
return new WeatherSettings(parent);
|
||||||
|
}
|
||||||
|
@@ -17,6 +17,8 @@ public:
|
|||||||
// ZeiterfassungPlugin interface
|
// ZeiterfassungPlugin interface
|
||||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
SettingsWidget *settingsWidget(QWidget *parent = Q_NULLPTR) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTranslator m_translator;
|
QTranslator m_translator;
|
||||||
};
|
};
|
||||||
|
@@ -17,9 +17,11 @@ DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}
|
|||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
HEADERS += weatherplugin.h \
|
HEADERS += weatherplugin.h \
|
||||||
|
weathersettings.h \
|
||||||
weatherwidget.h
|
weatherwidget.h
|
||||||
|
|
||||||
SOURCES += weatherplugin.cpp \
|
SOURCES += weatherplugin.cpp \
|
||||||
|
weathersettings.cpp \
|
||||||
weatherwidget.cpp
|
weatherwidget.cpp
|
||||||
|
|
||||||
FORMS +=
|
FORMS +=
|
||||||
|
20
plugins/weatherplugin/weathersettings.cpp
Normal file
20
plugins/weatherplugin/weathersettings.cpp
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#include "weathersettings.h"
|
||||||
|
|
||||||
|
#include <QFormLayout>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
WeatherSettings::WeatherSettings(QWidget *parent) :
|
||||||
|
SettingsWidget(parent)
|
||||||
|
{
|
||||||
|
auto layout = new QFormLayout(this);
|
||||||
|
|
||||||
|
layout->addRow(tr("Weather API:"), new QLineEdit(this));
|
||||||
|
|
||||||
|
setLayout(layout);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WeatherSettings::apply()
|
||||||
|
{
|
||||||
|
qDebug() << "called";
|
||||||
|
}
|
18
plugins/weatherplugin/weathersettings.h
Normal file
18
plugins/weatherplugin/weathersettings.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef WEATHERSETTINGS_H
|
||||||
|
#define WEATHERSETTINGS_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "settingswidget.h"
|
||||||
|
|
||||||
|
class WeatherSettings : public SettingsWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit WeatherSettings(QWidget *parent = Q_NULLPTR);
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void apply() Q_DECL_OVERRIDE;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // WEATHERSETTINGS_H
|
@@ -10,7 +10,7 @@ class ZEITERFASSUNGGUILIBSHARED_EXPORT SettingsWidget : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit SettingsWidget(QWidget *parent = nullptr);
|
explicit SettingsWidget(QWidget *parent = Q_NULLPTR);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
virtual void apply() { }
|
virtual void apply() { }
|
||||||
|
Reference in New Issue
Block a user