summaryrefslogtreecommitdiffstats
path: root/katomic/configbox.cpp
blob: ea546d894801d1a4b6df8138c64065b0eed719b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* configbox.cpp
 *
 * 1999 (c) Cristian Tibirna (tibirna@kde.org)
 *
 */

#include "configbox.h"
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h>
#include <qlayout.h>
#include <qgroupbox.h>
#include <qslider.h>

#include "settings.h"

extern Options settings;

ConfigBox::ConfigBox ( QWidget *parent, const char *name)
    : KDialogBase ( parent, name, true, i18n("Configure"), Ok | Cancel, Ok, true )
{
  QWidget *page = makeMainWidget();  

  QGridLayout *glay = new QGridLayout (page, 4, 5, 0, spacingHint());
  glay->setRowStretch(0, 1);
  glay->setRowStretch(3, 1);
  glay->setColStretch(0, 1);
  glay->setColStretch(4, 1);
 
  glay->addWidget(new QLabel(i18n("Animation speed:"),page), 2, 1);

  disp = new QLCDNumber(page);
  glay->addWidget(disp, 1, 2);
  disp->display(1);

  speed = new QSlider(1, 10, 1, 1, QSlider::Horizontal, page);
  glay->addMultiCellWidget(speed, 2, 2, 2, 3);

  connect(speed, SIGNAL(valueChanged(int)), disp, SLOT(display(int)));

  speed->setValue(settings.anim_speed);
  incInitialSize(QSize(20,20), true);
}
  
void ConfigBox::slotOk()
{
  settings.anim_speed = speed->value();
  settings.changed = true;

  emit speedChanged();

  accept();
}

ConfigBox::~ConfigBox()
{
}

#include "configbox.moc"