Fixed about box and added credits.
[tagua/yd.git] / src / pref_board.cpp
blob5b56ca9ff88f728e927ad995e3495454e996f6a3
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
12 #include <QApplication>
13 #include "mastersettings.h"
14 #include "pref_board.h"
17 PrefBoard::PrefBoard(const QString&, QWidget *parent)
18 : QWidget(parent) {
20 setupUi(this);
23 Settings s_anim = settings().group("animations");
24 groupAnimations->setChecked(s_anim.flag("enabled", true));
25 checkMovements->setChecked(s_anim["movement"].flag("enabled", true));
26 checkExplosions->setChecked(s_anim["explode"].flag("enabled", true));
27 checkFading->setChecked(s_anim["fading"].flag("enabled", true));
28 checkTransformations->setChecked(s_anim["transform"].flag("enabled", true));
30 Settings s_sequence = s_anim.group("sequence");
31 checkSequence->setChecked(s_sequence.flag("enabled", true));
32 spinSequenceMax->setValue(s_sequence["max"] | 10);
35 sliderSpeed->setValue(s_anim["speed"] | 16);
36 sliderSmoothness->setValue(s_anim["smoothness"] | 16);
40 Settings s_border = settings().group("board-border");
41 groupBorder->setChecked(s_border.flag("visible", "true"));
42 colorBorder->setColor(s_border["color"] |= QColor(Qt::white));
43 colorBorderText->setColor(s_border["text-color"] |= QColor(Qt::black));
44 fontBorder->setFont(s_border["font"] |= QApplication::font());
48 PrefBoard::~PrefBoard() {
51 void PrefBoard::apply() {
53 Settings s_anim = settings().group("animations");
54 s_anim.setFlag("enabled", groupAnimations->isChecked());
55 s_anim.group("movement").setFlag("enabled", checkMovements->isChecked());
56 s_anim.group("explode").setFlag("enabled", checkExplosions->isChecked());
57 s_anim.group("fading").setFlag("enabled", checkFading->isChecked());
58 s_anim.group("transform").setFlag("enabled", checkTransformations->isChecked());
60 Settings s_sequence = s_anim.group("sequence");
61 s_sequence.setFlag("enabled", checkSequence->isChecked());
62 s_sequence["max"] = spinSequenceMax->value();
65 s_anim["speed"] = sliderSpeed->value();
66 s_anim["smoothness"] = sliderSmoothness->value();
70 Settings s_border = settings().group("board-border");
71 s_border.setFlag("visible", groupBorder->isChecked());
72 s_border["color"] = colorBorder->color();
73 s_border["text-color"] = colorBorderText->color();
74 s_border["font"] = fontBorder->font();