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 // 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 + +#include "ktouch_build_config.h" + +#ifdef KDEEDU_KTOUCH_BUILD_WITH_PHONON #include +#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 @@ 0 0 911 - 103 + 109 @@ -19,18 +19,9 @@ 6 - + 9 - - 9 - - - 9 - - - 9 - @@ -40,18 +31,9 @@ 6 - + 9 - - 9 - - - 9 - - - 9 - @@ -85,18 +67,9 @@ 6 - + 0 - - 0 - - - 0 - - - 0 - @@ -128,35 +101,17 @@ 6 - + 9 - - 9 - - - 9 - - - 9 - 6 - + 0 - - 0 - - - 0 - - - 0 - @@ -225,6 +180,12 @@ + + + 1 + 0 + + Correctness @@ -232,35 +193,17 @@ 6 - + 9 - - 9 - - - 9 - - - 9 - 6 - + 0 - - 0 - - - 0 - - - 0 - @@ -320,6 +263,12 @@ + + + 2 + 0 + + New Characters in This Level @@ -350,26 +299,13 @@ true - Qt::AlignCenter|Qt::AlignHorizontal_Mask|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter|Qt::AlignVertical_Mask + Qt::AlignCenter - - - - Qt::Horizontal - - - - 40 - 20 - - - -