Plugin settings (weather & lunch) #74
@@ -9,6 +9,7 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "weatherwidget.h"
|
||||
#include "weathersettings.h"
|
||||
|
||||
WeatherPlugin::WeatherPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
@@ -34,3 +35,8 @@ void WeatherPlugin::attachTo(MainWindow &mainWindow)
|
||||
{
|
||||
mainWindow.statusBar()->addWidget(new WeatherWidget(mainWindow));
|
||||
}
|
||||
|
||||
SettingsWidget *WeatherPlugin::settingsWidget(QWidget *parent)
|
||||
{
|
||||
return new WeatherSettings(parent);
|
||||
}
|
||||
|
@@ -17,6 +17,8 @@ public:
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
SettingsWidget *settingsWidget(QWidget *parent = Q_NULLPTR) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
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
|
||||
|
||||
HEADERS += weatherplugin.h \
|
||||
weathersettings.h \
|
||||
weatherwidget.h
|
||||
|
||||
SOURCES += weatherplugin.cpp \
|
||||
weathersettings.cpp \
|
||||
weatherwidget.cpp
|
||||
|
||||
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
|
||||
public:
|
||||
explicit SettingsWidget(QWidget *parent = nullptr);
|
||||
explicit SettingsWidget(QWidget *parent = Q_NULLPTR);
|
||||
|
||||
public Q_SLOTS:
|
||||
virtual void apply() { }
|
||||
|
Reference in New Issue
Block a user