Replaced all std::cout with kDebug.
[tagua/yd.git] / src / pref_movelist.cpp
blobc8056990a8d4cf81eb09e605f830154dcb9f25ce
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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 "settings.h"
13 #include "movelist_p.h"
14 #include "pref_movelist.h"
16 PrefMoveList::PrefMoveList(const QString&, QWidget *parent)
17 : QWidget(parent) {
19 setupUi(this);
21 m_settings = new MoveList::Settings;
22 m_settings->load();
24 groupAnimations->setChecked(m_settings->anim_enabled);
25 checkFading->setChecked(m_settings->anim_hideshow);
26 checkHighlighting->setChecked(m_settings->anim_highlight);
27 checkMovements->setChecked(m_settings->anim_moving);
28 sliderSpeed->setValue(m_settings->anim_speed);
29 sliderSmoothness->setValue(m_settings->anim_smoothness);
31 colorSelected->setColor(m_settings->select_color);
32 colorComments->setColor(m_settings->comment_color);
33 checkMovesFont->setChecked(m_settings->use_mv_font);
34 fontMoves->setFont(m_settings->mv_font);
35 checkCommentsFont->setChecked(m_settings->use_comm_font);
36 fontComments->setFont(m_settings->comm_font);
39 PrefMoveList::~PrefMoveList() {
40 delete m_settings;
43 void PrefMoveList::apply() {
44 m_settings->anim_enabled = groupAnimations->isChecked();
45 m_settings->anim_hideshow = checkFading->isChecked();
46 m_settings->anim_highlight = checkHighlighting->isChecked();
47 m_settings->anim_moving = checkMovements->isChecked();
48 m_settings->anim_speed = sliderSpeed->value();
49 m_settings->anim_smoothness = sliderSmoothness->value();
51 m_settings->select_color = colorSelected->color();
52 m_settings->comment_color = colorComments->color();
53 m_settings->use_mv_font = checkMovesFont->isChecked();
54 m_settings->mv_font = fontMoves->font();
55 m_settings->use_comm_font = checkCommentsFont->isChecked();
56 m_settings->comm_font = fontComments->font();
58 m_settings->save();