2 This file is part of KSysGuard.
3 Copyright ( C ) 2002 Nadeem Hasan ( nhasan@kde.org )
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or ( at your option ) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
25 #include <kacceleratormanager.h>
28 #include "KSGAppletSettings.h"
30 KSGAppletSettings::KSGAppletSettings( QWidget
*parent
)
34 setCaption( i18n( "System Guard Applet Settings" ) );
35 setButtons( Ok
|Apply
|Cancel
);
36 showButtonSeparator( true );
38 QWidget
*page
= new QWidget( this );
39 setMainWidget( page
);
41 QGridLayout
*topLayout
= new QGridLayout( page
);
42 topLayout
->setMargin( KDialog::marginHint() );
43 topLayout
->setSpacing( KDialog::spacingHint() );
45 QLabel
*label
= new QLabel( i18n( "Number of displays:" ), page
);
46 topLayout
->addWidget( label
, 0, 0 );
48 mNumDisplay
= new QSpinBox( page
);
49 mNumDisplay
->setMinimum( 1 );
50 mNumDisplay
->setMaximum( 32 );
51 mNumDisplay
->setValue(2);
52 topLayout
->addWidget( mNumDisplay
, 0, 1 );
53 label
->setBuddy( mNumDisplay
);
55 label
= new QLabel( i18n( "Size ratio:" ), page
);
56 topLayout
->addWidget( label
, 1, 0 );
58 mSizeRatio
= new QSpinBox(page
);
59 mSizeRatio
->setValue(100);
60 mSizeRatio
->setMinimum( 10 );
61 mSizeRatio
->setMaximum( 500 );
62 mSizeRatio
->setSingleStep(20);
63 mSizeRatio
->setSuffix( i18n( "%" ) );
64 topLayout
->addWidget( mSizeRatio
, 1, 1 );
65 label
->setBuddy( mSizeRatio
);
67 label
= new QLabel( i18n( "Update interval:" ), page
);
68 topLayout
->addWidget( label
, 2, 0 );
70 mInterval
= new QSpinBox( page
);
71 mInterval
->setMinimum( 1 );
72 mInterval
->setMaximum( 300 );
73 mInterval
->setValue(2);
74 mInterval
->setSuffix( i18n( " sec" ) );
75 topLayout
->addWidget( mInterval
, 2, 1 );
76 label
->setBuddy( mInterval
);
78 resize( QSize( 250, 130 ).expandedTo( minimumSizeHint() ) );
80 KAcceleratorManager::manage( page
);
83 KSGAppletSettings::~KSGAppletSettings()
87 int KSGAppletSettings::numDisplay() const
89 return mNumDisplay
->value();
92 void KSGAppletSettings::setNumDisplay( int value
)
94 mNumDisplay
->setValue( value
);
97 int KSGAppletSettings::sizeRatio() const
99 return mSizeRatio
->value();
102 void KSGAppletSettings::setSizeRatio( int value
)
104 mSizeRatio
->setValue( value
);
107 int KSGAppletSettings::updateInterval() const
109 return mInterval
->value();
112 void KSGAppletSettings::setUpdateInterval( int value
)
114 mInterval
->setValue( value
);