[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeedu/ktouch
From: Andreas Nicolai <Andreas.Nicolai () gmx ! net>
Date: 2008-09-26 8:01:05
Message-ID: 1222416065.345729.6562.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 864949 by ghorwin:
Added build config for KTouch to be built without Phonon depedency. Added TODO \
entries.
M +12 -1 TODO.KDE4
_M src (directory)
M +12 -3 src/CMakeLists.txt
M +4 -0 src/ktouch.cpp
A src/ktouch_build_config.h.in
M +17 -4 src/ktouchtrainer.cpp
M +7 -0 src/ktouchtrainer.h
M +21 -85 src/ui/ktouchstatuswidget.ui
--- trunk/KDE/kdeedu/ktouch/TODO.KDE4 #864948:864949
@@ -1,4 +1,4 @@
-KTouch for KDE4 TODO
+KTouch for KDE4 - TODO
annma - November 2006
@@ -12,3 +12,14 @@
- translate training files titles so they appear correctly in the user menu. See \
https://bugs.kde.org/show_bug.cgi?id=135570
+Ghorwin - September 2008
+QA stuff:
+- "Default User" vs i18n name, in translated version only the translated name for \
"Default user" should appear +- color schemes (maybe remove?)
+- review/fix lectures and keyboards
+- update documentation + webpage
+
+Feature stuff:
+- welcome/initial setup dialog (select lecture and keyboard, some general \
instructions) +- finish lecture summary dialog (including visual rating for training \
quality) +
** trunk/KDE/kdeedu/ktouch/src #property svn:ignore
- Makefile
Makefile.in
.deps
.libs
*.moc
ktouch
ktouchlectureeditor_dlg.h
prefs.h
ktoucheditor_dlg.cpp
ktouchprefcolorslayout.cpp
ktouchstatistics_dlg.h
prefs.cpp
ktouchkeyboardeditor_dlg.h
ktouchprefcolorslayout.h
ktoucheditor_dlg.h
ktouchpreftraininglayout.h
ktouchkeyboardeditor_dlg.cpp
ktouchopenrequest_dlg.cpp
ktouchstatistics_dlg.moc
ktouchopenrequest_dlg.h
ktouch.desktop
ktouchprefkeyboardlayout.cpp
ktouchpreftraininglayout.cpp
ktouchstatuslayout.h
ktouchprefgenerallayout.cpp
ktouchlectureeditor_dlg.cpp
ktouchprefgenerallayout.h
ktouchprefkeyboardlayout.h
ktouchstatistics_dlg.cpp
ktouchstatuslayout.cpp
--- trunk/KDE/kdeedu/ktouch/src/CMakeLists.txt #864948:864949
@@ -3,6 +3,13 @@
# set include directories
#include_directories( )
+# add compilation options
+option( KDEEDU_KTOUCH_BUILD_WITH_PHONON "Enables compilation of sound output using \
Phonon." OFF ) +mark_as_advanced(KDEEDU_KTOUCH_BUILD_WITH_PHONON)
+
+# configure the local configuration file
+configure_file(ktouch_build_config.h.in ktouch_build_config.h)
+
# add ui files, all files in directory ui are Qt4 only
kde4_add_ui_files(ktouch_UIS
ui/ktouchcoloreditordialog.ui
@@ -46,8 +53,6 @@
main.cpp
)
-# create moc files automatically, requires that moc files are included into the cpp \
files
-
kde4_add_kcfg_files(ktouch_SRCS prefs.kcfgc )
#uncomment this if oxygen icons for ktouch are available
@@ -56,7 +61,11 @@
kde4_add_executable(ktouch ${ktouch_UIS} ${ktouch_SRCS})
-target_link_libraries(ktouch ${KDE4_KIO_LIBS} ${KDE4_PHONON_LIBS})
+if (KDEEDU_KTOUCH_BUILD_WITH_PHONON)
+ target_link_libraries(ktouch ${KDE4_KIO_LIBS} ${KDE4_PHONON_LIBS})
+else (KDEEDU_KTOUCH_BUILD_WITH_PHONON)
+ target_link_libraries(ktouch ${KDE4_KIO_LIBS})
+endif (KDEEDU_KTOUCH_BUILD_WITH_PHONON)
install(TARGETS ktouch ${INSTALL_TARGETS_DEFAULT_ARGS} )
--- trunk/KDE/kdeedu/ktouch/src/ktouch.cpp #864948:864949
@@ -37,6 +37,8 @@
#include <kio/netaccess.h>
// KTouch Header
+#include "ktouch_build_config.h"
+
#include "ktouchlecture.h"
#include "ktouchtrainer.h"
@@ -409,8 +411,10 @@
m_pageColors = new KTouchPrefColors(dialog);
dialog->addPage(m_pageColors, i18n("Color Settings"), \
"preferences-desktop-color");
+#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
m_pageSound = new KTouchPrefSound(dialog);
dialog->addPage(m_pageSound, i18n("Sound Settings"), \
"preferences-desktop-sound"); +#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
connect(dialog, SIGNAL(settingsChanged(const QString &)), this, \
SLOT(applyPreferences()));
--- trunk/KDE/kdeedu/ktouch/src/ktouchtrainer.cpp #864948:864949
@@ -49,17 +49,19 @@
m_decLinesCount=0;
m_incLinesCount=0;
- m_player = Phonon::createPlayer( Phonon::GameCategory );
- m_player->setParent(this);
-
// reset statistics
m_levelStats.clear();
m_sessionStats.clear();
+#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
+ m_player = Phonon::createPlayer( Phonon::GameCategory );
+ m_player->setParent(this);
+
/// \todo preload sounds and improve sound playback system
m_levelUpSound = KGlobal::dirs()->findResource("appdata","up.wav");
m_levelDownSound = KGlobal::dirs()->findResource("appdata","down.wav");
m_typeWriterSound = KGlobal::dirs()->findResource("appdata","typewriter.wav");
+#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
connect(m_statusWidget->levelUpBtn, SIGNAL(clicked()), this, SLOT(levelUp()) );
connect(m_statusWidget->levelDownBtn, SIGNAL(clicked()), this, SLOT(levelDown()) \
); @@ -85,14 +87,17 @@
// NOTE : In this function we need to distinguish between left and right
// typing. Use the config setting Prefs::right2LeftTyping() for that.
if(Prefs::soundOnKeypress()){
+#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
m_player->setCurrentSource(m_typeWriterSound.url());
m_player->play();
+#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
}
if (m_trainingPaused) continueTraining();
if (m_teacherText==m_studentText) {
// if already at end of line, don't add more chars
/// \todo Flash the line when line complete
- if (Prefs::beepOnError()) QApplication::beep();
+ if (Prefs::beepOnError())
+ QApplication::beep();
return;
}
// remember length of student text without added character
@@ -138,8 +143,10 @@
void KTouchTrainer::backspacePressed() {
if(Prefs::soundOnKeypress()){
+#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
m_player->setCurrentSource(m_typeWriterSound.url());
m_player->play();
+#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
}
if (m_trainingPaused) continueTraining();
/// \todo Implement the "remove space character = remove word count" feature
@@ -169,8 +176,10 @@
void KTouchTrainer::enterPressed() {
if(Prefs::soundOnKeypress()){
+#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
m_player->setCurrentSource(m_typeWriterSound.url());
m_player->play();
+#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
}
if (m_trainingPaused)
@@ -375,8 +384,10 @@
void KTouchTrainer::levelUp() {
if(Prefs::soundOnLevel()){
+#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
m_player->setCurrentSource(m_levelUpSound.url());
m_player->play();
+#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
}
if (m_level < m_lecture->levelCount() - 1) {
@@ -400,8 +411,10 @@
if (m_level>0) {
--m_level;
if(Prefs::soundOnLevel()){
+#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
m_player->setCurrentSource(m_levelDownSound.url());
m_player->play();
+#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
}
}
m_incLinesCount = 0;
--- trunk/KDE/kdeedu/ktouch/src/ktouchtrainer.h #864948:864949
@@ -14,7 +14,12 @@
#define KTOUCHTRAINER_H
#include <QObject>
+
+#include "ktouch_build_config.h"
+
+#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
#include <Phonon/MediaObject>
+#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
#include "ktouchstatisticsdata.h"
@@ -159,7 +164,9 @@
KUrl m_typeWriterSound; ///< URL of the typing sound.
unsigned int m_wordsInCurrentLine; ///< Number of words in the current typing \
line. +#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON
Phonon::MediaObject *m_player;
+#endif // KDEEDU_KTOUCH_BUILD_WITH_PHONON
};
#endif // KTOUCHTRAINER_H
--- trunk/KDE/kdeedu/ktouch/src/ui/ktouchstatuswidget.ui #864948:864949
@@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>911</width>
- <height>103</height>
+ <height>109</height>
</rect>
</property>
<property name="sizePolicy" >
@@ -19,18 +19,9 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>9</number>
</property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
<item>
<widget class="QGroupBox" name="GroupBox1" >
<property name="title" >
@@ -40,18 +31,9 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>9</number>
</property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
<item>
<widget class="QLCDNumber" name="levelLCD" >
<property name="sizePolicy" >
@@ -85,18 +67,9 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>0</number>
</property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
<item>
<widget class="KArrowButton" name="levelUpBtn" >
<property name="focusPolicy" >
@@ -128,35 +101,17 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>9</number>
</property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>0</number>
</property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
<item>
<widget class="KLed" name="speedLedGreen" >
<property name="sizePolicy" >
@@ -225,6 +180,12 @@
</item>
<item>
<widget class="QGroupBox" name="GroupBox12" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title" >
<string>Correctness</string>
</property>
@@ -232,35 +193,17 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>9</number>
</property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>0</number>
</property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
<item>
<widget class="KLed" name="correctnessLedGreen" >
<property name="sizePolicy" >
@@ -320,6 +263,12 @@
</item>
<item>
<widget class="QGroupBox" name="GroupBox4" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title" >
<string>New Characters in This Level</string>
</property>
@@ -350,26 +299,13 @@
<bool>true</bool>
</property>
<property name="alignment" >
- <set>Qt::AlignCenter|Qt::AlignHorizontal_Mask|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter|Qt::AlignVertical_Mask</set>
+ <set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic