Plugin settings (weather & lunch) #74
@@ -10,6 +10,7 @@
|
||||
#include "stripswidget.h"
|
||||
|
||||
#include "lunchmealwidget.h"
|
||||
#include "lunchmealsettingswidget.h"
|
||||
|
||||
LunchMealPlugin::LunchMealPlugin(QObject *parent) :
|
||||
ZeiterfassungPlugin(parent)
|
||||
@@ -36,3 +37,8 @@ void LunchMealPlugin::attachTo(MainWindow &mainWindow)
|
||||
for(auto stripsWidget : mainWindow.stripsWidgets())
|
||||
stripsWidget->headerLayout()->addWidget(new LunchMealWidget(*stripsWidget));
|
||||
}
|
||||
|
||||
SettingsWidget *LunchMealPlugin::settingsWidget(ZeiterfassungSettings &settings, QWidget *parent) const
|
||||
{
|
||||
return new LunchMealSettingsWidget(settings, parent);
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@ public:
|
||||
// ZeiterfassungPlugin interface
|
||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||
|
||||
virtual SettingsWidget *settingsWidget(ZeiterfassungSettings &settings, QWidget *parent = Q_NULLPTR) const Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QTranslator m_translator;
|
||||
};
|
||||
|
@@ -3,8 +3,9 @@
|
||||
#include <QFormLayout>
|
||||
#include <QLineEdit>
|
||||
|
||||
LunchMealSettingsWidget::LunchMealSettingsWidget(QWidget *parent) :
|
||||
SettingsWidget(parent)
|
||||
LunchMealSettingsWidget::LunchMealSettingsWidget(ZeiterfassungSettings &settings, QWidget *parent) :
|
||||
SettingsWidget(parent),
|
||||
m_settings(settings)
|
||||
{
|
||||
auto layout = new QFormLayout(this);
|
||||
layout->setMargin(0);
|
||||
@@ -20,7 +21,9 @@ LunchMealSettingsWidget::LunchMealSettingsWidget(QWidget *parent) :
|
||||
|
||||
bool LunchMealSettingsWidget::isValid(QString &message) const
|
||||
{
|
||||
Q_UNUSED(message)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LunchMealSettingsWidget::apply()
|
||||
|
@@ -5,12 +5,14 @@
|
||||
|
||||
#include "lunchmealsettings.h"
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
class LunchMealSettingsWidget : public SettingsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LunchMealSettingsWidget(ZeiterfassungSettings &settings, QWidget *parent = nullptr);
|
||||
explicit LunchMealSettingsWidget(ZeiterfassungSettings &settings, QWidget *parent = Q_NULLPTR);
|
||||
|
||||
virtual bool isValid(QString &message) const Q_DECL_OVERRIDE;
|
||||
|
||||
|
Reference in New Issue
Block a user