diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch) | |
tree | d3bb9f5d25a2dc09ca81adecf39621d871534297 /ktouch/src/ktouchstatus.cpp | |
download | tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ktouch/src/ktouchstatus.cpp')
-rw-r--r-- | ktouch/src/ktouchstatus.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/ktouch/src/ktouchstatus.cpp b/ktouch/src/ktouchstatus.cpp new file mode 100644 index 00000000..2c0d8341 --- /dev/null +++ b/ktouch/src/ktouchstatus.cpp @@ -0,0 +1,47 @@ +/*************************************************************************** + * ktouchstatus.cpp * + * ---------------- * + * Copyright (C) 2000 by Håvard Frøiland, 2004 by Andreas Nicolai * + * ghorwin@users.sourceforge.net * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#include "ktouchstatus.h" +#include "ktouchstatus.moc" + +#include <qlcdnumber.h> +#include <qlabel.h> +#include <qprogressbar.h> +#include <kdebug.h> +#include <kpushbutton.h> +#include "prefs.h" + +KTouchStatus::KTouchStatus(QWidget *parent) + : KTouchStatusLayout(parent) +{ + applyPreferences(); +} + +void KTouchStatus::applyPreferences() { + if (Prefs::autoLevelChange()) { + levelUpBtn->setEnabled( !Prefs::disableManualLevelChange() ); + levelDownBtn->setEnabled( !Prefs::disableManualLevelChange() ); + } + else { + levelUpBtn->setEnabled( true ); + levelDownBtn->setEnabled( true ); + } +} + +void KTouchStatus::setNewChars(const QString& newChars) { + newCharsLabel->setText(newChars); +} + +void KTouchStatus::updateStatus(unsigned int level, double correctness) { + levelLCD->display(static_cast<int>(level)+1); // +1 because our level variable ranges from 0...n-1 + correctnessBar->setProgress(static_cast<int>(correctness*100) ); +} |