File indexing completed on 2024-04-21 03:42:04

0001 /*
0002     SPDX-FileCopyrightText: 2005 Michael Goettsche <michael.goettsche@kdemail.net>
0003     SPDX-FileCopyrightText: 2006 Anne-Marie Mahfouf <annemarie.mahfouf@free.fr>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #include "timer.h"
0009 
0010 
0011 #include <KLocalizedString>
0012 
0013 #include "prefs.h"
0014 
0015 Timer::Timer()
0016     :QWidget()
0017 {
0018     ui_timer.setupUi(this);
0019     ui_timer.timeGrownLabel->setText(i18np("1 tenth of second", "%1 tenths of second", Prefs::grownTimer()));
0020     ui_timer.timeKidLabel->setText(i18np("1 tenth of second", "%1 tenths of second", Prefs::kidTimer()));
0021     connect(ui_timer.kcfg_GrownTimer, &QSlider::valueChanged, this, &Timer::sliderValueChanged);
0022     connect(ui_timer.kcfg_KidTimer, &QSlider::valueChanged, this, &Timer::sliderValueChanged);
0023 }
0024 
0025 
0026 void Timer::sliderValueChanged()
0027 {
0028     ui_timer.timeKidLabel->setText(i18np("1 tenth of second", "%1 tenths of second", ui_timer.kcfg_KidTimer->value()));
0029     ui_timer.timeGrownLabel->setText(i18np("1 tenth of second", "%1 tenths of second", ui_timer.kcfg_GrownTimer->value()));
0030 }
0031 
0032 #include "moc_timer.cpp"