Krazy fixes (mainly i18n)
[kdenetwork.git] / kopete / plugins / texteffect / texteffectconfig.cpp
blob6f0adf57524299392b2d685d2fbb4d7951f5d0d3
1 /*
2 texteffectconfig.cpp
4 Copyright (c) 2003 by Olivier Goffart <ogoffart@kde.org>
5 Copyright (c) 2003 by Matt Rogers <matt@matt.rogers.name>
7 Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 *************************************************************************
19 #include <qstring.h>
21 #include <kglobal.h>
22 #include <ksharedconfig.h>
23 #include <kconfiggroup.h>
25 #include "texteffectconfig.h"
27 TextEffectConfig::TextEffectConfig()
29 load();
32 void TextEffectConfig::load()
34 KConfigGroup config(KGlobal::config(), "TextEffect Plugin");
36 mColors = config.readEntry("Colors", QStringList() );
37 if(mColors.isEmpty())
39 mColors= defaultColorList();
41 mColorRandom = config.readEntry("Color Random Order", false);
42 mColorLines = config.readEntry("Color change every lines", true);
43 mColorWords = config.readEntry("Color change every words", false);
44 mColorChar = config.readEntry("Color change every char", false);
46 mLamer = config.readEntry("L4m3r", false);
47 mWaves = config.readEntry("WaVeS", false);
50 QStringList TextEffectConfig::defaultColorList()
53 return QString(QLatin1String("#00BBDD,#0088DD,#0000DD,#8800DD,#DD00DD,#DD0088,#DD0000,#DD8800,#DDBB00,#88BB00,#00BB00" )).split(',');
56 void TextEffectConfig::save()
58 KConfigGroup config(KGlobal::config(), "TextEffect Plugin");
60 config.writeEntry("Colors", mColors );
61 config.writeEntry("Color Random Order", mColorRandom);
62 config.writeEntry("Color change every lines", mColorLines);
63 config.writeEntry("Color change every words", mColorWords);
64 config.writeEntry("Color change every char", mColorChar);
66 config.writeEntry("L4m3r", mLamer);
67 config.writeEntry("WaVeS", mWaves);
69 config.sync();
72 QStringList TextEffectConfig::colors() const
74 return mColors;
77 bool TextEffectConfig::colorRandom() const
79 return mColorRandom;
82 bool TextEffectConfig::colorWords() const
84 return mColorWords;
87 bool TextEffectConfig::colorLines() const
89 return mColorLines;
92 bool TextEffectConfig::colorChar() const
94 return mColorChar;
97 bool TextEffectConfig::lamer() const
99 return mLamer;
102 bool TextEffectConfig::waves() const
104 return mWaves;
107 void TextEffectConfig::setColors(const QStringList &newColors)
109 mColors = newColors;
112 void TextEffectConfig::setColorWords(bool newWords)
114 mColorWords = newWords;
117 void TextEffectConfig::setColorLines(bool newLines)
119 mColorLines = newLines;
122 void TextEffectConfig::setColorRandom(bool newRandom)
124 mColorRandom = newRandom;
127 void TextEffectConfig::setColorChar(bool newChar)
129 mColorChar = newChar;
132 void TextEffectConfig::setLamer(bool newLamers)
134 mLamer = newLamers;
137 void TextEffectConfig::setWaves(bool newWaves)
139 mWaves = newWaves;