2
KSysGuard, the KDE System Guard
4
Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
#include <kacceleratormanager.h>
28
#include <QDoubleSpinBox>
31
#include "TimerSettings.h"
33
TimerSettings::TimerSettings( QWidget *parent, const char *name )
36
setObjectName( name );
38
setCaption( i18n( "Timer Settings" ) );
39
setButtons( Ok | Cancel );
41
QFrame *page = new QFrame( this );
42
setMainWidget( page );
44
QGridLayout *layout = new QGridLayout( page );
45
layout->setSpacing( spacingHint() );
46
layout->setMargin( 0 );
48
mUseGlobalUpdate = new QCheckBox( i18n( "Use update interval of worksheet" ), page );
49
layout->addWidget( mUseGlobalUpdate, 0, 0, 1, 2 );
51
mLabel = new QLabel( i18n( "Update interval:" ), page );
52
layout->addWidget( mLabel, 1, 0 );
54
mInterval = new QDoubleSpinBox( page );
55
mInterval->setRange( 0.1, 10000 );
56
mInterval->setSingleStep( 1 );
57
mInterval->setValue( 2 );
58
mInterval->setSuffix( i18n( " sec" ) );
59
layout->addWidget( mInterval, 1, 1 );
60
mLabel->setBuddy( mInterval );
61
mInterval->setWhatsThis( i18n( "All displays of the sheet are updated at the rate specified here." ) );
63
connect( mUseGlobalUpdate, SIGNAL( toggled( bool ) ),
64
SLOT( globalUpdateChanged( bool ) ) );
66
mUseGlobalUpdate->setChecked( true );
68
KAcceleratorManager::manage( this );
71
TimerSettings::~TimerSettings()
75
void TimerSettings::setUseGlobalUpdate( bool value )
77
mUseGlobalUpdate->setChecked( value );
80
bool TimerSettings::useGlobalUpdate() const
82
return mUseGlobalUpdate->isChecked();
85
void TimerSettings::setInterval( double interval )
87
mInterval->setValue( interval );
90
double TimerSettings::interval() const
92
return mInterval->value();
95
void TimerSettings::globalUpdateChanged( bool value )
97
mInterval->setEnabled( !value );
98
mLabel->setEnabled( !value );
101
#include "TimerSettings.moc"