Plugin settings (weather & lunch) #74
@@ -17,14 +17,16 @@ DEPENDPATH += $$PWD/$${PROJECT_ROOT}/zeiterfassungcorelib $$PWD/$${PROJECT_ROOT}
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||
|
||||
HEADERS += lunchmealdialog.h \
|
||||
lunchmealsettings.h \
|
||||
lunchmealsettingswidget.h \
|
||||
lunchmealplugin.h \
|
||||
lunchmealwidget.h \
|
||||
lunchmealsettings.h
|
||||
lunchmealwidget.h
|
||||
|
||||
SOURCES += lunchmealdialog.cpp \
|
||||
lunchmealsettings.cpp \
|
||||
lunchmealsettingswidget.cpp \
|
||||
lunchmealplugin.cpp \
|
||||
lunchmealwidget.cpp \
|
||||
lunchmealsettings.cpp
|
||||
lunchmealwidget.cpp
|
||||
|
||||
FORMS += lunchmealdialog.ui
|
||||
|
||||
|
29
plugins/lunchmealplugin/lunchmealsettingswidget.cpp
Normal file
29
plugins/lunchmealplugin/lunchmealsettingswidget.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "lunchmealsettingswidget.h"
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLineEdit>
|
||||
|
||||
LunchMealSettingsWidget::LunchMealSettingsWidget(QWidget *parent) :
|
||||
SettingsWidget(parent)
|
||||
{
|
||||
auto layout = new QFormLayout(this);
|
||||
layout->setMargin(0);
|
||||
|
||||
m_lineEditUrl = new QLineEdit(m_settings.url().toString(), this);
|
||||
layout->addRow(tr("Lunch meal API:"), m_lineEditUrl);
|
||||
|
||||
m_lineEditDateFormat = new QLineEdit(m_settings.dateFormat(), this);
|
||||
layout->addRow(tr("Lunch meal date format:"), m_lineEditDateFormat);
|
||||
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
bool LunchMealSettingsWidget::isValid(QString &message) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LunchMealSettingsWidget::apply()
|
||||
{
|
||||
|
||||
}
|
27
plugins/lunchmealplugin/lunchmealsettingswidget.h
Normal file
27
plugins/lunchmealplugin/lunchmealsettingswidget.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef LUNCHMEALSETTINGSWIDGET_H
|
||||
#define LUNCHMEALSETTINGSWIDGET_H
|
||||
|
||||
#include "settingswidget.h"
|
||||
|
||||
#include "lunchmealsettings.h"
|
||||
|
||||
class LunchMealSettingsWidget : public SettingsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LunchMealSettingsWidget(ZeiterfassungSettings &settings, QWidget *parent = nullptr);
|
||||
|
||||
virtual bool isValid(QString &message) const Q_DECL_OVERRIDE;
|
||||
|
||||
public Q_SLOTS:
|
||||
virtual void apply() Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
LunchMealSettings m_settings;
|
||||
|
||||
QLineEdit *m_lineEditUrl;
|
||||
QLineEdit *m_lineEditDateFormat;
|
||||
};
|
||||
|
||||
#endif // LUNCHMEALSETTINGSWIDGET_H
|
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QDebug>
|
||||
|
||||
WeatherSettingsWidget::WeatherSettingsWidget(ZeiterfassungSettings &settings, QWidget *parent) :
|
||||
SettingsWidget(parent),
|
||||
|
Reference in New Issue
Block a user