2017-12-04 20:11:11 +01:00
|
|
|
#include "settingsdialog.h"
|
|
|
|
|
#include "ui_settingsdialog.h"
|
|
|
|
|
|
|
|
|
|
#include "zeiterfassungsettings.h"
|
|
|
|
|
|
|
|
|
|
SettingsDialog::SettingsDialog(ZeiterfassungSettings &settings, QWidget *parent) :
|
|
|
|
|
QDialog(parent),
|
|
|
|
|
ui(new Ui::SettingsDialog),
|
|
|
|
|
m_settings(settings)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
2017-12-05 21:07:12 +01:00
|
|
|
ui->lineEditBuchungStartBackgroundColor->setText(settings.buchungStartBackgroundColor());
|
|
|
|
|
ui->lineEditBuchungEndBackgroundColor->setText(settings.buchungEndBackgroundColor());
|
2017-12-04 20:11:11 +01:00
|
|
|
ui->lineEditBuchungOtherBackgroundColor->setText(settings.buchungOtherBackgroundColor());
|
2017-12-05 21:03:03 +01:00
|
|
|
ui->lineEditTimeAssignmentBackgroundColor->setText(settings.timeAssignmentBackgroundColor());
|
2017-12-04 20:11:11 +01:00
|
|
|
|
|
|
|
|
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::submit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SettingsDialog::~SettingsDialog()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SettingsDialog::submit()
|
|
|
|
|
{
|
2017-12-05 21:07:12 +01:00
|
|
|
if(ui->lineEditBuchungStartBackgroundColor->text() != m_settings.buchungStartBackgroundColor())
|
|
|
|
|
m_settings.setBuchungStartBackgroundColor(ui->lineEditBuchungStartBackgroundColor->text());
|
|
|
|
|
if(ui->lineEditBuchungEndBackgroundColor->text() != m_settings.buchungEndBackgroundColor())
|
|
|
|
|
m_settings.setBuchungEndBackgroundColor(ui->lineEditBuchungEndBackgroundColor->text());
|
2017-12-04 20:11:11 +01:00
|
|
|
if(ui->lineEditBuchungOtherBackgroundColor->text() != m_settings.buchungOtherBackgroundColor())
|
|
|
|
|
m_settings.setBuchungOtherBackgroundColor(ui->lineEditBuchungOtherBackgroundColor->text());
|
2017-12-05 21:03:03 +01:00
|
|
|
if(ui->lineEditTimeAssignmentBackgroundColor->text() != m_settings.timeAssignmentBackgroundColor())
|
|
|
|
|
m_settings.setTimeAssignmentBackgroundColor(ui->lineEditTimeAssignmentBackgroundColor->text());
|
2017-12-04 20:11:11 +01:00
|
|
|
|
|
|
|
|
accept();
|
|
|
|
|
}
|