Files
Chronos/sources/weekoption.cpp
2022-10-17 20:03:12 +02:00

35 lines
695 B
C++

#include "weekoption.h"
#include "ui_weekoption.h"
WeekOption::WeekOption(Week *w, QWidget *parent) :
QDialog(parent),
ui(new Ui::WeekOption)
{
ui->setupUi(this);
this->time_delta = w->getTimeDelta();
ui->time_delta_spinbox->setValue(time_delta);
compute();
connect(ui->time_delta_spinbox, &QSpinBox::valueChanged, this, &WeekOption::set_time_delta);
}
WeekOption::~WeekOption()
{
delete ui;
}
int WeekOption::get_time_delta()
{
return this->time_delta;
}
void WeekOption::set_time_delta(int value)
{
this->time_delta = value;
compute();
}
void WeekOption::compute()
{
ui->total_label->setText(Tools::int_to_string_time(this->time_delta));
}